--- license: cc-by-4.0 task_categories: - feature-extraction language: - en tags: - transformer - attention - rope - power-law - scaling-laws - interpretability - llm - benchmark pretty_name: TAF Attention-Decay Measurements size_categories: - n<1K configs: - config_name: default data_files: - split: train path: taf-attention-decay.jsonl --- # TAF Attention-Decay Measurements > **First public dataset of attention-decay exponent γ measurements > across transformer LLMs.** > Companion to the paper *Predicting How Transformers Attend* > (Marín 2026, [Zenodo DOI 10.5281/zenodo.19826343](https://zenodo.org/records/19826343)). ## What it is Each record is one γ measurement on one (model, corpus, precision) tuple. γ is the exponent of the power-law decay of attention weights at distance d: ``` A(d) ∝ d^(-γ) ``` predicted from RoPE geometry by the closed-form Padé formula ``` γ_padé = (2θ - T√2) / (2θ + T√2) ``` where θ is the RoPE base frequency and T is the evaluation context length. ## Coverage - **32 models** across 12 families (Pythia, Qwen, Llama, Mistral, Gemma, Phi, OLMo, OLMoE, DeepSeek, StarCoder2, CodeLlama, GPT-J, SmolLM2, Falcon) - **58 records** total - **2 corpora**: real text (`real_text`, MongoDB English episodes) + random tokens (`random_tokens`) - **2 precisions**: 4-bit NF4 (BitsAndBytes) + bfloat16 - **Includes random-init controls** (E2 falsifier on Pythia 70M/410M/1B with random Gaussian init, no pretraining) — establishes that the slope ν = ∂γ/∂log₁₀(P) ≈ −1/(2π) is genuinely a *training imprint*, not architecture artifact. ## Schema Each JSONL row: ```json { "model_id": "EleutherAI/pythia-2.8b", "revision": "main", "arch": { "d_model": 2560, "n_heads": 32, "n_layers": 32, "d_head": 80, "n_kv_heads": 32, "n_params_M": 2800, "rope_theta": 10000, "T_train": 2048, "family": "pythia", "is_instruct": false, "is_moe": false }, "measurement": { "gamma": 0.674, "gamma_ci95_lo": 0.65, "gamma_ci95_hi": 0.70, "method": "pade_d_alias_T", "fit": {"log_A": -3.21, "R2": 0.987, "n_points": 9, "delta_R2_power_minus_exp": 0.42}, "T_eval": 2048, "corpus": "real_text", "n_prompts_per_distance": 150, "seeds": [42, 123, 7], "distances": [10, 20, 30, 50, 100, 200, 500, 1000, 2000], "precision": "4-bit-NF4" }, "predictions": { "gamma_pade": 0.747, "gamma_random_pred": null, "imprint_constant_nu": -0.1592 }, "decision": "MED gamma=0.674 (R²=0.987)", "provenance": { "taf_version": "0.4", "paper_doi": "10.5281/zenodo.19826343", "source_file": "EleutherAI--pythia-2.8b_mongo.json", "tool": "tafagent/cli/diagnose_model.py + e4_extended_gamma.py", "license_data": "CC-BY-4.0", "license_code": "Apache-2.0" } } ``` ## Usage ```python from datasets import load_dataset ds = load_dataset("karlexmarin/taf-attention-decay") print(ds["train"][0]) ``` ```python import pandas as pd df = pd.read_json("taf-attention-decay.jsonl", lines=True) df_text = df[df["measurement"].apply(lambda m: m["corpus"] == "real_text")] df_text["gamma"] = df_text["measurement"].apply(lambda m: m["gamma"]) print(df_text.groupby("arch")["gamma"].describe()) ``` ## Why this dataset exists The attention-decay exponent γ is a single-number diagnostic of how "locally" or "globally" a transformer attends. It connects RoPE geometry to long-context behavior, KV-cache compression, NIAH retrieval, and hallucination rates — see the companion paper for details. Until now, no public dataset of γ measurements existed across LLMs. This release closes that gap. ## What's NOT in this dataset - **Raw attention tensors** (TB-scale, redundant with model weights) - **Per-layer per-head γ-fields** (separate dataset planned) - **Training-trajectory γ over checkpoints** (separate, from Pythia ckpts) - **Downstream task scores** (use RULER, LongBench-v2, HELM separately) ## License - **Data (this dataset)**: CC-BY-4.0 - **Measurement code**: Apache-2.0 ([github.com/karlesmarin/tafagent](https://github.com/karlesmarin/tafagent)) - **Underlying model weights**: respective HuggingFace licenses (consult each model's card) ## Citation ```bibtex @dataset{marin2026taf_attention_decay, author = {Mar{\'\i}n, Carles}, title = {TAF Attention-Decay Measurements}, year = {2026}, publisher = {HuggingFace}, url = {https://huggingface.co/datasets/karlexmarin/taf-attention-decay}, license = {CC-BY-4.0} } @article{marin2026predicting, author = {Mar{\'\i}n, Carles}, title = {Predicting How Transformers Attend: Analytic Power-Law Theory, Phase Transitions, and Practical Compression Tools}, year = {2026}, doi = {10.5281/zenodo.19826343}, url = {https://zenodo.org/records/19826343} } ``` ## Acknowledgements This dataset would not exist without: - **EleutherAI** for the Pythia panel (8 sizes from 14M to 2.8B), the primary scientific anchor of the framework. - **AI2** for OLMo / OLMoE. - **Meta**, **Mistral AI**, **Qwen team / Alibaba**, **Google DeepMind**, **Microsoft**, **HuggingFace SmolLM team**, **DeepSeek-AI**, **TII** (Falcon), and **BigScience** (BLOOM) for releasing weights publicly. - The **HuggingFace Hub** for free hosting that made the measurements possible. ## Reproducibility The measurement protocol is fully open: - Tool: [github.com/karlesmarin/tafagent](https://github.com/karlesmarin/tafagent), `cli/diagnose_model.py` - Browser tool: [karlesmarin.github.io/tafagent](https://karlesmarin.github.io/tafagent) Each row in this dataset can be reproduced from the original model weights via the open tool. If you find a discrepancy, please open an issue at the GitHub repo — refutations are welcome. ## Updates - 2026-04-29: Initial release (58 records, 32 models, 2 corpora, 2 precisions) - Future: training-trajectory data (Pythia checkpoint γ-flow), per-layer γ-fields, fp16 anchor measurements (DeepSeek-chat verification, Llama-3-8B cross-paper anchor)