ReFT: Representation Finetuning for Language Models

Zhengxuan Wu, Aryaman Arora, Zheng Wang, Atticus Geiger, Dan Jurafsky, Christopher D Manning, Christopher Potts

Introduction

Parameter-efficient fine-tuning (PEFT) has become the standard for adapting large language models (LLMs) to specific tasks. Methods like LoRA (Low-Rank Adaptation) or Adapters typically work by freezing the base model's weights and training a small set of additional parameters. However, these methods still focus on modifying the model's weights to change its behavior.

This paper introduces Representation Finetuning (ReFT), a paradigm shift that moves away from weight-based adaptation. Instead of changing what the model "is" (its weights), ReFT changes what the model "thinks" (its hidden representations). By learning task-specific interventions on the hidden states during the forward pass, ReFT achieves state-of-the-art performance while being significantly more parameter-efficient than existing PEFT methods.

The ReFT Framework

ReFT is built on the insight from mechanistic interpretability that rich semantic information is encoded in the linear subspaces of a model's hidden representations. Rather than updating weights globally, ReFT applies interventions to specific layers and token positions.

LoReFT (Low-rank Linear Subspace ReFT)

The primary variant introduced is LoReFT. It operates by projecting hidden representations into a low-rank linear subspace, editing them via a learned linear projection, and then mapping them back into the residual stream. This method is inspired by "distributed interchange interventions," a technique used in interpretability research to establish causal links between neural activations and model outputs.

DiReFT

The authors also propose DiReFT, a simplified version of LoReFT that removes certain orthogonality constraints. While DiReFT is faster and resembles applying LoRA-style updates directly to activations, LoReFT remains the more robust and high-performing variant.

Experimental Evaluation

The authors evaluated ReFT across four diverse domains to test its versatility and efficiency:

  1. Commonsense Reasoning: Tested on 8 datasets (including BoolQ, PIQA, and ARC) using the Llama family of models.
  2. Arithmetic Reasoning: Evaluated on GSM8K, AQuA, MAWPS, and SVAMP.
  3. Instruction-Following: Fine-tuned on the Ultrafeedback dataset and evaluated via the Alpaca-Eval v1.0 benchmark.
  4. Natural Language Understanding (NLU): Evaluated on the GLUE benchmark using RoBERTa.

Key Insights

Extreme Parameter Efficiency

LoReFT is remarkably efficient, requiring 15x to 65x fewer parameters than LoRA. Despite this reduction, it consistently maintains or exceeds the performance of weight-based PEFTs. This suggests that the representation space is a highly dense and effective control surface for model behavior.

State-of-the-Art Performance

In NLU and commonsense reasoning tasks, LoReFT outperformed established methods like LoRA, DoRA, and Adapters. Most notably, in instruction-following, a Llama-2 7B model tuned with LoReFT achieved an 85.60% win rate on Alpaca-Eval. This outperformed both full fine-tuning (80.93%) and LoRA (81.48%), coming within 1% of the performance of GPT-3.5 Turbo.

Dense Information Storage

To demonstrate the power of representation-level control, the authors conducted probing experiments. They found that a single rank-1 intervention vector could force a model to perfectly memorize and reproduce over 2,000 tokens of text (specifically, Alice in Wonderland). This highlights the incredible density of information that can be manipulated within these linear subspaces.

Limitations and Future Directions

While ReFT represents a significant advancement, it introduces new considerations for deployment:

  • Inference Implementation: Unlike LoRA, where weights can be merged into the base model for zero-latency inference, ReFT requires "hooking" into the computation graph during the forward pass. However, since ReFT only intervenes on prompt tokens, the overhead is largely confined to the initial KV-cache population.
  • Hyperparameter Search: ReFT requires choosing which layers and token positions to intervene upon. Currently, this requires a search process, and the authors identify the automation of this selection as a priority for future work.
  • Long-form Generation: ReFT showed some performance degradation in complex arithmetic tasks requiring long chain-of-thought sequences, suggesting that the "steering" effect of the intervention may diminish over very long generation horizons.

Conclusion

ReFT demonstrates that directly editing a model's internal representations is a powerful and efficient alternative to traditional weight-based fine-tuning. By bridging the gap between mechanistic interpretability and practical model adaptation, ReFT opens new avenues for controlling large-scale neural networks with minimal computational overhead.

Summary updated

BibTeX
@inproceedings{wu2024reft,
  author = {Zhengxuan Wu and Aryaman Arora and Zheng Wang and Atticus Geiger and Dan Jurafsky and Christopher D Manning and Christopher Potts},
  title = {{ReFT: Representation Finetuning for Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=fykjplMc0V},
}
Figure