arXiv(opens in a new tab)cs.PFOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.17970

AlignPred: Error-Controlled KV Cache Compression via Alignment and Predictive Coding

Xu Yang, Jiapeng Zhang, Zhiwei Zuo, Yuxin Chen, Feiqiang Sun, Chengguang Xu, Feng Jin, Zhuo Tang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Long-running agents retain KV caches across turns and sessions for hours or days. Compressing these persistent caches requires reducing storage while controlling reconstruction error. We present AlignPred, a codec that combines local alignment with predictive coding under a configurable KV reconstruction-error budget. Local orthogonal transforms align related heads or layers into a common coordinate frame, allowing AlignPred to combine token-wise prediction with same-token prediction across heads or layers. Residuals are quantized on an error-bounded lattice and entropy-coded, without learned predictors, encoder-side mode search, or large joint transforms. Across three attention mechanisms, AlignPred requires less storage than the evaluated baselines at comparable measured reconstruction error. Against the evaluated CPU codec implementations, it decodes at least 1.6×1.6 \times faster while matching or improving encode time. AlignPred achieves near-native task scores at substantially compressed operating points on LongBench-Pro at 128K context. AlignPred's SGLang HiCache integration reduces persistent target-KV storage by 42–72% relative to native HiCache, with comparable latency.

1 INTRODUCTION

Long-running agents repeatedly revisit previously processed instructions, documents, and tool outputs across multiple turns (Zheng et al., 2024; Abhyankar et al., 2024). Retaining the corresponding KV caches avoids recomputing the same prefixes when a session resumes (Kwon et al., 2023; Liu et al., 2024b), but makes otherwise transient KV caches persistent. Commercial APIs already support retaining KV caches for hours or even days (Figure 1). As both context length and the number of retained sessions grow, compact storage becomes increasingly important for agent serving.

Cache retention

Figure

Figure 1: Long-lived KV caches motivate compact storage.

Serving frameworks such as TensorRT-LLM (NVIDIA, 2026) and vLLM (vLLM Project, 2026) support FP8 KV-cache quantization, which shows that models can tolerate some numerical error in their KV caches. The acceptable amount of error, however, depends on the application. Fidelity-sensitive workloads require tight error bounds, while other workloads can accept greater approximation. KV compression should therefore let users set a reconstruction-error budget and maximize the compression ratio within that budget. Existing KV compression methods typically seek high compression ratios while preserving performance on a limited set of downstream tasks (Liu et al., 2024c; Hooper et al., 2024; Staniszewski & Łańcucki, 2026), without explicitly bounding KV reconstruction error. As a result, users cannot tell whether a given setting meets the accuracy requirements of their own applications.

Meeting an error budget is only part of the problem. Effective compression still depends on how the resulting information is represented and coded. Current methods still leave room to exploit the properties of KV caches. General-purpose error-bounded compressors such as SZ3 (Liang et al.,

∗^{*}These authors contributed equally.

†^{\dagger}Email: yangxv@hnu.edu.cn

†^{†}Corresponding author.

(a) Cross-block alignment

Figure

(b) KV prediction structure

Figure

Figure 2: Alignment of related KV blocks. (a) Rotation registers same-token vectors across heads or layers. (b) Token rows share channels. Alignment also reduces cross-block differences.

  1. ignore head and layer geometry. Error-bounded coding has reached KV caches in the GPU-resident setting (Jiang et al., 2025; 2026), where decompression fuses into every attention step. Jiang et al. (2025) found that a prediction stage helps compression but conflicts with that fusion, and dropped it. Persistent KV storage reconstructs the cache once at restore time, so prediction remains available. KVTC (Staniszewski & Łańcucki, 2026) uses alignment to build a joint transform under a bit budget, not prediction references. Persistent storage thus leaves prediction available, but no existing method uses alignment to supply prediction references. This raises a natural question. Can alignment enable simple prediction in the original KV layout?

AlignPred starts from KV geometry. Within one attention head or latent-cache block, vectors from different tokens share a common coordinate frame, making token-wise dependencies directly accessible. Related heads or layers may encode similar information in different coordinate frames, so their corresponding coordinates are not directly comparable. We apply local orthogonal rotations to align these coordinate frames. After alignment, each cache value has two complementary sources of redundancy, neighboring tokens within the same block and the same token across related blocks. Alignment makes this cross-block relation usable as a prediction reference. Figure 2 shows this structure.

We exploit this structure with alignment-conditioned predictive coding. Because alignment exposes the cross-block dependency, prediction requires only fixed arithmetic. The first block is reconstructed by token interpolation, and later blocks are predicted from previously reconstructed aligned blocks before error-bounded residual coding. Alignment uses only one small rotation per block, sized to its head or latent dimension, so it costs far less computation than the joint transforms used in prior methods. This design also avoids learned predictors and encoder-side mode search while preserving parallelism across independent cache objects.

Contributions. (1) We show that local alignment enables effective cross-block prediction: in ablations on all three models, the same predictor increases storage without alignment but reduces it after alignment. (2) We introduce AlignPred, a codec that exploits this structure through fixed token-wise and cross-block prediction followed by error-bounded residual coding. It preserves the cache's block structure and supports a configurable reconstruction-error budget. Across three attention mechanisms, it stores less than the evaluated baselines at comparable measured error and decodes at least 1.6×1.6\times faster than the evaluated same-host CPU implementations. (3) We integrate the codec into SGLang HiCache, reducing persistent target-KV storage by 42–72% versus native HiCache at comparable cache-hit latency.

References (76)