LoopGuard: Breaking Self-Reinforcing Attention Loops via Dynamic KV Cache Intervention
On the map: Efficient LLM inference and serving → KV cache optimization
Abstract (arXiv)
Through systematic experiments on long-context generation, we observe a damaging failure mode in which decoding can collapse into persistent repetition loops. We find that this degeneration is driven by collapsed attention patterns, where a subset of heads locks onto a narrow suffix of the history, and is further stabilized by inference-time KV cache reuse. Crucially, since many existing KV cache policies rely on attention-based importance, this collapse can produce spuriously high scores for repetitive tokens, causing cache management to inadvertently amplify repetition. To study this phenomenon in a controlled and reproducible manner, we introduce LoopBench, a benchmark with explicit loop-inducing conditions and loop-oriented metrics that quantify repetition severity and generation instability beyond downstream task scores. Building on these insights, we propose LoopGuard, a lightweight, plug-in KV cache guard that detects loop onset online and disrupts the feedback cycle by pruning repetitive tail spans under a fixed cache budget. Experiments on LoopBench show that LoopGuard reduces loop incidence by over 90 percentage points, while restoring output diversity and reducing token waste.
Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Placed in KV cache optimization, one of 12 directions in Efficient LLM inference and serving. Builds on 18 of its 24 references that are in the map. First posted on arXiv 11 Apr 2026.
Builds on
18 of 24 references.
Closest ancestors · 2
Same direction, newest first
- 2024Quest: Query-Aware Sparsity for Efficient Long-Context LLM Inference16 Jun
- 2024SnapKV: LLM Knows What You are Looking for Before Generation22 Apr
Other references · 16
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
- 2019The Curious Case of Neural Text Degenerationcited by 2,881
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
- 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,378
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
- 2022In-context Learning and Induction Headscited by 930
- 2024InfLLM: Training-Free Long-Context Extrapolation for LLMs with an Efficient Context Memorycited by 192
- 2020Evaluating the Evaluation of Diversity in Natural Language Generationcited by 127
- 2025Context Length Alone Hurts LLM Performance Despite Perfect Retrievalcited by 118
- 2022Learning to Break the Loop: Analyzing and Mitigating Repetitions for Neural Text Generationcited by 90
4 more
- 2023Repetition In Repetition Out: Towards Understanding Neural Text Degeneration from the Data Perspectivecited by 39
- 2024Repetition Neurons: How Do Language Models Produce Repetitions?cited by 22
- 2025LoopLLM: Transferable Energy-Latency Attacks in LLMs via Repetitive Generationcited by 7
- 2024Non-Halting Queries: Exploiting Fixed Points in LLMscited by 4
Built on by
Citing papers per year: 2026: 2.
2 papers.
- 2026Leyline: KV Cache Directives for Agentic Inferencecited by 5
- 2026Agentic Search Spaces for Tabular Machine Learningcited by 0
- 2026Agentic Search Spaces for Tabular Machine Learning14 Sep 2026
- 2026Leyline: KV Cache Directives for Agentic Inference31 May 2026
Similar, not cited
Close in wording, no citation either way
- 2026Moment-KV: Momentum-Based Decode-Time KV Cache Compression for Long Generation
- 2025REAL: REtrieval-reAsoning and Logic-constructed Attention Behaviors for Long-Context KV Cache Compression
- 2025KV Cache Recycling to Expand Usable Context Capacity in Low Parameter LLMs
- 2026Random Attention: Rethinking KV Cache Eviction for Efficient Reasoning
- 2026Behavior-Preserving KV Cache Compression
- 2024DynamicKV: Task-Aware Adaptive KV Cache Compression for Long Context LLMs
- 2025LazyEviction: Lagged KV Eviction with Attention Pattern Observation for Efficient Long Reasoning
- 2026KVDiagnosis: A Diagnostic Benchmark for KV-Cache Compression in Long-Context Language Models