TACT-KV: Tri-Axis Cosine Transform for Compressing Volumetric KV Caches in Medical VLMs

Chongyu Qu, Ritchie Zhao, Yufan He, Dong Yang, Zhengyi Lu, Junchao Zhu, Tianyuan Yao, Juming Xiong, Junlin Guo, Yanfan Zhu, Yuechen Yang, Daguang Xu, Bennett Allan Landman, Yucheng Tang, Yuankai Huo

TL;DR

TACT-KV introduces a calibration-free compression method for the visual Key-Value (KV) cache in 3D medical Vision-Language Models (VLMs). By exploiting the spatial correlation across all three anatomical axes using a 3D Discrete Cosine Transform and adaptive bit allocation, it achieves state-of-the-art 1-bit quantization performance and enables up to an 8× increase in decoding batch size on a single GPU.

What Problem Does This Paper Address?

Large-scale 3D medical imaging, such as CT or MRI scans, presents a unique "memory wall" for modern AI. Unlike a single 2D image, a 3D scan consists of hundreds of slices, which a vision encoder turns into tens of thousands of tokens. When these tokens enter a transformer-based VLM, they generate a massive Key-Value (KV) cache that must be stored in GPU memory during inference.

This cache scales linearly with both batch size and sequence length. In clinical settings, where researchers often rely on single-card GPUs, this memory footprint becomes the primary bottleneck, limiting the number of patients a model can process simultaneously. While many KV compression techniques exist, they typically treat tokens as 1D sequences or 2D images, completely ignoring the rich, three-dimensional anatomical continuity inherent in medical scans.

Methods

The authors propose TACT-KV (Tri-Axis Cosine Transform), a four-stage, calibration-free pipeline designed to squeeze redundancy out of the volumetric KV cache:

  1. Volumetric KV Layout: The visual KV cache is reshaped from a flat sequence back into its original 3D grid dimensions (Slice, Height, Width).
  2. 3-D DCT-II: The method applies a separable 3D Discrete Cosine Transform. Because anatomical structures are continuous across slices and within planes, this transform concentrates the "energy" (information) into a small number of low-frequency components.
  3. Reverse Water-Filling: Instead of giving every frequency bin the same number of bits, TACT-KV uses a "reverse water-filling" strategy. It adaptively allocates more bits to high-energy (low-frequency) components and fewer (or zero) bits to high-frequency noise.
  4. Codebook Encoding: The surviving components are quantized using a gain-shape scalar codebook (Lloyd-Max).
Figure 2: TACT-KV pipeline. A medical VLM encodes a volumetric CT scan and a clinical prompt into visual and text embeddings ev, et. Inside each decoder block, visual keys/values Kv, Vv enter the four-stage pipeline below, while text Kt, Vt bypass at bf16. Volumetric KV Layout: the visual cache is reshaped into a (S, H, W) grid inherited from the vision encoder. 3-D DCT-II: a separable transform along the three axes concentrates energy at the DC corner (magma colormap, log2 σ2). Reverse Water-Filling: a per-layer bit budget is allocated above water level λ, with bins below dropped (bar color = bit width 4/2/1/0). Codebook Encoding: surviving bins are gain-shape encoded against the corresponding Lloyd–Max codebook (1/2/4-bit tiles shown). All spectral statistics are estimated on the fly, requiring no calibration data.

Crucially, the method is calibration-free, meaning it doesn't require a representative dataset to "learn" quantization parameters beforehand; it estimates spectral statistics on the fly for every sequence.

Datasets

The researchers evaluated TACT-KV across ten different VLMs (six medical, four general-purpose) using three major benchmarks:

  • RSNA-ICH: A head CT dataset focused on intracranial hemorrhage detection.
  • CT-RATE: A large-scale chest CT benchmark with 18 different abnormality labels.
  • Video-MME: A general-purpose video analysis benchmark used to test if the 3D spatial logic of TACT-KV generalizes to the temporal axis of videos.

Key Insights and Ideas

  • The 3D Advantage: Medical scans have high "inter-slice" similarity (often higher than "intra-slice" similarity). Exploiting this third axis is the "secret sauce" that allows TACT-KV to outperform 1D and 2D compression methods.
  • Spectral Concentration: As shown in Figure 1, tokens at the same spatial position across adjacent slices are highly correlated (Cosine Similarity $\approx$ 0.85). This correlation means that in the frequency domain, the lowest-frequency bin alone can hold 58–63% of the total axis energy.
  • Theoretical Grounding: The authors provide a closed-form proof (Theorem 1) showing that the distortion reduction from their adaptive bit allocation is directly tied to the "spectral flatness" of the cache. The more concentrated the energy, the higher the compression gain.
  • Heavy-Tailed Distributions: The authors found that post-DCT coefficients are heavy-tailed. Standard uniform quantization fails at low bitrates (like 1-bit) because it can't handle these outliers. TACT-KV’s gain-shape quantization effectively factors out magnitude before quantizing, preserving signal fidelity.
