SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.17762 · 2024

Massive Activations in Large Language Models

arXiv · PDF · Open in the Atlas

Code that ran

6 of 22 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, 1 violated it and 2 have no contract verdict; 2 failures of our instrument; 16 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/2402.17762.json · badge: /api/ran/2402.17762.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
locuslab/massive-activations canonical (classifier label)
classifier basis: census
2 ran · 8 no recorded run
bluorion-com/refine_massive_activations community (classifier label)
classifier basis not recorded on the link
2 ran · 8 no recorded run
copy not recorded community
not in the paper's declared repositories
2 ran · 0 no recorded run
FunctionStatusWhere it lives
get_layers Ran
ran on a synthesized input
bluorion-com/refine_massive_activations/utils/model.py
code served (permissive licence) · get_code("16dc8236499dd526")
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 Linear. 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.encoder = nn.Module()
        self.encoder.layer1 = nn.Linear(4, 3)
        self.encoder.layer2 = nn.Linear(3, 2)
        self.decoder = nn.Module()
        self.decoder.output = nn.Linear(2, 4)

model = SimpleModel()
layer_path = "encoder.layer1"

ARGS = {
    "model": model,
    "layer_path": layer_path
}
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 Linear — a Linear output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Linear 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
is_pow2 Ran
ran, violated the contract we drafted
this paper's copy was not recorded; identical code first harvested from jingyangxiang/dfrot
pointer only; the stored copy get_code serves, from jingyangxiang/dfrot, is pointer only (licence: NONE) · get_code("e36d941e3a44f9df")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

load_dinov2_linear_head Ran
ran, honoured the contract we drafted
locuslab/massive-activations/lib/load_model.py
code served (permissive licence) · get_code("beb24f2f9700985a")
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 (1000, 768) 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 os
import torch
import tempfile

torch.manual_seed(0)

# Create a temporary directory for the linear head path
temp_dir = tempfile.mkdtemp()

# Create a dummy linear head weights file
dummy_weights = torch.randn(1000, 768)  # Example weights tensor
linear_head_file = os.path.join(temp_dir, 'dinov2_vitb14_linear_head.pth')
torch.save(dummy_weights, linear_head_file)

# Create args object with required attributes
class Args:
    def __init__(self):
        self.model_family = 'dinov2'
        self.model_size = 'b'  # Single character for vit size
        self.linear_head_path = temp_dir

ARGS = {
    'args': Args()
}
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 (1000, 768) — shape (1000, 768) 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
setup_intervene_hook Ran
ran; our contract draft was wrong, not the code
locuslab/massive-activations/lib/hook.py
code served (permissive licence) · get_code("5331cf7f35a3916e")
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 RemovableHandle. 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)

# Build a minimal nn.Module that has a layer we can hook into
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer = nn.Linear(4, 5)
    
    def forward(self, x):
        return self.layer(x)

# Create model and layer to hook
model = MinimalModel()
layer = model.layer

# The function uses:
# - layer.register_forward_hook() method
# - model_name as a string that gets checked against 'llama2_13b' and 'llama2_7b'
# - reset_type as a string that gets checked against 'set_mean' and 'set_zero'

ARGS = {
    'layer': layer,
    'model_name': 'llama2_7b',
    'reset_type': 'set_mean'
}
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 RemovableHandle — a RemovableHandle output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a RemovableHandle 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
to_numpy Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from jingyangxiang/dfrot
pointer only; the stored copy get_code serves, from jingyangxiang/dfrot, is pointer only (licence: NONE) · get_code("962843b3fc75bc61")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

tokenize_data Ran
ran on a synthesized input
bluorion-com/refine_massive_activations/utils/data.py
code served (permissive licence) · get_code("37c41fc5246ced6c")
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 list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 transformers import PreTrainedTokenizerFast
from tokenizers import Tokenizer
from tokenizers.models import BPE
from tokenizers.pre_tokenizers import Whitespace
from tokenizers.processors import TemplateProcessing

torch.manual_seed(0)

# Create a minimal tokenizer with bos_token_id
class MinimalTokenizer:
    def __init__(self):
        self.bos_token_id = 0
        # Create a simple token vocabulary
        self.vocab = {str(i): i for i in range(100)}
    
    def __call__(self, text, add_special_tokens=False):
        # Simulate tokenization by creating token IDs from text
        # Return an object with input_ids attribute
        tokens = [hash(word) % 50 for word in text.split()]
        if len(tokens) == 0:
            tokens = [1]
        return MockTokenizerOutput(tokens)

class MockTokenizerOutput:
    def __init__(self, token_ids):
        self.input_ids = token_ids

# Create test data
seq_list = [
    "hello world this is a test",
    "another sequence for tokenization"
]

tokenizer = MinimalTokenizer()
nsamples = 2
seqlen = 4096
add_bos_token = False
device = None

