SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2601.06787 · 2026

Garbage Attention in Large Language Models: <BOS> Sink Heads and Sink-aware Pruning

Taesup Kim, Jeongjae Park, Jewon Yeom, Jaewon Sok, Seonghyeon Park

arXiv · PDF · Open in the Atlas

Code that ran

3 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 0 failures of our instrument; 7 no recorded run), measured 2026-11-23; 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/2601.06787.json · badge: /api/ran/2601.06787.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
CASIA-LMC-Lab/FLAP community
Papers with Code archive
3 ran · 7 no recorded run
FunctionStatusWhere it lives
BiasGPT Ran
ran on a synthesized input · constructed an object; no result was computed
CASIA-LMC-Lab/FLAP/lib/prune.py
code served (permissive licence) · get_code("faf763d25abb99d6")
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, BiasGPT: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 small Linear layer
# The layer needs: weight.device, weight.data.shape (out_dim, in_dim)
in_features = 4
out_features = 3
layer = nn.Linear(in_features, out_features)

# Create sample input and output tensors for add_batch testing
# inp should be compatible with the layer: (batch, in_features) or (batch, seq_len, in_features)
inp = torch.randn(2, in_features)
out = torch.randn(2, out_features)

# metric can be 'WIFN' or something else (e.g., 'other')
metric = 'WIFN'

ARGS = {
    'layer': layer,
    'metric': metric,
}
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 BiasGPT — 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 BiasGPT 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
TokenizerWrapper Ran
ran on a synthesized input · constructed an object; no result was computed
CASIA-LMC-Lab/FLAP/lib/prune.py
code served (permissive licence) · get_code("2d5c7a7358bcd465")
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, TokenizerWrapper: 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

torch.manual_seed(0)

# Create a small tensor to represent tokenized input IDs
# Shape: (batch_size=2, sequence_length=4)
input_ids = torch.randint(0, 100, (2, 4))

ARGS = {
    "input_ids": input_ids
}
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 TokenizerWrapper — 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 TokenizerWrapper 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
cal_remove_neuron Ran
ran, honoured the contract we drafted
CASIA-LMC-Lab/FLAP/lib/prune.py
code served (permissive licence) · get_code("afa39472138ad65e")
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 int, ndim 0, dtype family int, 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
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal config class that provides the required attributes
class MinimalConfig:
    def __init__(self):
        self.intermediate_size = 2048
        self.hidden_size = 768
        self.num_hidden_layers = 12

# Create a minimal model class that provides config
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.config = MinimalConfig()

# Create a minimal args class with the required attributes
class MinimalArgs:
    def __init__(self, structure, pruning_ratio, remove_heads):
        self.structure = structure
        self.pruning_ratio = pruning_ratio
        self.remove_heads = remove_heads

# Test with UL-MM structure
model = MinimalModel()
args = MinimalArgs(
    structure='UL-MM',
    pruning_ratio=0.1,
    remove_heads=4
)

ARGS = {
    'args': args,
    'model': model
}
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 int, ndim 0, dtype family int, 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
compress Not yet run
unverified (harvested, no recorded run)
CASIA-LMC-Lab/FLAP/lib/prune.py
code served (permissive licence) · get_code("1e3629d8fc0ca6c7")
How it ran

no invocation recorded.

get_c4 Not yet run
unverified (harvested, no recorded run)
CASIA-LMC-Lab/FLAP/lib/prune.py
code served (permissive licence) · get_code("6ccf0fe3fd4574d5")
How it ran

no invocation recorded.

get_loaders Not yet run
unverified (harvested, no recorded run)
CASIA-LMC-Lab/FLAP/lib/prune.py
code served (permissive licence) · get_code("21ef6425a9e8b029")
How it ran

no invocation recorded.

get_ptb Not yet run
unverified (harvested, no recorded run)
CASIA-LMC-Lab/FLAP/lib/prune.py
code served (permissive licence) · get_code("1d035152616b1d19")
How it ran

no invocation recorded.

get_wikitext2 Not yet run
unverified (harvested, no recorded run)
CASIA-LMC-Lab/FLAP/lib/prune.py
code served (permissive licence) · get_code("2d79e7ef9f571f3d")
How it ran

