Manuscript Offprint

arXiv:2608.23296

Sigmoid Attention as a Better Substrate for Learned KV Cache Eviction

Isaac, Li

Abstract

Learned KV-cache eviction often faces a soft-to-hard mismatch: during training, differentiable gates typically attenuate token contributions, whereas inference saves memory only when KV entries are physically removed. We ask whether the attention substrate affects this soft-to-hard transition. Using GPT-2-scale Transformers trained on OpenWebText, we run a controlled 2×2×22 \times 2 \times 2 comparison over attention type, learned gating, and positional encoding. Although sigmoid attention is worse as a dense language model, learned hard eviction changes the useful operating points: sigmoid-gated models delete KV entries with negligible PPL change relative to their own no-eviction references. Under a matched live-cache protocol on the same dense backbones, learned sigmoid gates obtain lower PPL than our H2OH_{2}O and KeyDiff implementations, whereas softmax gates do not uniformly beat these post-hoc methods. The results suggest that attention normalization can substantially affect whether a training-time soft gate transfers cleanly to hard KV deletion.

1. Introduction

Learned KV-cache eviction has a soft-to-hard mismatch. During training, a model can only learn a differentiable proxy for deletion: a token is attenuated by a soft gate, but its key and value remain in memory. During inference, however, memory is freed only when the corresponding KV entry is physically removed. A useful learned eviction policy must therefore be threshold-stable: replacing soft attenuation by hard deletion at some threshold τ\tau should introduce little or no loss in next-token prediction quality.

Most KV-cache compression work does not directly ask which attention substrate makes this soft-to-hard transition easier to learn. Online post-hoc methods operate on a frozen model and select which cache entries to retain using signals available at inference time. H2OH_{2}O maintains accumulated attention-based heavy-hitter scores and retains high-score tokens together with recent tokens (Zhang et al., 2023). Key-Diff is an attention-free, key-similarity-based method that ranks cached keys by their similarity to a key-space anchor and retains distinctive keys (Park et al., 2025). Learned compression methods, including Dynamic Context Pruning and Dynamic Memory Compression, show that retention policies can be trained (Anagnostidis et al., 2023; Nawrot et al., 2024). Our question is complementary: holding the learned eviction mechanism fixed, does the attention normalization itself affect how learnable hard KV deletion is?

We test this question with a controlled 2×2×22 \times 2 \times 2 experiment: softmax versus sigmoid attention, dense versus learned eviction, and RoPE versus NoPE. NoPE denotes the removal of rotary embeddings from queries and keys. All models share the same GPT-2-scale setup. Gated models use the same soft-to-hard rule: token gates attenuate logits and values during training, then delete KV entries with g<τg < \tau at inference.

The results separate dense modeling quality from eviction learnability. Without eviction, softmax remains stronger: sigmoid attention is worse by ∼0.36\sim 0.36 PPL with RoPE and ∼1.21\sim 1.21 PPL without RoPE. With learned hard eviction, however, the useful operating points come from sigmoid attention. Against their own dense no-eviction references, Sig+G RoPE deletes 19.8% of KV entries with no measurable PPL penalty (22.424 vs. 22.440), while Sig+G NoPE deletes 32.2% with only a small increase (24.637 vs. 24.603). Under the same matched live-cache protocol, both learned sigmoid gates obtain lower PPL than our H2OH_{2}O and KeyDiff implementations. By contrast, softmax-gated models lose to H2OH_{2}O at matched compression.

Further analysis clarifies why this pattern is substrate-specific. A random support-removal probe shows that sigmoid attention is not generically more robust to arbitrary K/V deletion: when random K/V positions are removed in dense RoPE models, sigmoid attention outputs are more perturbed than softmax at larger removal rates. Thus the advantage does not come from sigmoid tolerating deletion.

1^{1}University of Pittsburgh, Pittsburgh, PA, USA. Correspondence to: Isaac (Rucheng) Li isl74@pitt.edu.

ICML 2026 Workshop on Resource-Adaptive Foundation Model Inference, Seoul, South Korea. Copyright 2026 by the author(s).

indiscriminately. It appears when the deletion pattern is learned, where non-row-normalized attention gives soft gates a cleaner local attenuation channel.

Code and notebooks for reproducing the eight experimental cells are available at https://github.com/IsaacLi74/sigmoid-kv-eviction.

References (15)