# stanfordnlp/pyreft

Stanford NLP Python library for Representation Finetuning (ReFT)

Repository: https://github.com/stanfordnlp/pyreft
Canonical: https://ross.abutalabs.com/products/pyreft
Homepage: https://arxiv.org/abs/2404.03592
Language: Python
License: Apache-2.0
License Family: permissive
Topics: interpretability, reft, representation-finetuning
Last push: 2026-03-05T11:16:52+00:00

## Health v2 (maintenance only)
Score: 54/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 70, release rhythm 28, longevity 66
- inputs: {"age_days": 929, "days_push": 181, "days_rel": 575, "gap_med": 41, "n_releases_24m": 4}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1577, forks 134 (observed 2026-08-28T04:05:06.196900+00:00)

## What it is
pyreft is Stanford NLP's Python library for Representation Finetuning (ReFT), which adapts frozen language models by learning task-specific interventions on hidden representations. It works with any pretrained HuggingFace model and serves as a drop-in, more parameter-efficient alternative to LoRA and other PEFT methods.

## Use cases
- finetune an LLM with fewer trainable parameters than LoRA
- train representation interventions on a frozen HuggingFace model
- adapt a language model for commonsense or arithmetic reasoning tasks
- instruction-tune a model with parameter-efficient interventions
- share trained ReFT adapters to the HuggingFace Hub
- study how hidden representations encode task-relevant semantics

## When to choose
- you want maximum parameter efficiency (15x-65x fewer than LoRA) when adapting LLMs
- you already use HuggingFace transformers and pyvene
- you're researching representation-based interventions or interpretability-driven finetuning

## When to avoid
- you need a battle-tested, widely-supported PEFT method with broad ecosystem tooling
- you're finetuning non-transformer or non-HuggingFace models
- you want simple full finetuning without learning a new intervention paradigm

## Facets
- artifact type: library
- maturity: active
- function: machine-learning, llm-training, nlp
- domain: large-language-models, machine-learning
- platform: python
- tags: representation-finetuning, reft, peft, interpretability, parameter-efficient-finetuning, huggingface, interventions, natural-language-processing, research

## Member repositories
- stanfordnlp/pyreft (main) score 54

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:06.196900+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:57:11.171760+00:00, confidence not recorded.
  - readme: https://github.com/stanfordnlp/pyreft (fetched 2026-08-28T04:05:06.196900+00:00, sha 5a773dcc22f6)
  - homepage: https://arxiv.org/abs/2404.03592 (fetched 2026-08-29T11:27:39.490610+00:00, sha 13d8f01fe755)
  - site_page: https://info.arxiv.org/about/donate.html (fetched 2026-08-29T11:27:39.499644+00:00, sha cca9c3a11c56)
  - site_page: https://info.arxiv.org/about/ourmembers.html (fetched 2026-08-29T11:27:39.503189+00:00, sha 47cbc55ff1de)
  - site_page: https://info.arxiv.org/about (fetched 2026-08-29T11:27:39.505316+00:00, sha a1f16f915a9a)
  - registry_pypi: https://pypi.org/pypi/pyreft/json (fetched 2026-08-29T11:27:39.532934+00:00, sha bbb331609349)
  - site_page: https://info.arxiv.org/labs/index.html (fetched 2026-08-29T11:27:39.501500+00:00, sha b14a8d05a0ec)
- Data as of 2026-08-30T08:39:29.467469+00:00.
