SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.04093 · 2024

Scaling and evaluating sparse autoencoders

arXiv · PDF · Open in the Atlas

Code that ran

7 of 10 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; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 6 failures of our instrument; 3 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/2406.04093.json · badge: /api/ran/2406.04093.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
openai/sparse_autoencoder canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
eleutherai/sparsify community (classifier label)
classifier basis not recorded on the link
5 ran · 3 no recorded run
saprmarks/dictionary_learning reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
LN Ran
ran; our contract draft was wrong, not the code
openai/sparse_autoencoder/sparse_autoencoder/model.py
code served (permissive licence) · get_code("b4af06c57a251295")
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 tuple. 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

torch.manual_seed(0)

# Create a small tensor with shape (batch=2, features=4)
# The function uses mean and std along dim=-1, so we need at least 2D
x = torch.randn(2, 4)

# eps is a float parameter with default value 1e-05
eps = 1e-05

ARGS = {
    "x": x,
    "eps": eps,
}
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 tuple — a tuple output has no array shape of its own; none is 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
assert_type Ran
ran; our contract draft was wrong, not the code
eleutherai/sparsify/sparsify/utils.py
code served (permissive licence) · get_code("94434469ea2ebc0d")
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 str. 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 Type, TypeVar, Any, cast

torch.manual_seed(0)

T = TypeVar('T')

def assert_type(typ: Type[T], obj: Any) -> T:
    """Assert that an object is of a given type at runtime and return it."""
    if not isinstance(obj, typ):
        raise TypeError(f'Expected {typ.__name__}, got {type(obj).__name__}')
    return cast(typ, obj)


# Setup: Create valid arguments for assert_type
# The function takes a Type and an object, and asserts the object is an instance of that type

# Test case 1: Simple type assertion with str
test_string = "hello"
test_type = str