no invocation recorded.

prepare_calibration_input Not yet run
unverified (harvested, no recorded run)
CASIA-LMC-Lab/FLAP/lib/prune.py
code served (permissive licence) · get_code("2519b3efd481ad47")
How it ran

no invocation recorded.

prune_flap Not yet run
unverified (harvested, no recorded run)
CASIA-LMC-Lab/FLAP/lib/prune.py
code served (permissive licence) · get_code("61d8056ebaa89693")
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, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 0 later) and 5 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
get_wikitext2
brick of this paper's assembly: helper
15 other papers
15 dated earlier · 1 only as an assembly brick
2306.11695 (2023-06)
A Simple and Effective Pruning Approach for Large Language Models
2310.01382 (2023-10)
Compressing LLMs: The Truth is Rarely Pure and Never Simple
2310.05175 (2023-10)
Outlier Weighed Layerwise Sparsity (OWL ): A Missing Secret Sauce for Pruning LLMs to High Sparsity
and 12 more not named here
get_c4
brick of this paper's assembly: helper
10 other papers
10 dated earlier · 1 only as an assembly brick
2306.11695 (2023-06)
A Simple and Effective Pruning Approach for Large Language Models
2310.05175 (2023-10)
Outlier Weighed Layerwise Sparsity (OWL ): A Missing Secret Sauce for Pruning LLMs to High Sparsity
2310.08915 (2023-10)
Dynamic Sparse No Training: Training-Free Fine-tuning for Sparse LLMs
and 7 more not named here
TokenizerWrapper
brick of this paper's assembly: helper
4 other papers
4 dated earlier · 3 only as an assembly brick
2306.11695 (2023-06)
A Simple and Effective Pruning Approach for Large Language Models
2310.05175 (2023-10)
Outlier Weighed Layerwise Sparsity (OWL ): A Missing Secret Sauce for Pruning LLMs to High Sparsity
2310.08915 (2023-10)
Dynamic Sparse No Training: Training-Free Fine-tuning for Sparse LLMs
and 1 more not named here
prepare_calibration_input
brick of this paper's assembly: helper
3 other papers
3 dated earlier
2312.11983 (2023-12)
Fluctuation-based Adaptive Structured Pruning for Large Language Models
aaai_28960 (2024 (year only))
Fluctuation-Based Adaptive Structured Pruning for Large Language Models
2506.09351 (2025-06)
DIVE into MoE: Diversity-Enhanced Reconstruction of Large Language Models from Dense into Mixture-of-Experts
get_ptb
brick of this paper's assembly: helper
2 other papers
2 dated earlier
2312.11983 (2023-12)
Fluctuation-based Adaptive Structured Pruning for Large Language Models
aaai_28960 (2024 (year only))
Fluctuation-Based Adaptive Structured Pruning for 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-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

Large Language Models (LLMs) are known to contain significant redundancy, yet a systematic explanation for why certain components, particularly in higher layers, are more redundant has remained elusive. In this work, we identify the <BOS> sink phenomenon as a key mechanism driving this layer-wise sensitivity. We show that attention heads with high <BOS> sink scores are strongly associated with functional redundancy: such heads, especially in deeper layers, contribute little to predictive performance and effectively serve as dumping grounds for superfluous attention weights. This provides a concrete functional explanation for the structural redundancy reported in prior studies. Leveraging this insight, we introduce a simple pruning strategy that removes high-<BOS> sink heads. Experiments on Gemma-3, Llama-3.1, and Qwen3 demonstrate that this approach identifies redundant transformer components more reliably than weight-or activation-based criteria, while preserving performance close to dense baselines even under aggressive pruning. Moreover, we find that the behavior of sink heads remains stable across different sequence lengths. Overall, our results suggest that structural properties of attention offer a more intuitive and robust basis for model compression than magnitude-based methods.

For agents

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

get_harvested_code_for_paper("2601.06787")
get_code_for_paper("2601.06787")
have("2601.06787")

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

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

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

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

Connect an agent — have() is free.