SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.03592 · 2024

ReFT: Representation Finetuning for Language Models

arXiv · PDF · Open in the Atlas

Code that ran

6 of 14 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 3 failures of our instrument; 8 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2404.03592.json · badge: /api/ran/2404.03592.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
lqtrung1998/mwp_reft canonical (classifier label)
classifier basis: census
5 ran · 8 no recorded run
stanfordnlp/pyreft canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
collate_fn Ran
ran; our contract draft was wrong, not the code
lqtrung1998/mwp_reft/sampling.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from WNQzhu/CARFT, is pointer only (licence: NONE) · get_code("2bb5bd3526f55ecb")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from WNQzhu/CARFT, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

count_parameters Ran
ran, honoured the contract we drafted
stanfordnlp/pyreft/pyreft/reft_model.py
code served (permissive licence) · get_code("1cd5252a6c21c50e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a simple model with parameters that require gradients
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
        self.param = nn.Parameter(torch.randn(5))
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

ARGS = {
    'model': model
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
floatify Ran
ran, honoured the contract we drafted
lqtrung1998/mwp_reft/src/utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from WNQzhu/CARFT, is pointer only (licence: NONE) · get_code("f21a5f0d5bae0c14")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from WNQzhu/CARFT, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

is_numeric Ran
ran, violated the contract we drafted
lqtrung1998/mwp_reft/src/utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from WNQzhu/CARFT, is pointer only (licence: NONE) · get_code("c3b86a3bceec86cd")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from WNQzhu/CARFT, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

process_code Ran
ran; our contract draft was wrong, not the code
lqtrung1998/mwp_reft/src/python_engine.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from WNQzhu/CARFT, is pointer only (licence: NONE) · get_code("8b9f60df8d2c8a82")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from WNQzhu/CARFT, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

tokenize_fn Ran
ran; our contract draft was wrong, not the code
lqtrung1998/mwp_reft/sampling.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from WNQzhu/CARFT, is pointer only (licence: NONE) · get_code("951fe709737c50b9")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from WNQzhu/CARFT, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

do_gather Not yet run
unverified (harvested, no recorded run)
lqtrung1998/mwp_reft/src/utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from WNQzhu/CARFT, is pointer only (licence: NONE) · get_code("32851be78f5ecd4c")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from WNQzhu/CARFT, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

eval_code Not yet run
unverified (harvested, no recorded run)
lqtrung1998/mwp_reft/src/python_engine.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from WNQzhu/CARFT, is pointer only (licence: NONE) · get_code("7fcae9f5e120bafe")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from WNQzhu/CARFT, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

evaluate_rerank Not yet run
unverified (harvested, no recorded run)
lqtrung1998/mwp_reft/train_reward_model.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from WNQzhu/CARFT, is pointer only (licence: NONE) · get_code("c8164df09b7d7a68")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from WNQzhu/CARFT, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

prepare_datasets_and_data_loaders Not yet run
unverified (harvested, no recorded run)
lqtrung1998/mwp_reft/train_reward_model.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from WNQzhu/CARFT, is pointer only (licence: NONE) · get_code("4d434f6e5fd591b5")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from WNQzhu/CARFT, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

prepare_datasets_and_data_loaders Not yet run
unverified (harvested, no recorded run)
lqtrung1998/mwp_reft/train_sl_model.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from WNQzhu/CARFT, is pointer only (licence: NONE) · get_code("9f0489fe01df9539")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from WNQzhu/CARFT, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

prepare_datasets_and_data_loaders Not yet run
unverified (harvested, no recorded run)
lqtrung1998/mwp_reft/train_rl_reft.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from WNQzhu/CARFT, is pointer only (licence: NONE) · get_code("449e6a4081f8d019")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from WNQzhu/CARFT, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

prepare_datasets_and_data_loaders Not yet run
unverified (harvested, no recorded run)
lqtrung1998/mwp_reft/train_sft_model.py
code served (permissive licence) · get_code("d0eff44d0f627c24")
How it ran

no invocation recorded.

train_one_epoch Not yet run
unverified (harvested, no recorded run)
lqtrung1998/mwp_reft/train_reward_model.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from WNQzhu/CARFT, is pointer only (licence: NONE) · get_code("d3b8681876990bfa")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from WNQzhu/CARFT, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 14 are also present in other papers whose code we hold (14 with at least one paper dated earlier, 1 the same month, 14 later) and 0 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
count_parameters 180 other papers
122 dated earlier, 4 the same month, 48 later, 6 same year, order not determinable · 8 only as an assembly brick
1705.08415 (2017-05)
Supervised Community Detection with Line Graph Neural Networks
1707.01926 (2017-07)
Diffusion Convolutional Recurrent Neural Network: Data-Driven Traffic Forecasting
1808.09367 (2018-08)
Deriving Machine Attention from Human Rationales
and 177 more not named here
do_gather 3 other papers
2 dated earlier, 1 later
2401.08967 (2024-01)
REFT: Reasoning with REinforced Fine-Tuning
2402.05808 (2024-02)
Training Large Language Models for Reasoning through Reverse Curriculum Reinforcement Learning
2508.15868 (2025-08)
CARFT: Boosting LLM Reasoning via Contrastive Learning with Annotated Chain-of-Thought-based Reinforced Fine-Tuning
is_numeric 3 other papers
2 dated earlier, 1 later
2401.08967 (2024-01)
REFT: Reasoning with REinforced Fine-Tuning
2402.05808 (2024-02)
Training Large Language Models for Reasoning through Reverse Curriculum Reinforcement Learning
2508.15868 (2025-08)
CARFT: Boosting LLM Reasoning via Contrastive Learning with Annotated Chain-of-Thought-based Reinforced Fine-Tuning
collate_fn 2 other papers
1 dated earlier, 1 later
2401.08967 (2024-01)
REFT: Reasoning with REinforced Fine-Tuning
2508.15868 (2025-08)
CARFT: Boosting LLM Reasoning via Contrastive Learning with Annotated Chain-of-Thought-based Reinforced Fine-Tuning
eval_code 2 other papers
1 dated earlier, 1 later
2401.08967 (2024-01)
REFT: Reasoning with REinforced Fine-Tuning
2508.15868 (2025-08)
CARFT: Boosting LLM Reasoning via Contrastive Learning with Annotated Chain-of-Thought-based Reinforced Fine-Tuning
evaluate_rerank 2 other papers
1 dated earlier, 1 later
2401.08967 (2024-01)
REFT: Reasoning with REinforced Fine-Tuning
2508.15868 (2025-08)
CARFT: Boosting LLM Reasoning via Contrastive Learning with Annotated Chain-of-Thought-based Reinforced Fine-Tuning
floatify 2 other papers
1 dated earlier, 1 later
2401.08967 (2024-01)
REFT: Reasoning with REinforced Fine-Tuning
2508.15868 (2025-08)
CARFT: Boosting LLM Reasoning via Contrastive Learning with Annotated Chain-of-Thought-based Reinforced Fine-Tuning
prepare_datasets_and_data_loaders 2 other papers
1 dated earlier, 1 later
2401.08967 (2024-01)
REFT: Reasoning with REinforced Fine-Tuning
2508.15868 (2025-08)
CARFT: Boosting LLM Reasoning via Contrastive Learning with Annotated Chain-of-Thought-based Reinforced Fine-Tuning
prepare_datasets_and_data_loaders 2 other papers
1 dated earlier, 1 later
2401.08967 (2024-01)
REFT: Reasoning with REinforced Fine-Tuning
2508.15868 (2025-08)
CARFT: Boosting LLM Reasoning via Contrastive Learning with Annotated Chain-of-Thought-based Reinforced Fine-Tuning
prepare_datasets_and_data_loaders 2 other papers
1 dated earlier, 1 later
2401.08967 (2024-01)
REFT: Reasoning with REinforced Fine-Tuning
2508.15868 (2025-08)
CARFT: Boosting LLM Reasoning via Contrastive Learning with Annotated Chain-of-Thought-based Reinforced Fine-Tuning
prepare_datasets_and_data_loaders 2 other papers
1 dated earlier, 1 later
2401.08967 (2024-01)
REFT: Reasoning with REinforced Fine-Tuning
2508.15868 (2025-08)
CARFT: Boosting LLM Reasoning via Contrastive Learning with Annotated Chain-of-Thought-based Reinforced Fine-Tuning
process_code 2 other papers
1 dated earlier, 1 later
2401.08967 (2024-01)
REFT: Reasoning with REinforced Fine-Tuning
2508.15868 (2025-08)
CARFT: Boosting LLM Reasoning via Contrastive Learning with Annotated Chain-of-Thought-based Reinforced Fine-Tuning
tokenize_fn 2 other papers
1 dated earlier, 1 later
2401.08967 (2024-01)
REFT: Reasoning with REinforced Fine-Tuning
2508.15868 (2025-08)
CARFT: Boosting LLM Reasoning via Contrastive Learning with Annotated Chain-of-Thought-based Reinforced Fine-Tuning
train_one_epoch 2 other papers
1 dated earlier, 1 later
2401.08967 (2024-01)
REFT: Reasoning with REinforced Fine-Tuning
2508.15868 (2025-08)
CARFT: Boosting LLM Reasoning via Contrastive Learning with Annotated Chain-of-Thought-based Reinforced Fine-Tuning

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2404.03592")
get_code_for_paper("2404.03592")
have("2404.03592")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2404.03592.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2404.03592.svg)](https://syntology.ai/paper/2404.03592)

Connect an agent — have() is free.