Cocktail: Chunk-Adaptive Mixed-Precision Quantization for Long-Context LLM Inference

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Tao, Wei, Zhang, Bin, Qu, Xiaoyang, Wan, Jiguang, Wang, Jianzong
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866908290059862016
author Tao, Wei
Zhang, Bin
Qu, Xiaoyang
Wan, Jiguang
Wang, Jianzong
author_facet Tao, Wei
Zhang, Bin
Qu, Xiaoyang
Wan, Jiguang
Wang, Jianzong
contents Recently, large language models (LLMs) have been able to handle longer and longer contexts. However, a context that is too long may cause intolerant inference latency and GPU memory usage. Existing methods propose mixed-precision quantization to the key-value (KV) cache in LLMs based on token granularity, which is time-consuming in the search process and hardware inefficient during computation. This paper introduces a novel approach called Cocktail, which employs chunk-adaptive mixed-precision quantization to optimize the KV cache. Cocktail consists of two modules: chunk-level quantization search and chunk-level KV cache computation. Chunk-level quantization search determines the optimal bitwidth configuration of the KV cache chunks quickly based on the similarity scores between the corresponding context chunks and the query, maintaining the model accuracy. Furthermore, chunk-level KV cache computation reorders the KV cache chunks before quantization, avoiding the hardware inefficiency caused by mixed-precision quantization in inference computation. Extensive experiments demonstrate that Cocktail outperforms state-of-the-art KV cache quantization methods on various models and datasets.
format Preprint
id arxiv_https___arxiv_org_abs_2503_23294
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Cocktail: Chunk-Adaptive Mixed-Precision Quantization for Long-Context LLM Inference
Tao, Wei
Zhang, Bin
Qu, Xiaoyang
Wan, Jiguang
Wang, Jianzong
Computation and Language
Recently, large language models (LLMs) have been able to handle longer and longer contexts. However, a context that is too long may cause intolerant inference latency and GPU memory usage. Existing methods propose mixed-precision quantization to the key-value (KV) cache in LLMs based on token granularity, which is time-consuming in the search process and hardware inefficient during computation. This paper introduces a novel approach called Cocktail, which employs chunk-adaptive mixed-precision quantization to optimize the KV cache. Cocktail consists of two modules: chunk-level quantization search and chunk-level KV cache computation. Chunk-level quantization search determines the optimal bitwidth configuration of the KV cache chunks quickly based on the similarity scores between the corresponding context chunks and the query, maintaining the model accuracy. Furthermore, chunk-level KV cache computation reorders the KV cache chunks before quantization, avoiding the hardware inefficiency caused by mixed-precision quantization in inference computation. Extensive experiments demonstrate that Cocktail outperforms state-of-the-art KV cache quantization methods on various models and datasets.
title Cocktail: Chunk-Adaptive Mixed-Precision Quantization for Long-Context LLM Inference
topic Computation and Language
url https://arxiv.org/abs/2503.23294