As the demand for long-context large language models (LLMs) increases, models with context windows of up to 128K or 1M tokens are becoming increasingly prevalent. However, long-context LLM inference is challenging since the inference speed decreases significantly as the sequence length grows. This slowdown is primarily caused by loading a large KV cache during self-attention. Previous works have shown that a small portion of critical tokens will dominate the attention outcomes. However, we observe the criticality of a token highly depends on the query. To this end, we propose Quest, a query-aware KV cache selection algorithm. Quest keeps track of the minimal and maximal Key values in KV cache pages and estimates the criticality of a given page using Query vectors. By only loading the Top-K critical KV cache pages for attention, Quest significantly speeds up self-attention without sacrificing accuracy. We show that Quest can achieve up to 2.23x self-attention speedup, which reduces inference latency by 7.03x while performing well on tasks with long dependencies with negligible accuracy loss. Code is available at http://github.com/mit-han-lab/Quest .
QueStER: Query Specification for Generative keyword-based Retrieval
MILA – Quebec AI Institute & ILLS(魁北克人工智能研究所);Université Paris-Saclay & CentraleSupélec & CNRS(巴黎-萨克雷大学);Air Liquide(Air Liquide公司);Sorbonne Université & ISIR & CNRS(索邦大学)
When Does Sparsity Mitigate the Curse of Depth in LLMs
Max Planck Institute for Intelligent Systems(马克斯·普朗克智能系统研究所);ELLIS Institute Tübingen(ELLIS图宾根研究所);ETH Zürich(苏黎世联邦理工学院);Tübingen AI Center(图宾根人工智能中心);Zuse Institute Berlin(柏林祖泽研究所);Technical University of Berlin(柏林工业大学);Emory University(埃默里大学)
Quest: Query-centric Data Synthesis Approach for Long-context Scaling of Large Language Model
Institute of Information Engineering, Chinese Academy of Sciences(中国科学院信息工程研究所);School of Cyber Security, University of Chinese Academy of Sciences(中国科学院大学网络空间安全学院);Xiaohongshu Inc(小红书科技有限公司)