$\textit{Trans-LoRA}$: towards data-free Transferable Parameter Efficient Finetuning

Runqian Wang, Soumya Ghosh, David Daniel Cox, Diego Antognini, Aude Oliva, Rogerio Feris, Leonid Karlinsky

TL;DR

Trans-LoRA is a novel framework designed to transfer Low-Rank Adapters (LoRA) from one base model to another without requiring access to the original training data. By leveraging a small set of "seed" examples and a robust synthetic data generation pipeline, it achieves "lossless" transfer. In many cases, it even improves performance across different model families and fine-tuning methods.

The Challenge of Upgrading Base Models

In the ecosystem of Large Language Models (LLMs), Parameter-Efficient Fine-Tuning (PEFT) techniques like LoRA have become the gold standard for customizing models. They allow users to train a tiny fraction of parameters (the "adapter") while keeping the massive base model frozen.

However, these adapters are inherently "locked" to their specific base model. If a service provider upgrades their base model (e.g., moving from Llama-2 to Llama-3), every single client's LoRA adapter becomes obsolete and must be re-trained. This creates a logistical nightmare: in many commercial cloud scenarios, the original training data is proprietary and is not retained by the provider for privacy reasons. Without that data, standard re-training is impossible.

The Trans-LoRA Method

To solve this, the authors propose a "nearly data-free" approach that relies on Knowledge Distillation (KD) and synthetic data generation. The process involves two main stages:

  1. Task Fine-Tuning (Preparation): While the source model ($M_s$) is being fine-tuned on the original data, a small Discriminator LoRA ($M_{disc}$) is simultaneously trained. This discriminator learns to distinguish between the real task data and "raw" synthetic data generated by the source model.
  2. Task Transfer: To move the LoRA to a new target model ($M_t$), the target model generates a large batch of synthetic data based on just 5 "seed" examples from the original task. The previously trained Discriminator filters this synthetic data, keeping only the samples that closely resemble the original training distribution. Finally, the source model (with its LoRA) acts as a teacher, providing "labels" for this filtered data to train a new LoRA on the target model.
Detailed breakdown of the Trans-LoRA pipeline, showing the interaction between the source teacher and the target student during task finetuning and transfer.

Evaluated Datasets

The researchers rigorously evaluated Trans-LoRA across 86 different tasks using several popular benchmarks:

  • BBH (BigBench-Hard): 27 challenging reasoning tasks.
  • MMLU: 57 tasks covering elementary to professional knowledge.
  • GSM8K: Grade school math word problems.
  • MBPP / MBPP+: Python programming tasks.
  • Coqa, Newsroom, and Squadv2: Used for additional validation on T5 models.

Key Insights and Results

  • The Discriminator is the "Secret Sauce": Naively using synthetic data for transfer often fails because the distribution of generated text doesn't match the "comfort zone" of the original fine-tuned model. The discriminator ensures the distillation process uses only high-quality, relevant inputs.
  • Positive Transfer: One of the most exciting findings is that the transferred LoRA often performs better than the original. This occurs because it combines the specific task knowledge of the source LoRA with the superior general capabilities of a newer, stronger target base model.
  • Universal Compatibility: The method isn't just for LoRA-to-LoRA transfers. It works seamlessly across different model families (e.g., Llama to Gemma) and even between different PEFT architectures, such as transferring a LoRA to a Weight-Decomposed Low-Rank Adaptation (DoRA) or Prompt Tuning (PT).
Scatter plots demonstrating positive transfer across various model families on the BBH benchmark. Points above the diagonal indicate improved performance after transfer.

Across almost all 86 tasks, the transferred models matched or exceeded the performance of the source models. In some cases, performance improved by up to 10% over the source model. For example, transferring from Llama-2-7b to Gemma-7b resulted in an average accuracy jump from 43.32% to 45.41% on BBH tasks. The authors also demonstrated "continuous transfer," where a LoRA was successfully moved from a source to an intermediate model, and then to a final target model, without significant degradation.

Limitations and Future Work

While highly effective, Trans-LoRA does present some hurdles:

  • Computational Cost: Generating thousands of synthetic samples and performing distillation requires significant GPU time (averaging about 10 hours per task in their setup).
  • Task Understanding: If the generator model fails to understand the task intent from the 5 seed examples, the synthetic data will be poor quality. The authors noted a few outliers where the generator merely mimicked the pattern of the seeds without grasping the underlying logic.
  • Future Directions: The authors suggest exploring ways to perform "direct" PEFT transfer that might eliminate the need for data synthesis entirely, which would further reduce the computational overhead.

Summary updated

BibTeX
@inproceedings{wang2024textit,
  author = {Runqian Wang and Soumya Ghosh and David Daniel Cox and Diego Antognini and Aude Oliva and Rogerio Feris and Leonid Karlinsky},
  title = {{$\textbackslash\{\}textit\{Trans-LoRA\}$: towards data-free Transferable Parameter Efficient Finetuning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=c3Pakdyi3t},
}
Figure