Pyreft
Stanford NLP Python library for Representation Finetuning (ReFT)
About
Parameter-efficient finetuning (PEFT) methods seek to adapt large neural models via updates to a small number of weights. However, much prior interpretability work has shown that representations encode rich semantic information, suggesting that editing representations might be a more powerful alternative. We pursue this hypothesis by developing a family of Representation Finetuning (ReFT) methods. ReFT methods operate on a frozen base model and learn task-specific interventions on hidden representations. We define a strong instance of the ReFT family, Low-rank Linear Subspace ReFT (LoReFT), and we identify an ablation of this method that trades some performance for increased efficiency. Both are drop-in replacements for existing PEFTs and learn interventions that are 15x--65x more parameter-efficient than LoRA. We showcase LoReFT on eight commonsense reasoning tasks, four arithmetic reasoning tasks, instruction-tuning, and GLUE. In all these evaluations, our ReFTs deliver the best balance of efficiency and performance, and almost always outperform state-of-the-art PEFTs. We release a generic ReFT training library publicly at https://github.com/stanfordnlp/pyreft.
Open Source Health
- Stars
- 1,583
- Forks
- 134
- License
- Apache-2.0
- Last commit
- 7 months ago
Related Categories
Vendor
Stanfordnlp
Publisher of Pyreft
Quick Links
Open Source
Related Products
Peft
🤗 PEFT: State-of-the-art Parameter-Efficient Fine-Tuning.
Top category match
Sophia Script For Windows
zap: The most powerful PowerShell module for fine-tuning Windows 10 & Windows 11 on GitHub
Top category match
KTransformers
A Flexible Framework for Experiencing Heterogeneous LLM Inference/Fine-tune Optimizations
Top category match
LongWriter
[ICLR 2025] LongWriter: Unleashing 10,000+ Word Generation from Long Context LLMs
Top category match
Regress Lm
Library for sequence-to-sequence numeric prediction, applicable to any tokenizable input, and allows pretraining and fine-tuning over multiple tasks.
Top category match