SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.05892 · 2026

Beyond Steering Vector: Flow-based Activation Steering for Inference-Time Intervention

Chao Zhang, Zehao Jin, Xinjie Shen, Ruixuan Deng, Junran Wang

arXiv · PDF · Open in the Atlas

Code that ran

7 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (4 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 2 failures of our instrument; 4 no recorded run), measured 2026-11-22; 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/2605.05892.json · badge: /api/ran/2605.05892.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
flas-ai/FLAS community
Papers with Code archive
7 ran · 4 no recorded run
FunctionStatusWhere it lives
ArchSpec Ran
ran on a synthesized input · constructed an object; no result was computed
flas-ai/FLAS/src/flas/model.py
code served (permissive licence) · get_code("9760ba242ba86dd0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, ArchSpec: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type 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
from typing import Optional, Dict, Callable


# Define minimal RMSNorm class
class MinimalRMSNorm(nn.Module):
    def __init__(self, dim, eps=1e-6):
        super().__init__()
        self.weight = nn.Parameter(torch.ones(dim))
        self.eps = eps
    
    def forward(self, x):
        return x * torch.rsqrt(x.pow(2).mean(-1, keepdim=True) + self.eps)


# Define minimal RotaryEmbedding class
class MinimalRotaryEmbedding(nn.Module):
    def __init__(self, config=None):
        super().__init__()
        self.dim = 4
    
    def forward(self, x):
        return x


# Define minimal Attention class
class MinimalAttention(nn.Module):
    def __init__(self, config=None):
        super().__init__()
        self.config = config
    
    def forward(self, x, layer_idx=0):
        return x


# Simple callable for self_attn_layer_idx_fn
def simple_layer_idx_fn(layer_idx: int) -> int:
    return layer_idx % 2


# Build ARGS dict with all required parameters
ARGS = {
    "rms_norm_cls": MinimalRMSNorm,
    "rotary_emb_cls": MinimalRotaryEmbedding,
    "attention_cls": MinimalAttention,
    "embed_scale": True,
    "needs_layer_types": False,
    "self_attn_layer_idx_fn": simple_layer_idx_fn,
    "norm_init_map": {
        "input_layernorm": "input_layernorm",
        "post_attention_layernorm": "post_attention_layernorm",
    },
    "rope_layer_type": None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArchSpec — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ArchSpec output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
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
FlowCrossAttention Ran
ran on a synthesized input · constructed an object; no result was computed
flas-ai/FLAS/src/flas/model.py
code served (permissive licence) · get_code("bfe0eda103a5f249")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, FlowCrossAttention: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type 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)

class MockRotaryEmbedding(nn.Module):
    """Mock rotary embedding that returns cos and sin tensors."""
    def __init__(self, dim):
        super().__init__()
        self.dim = dim
    
    def forward(self, x, positions):
        # x shape: (batch, num_heads, seq_len, head_dim)
        # positions shape: (batch, seq_len)
        batch, num_heads, seq_len, head_dim = x.shape
        # Return cos and sin with shape (batch, seq_len, head_dim)
        cos = torch.cos(torch.zeros(batch, seq_len, head_dim))
        sin = torch.sin(torch.zeros(batch, seq_len, head_dim))
        return cos, sin

class MockRMSNorm(nn.Module):
    """Mock RMS normalization."""
    def __init__(self, dim, eps=1e-6):
        super().__init__()
        self.dim = dim
        self.eps = eps
        self.weight = nn.Parameter(torch.ones(dim))
    
    def forward(self, x):
        # x can be shape (batch, seq_len, dim) or (batch, num_heads, seq_len, head_dim)
        return x

# Parameters
hidden_size = 4
num_heads = 2
num_kv_heads = 2
head_dim = 2
rms_norm_eps = 1e-6
attn_bias = False
softcap = None

# Create instances
rotary_emb = MockRotaryEmbedding(head_dim)
rms_norm_cls = MockRMSNorm

ARGS = {
    "hidden_size": hidden_size,
    "num_heads": num_heads,
    "num_kv_heads": num_kv_heads,
    "head_dim": head_dim,
    "rms_norm_eps": rms_norm_eps,
    "rotary_emb": rotary_emb,
    "rms_norm_cls": rms_norm_cls,
    "attn_bias": attn_bias,
    "softcap": softcap,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type FlowCrossAttention — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a FlowCrossAttention output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
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
TimeEmbedder Ran
ran on a synthesized input · constructed an object; no result was computed
flas-ai/FLAS/src/flas/model.py
code served (permissive licence) · get_code("9a34212269a4980c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, TimeEmbedder: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type 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
import math

torch.manual_seed(0)

# Create a simple time tensor (batch_size=2, time values)
t = torch.tensor([0, 1], dtype=torch.long)

# TimeEmbedder parameters
hidden_size = 16
freq_dim = 128

ARGS = {
    "hidden_size": hidden_size,
    "freq_dim": freq_dim,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type TimeEmbedder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TimeEmbedder output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
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
_RopeLayerTypeWrapper Ran
ran on a synthesized input · constructed an object; no result was computed
flas-ai/FLAS/src/flas/model.py
code served (permissive licence) · get_code("09a774d5be2e087b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, _RopeLayerTypeWrapper: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type 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)

class MockRoPE(nn.Module):
    """Mock RoPE that accepts layer_type parameter"""
    def __init__(self):
        super().__init__()
    
    def forward(self, x, position_ids, layer_type=None):
        # Return cos and sin tensors matching input shape
        batch_size, seq_len, dim = x.shape
        cos = torch.cos(x)
        sin = torch.sin(x)
        return cos, sin

# Create mock rope instance
mock_rope = MockRoPE()

# Create layer_type parameter
layer_type = "attention"

ARGS = {
    "rope": mock_rope,
    "layer_type": layer_type,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type _RopeLayerTypeWrapper — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a _RopeLayerTypeWrapper output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
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
repeat_kv Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
flas-ai/FLAS/src/flas/model.py
code served (permissive licence) · get_code("0f07b44f9c18969e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 4, dtype family float, shape (2, 6, 4, 5) 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

torch.manual_seed(0)

# hidden_states: shape (batch, num_kv_heads, slen, head_dim)
# n_rep: int representing repetition factor for GQA

hidden_states = torch.randn(2, 3, 4, 5)  # batch=2, num_kv_heads=3, slen=4, head_dim=5
n_rep = 2

ARGS = {
    "hidden_states": hidden_states,
    "n_rep": n_rep,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 6, 4, 5) — shape (2, 6, 4, 5) 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
rotate_half Ran
ran, honoured the contract we drafted
flas-ai/FLAS/src/flas/model.py
code served (permissive licence) · get_code("e0782939cfb8d55c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 2, dtype family float, shape (2, 4) 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

torch.manual_seed(0)

# The function rotate_half takes a tensor x and rotates half the hidden dims
# It accesses x[..., :x.shape[-1] // 2] and x[..., x.shape[-1] // 2:]
# Then concatenates them with negation applied to the second half
# So x needs to be a tensor with an even last dimension

x = torch.randn(2, 4)  # batch_size=2, hidden_dim=4 (even number)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
sinusoidal_time_embedding Ran
ran; our contract draft was wrong, not the code
flas-ai/FLAS/src/flas/model.py
code served (permissive licence) · get_code("b6154393aab1604d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (4, 4) 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 math
import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create a small batch of time indices
t = torch.tensor([0, 5, 10, 15], dtype=torch.int64)

# Create embedding dimension (even number for testing)
dim = 4

ARGS = {
    "t": t,
    "dim": dim,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (4, 4) — shape (4, 4) 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
FlowBlock Not yet run
unverified (harvested, no recorded run)
flas-ai/FLAS/src/flas/model.py
code served (permissive licence) · get_code("9e67a860c7dbf282")
How it ran

no invocation recorded.

FlowFunction Not yet run
unverified (harvested, no recorded run)
flas-ai/FLAS/src/flas/model.py
code served (permissive licence) · get_code("37afef23099a66de")
How it ran

no invocation recorded.

_apply_rope_single Not yet run
unverified (harvested, no recorded run)
flas-ai/FLAS/src/flas/model.py
code served (permissive licence) · get_code("546fc68bf3f5a09d")
How it ran

no invocation recorded.

get_arch_spec Not yet run
unverified (harvested, no recorded run)
flas-ai/FLAS/src/flas/model.py
code served (permissive licence) · get_code("f09d6389d3aa5959")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 1 later) and 10 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
rotate_half
brick of this paper's assembly: helper
360 other papers
340 dated earlier, 5 the same month, 12 later, 3 undated · 30 only as an assembly brick
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
2203.08913 (2022-03)
Memorizing Transformers
2302.13971 (2023-02)
LLaMA: Open and Efficient Foundation Language Models
and 357 more not named here

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

Activation steering has emerged as a promising alternative for controlling languagemodel behavior at inference time by modifying intermediate representations while keeping model parameters frozen. However, large-scale evaluations such as AxBench show that existing steering methods are often outperformed by simple in-context prompting and generalize poorly to unseen concepts. We hypothesize that these limitations arise from unvalidated simplifying assumptions shared across prior methods, which typically restrict steering interventions to fixed, single-step, position-invariant transforms. We propose FLAS (Flow-based Activation Steering), which learns a general, concept-conditioned velocity field v θ (h, t, c) that transports unsteered activations to steered ones without relying on these assumptions. On AxBench, FLAS is the first learned method to consistently outperform prompting, reaching held-out harmonic means of 1.015 on Gemma-2-2B-IT and 1.113 on Gemma-2-9B-IT without per-concept tuning. Analysis of the learned flow shows curved, multi-step, token-varying trajectories, which suggests that previous hypotheses on activation space geometry might be incomplete. Our code is available at https://github.com/flas-ai/FLAS.

For agents

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

get_harvested_code_for_paper("2605.05892")
get_code_for_paper("2605.05892")
have("2605.05892")

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

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

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

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

Connect an agent — have() is free.