SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2401.18079 · NeurIPS · 2024

KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache Quantization

Kurt Keutzer, Michael Mahoney, Sehoon Kim, Amir Gholami, Coleman Hooper, Hiva Mohammadzadeh, Yakun Shao, Baseline Kvquant, Baseline

arXiv · PDF · Open in the Atlas

Code that ran

3 of 3 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 1 violated it and 1 has no contract verdict; 1 failure of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2401.18079.json · badge: /api/ran/2401.18079.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
SqueezeAILab/KVQuant canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
squeezeailab/kvquant community
Papers with Code archive
2 ran · 0 no recorded run
FunctionStatusWhere it lives
SimQuant Ran
ran on a synthesized input · constructed an object; no result was computed
squeezeailab/kvquant/quant/kvquant/simquant_module_quantizer.py
pointer only (licence: NONE) · get_code("1fe7913f2b94b5f0")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, squeezeailab/kvquant when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

find_layers Ran
ran; our contract draft was wrong, not the code
SqueezeAILab/KVQuant/deployment/kvquant/modelutils.py
pointer only (licence: NONE) · get_code("71eb7727feb23c97")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, SqueezeAILab/KVQuant when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

round_to_nearest_pole_sim Ran
ran, violated the contract we drafted
squeezeailab/kvquant/quant/kvquant/simquant_module_quantizer.py
pointer only (licence: NONE) · get_code("3e91fb91f5019b88")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, squeezeailab/kvquant when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

Also present in other papers' code

Of 3 samples lifted from this paper's linked repositories, 3 carry a function identity and 0 do not. Of the 3 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 2 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
find_layers 27 other papers
8 dated earlier, 17 later, 1 same year, order not determinable, 1 undated
2203.13474 (2022-03)
CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
2023.emnlp-main.892 (2023 (year only))
Z-FOLD: A Frustratingly Easy Post-Training Quantization Scheme for LLMs
2307.09288 (2023-07)
Llama 2: Open Foundation and Fine-Tuned Chat Models
and 24 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

LLMs are seeing growing use for applications which require large context windows, and with these large context windows KV cache activations surface as the dominant contributor to memory consumption during inference. Quantization is a promising approach for compressing KV cache activations; however, existing solutions fail to represent activations accurately in sub-4-bit precision. Our work, KVQuant, facilitates low precision KV cache quantization by incorporating several novel methods: (i) Per-Channel Key Quantization, where we adjust the dimension along which we quantize the Key activations to better match the distribution; (ii) Pre-RoPE Key Quantization, where we quantize Key activations before the rotary positional embedding to mitigate its impact on quantization; (iii) Non-Uniform KV Cache Quantization, where we derive per-layer sensitivity-weighted non-uniform datatypes that better represent the distributions; and (iv) Per-Vector Dense-and-Sparse Quantization, where we isolate outliers separately for each vector to minimize skews in quantization ranges. By applying our method to the LLaMA, Llama-2, Llama-3, and Mistral models, we achieve < 0.1 perplexity degradation with 3-bit quantization on both Wikitext-2 and C4, outperforming existing approaches. Our method enables serving LLaMA-7B with a context length of up to 1 million on a single A100-80GB GPU and up to 10 million on an 8-GPU system. We develop custom CUDA kernels for KVQuant, showing that we can achieve up to ∼1.7× speedups, compared to baseline fp16 matrix-vector multiplications, for the LLaMA-7B model. Code is available at https://github.com/SqueezeAILab/KVQuant. 38th Conference on Neural Information Processing Systems (NeurIPS 2024).

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2401.18079")
get_code_for_paper("2401.18079")
have("2401.18079")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2401.18079.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2401.18079.svg)](https://syntology.ai/paper/2401.18079)

Connect an agent — have() is free.