SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.19279 · NeurIPS · 2024

Understanding and Minimising Outlier Features in Transformer Training

Thomas Hofmann, Imanol Schlag, Bobby He, Lorenzo Noci, Daniele Paliotta

arXiv · PDF · Open in the Atlas

Code that ran

6 of 12 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 6 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/2405.19279.json · badge: /api/ran/2405.19279.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
huggingface/nanotron canonical (classifier label)
classifier basis: census
6 ran · 4 no recorded run
bobby-he/simplified_transformers canonical (classifier label)
classifier basis: census
0 ran · 1 no recorded run
nikhilvyas/SOAP community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
compute_kurtosis Ran
ran; our contract draft was wrong, not the code
huggingface/nanotron/src/nanotron/metrics_logging.py
code served (permissive licence) · get_code("eb326174c926895a")
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 0, dtype family float, 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

torch.manual_seed(0)

# The function takes a single tensor parameter and computes kurtosis
# It uses: .device, .float(), .mean(), .std(), .pow(), torch.tensor()
# The tensor can be any shape - we'll use a small 2D tensor

tensor = torch.randn(2, 4)

ARGS = {
    "tensor": tensor
}
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 0, dtype family float, 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
compute_tensor_norm Ran
ran; our contract draft was wrong, not the code
huggingface/nanotron/src/nanotron/metrics_logging.py
code served (permissive licence) · get_code("a72c22a93e228377")
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 0, dtype family float, 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

torch.manual_seed(0)

# Create a small tensor for testing
tensor = torch.randn(2, 4)

# Define arguments for compute_tensor_norm
ARGS = {
    "tensor": tensor,
    "p": 2
}
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 0, dtype family float, 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
get_attribute_by_path Ran
ran, honoured the contract we drafted
huggingface/nanotron/src/nanotron/metrics_logging.py
code served (permissive licence) · get_code("13ac96439b0894ca")
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 (3, 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
import torch.nn as nn

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer1 = nn.Linear(4, 3)
        self.layer2 = nn.Linear(3, 2)
        self.tensor_attr = torch.randn(2, 4)
        self.nested = NestedObject()
    
    def forward(self, x):
        return self.layer2(self.layer1(x))

class NestedObject:
    def __init__(self):
        self.value = 42
        self.deep = DeepObject()

class DeepObject:
    def __init__(self):
        self.final_value = torch.tensor([1.0, 2.0, 3.0])

model = SimpleModel()

ARGS = {
    "obj": model,
    "path": "layer1.weight"
}
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 (3, 4) — shape (3, 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_parameter_and_parent_module Ran
ran; our contract draft was wrong, not the code
huggingface/nanotron/src/nanotron/utils.py
code served (permissive licence) · get_code("0a00ba3983dd6e58")
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 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
from torch import nn

torch.manual_seed(0)

# Create a root module with a nested structure containing a parameter
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer1 = nn.Module()
        self.layer1.weight = nn.Parameter(torch.randn(4, 3))
        self.layer1.bias = nn.Parameter(torch.randn(4))

root_module = SimpleModel()

# Define arguments for the function
ARGS = {
    "target": "layer1.weight",
    "root_module": root_module
}
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 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
get_size Ran
ran; our contract draft was wrong, not the code
huggingface/nanotron/src/nanotron/trainer.py
code served (permissive licence) · get_code("89dc6d87894c3644")
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 numpy as np

def get_size(bytes):
    """Convert bytes to human readable format"""
    for unit in ['', 'K', 'M', 'B', 'T', 'P']:
        if bytes < 1024:
            return f'{bytes:.2f}{unit}B'
        bytes /= 1024

# Test with a reasonable byte size
ARGS = {
    'bytes': 2048
}
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 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
get_untyped_storage Ran
ran; our contract draft was wrong, not the code
huggingface/nanotron/src/nanotron/utils.py
code served (permissive licence) · get_code("a56a30fdb336647c")
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 UntypedStorage. 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
from packaging import version

torch.manual_seed(0)

# Create a small tensor to pass to get_untyped_storage
# The function only calls .untyped_storage() or .storage().untyped() on it
tensor = torch.randn(2, 4)

ARGS = {
    "tensor": tensor
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
packaging, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type UntypedStorage — a UntypedStorage output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a UntypedStorage output the recorded ndim 1 and dtype family int 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
SOAP Not yet run
unverified (harvested, no recorded run)
nikhilvyas/SOAP/soap.py
code served (permissive licence) · get_code("f2e2f9c92f1493e5")
How it ran

no invocation recorded.

all_gather_into_tensor Not yet run
unverified (harvested, no recorded run)
huggingface/nanotron/src/nanotron/distributed.py
code served (permissive licence) · get_code("22aa5bcc567897ad")
How it ran

no invocation recorded.

checkpoint_method Not yet run
unverified (harvested, no recorded run)
huggingface/nanotron/src/nanotron/utils.py
code served (permissive licence) · get_code("f021200d293b3b7f")
How it ran

no invocation recorded.

convertGPT2model Not yet run
unverified (harvested, no recorded run)
bobby-he/simplified_transformers/simplified_transformers/model_utils.py
code served (permissive licence) · get_code("06ee5a859c15c954")
How it ran

no invocation recorded.

new_group Not yet run
unverified (harvested, no recorded run)
huggingface/nanotron/src/nanotron/distributed.py
code served (permissive licence) · get_code("4db6f468bd875ddf")
How it ran

no invocation recorded.

reduce_scatter_tensor Not yet run
unverified (harvested, no recorded run)
huggingface/nanotron/src/nanotron/distributed.py
code served (permissive licence) · get_code("706bb90608ef58d5")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 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 12 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-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

Outlier Features (OFs) are neurons whose activation magnitudes significantly exceed the average over a neural network's (NN) width. They are well known to emerge during standard transformer training and have the undesirable effect of hindering quantisation in afflicted models. Despite their practical importance, little is known behind why OFs emerge during training, nor how one can minimise them. Our work focuses on the above questions, first identifying several quantitative metrics, such as the kurtosis over neuron activation norms, to measure OFs. With these metrics, we study how architectural and optimisation choices influence OFs, and provide practical insights to minimise OFs during training. As highlights, we introduce a novel unnormalised transformer block, the Outlier Protected block, and present a previously unknown benefit of non-diagonal preconditioning optimisers, finding both approaches to significantly reduce OFs and improve quantisation without compromising convergence speed, at scales of up to 7B parameters. Notably, our combination of OP block and non-diagonal preconditioner (SOAP) achieves 14.87 int8 weight-and-activation perplexity (from 14.71 in standard precision), compared to 63.4 int8 perplexity (from 16.00) with a default OF-prone combination of Pre-Norm model and Adam, when quantising OPT-125m models post-training. Overall, our findings shed new light on our understanding of, our ability to prevent, and the complexity of this important aspect of NN training dynamics.

For agents

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

get_harvested_code_for_paper("2405.19279")
get_code_for_paper("2405.19279")
have("2405.19279")

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

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

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

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

Connect an agent — have() is free.