Validation artifacts and code for 'The Discipline of Sparse Attention: A Budget-Matched Validation from 350M to 27B': measurements, interceptor and harness, experiment drivers, analysis scripts, and a provenance manifest mapping every table and figure to its data and code.
Python
0
7 commits
updated Oct 12, 2026
Machine-readable measurements, experiment drivers and analysis code for
The Discipline of Sparse Attention: A Budget-Matched Validation from 350M to 27B Eduardo Nacimiento-García and Carina S. González-González, University of La Laguna Neural Computing and Applications
DOI (always resolves to the current version): 10.5281/zenodo.22229672
Start with MANIFEST.md, which maps every numbered table and figure of the paper
to the data file and the script that produced it, and states how each attribution was established.
Hybrid Transformers interleave a few dense full-attention layers with sub-quadratic linear or convolutional layers. Only the dense layers carry the quadratic cost, so only they need approximation. This archive contains the measurements behind a controlled protocol for validating any training-free sparse mask, and the three boundaries it found.
The recipe under test is deliberately simple: a causal local window of 64 tokens, the first 4 positions as sinks, and a content top-k of 32 free keys, applied only to the full-attention layers.
src/ the attention interceptor, method registry, model loader and harness
scripts/ one driver per experiment, plus the figure script and the analysis utilities
analysis/ the scripts that assemble the published aggregate tables from the raw rows
results/ the measurements: one JSONL file per experiment, one row per measurement
results/old_bug/ measurements invalidated by a correction to decode-time key selection (see below)
results/provenance/ the execution log of the notebook-tier campaign, which is the auditable
evidence for that platform's driver, library versions and the out-of-memory
ceiling reported in the paper
results/figs/ the four figures, regenerable with scripts/plot_paper_figs.py
MANIFEST.md table and figure -> data file -> script, with the evidence level of each row
environment_manifest.json the four platforms, their exact software stacks, and what each produced
requirements.txt the reference-host stack; per-platform versions are in the manifest
LICENSE GNU GPL version 3, verbatim, covering src/, scripts/ and analysis/
LICENSE-data CC-BY-SA-4.0, covering results/
NOTICE copyright notice and the statement of the dual licensing
CITATION.cff citation metadata for this release
Each row of each JSONL file carries at least the model, the method, the task, the context, the seed and the outcome, so any cell of any table can be traced back to the rows behind it. Files from the 2026 campaigns additionally record the GPU, compute capability, driver, PyTorch, CUDA and Python versions, peak VRAM and wall-clock per row.
The drivers are independent and each writes one file. For example, to regenerate the block-granularity benchmark behind Table 12:
python scripts/run_flex_granularity.py --out results/REV2_flex_granularity.jsonl
To regenerate the four figures:
python scripts/plot_paper_figs.py
To regenerate the RULER-style battery at n=40 per task (this is a long run; see the header of the script for the per-model cost):
bash scripts/rev2_battery.sh
The aggregate tables are then assembled from those rows by the scripts in analysis/, which print
LaTeX-ready output. For instance analysis/analisis_bateria_rev2.py produces Tables 15, 16 and 17,
including the Wilson intervals, the paired effect sizes and the exact McNemar tests.
lg_topk_k32, local_global_topk, lg_topk and
lg_topk_perkey in different files. Table 2 of the paper is the authoritative mapping.results/old_bug/ is superseded data. A correction to decode-time key selection invalidated the
earlier single-forward retrieval numbers. Those rows are archived so the correction can be audited,
and no number in the paper is drawn from them.causal_conv1d,
flash-linear-attention and mamba_ssm could not be installed there, so those models fell back to
reference PyTorch implementations. Fidelity results are unaffected; timings on that platform are not
comparable to the others.scripts/ holds more drivers than the paper reports. The qwen38 family and a handful of early
probes (run_baseline.py, run_needle.py, run_retrieval.py, run_retrieval_rigorous.py,
run_local_window.py, run_combined.py, run_formatfree_probe.py, smoke_new_methods.py,
summarize.py) belong to exploratory work whose measurements are not deposited here, and no number
in the paper is drawn from them. They are kept because they are part of the codebase as it stood.
MANIFEST.md states exactly which script produced which deposited file.results/needle_diag.jsonl holds two appended runs
of its driver, and the first left recall: null in 54 of its 108 rows. Filter on
recall is not null before aggregating: the complete 54 rows are the n=18 per method that
Table 14 reports. MANIFEST.md gives the detail.results/ruler_battery.jsonl holds 59 rows per
method for the 0.8B arm where only 53 are distinct on (method, task, seed); the 4B arm is clean.
Deduplicate before aggregating. Every number published from this file was computed on the
deduplicated set and reproduces exactly, so no published figure is affected, but a naive
aggregation of the file as deposited gives different denominators. The revised manuscript draws
Tables 15 to 17 from the balanced n=40 re-run in results/REV2_battery_qwen3.5-*.jsonl instead.
MANIFEST.md gives the detail and the exact counts both ways.The software is licensed under the GNU General Public License version 3 (GPL-3.0-only). The
measurements under results/ are licensed under the Creative Commons Attribution-ShareAlike 4.0
International licence (CC-BY-SA-4.0). Full texts in LICENSE and LICENSE-data. The two licences
cover disjoint parts of the archive: no file is under both.
Artificial intelligence tools were used for review and translation and for assistance with the scripts and the analyses, specifically the OpenCode command-line interface together with models of the Qwen3.8 family. The authors reviewed and edited the content and take full responsibility for it.
Validation artifacts and code for 'The Discipline of Sparse Attention: A Budget-Matched Validation from 350M to 27B': measurements, interceptor and harness, experiment drivers, analysis scripts, and a provenance manifest mapping every table and figure to its data and code.
Python
0
7 commits
updated Oct 12, 2026
Machine-readable measurements, experiment drivers and analysis code for
The Discipline of Sparse Attention: A Budget-Matched Validation from 350M to 27B Eduardo Nacimiento-García and Carina S. González-González, University of La Laguna Neural Computing and Applications
DOI (always resolves to the current version): 10.5281/zenodo.22229672
Start with MANIFEST.md, which maps every numbered table and figure of the paper
to the data file and the script that produced it, and states how each attribution was established.
Hybrid Transformers interleave a few dense full-attention layers with sub-quadratic linear or convolutional layers. Only the dense layers carry the quadratic cost, so only they need approximation. This archive contains the measurements behind a controlled protocol for validating any training-free sparse mask, and the three boundaries it found.
The recipe under test is deliberately simple: a causal local window of 64 tokens, the first 4 positions as sinks, and a content top-k of 32 free keys, applied only to the full-attention layers.
src/ the attention interceptor, method registry, model loader and harness
scripts/ one driver per experiment, plus the figure script and the analysis utilities
analysis/ the scripts that assemble the published aggregate tables from the raw rows
results/ the measurements: one JSONL file per experiment, one row per measurement
results/old_bug/ measurements invalidated by a correction to decode-time key selection (see below)
results/provenance/ the execution log of the notebook-tier campaign, which is the auditable
evidence for that platform's driver, library versions and the out-of-memory
ceiling reported in the paper
results/figs/ the four figures, regenerable with scripts/plot_paper_figs.py
MANIFEST.md table and figure -> data file -> script, with the evidence level of each row
environment_manifest.json the four platforms, their exact software stacks, and what each produced
requirements.txt the reference-host stack; per-platform versions are in the manifest
LICENSE GNU GPL version 3, verbatim, covering src/, scripts/ and analysis/
LICENSE-data CC-BY-SA-4.0, covering results/
NOTICE copyright notice and the statement of the dual licensing
CITATION.cff citation metadata for this release
Each row of each JSONL file carries at least the model, the method, the task, the context, the seed and the outcome, so any cell of any table can be traced back to the rows behind it. Files from the 2026 campaigns additionally record the GPU, compute capability, driver, PyTorch, CUDA and Python versions, peak VRAM and wall-clock per row.
The drivers are independent and each writes one file. For example, to regenerate the block-granularity benchmark behind Table 12:
python scripts/run_flex_granularity.py --out results/REV2_flex_granularity.jsonl
To regenerate the four figures:
python scripts/plot_paper_figs.py
To regenerate the RULER-style battery at n=40 per task (this is a long run; see the header of the script for the per-model cost):
bash scripts/rev2_battery.sh
The aggregate tables are then assembled from those rows by the scripts in analysis/, which print
LaTeX-ready output. For instance analysis/analisis_bateria_rev2.py produces Tables 15, 16 and 17,
including the Wilson intervals, the paired effect sizes and the exact McNemar tests.
lg_topk_k32, local_global_topk, lg_topk and
lg_topk_perkey in different files. Table 2 of the paper is the authoritative mapping.results/old_bug/ is superseded data. A correction to decode-time key selection invalidated the
earlier single-forward retrieval numbers. Those rows are archived so the correction can be audited,
and no number in the paper is drawn from them.causal_conv1d,
flash-linear-attention and mamba_ssm could not be installed there, so those models fell back to
reference PyTorch implementations. Fidelity results are unaffected; timings on that platform are not
comparable to the others.scripts/ holds more drivers than the paper reports. The qwen38 family and a handful of early
probes (run_baseline.py, run_needle.py, run_retrieval.py, run_retrieval_rigorous.py,
run_local_window.py, run_combined.py, run_formatfree_probe.py, smoke_new_methods.py,
summarize.py) belong to exploratory work whose measurements are not deposited here, and no number
in the paper is drawn from them. They are kept because they are part of the codebase as it stood.
MANIFEST.md states exactly which script produced which deposited file.results/needle_diag.jsonl holds two appended runs
of its driver, and the first left recall: null in 54 of its 108 rows. Filter on
recall is not null before aggregating: the complete 54 rows are the n=18 per method that
Table 14 reports. MANIFEST.md gives the detail.results/ruler_battery.jsonl holds 59 rows per
method for the 0.8B arm where only 53 are distinct on (method, task, seed); the 4B arm is clean.
Deduplicate before aggregating. Every number published from this file was computed on the
deduplicated set and reproduces exactly, so no published figure is affected, but a naive
aggregation of the file as deposited gives different denominators. The revised manuscript draws
Tables 15 to 17 from the balanced n=40 re-run in results/REV2_battery_qwen3.5-*.jsonl instead.
MANIFEST.md gives the detail and the exact counts both ways.The software is licensed under the GNU General Public License version 3 (GPL-3.0-only). The
measurements under results/ are licensed under the Creative Commons Attribution-ShareAlike 4.0
International licence (CC-BY-SA-4.0). Full texts in LICENSE and LICENSE-data. The two licences
cover disjoint parts of the archive: no file is under both.
Artificial intelligence tools were used for review and translation and for assistance with the scripts and the analyses, specifically the OpenCode command-line interface together with models of the Qwen3.8 family. The authors reviewed and edited the content and take full responsibility for it.