Research arXiv cs.LG

A Self-Pruning Transformer: Extreme KV-Cache Compression with Universal Attention

KV-cacheattentionlong-contextmodel compression

The large KV-cache footprint of modern LLMs is a key bottleneck for efficient deployment. Prior approaches replaced attention layers' RoPE positional embeddings with alternative decay-based mechanisms that can prune the KV-cache at inference time, but those decay functions have limited expressivity and in practice collapse into sliding-window-like eviction patterns.

This work introduces a unifying framework for complementary and novel decay mechanisms that can capture complex key statistics and interactions while still preserving expressive RoPE embeddings and Softmax attention. The resulting Universal Attention architecture is highly expressive and end-to-end trainable, and its composite decay mechanism doubles as a natural adaptive pruning criterion that removes the tokens contributing least to the attention computation.

Experimentally, Universal Attention achieves state-of-the-art 10x compression on natural language and synthetic task data, and it improves downstream performance relative to both state-of-the-art baselines and unpruned oracles. It also shows superior long-context generalization, reaching an unprecedented 25x compression at a context length of 16k.

The upshot is a single attention design that could substantially shrink KV-cache memory for long-context inference without sacrificing — and in these experiments, while improving — model quality.

Read original →

← Back to home