A JoLT for the KV Cache: Near-Lossless KV Cache Compression via Joint Tucker and JL-Residual Allocation for LLMs

· Source: Computation and Language · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Mathematics & Computational Sciences · Depth: Expert, quick

Summary

JoLT introduces a novel method for near-lossless key-value (KV) cache compression, addressing the dominant memory cost in Transformer inference. This technique views the cache at a layer as a third-order tensor, exploiting varying redundancy across its heads, tokens, and features axes. JoLT applies a partial Tucker decomposition to compress the token and feature axes, then restores discarded energy using a Johnson-Lindenstrauss (JL) rotated low-bit residual. A single Lagrangian dual jointly allocates Tucker ranks and residual bit-widths per layer group. This achieves 2-3x compression, maintaining perplexity, GSM8K accuracy, and RULER retrieval within statistical noise on Mistral-7B-v0.3 and LLaMA-2-13B. At 2x compression, it yields relative Frobenius errors of 0.009 (K) and 0.006 (V). FlashJoLT offers a 5-13x compression-time speedup.

Key takeaway

For Machine Learning Engineers optimizing large language model inference, JoLT offers a compelling solution to reduce KV cache memory footprint. You can achieve a near-lossless 2-3x compression, maintaining model performance on benchmarks like GSM8K and RULER, as demonstrated on Mistral-7B-v0.3 and LLaMA-2-13B. Consider integrating JoLT or its faster variant, FlashJoLT, to significantly improve throughput and reduce GPU memory requirements for long-context LLM deployments.

Key insights

JoLT compresses LLM KV caches by treating them as third-order tensors, combining Tucker decomposition with JL-residual allocation for near-lossless results.

Principles

Method

JoLT applies partial Tucker decomposition on token and feature axes, then restores energy with a Johnson-Lindenstrauss (JL) rotated low-bit residual, allocated via a Lagrangian dual per layer group.

In practice

Topics

Best for: AI Engineer, Research Scientist, AI Scientist, Machine Learning Engineer, NLP Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Computation and Language.