SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2504.02922 · NeurIPS · 2025

Overcoming Sparsity Artifacts in Crosscoders to Interpret Chat-Tuning

Neel Nanda, Bilal Chughtai, Julian Minder, Clément Dumas, Caden Juang

arXiv · PDF · Open in the Atlas

Code that ran

4 of 8 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 4 have no contract verdict; 0 failures of our instrument; 4 no recorded run), measured 2026-11-24; 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/2504.02922.json · badge: /api/ran/2504.02922.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
jkminder/dictionary_learning canonical (classifier label)
classifier basis not recorded on the link
4 ran · 4 no recorded run
FunctionStatusWhere it lives
get_model Ran
ran on a synthesized input
jkminder/dictionary_learning/dictionary_learning/training.py
code served (permissive licence) · get_code("b9097b889cb4d77e")
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 SimpleModel. 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 SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

class Trainer:
    def __init__(self, has_ae=False, use_compiled=False):
        if has_ae:
            model = SimpleModel()
            if use_compiled:
                self.ae = nn.Module()
                self.ae._orig_mod = model
            else:
                self.ae = model
        else:
            model = SimpleModel()
            if use_compiled:
                self.model = nn.Module()
                self.model._orig_mod = model
            else:
                self.model = model

trainer_with_ae = Trainer(has_ae=True, use_compiled=False)

ARGS = {
    'trainer': trainer_with_ae
}
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 SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel 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
grad_pursuit Ran
ran on a synthesized input
jkminder/dictionary_learning/dictionary_learning/grad_pursuit.py
code served (permissive licence) · get_code("5712034dc298886f")
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 (2, 3) 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)

# Parameters for grad_pursuit function
batch_size = 2
signal_dim = 4
dictionary_atoms = 3
target_l0 = 5

# signal: b x d
signal = t.randn(batch_size, signal_dim)

# dictionary: d x n
dictionary = t.randn(signal_dim, dictionary_atoms)

# target_l0: int
target_l0_val = target_l0

# device: str
device = 'cpu'

ARGS = {
    'signal': signal,
    'dictionary': dictionary,
    'target_l0': target_l0_val,
    'device': device
}
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 (2, 3) — shape (2, 3) 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
hf_dataset_to_generator Ran
ran on a synthesized input
jkminder/dictionary_learning/dictionary_learning/utils.py
code served (permissive licence) · get_code("624c94649d7e86d4")
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 generator. 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.

from unittest.mock import Mock, MagicMock

# Create a mock dataset that mimics HuggingFace dataset structure
class MockDataset:
    def __init__(self):
        self.data = [
            {'text': 'This is sample text one'},
            {'text': 'This is sample text two'},
            {'text': 'This is sample text three'},
        ]
        self.index = 0
    
    def __iter__(self):
        return iter(self.data)

# Mock the load_dataset function to return our mock dataset
def mock_load_dataset(dataset_name, split='train', streaming=True):
    return MockDataset()

# Patch load_dataset before importing the function
import sys
from unittest.mock import patch

with patch('datasets.load_dataset', side_effect=mock_load_dataset):
    from datasets import load_dataset

ARGS = {
    'dataset_name': 'wikitext',
    'split': 'train',
    'streaming': True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type generator — a generator output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a generator 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
numpy_to_torch_dtype Ran
ran on a synthesized input
jkminder/dictionary_learning/dictionary_learning/utils.py
code served (permissive licence) · get_code("77a35fa07b4643b5")
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 dtype. 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 numpy as np
import torch as th

NUMPY_TO_TORCH_DTYPE_DICT = {np.uint8: th.uint8, np.int8: th.int8, np.int16: th.int16, np.int32: th.int32, np.int64: th.int64, np.float16: th.float16, np.float32: th.float32, np.float64: th.float64, np.complex64: th.complex64, np.complex128: th.complex128}

def numpy_to_torch_dtype(np_dtype):
    return NUMPY_TO_TORCH_DTYPE_DICT[np_dtype]

ARGS = {
    "np_dtype": np.float32
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dtype — a dtype output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dtype 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
feature_effect Not yet run
unverified (harvested, no recorded run)
jkminder/dictionary_learning/dictionary_learning/interp.py
code served (permissive licence) · get_code("47523c58bac9ebdc")
How it ran

no invocation recorded.

get_stats Not yet run
unverified (harvested, no recorded run)
jkminder/dictionary_learning/dictionary_learning/training.py
code served (permissive licence) · get_code("87467b7150f616a8")
How it ran

no invocation recorded.

run_validation Not yet run
unverified (harvested, no recorded run)
jkminder/dictionary_learning/dictionary_learning/training.py
code served (permissive licence) · get_code("2f3727370354fa2b")
How it ran

no invocation recorded.

zst_to_generator Not yet run
unverified (harvested, no recorded run)
jkminder/dictionary_learning/dictionary_learning/utils.py
code served (permissive licence) · get_code("c3489b6eb423ae43")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 8 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.

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

Repositories linked to this paper

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

Abstract

Model diffing is the study of how fine-tuning changes a model's representations and internal algorithms. Many behaviors of interest are introduced during fine-tuning, and model diffing offers a promising lens to interpret such behaviors. Crosscoders are a recent model diffing method that learns a shared dictionary of interpretable concepts represented as latent directions in both the base and fine-tuned models, allowing us to track how concepts shift or emerge during fine-tuning. Notably, prior work has observed concepts with no direction in the base model, and it was hypothesized that these model-specific latents were concepts introduced during fine-tuning. However, we identify two issues which stem from the crosscoders L1 training loss that can misattribute concepts as unique to the fine-tuned model, when they really exist in both models. We develop Latent Scaling to flag these issues by more accurately measuring each latent's presence across models. In experiments comparing Gemma 2 2B base and chat models, we observe that the standard crosscoder suffers heavily from these issues. Building on these insights, we train a crosscoder with BatchTopK loss and show that it substantially mitigates these issues, finding more genuinely chat-specific and highly interpretable concepts. We recommend practitioners adopt similar techniques. Using the BatchTopK crosscoder, we successfully identify a set of chat-specific latents that are both interpretable and causally effective, representing concepts such as false information and personal question, along with multiple refusal-related latents that show nuanced preferences for different refusal triggers. Overall, our work advances best practices for the crosscoder-based methodology for model diffing and demonstrates that it can provide concrete insights into how chat-tuning modifies model behavior. 1 * Equal contribution. Order randomized. 1 We open-source our code, training library, models, wandb runs and a demo notebook to explore latents. 39th Conference on Neural Information Processing Systems (NeurIPS 2025).

For agents

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

get_harvested_code_for_paper("2504.02922")
get_code_for_paper("2504.02922")
have("2504.02922")

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

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

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

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

Connect an agent — have() is free.