ARGS = {
    "typ": test_type,
    "obj": test_string
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
fused_encoder Ran
ran; our contract draft was wrong, not the code
eleutherai/sparsify/sparsify/fused_encoder.py
pointer only (licence: MIT); the stored copy get_code serves, from Teddy-XiongGZ/RAGLens, is pointer only (licence: NONE) · get_code("c839c072b645f3c8")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from Teddy-XiongGZ/RAGLens, 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.

geometric_median Ran
ran; our contract draft was wrong, not the code
saprmarks/dictionary_learning/dictionary_learning/trainers/top_k.py
code served (permissive licence) · get_code("3ca099bf6afb9a6a")
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 1, dtype family float, shape (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 as t

t.manual_seed(0)

# Create a small tensor of points in 4D space
# Shape: (batch_size=2, dim=4)
points = t.randn(2, 4)

ARGS = {
    "points": points,
    "max_iter": 100,
    "tol": 1e-05,
}
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 1, dtype family float, shape (4,) — shape (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
get_columns_all_equal Ran
ran; our contract draft was wrong, not the code
eleutherai/sparsify/sparsify/data.py
pointer only (licence: MIT); the stored copy get_code serves, from Teddy-XiongGZ/RAGLens, is pointer only (licence: NONE) · get_code("b44a86959a6f33aa")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from Teddy-XiongGZ/RAGLens, 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.

get_saes_by_layer_name Ran
ran on a synthesized input
eleutherai/sparsify/sparsify/trainer.py
code served (permissive licence) · get_code("55dfcfdde405bda2")
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 dict. 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)

# Create a sample SAE dictionary with various module names
# The function filters by module_name, so we need keys that match or start with module_name/
saes = {
    'layer.0': nn.Linear(4, 3),
    'layer.0/encoder': nn.Linear(4, 3),
    'layer.0/decoder': nn.Linear(3, 4),
    'layer.1': nn.Linear(4, 3),
    'layer.1/encoder': nn.Linear(4, 3),
    'other.module': nn.Linear(4, 3),
}

module_name = 'layer.0'

ARGS = {
    'saes': saes,
    'module_name': module_name,
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
quintic_newtonschulz Ran
ran; our contract draft was wrong, not the code
eleutherai/sparsify/sparsify/muon.py
pointer only (licence: MIT); the stored copy get_code serves, from Teddy-XiongGZ/RAGLens, is pointer only (licence: NONE) · get_code("1930bbdc2f82dc62")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from Teddy-XiongGZ/RAGLens, 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.

chunk_and_tokenize Not yet run
unverified (harvested, no recorded run)
eleutherai/sparsify/sparsify/data.py
pointer only (licence: MIT); the stored copy get_code serves, from Teddy-XiongGZ/RAGLens, is pointer only (licence: NONE) · get_code("3fafa18bde72510f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from Teddy-XiongGZ/RAGLens, 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.

get_layer_list Not yet run
unverified (harvested, no recorded run)
eleutherai/sparsify/sparsify/utils.py
code served (permissive licence) · get_code("72500992c94f5911")
How it ran

no invocation recorded.

resolve_widths Not yet run
unverified (harvested, no recorded run)
eleutherai/sparsify/sparsify/utils.py
code served (permissive licence) · get_code("4cd2443146d52623")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 10 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 10 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
assert_type 5 other papers
2 dated earlier, 3 later
2303.08112 (2023-03)
Eliciting Latent Predictions from Transformers with the Tuned Lens
2312.01037 (2023-12)
Eliciting Latent Knowledge from Quirky Language Models
2410.16090 (2024-10)
Analysing the Residual Stream of Language Models Under Knowledge Conflicts
and 2 more not named here
get_columns_all_equal 4 other papers
1 dated earlier, 3 later
2303.08112 (2023-03)
Eliciting Latent Predictions from Transformers with the Tuned Lens
2410.16090 (2024-10)
Analysing the Residual Stream of Language Models Under Knowledge Conflicts
2501.18823 (2025-01)
Transcoders Beat Sparse Autoencoders for Interpretability
and 1 more not named here
LN 3 other papers
1 dated earlier, 2 later
2312.16682 (2023-12)
Some things are more CRINGE than others: Iterative Preference Optimization with the Pairwise Cringe Loss
2409.04185 (2024-09)
Residual Stream Analysis with Multi-Layer SAEs
2411.07122 (2024-11)
SCAR: Sparse Conditioned Autoencoders for Concept Detection and Steering in LLMs
chunk_and_tokenize 3 other papers
3 later
2410.16090 (2024-10)
Analysing the Residual Stream of Language Models Under Knowledge Conflicts
2501.18823 (2025-01)
Transcoders Beat Sparse Autoencoders for Interpretability
2512.08892 (2025-12)
Toward Faithful Retrieval-Augmented Generation with Sparse Autoencoders
fused_encoder 2 other papers
2 later
2501.18823 (2025-01)
Transcoders Beat Sparse Autoencoders for Interpretability
2512.08892 (2025-12)
Toward Faithful Retrieval-Augmented Generation with Sparse Autoencoders
quintic_newtonschulz 2 other papers
2 later
2501.18823 (2025-01)
Transcoders Beat Sparse Autoencoders for Interpretability
2512.08892 (2025-12)
Toward Faithful Retrieval-Augmented Generation with Sparse Autoencoders
geometric_median 1 other paper
1 later
2410.08201 (2024-10)
Efficient Dictionary Learning with Switch Sparse Autoencoders
get_layer_list 1 other paper
1 later
2501.18823 (2025-01)
Transcoders Beat Sparse Autoencoders for Interpretability
get_saes_by_layer_name 1 other paper
1 later
2501.18823 (2025-01)
Transcoders Beat Sparse Autoencoders for Interpretability
resolve_widths 1 other paper
1 later
2501.18823 (2025-01)
Transcoders Beat Sparse Autoencoders for Interpretability

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

Sparse autoencoders provide a promising unsupervised approach for extracting interpretable features from a language model by reconstructing activations from a sparse bottleneck layer. Since language models learn many concepts, autoencoders need to be very large to recover all relevant features. However, studying the properties of autoencoder scaling is difficult due to the need to balance reconstruction and sparsity objectives and the presence of dead latents. We propose using k-sparse autoencoders [Makhzani and Frey, 2013] to directly control sparsity, simplifying tuning and improving the reconstruction-sparsity frontier. Additionally, we find modifications that result in few dead latents, even at the largest scales we tried. Using these techniques, we find clean scaling laws with respect to autoencoder size and sparsity. We also introduce several new metrics for evaluating feature quality based on the recovery of hypothesized features, the explainability of activation patterns, and the sparsity of downstream effects. These metrics all generally improve with autoencoder size. To demonstrate the scalability of our approach, we train a 16 million latent autoencoder on GPT-4 activations for 40 billion tokens. We release training code and autoencoders for open-source models, as well as a visualizer.

For agents

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

get_harvested_code_for_paper("2406.04093")
get_code_for_paper("2406.04093")
have("2406.04093")

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

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

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

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

Connect an agent — have() is free.