~7× smaller KV cache, ~85% less memory, no fine-tuning, no weight changes. QuantVideoGen quantizes the KV cache of autoregressive video generators to INT2 during inference and decompresses it on the fly at attention time — turning the cache from "the dominant memory cost of long video generation" into "an afterthought."
QuantVideoGen is a lightweight KV-cache quantization toolkit for autoregressive video generation. It compresses long-horizon attention cache during inference, with experiment integrations for LongCat-Video, Self-Forcing, HY-WorldPlay, and LingBot-World.
✨ Highlights
- Quantizes KV cache with Triton k-means / staged product quantization kernels — ~7× compression at INT2.
- Keeps the original model weights unchanged; quantization is applied to inference cache.
- Includes bf16 and quantized launch scripts for four long-video / streaming generation repos.
- Targets memory-heavy long-context settings where KV cache dominates peak usage.
📦 Installation
conda create -n qvg python=3.12.9 -y
conda activate qvg
pip install uv
# Everything, recommended for reproducing all experiments.
uv pip install -e ".[all]"
# Or install only one experiment extra.
uv pip install -e ".[longcat]"
uv pip install -e ".[selfforcing]"
uv pip install -e ".[hyworldplay]"
uv pip install -e ".[lingbot]"
# Flash Attention, CUDA 12 / torch 2.8 wheel.
uv pip install https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.3/flash_attn-2.8.3+cu12torch2.8cxx11abiFALSE-cp312-cp312-linux_x86_64.whl
⬇️ Download Models
Download model checkpoints before running experiments.
# LongCat-Video
hf download meituan-longcat/LongCat-Video --local-dir ckpts/LongCat-Video
# Self-Forcing
bash scripts/Self-Forcing/download_models.sh
# HY-WorldPlay
bash scripts/HY-WorldPlay/download_models.sh
# LingBot-World
bash scripts/LingBot/download_models.sh
💥 Quick Start
Each integration provides a bf16 baseline script and a quantized script. The quantized scripts currently use triton-nstages-kmeans-int2 with block size 64 and 256 K/V centroids by default.
# LongCat-Video
bash scripts/LongCat/run_bf16.sh
bash scripts/LongCat/run_qvg.sh
# Self-Forcing
bash scripts/Self-Forcing/run_bf16.sh
bash scripts/Self-Forcing/run_qvg.sh
# HY-WorldPlay
bash scripts/HY-WorldPlay/run_bf16.sh
bash scripts/HY-WorldPlay/run_qvg.sh
# LingBot-World
bash scripts/LingBot/run_bf16.sh
bash scripts/LingBot/run_qvg.sh
Outputs are written under results/. Quantization options can be changed directly in the corresponding run_qvg.sh script.
📊 Memory Results
The table below reports KV-cache memory for the provided scripts. Numbers are in MB.
| Model | Precision | QVG | Per Layer KV | Total KV Cache | Compression Rate |
|---|---|---|---|---|---|
| LongCat-Video | BF16 | ✗ | 464.00 | 22272.00 | 1.00x |
| LongCat-Video | INT2 | ✓ | 67.32 | 3231.28 | 6.89x |
| Self-Forcing | BF16 | ✗ | 1535.76 | 46072.88 | 1.00x |
| Self-Forcing | INT2 | ✓ | 220.45 | 6613.59 | 6.97x |
| HY-WorldPlay | BF16 | ✗ | 990.00 | 29700.00 | 1.00x |
| HY-WorldPlay | INT2 | ✓ | 141.18 | 4235.45 | 7.01x |
| LingBot-World | BF16 | ✗ | 884.00 | 35360.04 | 1.00x |
| LingBot-World | INT2 | ✓ | 142.33 | 5693.36 | 6.21x |
Across these runs, QuantVideoGen consistently delivers ~6–7× KV-cache compression and reduces total KV-cache memory by about 85%.
✏️ Citation
@article{xi2026quant,
title={Quant VideoGen: Auto-Regressive Long Video Generation via 2-Bit KV-Cache Quantization},
author={Xi, Haocheng and Yang, Shuo and Zhao, Yilong and Li, Muyang and Cai, Han and Li, Xingyang and Lin, Yujun and Zhang, Zhuoyang and Zhang, Jintao and Li, Xiuyu and others},
journal={arXiv preprint arXiv:2602.02958},
year={2026}
}
Metadata
Release files for quant-videogen 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| quant_videogen-0.1.0.tar.gz | 41.0 kB | Without provenance | Details for quant_videogen-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| quant_videogen-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for quant_videogen-0.1.0-py3-none-any.whl |
Total release size: 86.7 kB
Release files / quant_videogen-0.1.0.tar.gz
| Download URL | quant_videogen-0.1.0.tar.gz |
|---|---|
| Size | 41.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
41fa8814c7e8ffd548be7887e12e1271a94e2b75cfb2614cd54dac97dcd4fead
|
|
BLAKE2b-256 checksum How to use checksums |
7450ab8cdea9dc0602fbc88daf9cc99d9885d35ad3c885f68602a90d6be03e2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.9
|
Release files / quant_videogen-0.1.0-py3-none-any.whl
| Download URL | quant_videogen-0.1.0-py3-none-any.whl |
|---|---|
| Size | 45.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ea6e57660221dae5c104c036b13e3e92beb8e5bb484ea7c321f8945d10c89de9
|
|
BLAKE2b-256 checksum How to use checksums |
a48517e60c8bba714823c8a446b6a0a35b54e0ab0a55aa66609d1bf582a398f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.9
|
Security for quant-videogen 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.