SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.05954 · NeurIPS · 2024

Aligning Large Language Models with Representation Editing: A Control Perspective

U Berkeley, Lingkai Kong, Chao Zhang, Kai Wang, Yuanqi Du, Yue Song, Haorui Wang, Yifei Zhou, Yuchen Zhuang, Wenhao Mu, Rongzhi Zhang

arXiv · PDF · Open in the Atlas

Code that ran

8 of 15 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; 3 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 7 no recorded run), measured 2026-11-23; 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/2406.05954.json · badge: /api/ran/2406.05954.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
Lingkai-Kong/RE-Control canonical (classifier label)
classifier basis: census
5 ran · 4 no recorded run
lingkai-kong/re-control canonical (classifier label)
classifier basis: classifier_2025
3 ran · 3 no recorded run
FunctionStatusWhere it lives
clean Ran
ran; our contract draft was wrong, not the code
Lingkai-Kong/RE-Control/gpt4_eval.py
pointer only (licence: NONE); the stored copy get_code serves, from lblaoke/CARDS, is pointer only (licence: NONE) · get_code("9d741ca160b48466")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Lingkai-Kong/RE-Control 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.

clean Ran
ran; our contract draft was wrong, not the code
Lingkai-Kong/RE-Control/metrics.py
pointer only (licence: NONE); the stored copy get_code serves, from lblaoke/CARDS, is pointer only (licence: NONE) · get_code("3cf2a6616e939e43")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Lingkai-Kong/RE-Control 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.

data_collactor Ran
ran; our contract draft was wrong, not the code
Lingkai-Kong/RE-Control/reward_label.py
pointer only (licence: NONE) · get_code("caf88b9c8ecf956d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Lingkai-Kong/RE-Control 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.

data_process Ran
ran; our contract draft was wrong, not the code
lingkai-kong/re-control/measure_reward.py
pointer only (licence: NONE) · get_code("b2e30556f9379844")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, lingkai-kong/re-control 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.

get_rm Ran
ran, honoured the contract we drafted
Lingkai-Kong/RE-Control/reward_label.py
pointer only (licence: NONE) · get_code("eff184cc56e8bb4d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Lingkai-Kong/RE-Control 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.

gpt4_eval Ran
ran; our contract draft was wrong, not the code
Lingkai-Kong/RE-Control/gpt4_eval.py
pointer only (licence: NONE) · get_code("e891a84231ca8dd6")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Lingkai-Kong/RE-Control 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.

test_epoch Ran
ran, honoured the contract we drafted
lingkai-kong/re-control/train_value_model.py
pointer only (licence: NONE) · get_code("9e69e7d1e58dec6b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, lingkai-kong/re-control 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.

train_epoch Ran
ran, honoured the contract we drafted
lingkai-kong/re-control/train_value_model.py
pointer only (licence: NONE) · get_code("1b355772493f759c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, lingkai-kong/re-control 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.

Intervented_LlamaForCausalLM Not yet run
unverified (harvested, no recorded run)
lingkai-kong/re-control/intervented_model/llama.py
pointer only (licence: NONE) · get_code("c19b40e338f183c3")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, lingkai-kong/re-control 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.

Intervented_LlamaModel Not yet run
unverified (harvested, no recorded run)
lingkai-kong/re-control/intervented_model/llama.py
pointer only (licence: NONE) · get_code("e5833ed42b181705")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, lingkai-kong/re-control 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.

compute_diversity Not yet run
unverified (harvested, no recorded run)
Lingkai-Kong/RE-Control/metrics.py
pointer only (licence: NONE); the stored copy get_code serves, from lblaoke/CARDS, is pointer only (licence: NONE) · get_code("93c198d58d919707")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Lingkai-Kong/RE-Control 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.

compute_rep_n Not yet run
unverified (harvested, no recorded run)
Lingkai-Kong/RE-Control/metrics.py
pointer only (licence: NONE); the stored copy get_code serves, from lblaoke/CARDS, is pointer only (licence: NONE) · get_code("6c1c5b07ef997d49")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Lingkai-Kong/RE-Control 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.

extract_out Not yet run
unverified (harvested, no recorded run)
lingkai-kong/re-control/measure_reward.py
pointer only (licence: NONE) · get_code("66a8dc7918ff99ab")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, lingkai-kong/re-control 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.

get_llm_activations Not yet run
unverified (harvested, no recorded run)
Lingkai-Kong/RE-Control/get_activations_only.py
pointer only (licence: NONE) · get_code("71124f71d7503e4d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Lingkai-Kong/RE-Control 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.

process_hidden_states Not yet run
unverified (harvested, no recorded run)
Lingkai-Kong/RE-Control/get_activations_only.py
pointer only (licence: NONE) · get_code("27de88ce6534463a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Lingkai-Kong/RE-Control 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 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 4 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 4 the same month, 0 later) and 11 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
clean 1 other paper
1 the same month
2406.16306 (2024-06)
Cascade Reward Sampling for Efficient Decoding-Time Alignment
clean 1 other paper
1 the same month
2406.16306 (2024-06)
Cascade Reward Sampling for Efficient Decoding-Time Alignment
compute_diversity 1 other paper
1 the same month
2406.16306 (2024-06)
Cascade Reward Sampling for Efficient Decoding-Time Alignment
compute_rep_n 1 other paper
1 the same month
2406.16306 (2024-06)
Cascade Reward Sampling for Efficient Decoding-Time Alignment

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-23.

Repositories linked to this paper

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

Abstract

Aligning large language models (LLMs) with human objectives is crucial for real-world applications. However, fine-tuning LLMs for alignment often suffers from unstable training and requires substantial computing resources. Test-time alignment techniques, such as prompting and guided decoding, do not modify the underlying model, and their performance remains dependent on the original model's capabilities. To address these challenges, we propose aligning LLMs through representation editing. The core of our method is to view a pre-trained autoregressive LLM as a discrete-time stochastic dynamical system. To achieve alignment for specific objectives, we introduce external control signals into the state space of this language dynamical system. We train a value function directly on the hidden states according to the Bellman equation, enabling gradient-based optimization to obtain the optimal control signals at test time. Our experiments demonstrate that our method outperforms existing test-time alignment techniques while requiring significantly fewer resources compared to fine-tuning methods. Our code is available at https://github.com/Lingkai-Kong/RE-Control.

For agents

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

get_harvested_code_for_paper("2406.05954")
get_code_for_paper("2406.05954")
have("2406.05954")

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

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

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

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

Connect an agent — have() is free.