arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.05529cs.CLcs.LG
收藏

H1B-KV:用于内存高效大语言模型推理的混合一位缓存

H1B-KV: Hybrid One-Bit Caches for Memory-Efficient Large Language Model Inference

Rutgers University(罗格斯大学)

Harshil Vejendla

AI总结:

本文提出H1B-KV混合一位缓存,通过键的1位二进制草图和值的4位量化,将70亿参数LLM的8k上下文缓存内存减少70倍,并匹配全精度性能,优于现有量化、驱逐和草图方法。

摘要:

大语言模型(LLM)中的自回归解码需要缓存不断增长的过去键值(KV)对列表,使得长上下文推理成为一个内存受限的问题。尽管近期方法探索了量化缓存、驱逐令牌或使用键的二进制草图(例如Loki),但这些方法往往通过留下一个组件(如值)未压缩或丢弃上下文信息来提供不完整的解决方案。本文介绍了混合一位KV缓存(H1B-KV),一种全面的压缩方案,在不牺牲上下文的情况下大幅减少内存使用。H1B-KV使用1位二进制草图表示每个键向量,实现硬件友好的按位注意力,并进一步使用4位量化压缩值向量。这种整体混合方法使得一个70亿参数的LLM能够处理8k令牌上下文,缓存内存低于60 MB——减少了70倍。我们证明,经过轻量级微调后,H1B-KV不仅在困惑度基准上,而且在复杂下游任务(如数学推理(GSM8K)、多任务理解(MMLU)和代码生成(HumanEval))上均匹配全精度性能。我们的结果表明,H1B-KV在每字节质量上显著优于领先的量化(KIVI)、令牌驱逐(SparseLLM)和仅键草图(Loki)方法,使其成为在内存受限环境中部署LLM的稳健解决方案。

英文摘要:

Autoregressive decoding in large language models (LLMs) requires caching a growing list of past key-value (KV) pairs, making long-context inference a memory-bound problem. While recent methods have explored quantizing the cache, evicting tokens, or using binary sketches for keys (e.g., Loki), these approaches often provide an incomplete solution by leaving one component (like values) uncompressed or by discarding context information. This paper introduces the Hybrid One-Bit KV Cache (H1B-KV), a comprehensive compression scheme that radically reduces memory usage without sacrificing context. H1B-KV represents each key vector using a 1-bit binary sketch, enabling hardware-friendly bitwise attention, and further compresses value vectors using 4-bit quantization. This holistic, hybrid approach allows a 7-billion parameter LLM to handle an 8k-token context with under 60 MB of cache memory - a 70x reduction. We demonstrate that after a lightweight finetuning, H1B-KV matches full-precision performance not only on perplexity benchmarks but also on complex downstream tasks like mathematical reasoning (GSM8K), multi-task understanding (MMLU), and code generation (HumanEval). Our results show H1B-KV significantly outperforms leading quantization (KIVI), token eviction (SparseLLM), and key-only sketching (Loki) methods in quality-per-byte, establishing it as a robust solution for deploying LLMs in memory-constrained environments.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