Figure 1: Motivation. Tokens at the same in-plane spatial position across adjacent slices in the visual KV cache exhibit high pairwise similarity, and within each slice neighboring tokens are also strongly correlated. The cache energy then concentrates in a small set of low-frequency components along every axis, a three-axis structure that previous work leaves unexploited.

Key Results

  • Superior Fidelity at 1-bit: In a head-to-head comparison across 12 model/dataset pairs, TACT-KV achieved the lowest "prediction-flip rate" (how often the model changes its mind due to compression) in 11 out of 12 cases. At 1-bit, it performed nearly as well as the uncompressed (bf16) baseline.
  • Massive Throughput Gains: By reducing the per-request KV cache size by ~7×, TACT-KV allowed the decoding batch size on a single NVIDIA RTX 6000 GPU to scale from 8 to 64 for a 32B model—an 8× increase.
  • Cross-Domain Generalization: Even though it was designed for medical 3D scans, the method proved highly effective for video tasks on Video-MME, suggesting that "time" in video acts similarly enough to "depth" in medical scans for the 3D DCT to work its magic.
Table 1: Macro prediction-flip rate (%) relative to bf16 on RSNA-ICH and CT-RATE. Entries include Wald 95% CI half-widths. Bold and underline mark the lowest and second-lowest measured values in each column. RSNA-ICH uses a stratified subset of N=3,000 studies under the six-label challenge protocol [11]. Each CT-RATE entry aggregates 54,702 predictions from N=3,039 official validation volumes under the 18-abnormality protocol [17]. Bit budgets denote nominal quantizer rates and exclude metadata. For KVTC, the budget is the average number of bits per PCA coefficient before entropy coding.

Limitations and Future Work

  • Modality Scope: While validated on head and chest CTs, the authors note that other 3D modalities like MRI, PET, and ultrasound—which likely share similar spatial properties—have not yet been tested.
  • Visual-Only Compression: The current pipeline only compresses the visual portion of the cache. Text tokens are kept at full precision (bf16). Integrating TACT-KV with attention-aware eviction for text tokens is a logical next step.
  • Compute vs. Memory Trade-off: The 3D DCT and gain-shape codebook add some computational overhead (FLOPs) per token. While this is a winning trade-off for memory-bound deployments (the current norm), it might be less attractive for systems that are already compute-bound.

Summary updated

Abstract

Vision-language models (VLMs) applied to 3D medical scans face a structural memory wall. A single CT or MRI volume produces tens of thousands of vision tokens, and the resulting key-value (KV) cache scales linearly with both batch and context. Existing KV compression methods operate on the cache's feature or token statistics, or apply 1D and 2D transforms, leaving the three-axis spatial structure in the cache unexploited. We propose TACT-KV (Tri-Axis Cosine Transform), a calibration-free KV compression method that exploits strong spatial correlations in visual KV states along all three anatomical axes of 3D scans. This correlation concentrates the KV cache energy under a frequency-domain transform. TACT-KV applies a separable 3D discrete cosine transform to the KV cache, allocates a per-layer bit budget across frequency bins via reverse water-filling (more bits to high-energy components), and quantizes each bin with a fixed scalar codebook. We derive a close-form relation: the distortion reduction from adaptive bit allocation is dominated by the spectral concentration of the transformed cache. Across six medical VLMs and two 3D CT benchmarks, TACT-KV achieves the lowest 1-bit prediction-flip rate on eleven of twelve model and dataset pairs in our main comparison. The same advantage reproduces on four general-purpose VLMs evaluated on video tasks, indicating that the benefit of exploiting three-axis structure generalizes beyond medical imaging. At equal high-bandwidth memory (HBM), TACT-KV scales the decoding batch size on a single GPU by up to $8\times$.
BibTeX
@inproceedings{qu2026tact,
  author = {Chongyu Qu and Ritchie Zhao and Yufan He and Dong Yang and Zhengyi Lu and Junchao Zhu and Tianyuan Yao and Juming Xiong and Junlin Guo and Yanfan Zhu and Yuechen Yang and Daguang Xu and Bennett Allan Landman and Yucheng Tang and Yuankai Huo},
  title = {{TACT-KV: Tri-Axis Cosine Transform for Compressing Volumetric KV Caches in Medical VLMs}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=OU6bVNsqd3},
}
Figure