Tuning Language Models by Proxy

Alisa Liu, Xiaochuang Han, Yizhong Wang, Yulia Tsvetkov, Yejin Choi, Noah A. Smith

TL;DR

This paper introduces "proxy-tuning," a novel decoding-time technique that allows large language models (LLMs) to be adapted without direct access to their weights. By using a smaller, fine-tuned "expert" model to guide the output of a larger "base" model, proxy-tuning effectively achieves similar performance gains to traditional fine-tuning, even for proprietary LLMs. This opens up new avenues for efficient and accessible LLM customization.

What Problem Does This Paper Address?

Large language models (LLMs) are incredibly powerful, but they often need further adaptation (fine-tuning) to perform optimally on specific tasks, follow instructions, or exhibit desired behaviors. However, this fine-tuning process is becoming increasingly resource-intensive, requiring significant computational power and time. Furthermore, for many state-of-the-art models, the model weights are kept private, making direct fine-tuning impossible. This creates a barrier to customizing these powerful LLMs for diverse applications. The authors aim to bridge this gap by enabling efficient adaptation of LLMs without needing access to their internal parameters.

Methods

The core innovation is proxy-tuning, a decoding-time algorithm. Here's how it works:

  1. Expert and Anti-Expert: The authors first fine-tune a smaller language model. This fine-tuned model acts as the "expert" (M+). They also use the same smaller model before fine-tuning as the "anti-expert" (M-).
  2. Leveraging Black-Box Access: Proxy-tuning operates on a larger, "base" LLM (M) that is treated as a black box. The only information accessed from the base LLM is its output probability distribution (logits) over the vocabulary for a given input.
  3. Logit Offsets: The key idea is to use the difference in predictions between the expert (M+) and the anti-expert (M-) to create a "logit offset." This offset is then added to the original logits of the base LLM (M).
  4. Guiding the Base Model: This additive offset steers the base LLM's predictions towards the desired behavior learned by the expert, effectively "proxy-tuning" it. The crucial benefit is that the larger LLM's pre-trained knowledge is retained, while its behavior is modified by the smaller expert. This is mathematically expressed as: $P_M(x_t | x_{<t}) = \text{softmax}[s_M(x_t | x_{<t}) + s_{M^+}(x_t | x_{<t}) - s_{M^-}(x_t | x_{<t})]$.

Datasets

The paper evaluates proxy-tuning across several established benchmarks:

  • Instruction-Tuning: AlpacaFarm, GSM (arithmetic word problems), ToxiGen (toxicity detection), and TruthfulQA (truthfulness and knowledge).
  • Code Adaptation: CodexEval and DS-1000 (Python programming tasks).
  • Task-Specific Finetuning: TriviaQA (question-answering) and GSM (math word problems).
  • Temporal Adaptation (Black-Box): REALTIMEQA (news-based questions).

The authors note that they use zero-shot prompting for LLAMA2-CHAT models as they struggle with in-context examples.

Key Insights and Ideas

  • Tuning without Weights: The most significant insight is that effective model adaptation can be achieved by only observing output probabilities, not by modifying model weights. This bypasses the need for access to proprietary models.
  • Small Expert, Big Impact: A surprisingly small fine-tuned model (e.g., 7B parameters) can effectively guide a much larger model (e.g., 70B parameters) to achieve performance comparable to models that were directly fine-tuned at scale.
  • Preserving Pre-trained Knowledge: Proxy-tuning seems to better preserve the knowledge embedded in large pre-trained models compared to direct fine-tuning, which can sometimes lead to "catastrophic forgetting" or a reduction in general knowledge.
  • Controllable Steering: The authors show that a hyperparameter can be introduced to control the strength of the proxy-tuning effect, allowing for a smooth trade-off between different desired attributes.
  • Weak-to-Strong Generalization: Even when the "expert" and "anti-expert" are weaker than the base model, their contrast can still provide a positive signal, leading to improved performance.

Key Results

  • Instruction-Tuning: Proxy-tuning LLAMA2-70B with a 7B expert closed 88% of the performance gap between the base 70B model and its directly tuned CHAT version on knowledge, reasoning, and safety benchmarks. For LLAMA2-13B, it closed 91% of the gap. In some cases, proxy-tuning even surpassed the directly tuned small expert.
  • Code Adaptation: Proxy-tuning LLAMA2-13B with CODELLAMA-7B resulted in a 17-32% absolute improvement on coding benchmarks.
  • Task-Specific Finetuning: Proxy-tuning LLAMA2-70B for QA and math problems yielded a 31% absolute improvement over the untuned 70B model and 9% over the tuned 7B task model.
  • GPT-3.5 Temporal Adaptation: Proxy-tuning GPT-3.5 (using only top-5 log probabilities) with a 7B expert improved accuracy on recent events by 2.3%, demonstrating its utility for black-box models.
  • Runtime: Proxy-tuning introduces a runtime overhead (e.g., ~1.5-2.4x increase at 13B/70B), but this can be significantly mitigated with parallel GPU computation.

Limitations and Future Work

  • Runtime Overhead: While manageable, proxy-tuning does add computational cost during inference compared to a base model. The authors suggest parallelization as a solution.
  • Expert Quality: The effectiveness of proxy-tuning is dependent on the quality of the smaller "expert" model.
  • Future Work: The authors encourage organizations to share output probabilities from their models to enable wider use of proxy-tuning. They also highlight the ongoing question of how proxy-tuning compares to direct tuning in terms of balancing adaptation with preserving general capabilities, and suggest further exploration of customizable, algorithmic, decoding-time tuning.

Summary updated

BibTeX
@inproceedings{liu2024tuning,
  author = {Alisa Liu and Xiaochuang Han and Yizhong Wang and Yulia Tsvetkov and Yejin Choi and Noah A. Smith},
  title = {{Tuning Language Models by Proxy}},
  booktitle = {COLM},
  year = {2024},
  url = {https://openreview.net/forum?id=dribhnhm1i},
}
Figure