LoopGuard: 동적 KV 캐시 개입을 통한 자기 강화 어텐션 루프 해소
LoopGuard: Breaking Self-Reinforcing Attention Loops via Dynamic KV Cache Intervention
장문 생성에 대한 체계적인 실험을 통해, 디코딩 과정이 지속적인 반복 루프로 붕괴되는 심각한 오류 패턴을 관찰했습니다. 이러한 붕괴는 특정 헤드가 과거 정보의 일부분에만 집중하는 '축소된 어텐션 패턴'에 의해 발생하며, 추론 시점의 KV 캐시 재사용에 의해 더욱 강화됩니다. 특히, 기존의 KV 캐시 정책 중 많은 부분이 어텐션 기반의 중요도를 활용하기 때문에, 이러한 붕괴는 반복되는 토큰에 대해 부적절하게 높은 점수를 부여하여, 캐시 관리 과정에서 반복을 의도치 않게 증폭시킬 수 있습니다. 이러한 현상을 체계적이고 재현 가능한 방식으로 연구하기 위해, 명시적인 반복 유발 조건과 반복 정도 및 생성 안정성을 측정하는 지표를 포함하는 벤치마크인 LoopBench를 소개합니다. 이러한 통찰력을 바탕으로, 우리는 LoopGuard라는 경량의 KV 캐시 보호 장치를 제안합니다. LoopGuard는 온라인으로 반복 시작을 감지하고, 고정된 캐시 용량을 유지하면서 반복되는 후반 부분을 제거하여 피드백 루프를 방해합니다. LoopBench에서의 실험 결과, LoopGuard는 반복 발생 횟수를 90% 이상 감소시키면서, 출력 다양성을 회복하고 토큰 낭비를 줄이는 것으로 나타났습니다.
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.
No Analysis Report Yet
This paper hasn't been analyzed by Gemini yet.
Log in to request an AI analysis.