paper-with-me

홈 › Papers

KV-Fold: One-Step KV-Cache Recurrence for Long-Context Inference

2026-05-12 · Alireza Nadali, Patrick Cooper, Ashutosh Trivedi, Alvaro Velasquez arxiv

We introduce KV-Fold, a simple, training-free long-context inference protocol that treats the key-value (KV) cache as the accumulator in a left fold over sequence chunks. At each step, the model processes the next chunk conditioned on the accumulated cache, appends the newly produced keys and values, and passes the enlarged cache forward; the same one-step update is applied repeatedly, analogous to foldl in functional programming. Building on the KV cache concatenation primitive introduced for latent multi-agent communication, we repurpose it as a chunk-to-chunk recurrence for long-context inference. When processing chunk t, the model attends to the KV cache carried from earlier chunks as a prefix, reusing its internal state across segments without modifying or retraining the model. Despite its simplicity, the induced recurrence is stable: per-step drift rises briefly and then saturates into a flat plateau that persists across deep chains. This plateau is insensitive to a 10,000x change in numerical precision, robust across chunk sizes, and consistent across model families. At the task level, KV-Fold preserves exact information over long distances. On a needle-in-a-haystack benchmark, it achieves 100% exact-match retrieval across 152 trials spanning contexts from 16K to 128K tokens and chain depths up to 511 on Llama-3.1-8B, while remaining within the memory limits of a single 40GB GPU. Compared to streaming methods, which trade fidelity for bounded memory, KV-Fold maintains long-range retrieval while operating as a sequence of tractable forward passes. Overall, our results show that frozen pretrained transformers already support a stable form of KV-cache recurrence, providing a practical route to long-context inference without architectural changes or training.

📄 PDF Abstract BibTeX arXiv:2605.12471

Code (0)

등록된 구현이 없습니다.

Similar Papers 제목 키워드 기반

Looped Latent Attention: Cross-Loop KV Compression for Looped Transformers

2026-07-16 · James O' Neill, Fergal Reid arxiv

Looped, weight-tied Transformers reduce parameters by reusing a block, but decoding still stores a separate K/V cache for every recurrence step. We show that this loop-indexed cache is highly structured. For a fixed toke…

LazyEviction: Lagged KV Eviction with Attention Pattern Observation for Efficient Long Reasoning

2025-06-19 · Haoyue Zhang, Hualei Zhang, Xiaosong Ma, Jie Zhang 외

Large Language Models (LLMs) exhibit enhanced reasoning capabilities by employing Chain-of-Thought (CoT). However, the extended reasoning sequences introduce significant GPU memory overhead due to increased key-value (KV…

GPU

PM-KVQ: Progressive Mixed-precision KV Cache Quantization for Long-CoT LLMs

2025-05-24 · Tengxuan Liu, Shiyao Li, Jiayi Yang, Tianchen Zhao 외

Recently, significant progress has been made in developing reasoning-capable Large Language Models (LLMs) through long Chain-of-Thought (CoT) techniques. However, this long-CoT reasoning process imposes substantial memor…

Quantization

ManifoldKV: Training-Free KV Cache Compression via Euclidean Outlier Detection

2026-02-09 · Debajyoti Datta, Trishala Neeraj, Bibek Paudel, Vyom Sharma 외 arxiv

Long-context inference is constrained by KV-cache memory, which grows linearly with sequence length; KV-cache compression therefore hinges on reliably selecting which past tokens to retain. Most geometry-based eviction m…

Outlier Detection

RAT+: Train Dense, Infer Sparse -- Recurrence Augmented Attention for Dilated Inference

2026-02-20 · Xiuying Wei, Caglar Gulcehre arxiv

Structured dilated attention has an appealing inference-time efficiency knob: it reduces the FLOPs of attention and the KV cache size by a factor of the dilation size D, while preserving long-range connectivity. While pr…