mlsanityData to 7 Oct 2026

Stream: Scaling up Mechanistic Interpretability to Long Context in LLMs via Sparse Attention

arXiv 2510.19875 ↗First posted 22 Oct 2025cs.CL cs.AIcited by 2

Not on the map. Why?

Abstract (arXiv)

As Large Language Models (LLMs) scale to million-token contexts, traditional Mechanistic Interpretability techniques for analyzing attention scale quadratically with context length, demanding terabytes of memory beyond 100,000 tokens. We introduce Sparse Tracing, a novel technique that leverages dynamic sparse attention to efficiently analyze long context attention patterns. We present Stream, a compilable hierarchical pruning algorithm that estimates per-head sparse attention masks in near-linear time O(T log T) and linear space O(T), enabling one-pass interpretability at scale. Stream performs a binary-search-style refinement to retain only the top-k key blocks per query while preserving the model's next-token behavior. We apply Stream to long chain-of-thought reasoning traces and identify thought anchors while pruning 97-99% of token interactions. On the RULER benchmark, Stream preserves critical retrieval paths while discarding 90-96% of interactions and exposes layer-wise routes from the needle to output. Our method offers a practical drop-in tool for analyzing attention patterns and tracing information flow without terabytes of caches. By making long context interpretability feasible on consumer GPUs, Sparse Tracing helps democratize chain-of-thought monitoring. Code is available at https://anonymous.4open.science/r/stream-03B8/.

Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 34 of its 42 references that are in the map. First posted on arXiv 22 Oct 2025.

Builds on

34 of 42 references.

References · 34

  1. 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,146
  2. 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,203
  3. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  4. 2024GPT-4o System Cardcited by 4,467
  5. 2025Gemini 2.5: Pushing the Frontier with Advanced Reasoning, Multimodality, Long Context, and Next Generation Agentic Capabilitiescited by 3,655
  6. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
  7. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
  8. 2020Longformer: The Long-Document Transformercited by 3,362
  9. 2022Locating and Editing Factual Associations in GPTcited by 2,609
  10. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  11. 2025Gemma 3 Technical Reportcited by 1,686
  12. 2020Big Bird: Transformers for Longer Sequencescited by 1,673
22 more
  1. 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,311
  2. 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,270
  3. 2024Qwen2.5-Math Technical Report: Toward Mathematical Expert Model via Self-Improvementcited by 1,057
  4. 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 721
  5. 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 584
  6. 2025Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attentioncited by 391
  7. 2024Retrieval Head Mechanistically Explains Long-Context Factualitycited by 219
  8. 2025Thought Anchors: Which LLM Reasoning Steps Matter?cited by 126
  9. 2025Why do LLMs attend to the first token?cited by 122
  10. 2024Retrieval Augmented Generation or Long-Context LLMs? A Comprehensive Study and Hybrid Approachcited by 117
  11. 2024Round and Round We Go! What makes Rotary Positional Encodings useful?cited by 111
  12. 2024Automatically Interpreting Millions of Features in Large Language Modelscited by 106
  13. 2024AtP*: An efficient and scalable method for localizing LLM behaviour to componentscited by 100
  14. 2024Information Flow Routes: Automatically Interpreting Language Models at Scalecited by 92
  15. 2024Transformers need glasses! Information over-squashing in language taskscited by 87
  16. 2025Understanding Reasoning in Thinking Language Models via Steering Vectorscited by 69
  17. 2024Attention Heads of Large Language Models: A Surveycited by 65
  18. 2024How to think step-by-step: A mechanistic understanding of chain-of-thought reasoningcited by 53
  19. 2024A Mechanistic Analysis of a Transformer Trained on a Symbolic Multi-Step Reasoning Taskcited by 49
  20. 2024Iteration Head: A Mechanistic Study of Chain-of-Thoughtcited by 31
  21. 2024Understanding the RoPE Extensions of Long-Context LLMs: An Attention Perspectivecited by 13
  22. 2025A Survey on Transformer Context Extension: Approaches and Evaluationcited by 11

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 2.

2 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025DAM: Dynamic Attention Mask for Long-Context Large Language Model Inference Acceleration
  2. 2026You Only Index Once: Cross-Layer Sparse Attention with Shared Routing
  3. 2025LServe: Efficient Long-sequence LLM Serving with Unified Sparse Attention
  4. 2025Every Token Counts: Generalizing 16M Ultra-Long Context in Large Language Models
  5. 2026Full Attention Strikes Back: Transferring Full Attention into Sparse within Hundred Training Steps
  6. 2024From Sparse Dependence to Sparse Attention: Unveiling How Chain-of-Thought Enhances Transformer Sample Efficiency
  7. 2026Simplified Sparse Attention via Gist Tokens
  8. 2026Double-P: Hierarchical Top-P Sparse Attention for Long-Context LLMs