ReFT: Representation Finetuning for Language Models
Citation. Zhengxuan Wu, Aryaman Arora, Zheng Wang, Atticus Geiger, Dan Jurafsky, Christopher D. Manning and Christopher Potts. Geiger is at the Pr(Ai)²R Group, and the others are at Stanford University. Wu and Arora made an equal contribution. "ReFT: Representation Finetuning for Language Models". arXiv:2404.03592, version 3 of 22 May 2024. Version 1 is of 4 April 2024, and version 2 of 8 April 2024. The v3 text says "Preprint. Under review." The venue is NeurIPS 2024 (Advances in Neural Information Processing Systems 37, Main Conference Track, DOI 10.52202/[removed]), from the NeurIPS proceedings page. Code is the pyreft library at github.com/stanfordnlp/pyreft, under Apache-2.0, built on pyvene. The instruction-tuned ReFT weights are on HuggingFace. The text names no funding. Every experiment ran on one GPU: an NVIDIA A100 40G or 80G, or an RTX 6000.
Status. Planned. #4782 (catastrophic interference, weight-space programming and LoRA) would use it in its synthesis. #3229 would use the distributed interchange intervention of the paper's equation 1, which LoReFT extends. The page opens no new issue. It records evidence for #5125 and #3229, and the fix campaign stays the maintainer's.
Read. On 2026-11-19 we downloaded the arXiv v3 PDF and extracted its text with pdftotext. The reader was this page's author, a model (Claude Opus 5.5). We read in the source's own words the abstract, sections 1 to 6 and Appendices A to H. We read Tables 1 to 17 as text, and the start of Appendix I and of Appendix J. We did not see the figures as images. So Figures 1 to 11 come to this page only through their captions and the numbers that the text states. We did not read the references in full, most of Appendix I, or the NeurIPS camera-ready PDF. From the NeurIPS proceedings page, we read the title, the authors, the venue and the DOI only.
Summary
Claim. One can adapt a frozen language model by training small interventions on its hidden representations, in place of changes to its weights. LoReFT edits a low-rank linear subspace of the residual stream at a few layers and prompt positions. It uses 15×–65× fewer parameters than LoRA, the authors say, and matches or beats weight-based PEFTs on most of the benchmarks.
Method.
- The intervention. LoReFT is Φ(h) = h + Rᵀ(Wh + b − Rh). R is an r × d matrix with orthonormal rows, W is r × d and b has r entries. The LM's own parameters stay frozen. The form comes from the distributed interchange intervention, DII(b, s, R) = b + Rᵀ(Rs − Rb), with the source Rs replaced by a learned Wh + b. R is the subspace that distributed alignment search (DAS) learns in that earlier work.
- DiReFT. An ablation, Φ(h) = h + W2ᵀ(W1h + b). It drops the orthogonality and the difference term. The authors call it "LoRA applied directly to hidden representations at certain positions."
- Where it acts. An intervention is a function, a set of positions and a layer. It overwrites h at that layer just after the layer computes it, so only later layers see the change. The runs edit the first p and the last s prompt tokens, at a chosen set of layers, with weights tied across positions or not. Generated tokens are not edited.
- Models and tasks. LLaMA-1 7B and 13B, Llama-2 7B and Llama-3 8B on eight commonsense tasks (Commonsense170K). LLaMA-1 7B and 13B on four arithmetic tasks (Math10K). Llama-2 7B on Ultrafeedback, scored by Alpaca-Eval v1.0 with GPT-4 as judge. RoBERTa-base and RoBERTa-large on GLUE.
- Baselines. Prefix tuning, series and parallel adapters, BitFit, RED, LoRA, DoRA and full fine-tuning. Most baseline numbers come from earlier papers and carry an asterisk.
- Hyperparameters. For commonsense and arithmetic, the authors tune on a development set of the last 300 GSM8K training examples, with LLaMA-7B only. For instruction tuning, they tune on Alpaca-52K. For GLUE, they tune each task on a held-out half of the validation set with seed 42.
- Statistics. Means over three seeds for commonsense and arithmetic, two for instruction tuning, and five for GLUE. Only GLUE has standard deviations, in Table 13. The paper gives no significance tests.
- Extra studies. Appendix E ablates the terms of the LoReFT formula. Appendix F tests how much a rank-1 intervention can memorise. Appendix G trains two halves of one rank-8 subspace on two tasks and turns them on together. Appendix H measures the time that the interventions add.
Findings, as the source reports them.
| Setting | Result |
|---|---|
| Commonsense mean, LLaMA-7B (Table 1) | LoRA 74.7 (0.826% of parameters), DoRA 78.1 (0.838%), DiReFT 79.0 and LoReFT 80.2 (0.031%) |
| Commonsense mean, LLaMA-13B (Table 1) | LoRA 80.5 (0.670%), DoRA 81.5, LoReFT 83.3 (0.025%) |
| Commonsense mean, Llama-3 8B (Table 1) | LoRA 80.8 (0.700%), DoRA 85.2, LoReFT 86.6 (0.026%) |
| Commonsense, epochs matched to DoRA (Table 14) | LoReFT with 3 epochs: 79.5 on LLaMA-7B and 83.1 on LLaMA-13B |
| Arithmetic mean, LLaMA-7B (Table 2) | LoRA 46.9, LoReFT 42.6, DiReFT 40.6, prefix tuning 35.0 |
| Arithmetic mean, LLaMA-13B (Table 2) | LoRA 51.1, LoReFT 49.6, DiReFT 48.0 |
| Alpaca-Eval v1.0 win rate, Llama-2 7B (Table 3) | Full fine-tuning 80.93, LoRA 81.48 (0.1245%), RED 81.69, LoReFT 85.60 (0.0039%). GPT-3.5 Turbo 1106 86.30 |
| Same, smaller LoReFT (Table 3) | Half rank 84.12. 1K training examples 81.91, trained in 18 minutes on one A100 |
| GLUE mean, RoBERTa-base (Table 4) | Full fine-tuning 85.6, LoRA 84.7 (0.239%), RED 84.3, LoReFT 84.2 (0.015%), DiReFT 83.2 |
| GLUE mean, RoBERTa-large (Table 4) | Full fine-tuning 88.6, LoRA 88.1 (0.225%), LoReFT 88.2 (0.014%) |
| Ablations, arithmetic mean on LLaMA-7B (Table 17) | h + Rᵀb (a learned constant) 31.3. h + Rᵀ(b − Rh) 37.1. h + Rᵀ(Wh + b) 42.9. LoReFT 42.6 |
| Memorisation, one rank-1 intervention at the last prompt token (F.1) | 4,097 parameters on LLaMA-1 7B. Recovers the first 2,048 tokens of Alice's Adventures in Wonderland at most layers, at 100% |
| Memorisation of random text (F.1) | Random token sequences come back only up to 128 tokens |
| Codebook (F.2) | A rank-1 intervention "can reliably remember up to 256 pairs" of a random ID and one output token |
| Few-shot style (G.2) | A rank-4 LoReFT at layer 15 of Llama-2-Chat, 32,772 parameters, trained on 5 examples for 100 epochs in under 30 seconds |
| Time added (H) | About 0.05 seconds for 10 layers at rank 8 on the last prompt token, on LLaMA-1 7B |
In section 5, the authors draw a view on neurons from the instruction result. In their words, "a linear subspace distributed across a set of neurons can achieve generalised control over a vast number of tasks." They call this "a serious challenge to work seeking to interpret individual neurons in isolation." They say the result suggests an approach that "starts from the assumption that neurons will play different roles in different contexts." From F.2 they say that token identities are "likely superpositioned in the original basis," and that R can "disentangle superpositioned information to some degree."
Where the claims go beyond the evidence
- "15×–65×" does not follow from the tables we read. This is our arithmetic. The LoRA-to-LoReFT parameter ratios in Tables 1 to 4 run from about 16× (GLUE) to about 32× (instruction tuning). We found no setting that gives 65×.
- "State of the art" leans on baselines from other papers. Most LoRA, DoRA and adapter numbers are copied from Hu et al. 2023, Liu et al. 2024 and Wu et al. 2024. Their tuning differs. The authors check one gap, the number of epochs, in Table 14, and LoReFT stays ahead on commonsense.
- Arithmetic is a loss. LoReFT is below LoRA and parallel adapters on both models, and below series adapters on LLaMA-7B. The authors state this. Their account, that a longer generation dilutes an edit on prompt tokens only, is not tested.
- Some selection on test data remains on GLUE. The authors tune on a development set elsewhere, and they credit this over earlier PEFT work. But on GLUE they pick hyperparameters on the held-out half with seed 42, and that seed is one of the five they average. They also replace "several random seeds" for RTE and one or two for CoLA "for stability". For QQP on RoBERTa-large, they keep the best of three runs for each seed.
- Few seeds, and no tests. Instruction tuning has two seeds, and commonsense and arithmetic have three. Only GLUE gives standard deviations. Several GLUE gaps between LoReFT and LoRA are smaller than those deviations. For example, MRPC on RoBERTa-base has an SD of 2.62 for LoReFT.
- The judge for the instruction result is a model. The win rate is from GPT-4 against text-davinci-003. For tuning, the authors use GPT-4 Turbo as the judge to avoid overfitting to GPT-4. A 0.7-point gap to GPT-3.5 Turbo rests on that judge and two seeds.
- The neuron argument is not an experiment. No run compares a subspace with a neuron-aligned basis, or with a fixed random R of the same rank. So the paper shows that a learned subspace edit works. It does not show that a neuron-basis edit of the same size fails. The superposition reading of F.2 has the same gap: no run checks whether R could be replaced by a few residual coordinates.
- "More interpretable" is not measured. The conclusion says ReFT is "more interpretable than any existing PEFTs." No experiment measures interpretability. The composition study in G.1 shows two qualitative examples and no score.
- The memorisation results carry a null that cuts the claim. The book is very likely in pre-training data, and random tokens stop at 128. The authors note this themselves. So "a single vector is worth a thousand tokens" depends on what the model already knows.
- Small inconsistencies. In Table 17, DiReFT's AQuA score reads 221.3, where Table 2 gives 21.3. F.1 calls the learned b "input-independent", and F.2 calls the same b "input-dependent". The Limitations section says the causal effect may emerge in "upstream" computations, where the text elsewhere implies later layers. None of these changes a headline result.
The authors state several limits themselves. They mainly test the LLaMA family. They do not know why ReFT works, and they say the edit may create new causal pathways. They also report the arithmetic loss and the extra inference cost, which a LoRA merge does not have.
Use in this repo
- The repo has hooks but no trained intervention.
openinterpretability/harness/hooks.pyand the patching code edit activations, andharness/probing.pyfits linear probes with LBFGS. Nothing inopeninterpretability/orscripts/trains an intervention into a model.git grepfinds nopyreftorpyveneimport. The repo cites ReFT only throughaxbench.md,does-steering-break-your-model.mdandsteering-specificity.md. - A ReFT leaves every pole's weights unchanged. All base weights are frozen, as with the bottleneck adapters of
parameter-efficient-transfer-learning.md. Unlike LoRA (lora-low-rank-adaptation.md), nothing merges into a matrix. With the hooks removed, every VERIFIED explanation holds exactly. - A ReFT changes inputs at known layers and positions only. This point is our inference from equation 7. The edit is applied after layer l computes its output. So every pole in layers up to the lowest edited layer reads the same input as before. Poles above it see the edit through the residual stream, and through attention at later positions. An adapter changes the input to every block above the first adapter. So a ReFT arm splits input drift more finely than an adapter arm does.
- Evidence for #5125. #5125 fine-tunes Qwen2.5-0.5B and its instruct model in stages, and re-tests VERIFIED poles. The adapter-arm comment there (from
parameter-efficient-transfer-learning.md) attributes failures to inputs, not to a pole's own weights. A LoReFT arm at one known layer adds a check: poles at or below that layer must all keep. A failure there would be a bug in the test, not a finding. Above the layer, the keep share against depth would show how far a rank-r edit spreads. This needs training code that the repo lacks (fixing-models.md). - The base-instruct result fits a small representation change, in kind. In
docs/analyses/base-instruct.md, 38 of 43 Qwen2.5-1.5B hypotheses keep on the instruct model (88%, 95% CI 76–95%). The median activation correlation is 0.983. On Qwen2.5-0.5B, 252 of 311 keep (81%, 76–85%). The paper reaches a high Alpaca-Eval win rate with 0.0039% of Llama-2 7B's parameters, all in a few prompt positions. Both results say that instruction following can sit on top of units that barely move. The models, the tuning and the measures differ, so this is a match in kind, not a test. - The chat-template loss is a position effect, which ReFT also uses. base-instruct finds that the chat template costs 9 to 18 points of keep share, mostly in sensitivity. LoReFT acts only on the first and last prompt tokens. This is our inference: in both cases, what surrounds the text changes what the units read. It is not evidence about any one pole.
- The copy-route direction has the shape of a LoReFT read.
docs/analyses/copy-route-separation.mdfinds that no unit of the VERIFIED pythia-70m copy route separates right from wrong copies beyond its null. A difference-in-means direction after layer 2 does, at balanced accuracy 0.73 against 0.62 for the random 95th percentile. On objects only, it is 0.66 against 0.60. LoReFT's term Wh + b reads the residual along learned directions, and writes inside R. So a rank-1 LoReFT at the answer position can make its edit depend on such a direction, unlike a fixed vector. This is evidence for #5015 and the fix campaign, not a design. Whether to use a direction is the maintainer's question. - The memorisation results warn about a narrow fix. One rank-1 intervention can store 256 random pairs or 2,048 tokens of a known book. So a ReFT trained on the six shortlist prompts could simply memorise them.
latent-steering-vectors.mdmakes the same point for a free vector. The tests infixing-models.mdalready name the check: hard negatives on the same route, and paraphrases. The right copies of the copy-route analysis (216 of 956) are those hard negatives. - Steering pages already score LoReFT as a steerer. In
axbench.md, LoReFT steers at 0.741, below prompting at 0.894 and above LoRA at 0.615. Indoes-steering-break-your-model.md, LoReFT's concept gain in distribution is 1.2070, against 0.9570 for prompt steering. Its instruction degradation is 0.4200, against 0.1110. Neither page tests a VERIFIED unit, and neither does this paper. - The neuron argument meets the registry directly. The paper says a distributed subspace challenges single-neuron interpretation. The registry's answer to that is empirical, through random nulls on each unit. The paper has no neuron-basis baseline, so it cannot settle the point. #3229 is the closest test that the repo plans. It compares a pole's interchange-intervention accuracy with a learned one-dimensional DAS direction for the same variable. That is equation 1 of this paper with r = 1. A pole near the DAS ceiling would be evidence against the paper's reading for that variable.
- Superposition directions are the nearer match. A rank-r R spans directions across all residual coordinates. So a learned R bears on the superposition directions of
openinterpretability/explain_groups.pymore than on one neuron. The paper's F.2 claim of "superpositioned" token identities is not tested against a basis, so it adds no number here. - Question for the maintainer. Should #4782's synthesis treat ReFT as a third case beside full fine-tuning and weight adapters? In that case, the explanation question changes from "do the weights move?" to "which layers read the edit?". The page records this and opens no issue.
- No follow-up issue. The ReFT arm fits inside #5125, and the DAS comparison is #3229. Both belong on those issues as comments.