LogQuant: 一种基于对数分布的2位KV缓存量化技术,具有更优异的精度保持性能
LogQuant: Log-Distributed 2-Bit Quantization of KV Cache with Superior Accuracy Preservation
AI总结:
LogQuant通过基于对数的过滤机制实现KV缓存的2位量化,减少内存占用的同时保持高性能,实验表明其在吞吐量、批处理大小和准确性上均优于现有方法。
摘要:
我们介绍了LogQuant,一种突破性的2位量化技术,用于大型语言模型(LLM)推理中的KV缓存,实现显著的内存节省同时保持优越的性能。先前的方法要么假设后续token更重要,要么基于早期注意力模式预测重要token,但两者都可能导致性能瓶颈或频繁的误预测。LogQuant采取了不同的方法。通过应用基于对数的过滤机制,它在整个上下文中选择性地压缩KV缓存,与现有方法相比,实现更好的性能,甚至减少内存占用。在基准测试中,它提高了25%的吞吐量,提升了60%的批处理大小,而无需增加内存消耗。对于Math和Code Completion等具有挑战性的任务,LogQuant在相同压缩比下将准确性提高了40%至200%,优于其他方法。LogQuant可以轻松集成到流行的推理框架中,如Python的transformers库。实现可在https://github.com/Concyclics/LogQuantKV上获得。
英文摘要:
We introduce LogQuant, a groundbreaking 2-bit quantization technique for KV Cache in large language model (LLM) inference, delivering substantial memory savings while preserving superior performance. Previous methods either assume that later tokens are more important or attempt to predict important tokens based on earlier attention patterns. Both approaches, however, can result in performance bottlenecks or frequent mispredictions. LogQuant takes a different approach. By applying a log-based filtering mechanism, it selectively compresses the KV Cache across the entire context, achieving better performance with the same or even reduced memory footprint compared to existing methods. In benchmark tests, it enhances throughput by 25% and boosts batch size by 60% without increasing memory consumption. For challenging tasks such as Math and Code Completion, LogQuant improves accuracy by 40% to 200% at the same compression ratio, outperforming comparable techniques.LogQuant integrates effortlessly with popular inference frameworks like Python's transformers library. Implementation can be available in https://github.com/Concyclics/LogQuantKV.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。