{
  "schema_version": 1,
  "builder_plan": {
    "scenario": "Profiling shows attention computation is a bottleneck in your self-hosted service.",
    "change": "Check the supported GPU, tensor shapes, and precision, then replace only the relevant kernel.",
    "baseline": "The existing kernel inside the same complete serving pipeline.",
    "steps": [
      "Locate the paper's implementation and check its license, model support, data needs, and hardware requirements. Stop here if you cannot obtain the required artifacts.",
      "Save a small set of representative product tasks and expected outcomes. Keep evaluation tasks out of any training or tuning, and choose quality and cost limits before running.",
      "Run the baseline and the proposed change on identical inputs. Keep other settings fixed and repeat paired runs to expose variation.",
      "Save per-task outputs, failures, timings, and all usage costs. Review regressions before expanding the test."
    ],
    "measure": "Numerical differences, end-to-end latency, throughput, and memory at realistic shapes.",
    "decision": "Keep the change only if it meets your preselected quality and latency limits and improves the metric you care about after setup and operating costs. Otherwise retain the baseline. This is an exploration plan, not a validated recommendation."
  },
  "builder_review": null,
  "arxiv_id": "2607.27692",
  "title": "Recall Before You Rank: Similarity-Guided Top-$K$ Reuse for Efficient Long-Context Attention",
  "summary": "ReTopK replaces the per-token full-KV scoring and global Top-K selection step of dynamic sparse attention with a bounded per-head cache of historical query-support pairs: for each new query it retrieves similar cached queries, unions their supports with a recent window, and reranks only that compact candidate set with exact current-query scores, keeping the complete KV cache intact. The cost is extra memory for the query-support cache, the added complexity of similarity retrieval, similarity-based fallback to Exact Top-K, and periodic exact refreshes, plus the residual quality gap of approximate selection (0.50% perplexity increase at 128K, K=512). It can fail when query similarity does not predict support overlap, when the fallback triggers so often that the speedup vanishes, and because the reported gains cover only 16K-128K contexts on PG19/NIAH/LongBench and assume a Top-K attention stack already in production.",
  "rationale": "The method is training-free and preserves the full KV cache, making it feasible on a single 24 GB GPU serving long-context inference, but the speedup depends on the reader already using dynamic Top-K attention and on reuse reliability holding for their specific workload, so small-scale validation is required before adoption.",
  "technique": "Query-similarity reuse of Top-K attention selections",
  "family": "kernels_e_atencao",
  "recommendation": "testar",
  "published": "2026-07-30",
  "as_of": "2026-10-18",
  "editorial_status": "indexed",
  "source_url": "https://arxiv.org/abs/2607.27692",
  "independent_implementations": 0,
  "total_implementations": 1,
  "stars": 0,
  "citations": 0,
  "claims": [
    {
      "claim_id": "claim-01",
      "statement": "ReTopK replaces the per-token full-KV scoring and global Top-K selection step of dynamic sparse attention with a bounded per-head cache of historical query-support pairs: for each new query it retrieves similar cached queries, unions their supports with a recent window, and reranks only that compact candidate set with exact current-query scores, keeping the complete KV cache intact. The cost is extra memory for the query-support cache, the added complexity of similarity retrieval, similarity-based fallback to Exact Top-K, and periodic exact refreshes, plus the residual quality gap of approximate selection (0.50% perplexity increase at 128K, K=512). It can fail when query similarity does not predict support overlap, when the fallback triggers so often that the speedup vanishes, and because the reported gains cover only 16K-128K contexts on PG19/NIAH/LongBench and assume a Top-K attention stack already in production.",
      "basis": "inferred",
      "result": "",
      "baseline": "",
      "conditions": "",
      "source_url": "https://arxiv.org/abs/2607.27692",
      "source_page": null,
      "source_excerpt": ""
    },
    {
      "claim_id": "claim-02",
      "statement": "At 128K context with K=512, 3.07x attention-computation speedup over Exact Top-K with a 0.50% perplexity increase, plus best PG19 perplexity and NIAH/LongBench scores among evaluated approximate methods.",
      "basis": "inferred",
      "result": "",
      "baseline": "",
      "conditions": "",
      "source_url": "https://arxiv.org/abs/2607.27692",
      "source_page": null,
      "source_excerpt": ""
    }
  ],
  "exposure_map": [
    {
      "dimension": "quality",
      "basis": "not_evaluated",
      "finding": "",
      "interpretation": "",
      "limitation": "",
      "next_check": "",
      "source_url": "",
      "source_page": null,
      "source_excerpt": ""
    },
    {
      "dimension": "compute",
      "basis": "not_evaluated",
      "finding": "",
      "interpretation": "",
      "limitation": "",
      "next_check": "",
      "source_url": "",
      "source_page": null,
      "source_excerpt": ""
    },
    {
      "dimension": "latency",
      "basis": "not_evaluated",
      "finding": "",
      "interpretation": "",
      "limitation": "",
      "next_check": "",
      "source_url": "",
      "source_page": null,
      "source_excerpt": ""
    },
    {
      "dimension": "operations",
      "basis": "not_evaluated",
      "finding": "",
      "interpretation": "",
      "limitation": "",
      "next_check": "",
      "source_url": "",
      "source_page": null,
      "source_excerpt": ""
    },
    {
      "dimension": "compatibility",
      "basis": "not_evaluated",
      "finding": "",
      "interpretation": "",
      "limitation": "",
      "next_check": "",
      "source_url": "",
      "source_page": null,
      "source_excerpt": ""
    },
    {
      "dimension": "security",
      "basis": "not_evaluated",
      "finding": "",
      "interpretation": "",
      "limitation": "",
      "next_check": "",
      "source_url": "",
      "source_page": null,
      "source_excerpt": ""
    },
    {
      "dimension": "data_and_training",
      "basis": "not_evaluated",
      "finding": "",
      "interpretation": "",
      "limitation": "",
      "next_check": "",
      "source_url": "",
      "source_page": null,
      "source_excerpt": ""
    },
    {
      "dimension": "reproducibility",
      "basis": "not_evaluated",
      "finding": "",
      "interpretation": "",
      "limitation": "",
      "next_check": "",
      "source_url": "",
      "source_page": null,
      "source_excerpt": ""
    }
  ],
  "risks": [],
  "minimum_test": [],
  "open_questions": [],
  "independent_tests": [],
  "lab_reproductions": [],
  "report_available": false,
  "validation_tier": "unknown",
  "evidence_tier": "unknown",
  "infrastructure_basis": "unknown",
  "equations": [
    {
      "anchor": "Sx3.E5",
      "label": "(5)",
      "section": "Methodology",
      "role": "proposed_method",
      "latex": "\\mathcal{B}_{t}=\\left\\{\\left(\\bar{q}_{c},\\hat{S}_{c}\\right)\\right\\}_{c=1}^{|\\mathcal{B}_{t}|},\\qquad\\bar{q}_{c}=\\frac{q_{c}}{\\|q_{c}\\|_{2}},",
      "mathml": "<math display=\"block\"><mrow><mrow><mrow><msub><mi>ℬ</mi><mi>t</mi></msub><mo>=</mo><msubsup><mrow><mo>{</mo><mrow><mo>(</mo><msub><mover accent=\"true\"><mi>q</mi><mo>¯</mo></mover><mi>c</mi></msub><mo>,</mo><msub><mover accent=\"true\"><mi>S</mi><mo>^</mo></mover><mi>c</mi></msub><mo>)</mo></mrow><mo>}</mo></mrow><mrow><mi>c</mi><mo>=</mo><mn>1</mn></mrow><mrow><mo stretchy=\"false\">|</mo><msub><mi>ℬ</mi><mi>t</mi></msub><mo stretchy=\"false\">|</mo></mrow></msubsup></mrow><mo rspace=\"2.167em\">,</mo><mrow><msub><mover accent=\"true\"><mi>q</mi><mo>¯</mo></mover><mi>c</mi></msub><mo>=</mo><mfrac><msub><mi>q</mi><mi>c</mi></msub><msub><mrow><mo stretchy=\"false\">‖</mo><msub><mi>q</mi><mi>c</mi></msub><mo stretchy=\"false\">‖</mo></mrow><mn>2</mn></msub></mfrac></mrow></mrow><mo>,</mo></mrow></math>",
      "context": "For each query head, ReTopK maintains a bounded FIFO cache of capacity <math display=\"inline\"><mi>C</mi></math>:",
      "headline": "",
      "explanation": "",
      "objective": "",
      "symbols": {},
      "evidence": "",
      "evidence_url": "",
      "source_url": ""
    },
    {
      "anchor": "Sx3.E9",
      "label": "(9)",
      "section": "Methodology",
      "role": "proposed_method",
      "latex": "\\mathcal{A}_{t}=\\operatorname{Unique}\\left(\\bigcup_{c\\in\\mathcal{R}_{t}}\\hat{S}_{c}\\;\\cup\\;\\mathcal{L}_{t}\\right),\\qquad M_{t}=|\\mathcal{A}_{t}|.",
      "mathml": "<math display=\"block\"><mrow><mrow><mrow><msub><mi>𝒜</mi><mi>t</mi></msub><mo>=</mo><mrow><mi>Unique</mi><mo>⁡</mo><mrow><mo>(</mo><mrow><mrow><munder><mo lspace=\"0em\" movablelimits=\"false\">⋃</mo><mrow><mi>c</mi><mo>∈</mo><msub><mi>ℛ</mi><mi>t</mi></msub></mrow></munder><msub><mover accent=\"true\"><mi>S</mi><mo>^</mo></mover><mi>c</mi></msub></mrow><mo rspace=\"0.502em\">∪</mo><msub><mi>ℒ</mi><mi>t</mi></msub></mrow><mo>)</mo></mrow></mrow></mrow><mo rspace=\"2.167em\">,</mo><mrow><msub><mi>M</mi><mi>t</mi></msub><mo>=</mo><mrow><mo stretchy=\"false\">|</mo><msub><mi>𝒜</mi><mi>t</mi></msub><mo stretchy=\"false\">|</mo></mrow></mrow></mrow><mo lspace=\"0em\">.</mo></mrow></math>",
      "context": "where <math display=\"inline\"><mi>W</mi></math> is the window size. The resulting candidate set is",
      "headline": "",
      "explanation": "",
      "objective": "",
      "symbols": {},
      "evidence": "",
      "evidence_url": "",
      "source_url": ""
    },
    {
      "anchor": "Sx3.E14",
      "label": "(14)",
      "section": "Methodology",
      "role": "complexity",
      "latex": "M_{t}\\leq RK+W\\ll L_{t}.",
      "mathml": "<math display=\"block\"><mrow><mrow><msub><mi>M</mi><mi>t</mi></msub><mo>≤</mo><mrow><mrow><mi>R</mi><mo lspace=\"0em\" rspace=\"0em\">​</mo><mi>K</mi></mrow><mo>+</mo><mi>W</mi></mrow><mo>≪</mo><msub><mi>L</mi><mi>t</mi></msub></mrow><mo lspace=\"0em\">.</mo></mrow></math>",
      "context": "For Exact Top-<math display=\"inline\"><mi>K</mi></math>, full-history QK scoring requires <math display=\"inline\"><mrow><mi>𝒪</mi><mo>⁡</mo><mrow><mo stretchy=\"false\">(</mo><mrow><msub><mi>L</mi><mi>t</mi></msub><mo lspace=\"0em\" rspace=\"0em\">​</mo><mi>d</mi></mrow><mo stretchy=\"false\">)</mo></mrow></mrow></math> work, followed by global Top-<math display=\"inline\"><mi>K</mi></math> selection over <math display=\"inline\"><msub><mi>L</mi><mi>t</mi></msub></math> scores. In contrast, a ReTopK reuse step requires <math display=\"inline\"><mrow><mi>𝒪</mi><mo>⁡</mo><mrow><mo stretchy=\"false\">(</mo><mrow><mi>C</mi><mo lspace=\"0em\" rspace=\"0em\">​</mo><mi>d</mi></mrow><mo stretchy=\"false\">)</mo></mrow></mrow></math> work for cache matching, <math display=\"inline\"><mrow><mi>𝒪</mi><mo>⁡</mo><mrow><mo stretchy=\"false\">(</mo><mrow><mrow><mi>R</mi><mo lspace=\"0em\" rspace=\"0em\">​</mo><mi>K</mi></mrow><mo>+</mo><mi>W</mi></mrow><mo stretchy=\"false\">)</mo></mrow></mrow></math> work to construct the raw candidate list, and <math display=\"inline\"><mrow><mi>𝒪</mi><mo>⁡</mo><mrow><mo stretchy=\"false\">(</mo><mrow><msub><mi>M</mi><mi>t</mi></msub><mo lspace=\"0em\" rspace=\"0em\">​</mo><mi>d</mi></mrow><mo stretchy=\"false\">)</mo></mrow></mrow></math> work for candidate QK scoring, followed by Top-<math display=\"inline\"><mi>K</mi></math> selection over <math display=\"inline\"><msub><mi>M</mi><mi>t</mi></msub></math> scores, where",
      "headline": "",
      "explanation": "",
      "objective": "",
      "symbols": {},
      "evidence": "",
      "evidence_url": "",
      "source_url": ""
    }
  ],
  "equations_status": "selected",
  "core_kind": "formula",
  "equations_fetched_at": "2026-09-15",
  "equations_source_url": "",
  "equations_source_sha256": "",
  "exposures_reviewed_at": "",
  "exposures_source_sha256": ""
}