ARGS = {
    "seq_list": seq_list,
    "tokenizer": tokenizer,
    "nsamples": nsamples,
    "seqlen": seqlen,
    "add_bos_token": add_bos_token,
    "device": device
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tokenizers, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
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
check_module_hidden_states Not yet run
unverified (harvested, no recorded run)
bluorion-com/refine_massive_activations/utils/model.py
code served (permissive licence) · get_code("fedac06eb6b7397d")
How it ran

no invocation recorded.

fix_reg_mean Not yet run
unverified (harvested, no recorded run)
locuslab/massive-activations/lib/eval_utils.py
code served (permissive licence) · get_code("0a1741a6e7ed06cc")
How it ran

no invocation recorded.

get_data Not yet run
unverified (harvested, no recorded run)
locuslab/massive-activations/lib/load_data.py
code served (permissive licence) · get_code("72267856fa2b021a")
How it ran

no invocation recorded.

get_data Not yet run
unverified (harvested, no recorded run)
bluorion-com/refine_massive_activations/utils/data.py
code served (permissive licence) · get_code("e9ecff7082bc2114")
How it ran

no invocation recorded.

get_pg19 Not yet run
unverified (harvested, no recorded run)
locuslab/massive-activations/lib/load_data.py
code served (permissive licence) · get_code("30e312efd276f18f")
How it ran

no invocation recorded.

get_test_data Not yet run
unverified (harvested, no recorded run)
bluorion-com/refine_massive_activations/utils/data.py
code served (permissive licence) · get_code("de38267cc96913a3")
How it ran

no invocation recorded.

get_wikitext Not yet run
unverified (harvested, no recorded run)
locuslab/massive-activations/lib/load_data.py
code served (permissive licence) · get_code("2925fa19b17e4124")
How it ran

no invocation recorded.

gpt2_attention_custom_forward Not yet run
unverified (harvested, no recorded run)
bluorion-com/refine_massive_activations/monkey_patch/gpt2_attn.py
code served (permissive licence) · get_code("918a72c6d010f93d")
How it ran

no invocation recorded.

gpt2_attention_kvbias_custom_forward Not yet run
unverified (harvested, no recorded run)
bluorion-com/refine_massive_activations/monkey_patch/gpt2_attn.py
code served (permissive licence) · get_code("57f24e1498cb806e")
How it ran

no invocation recorded.

llama_attention_custom_forward Not yet run
unverified (harvested, no recorded run)
bluorion-com/refine_massive_activations/monkey_patch/llama_attn.py
code served (permissive licence) · get_code("f30d58738468dd83")
How it ran

no invocation recorded.

llama_attention_kvbias_custom_forward Not yet run
unverified (harvested, no recorded run)
bluorion-com/refine_massive_activations/monkey_patch/llama_attn.py
code served (permissive licence) · get_code("2ce409aa896564d1")
How it ran

no invocation recorded.

load_llm Not yet run
unverified (harvested, no recorded run)
locuslab/massive-activations/lib/load_model.py
code served (permissive licence) · get_code("56d56728226c0df7")
How it ran

no invocation recorded.

load_model_and_tokenizer Not yet run
unverified (harvested, no recorded run)
bluorion-com/refine_massive_activations/utils/model.py
code served (permissive licence) · get_code("f9134816cda05113")
How it ran

no invocation recorded.

load_vit Not yet run
unverified (harvested, no recorded run)
locuslab/massive-activations/lib/load_model.py
code served (permissive licence) · get_code("61bb78b9e7903751")
How it ran

no invocation recorded.

setup_dinov2_model_for_eval Not yet run
unverified (harvested, no recorded run)
locuslab/massive-activations/lib/eval_utils.py
code served (permissive licence) · get_code("f3b705c49b57ec48")
How it ran

no invocation recorded.

test_imagenet Not yet run
unverified (harvested, no recorded run)
locuslab/massive-activations/lib/eval_utils.py
code served (permissive licence) · get_code("95efeec4214462f4")
How it ran

no invocation recorded.

Also present in other papers' code

Of 22 samples lifted from this paper's linked repositories, 22 carry a function identity and 0 do not. Of the 22 distinct functions with an identity, 4 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 4 later) and 18 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
is_pow2 3 other papers
3 later
2404.00456 (2024-04)
QuaRot: Outlier-Free 4-Bit Inference in Rotated LLMs
2410.13229 (2024-10)
Quamba: A Post-Training Quantization Recipe for Selective State Space Models
2412.00648 (2024-12)
DFRot: Achieving Outlier-Free and Massive Activation-Free for Rotated LLMs with Refined Rotation
to_numpy 2 other papers
2 later
2404.00456 (2024-04)
QuaRot: Outlier-Free 4-Bit Inference in Rotated LLMs
2412.00648 (2024-12)
DFRot: Achieving Outlier-Free and Massive Activation-Free for Rotated LLMs with Refined Rotation
fix_reg_mean 1 other paper
1 later
2502.06415 (2025-02)
Systematic Outliers in Large Language Models
setup_dinov2_model_for_eval 1 other paper
1 later
2502.06415 (2025-02)
Systematic Outliers in Large Language Models

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

We observe an empirical phenomenon in Large Language Models (LLMs) -- very few activations exhibit significantly larger values than others (e.g., 100,000 times larger). We call them massive activations. First, we demonstrate the widespread existence of massive activations across various LLMs and characterize their locations. Second, we find their values largely stay constant regardless of the input, and they function as indispensable bias terms in LLMs. Third, these massive activations lead to the concentration of attention probabilities to their corresponding tokens, and further, implicit bias terms in the self-attention output. Last, we also study massive activations in Vision Transformers. Code is available at https://github.com/locuslab/massive-activations.

For agents

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

get_harvested_code_for_paper("2402.17762")
get_code_for_paper("2402.17762")
have("2402.17762")

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

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

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

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

Connect an agent — have() is free.