Language models are increasingly adopting smaller architectures optimized for consumer devices. In this setting, inference efficiency is the primary constraint. Meanwhile, vocabulary sizes continue to grow rapidly, making the classification head a critical bottleneck that accounts for up to 60\% of model parameters, and 50\% of inference compute. We introduce FlashHead, the first efficient drop-in replacement for the dense classification head that is training-free and hardware-friendly. FlashHead builds on principles from information retrieval, reframing that computation at the output head as a retrieval problem rather than a dense classification over the full vocabulary. FlashHead introduces four key innovations: (1) a balanced clustering scheme that structures vocabulary partitions into compact hardware-efficient tensors, (2) extending multiprobe retrieval to language model heads, enabling thousands of clusters to be scored in parallel, (3) a novel inference-time sampling mechanism that extends retrieval beyond top tokens, enabling probabilistic sampling across the full vocabulary, and (4) selective quantization, enabling effective low-bit computation in the head. Experiments on Llama-3.2, Gemma-3, and Qwen-3 show that FlashHead delivers model-level inference speedups of up to \textbf{1.75x} which maintaining output accuracy compared to the original head. By overcoming the classification head bottleneck, FlashHead establishes a new benchmark for efficient inference and removes a key barrier to developing smaller, capable models for consumer hardware.


翻译:语言模型正日益采用针对消费设备优化的更小型架构。在此背景下,推理效率成为主要约束。与此同时,词汇表规模持续快速增长,使得分类头成为关键瓶颈,其参数量可占模型总参数的60%,推理计算量占比达50%。我们提出了FlashHead,首个无需重新训练且对硬件友好的高效即插即用密集分类头替代方案。FlashHead基于信息检索原理,将输出头的计算重新定义为检索问题,而非在整个词汇表上进行密集分类。FlashHead引入了四项关键创新:(1) 平衡聚类方案,将词汇分区组织为紧凑的硬件高效张量;(2) 将多探针检索技术扩展至语言模型头部,支持并行评估数千个聚类;(3) 新颖的推理时采样机制,将检索范围扩展至非最高分词元,实现全词汇表的概率采样;(4) 选择性量化技术,支持在头部进行有效的低位宽计算。在Llama-3.2、Gemma-3和Qwen-3上的实验表明,FlashHead在保持输出精度的同时,可实现高达\textbf{1.75倍}的模型级推理加速。通过突破分类头瓶颈,FlashHead为高效推理树立了新标杆,并为开发适用于消费硬件的更小型高性能模型扫除了关键障碍。

0
下载
关闭预览

相关内容

【普林斯顿博士论文】大型模型的高效推理
专知会员服务
23+阅读 · 2025年8月10日
大型语言模型推理引擎的综述:优化与效率的视角
专知会员服务
22+阅读 · 2025年5月13日
高效大语言模型推理服务综述
专知会员服务
18+阅读 · 2025年4月30日
大型语言模型高效推理综述
专知会员服务
64+阅读 · 2024年4月23日
大型语言模型的模型压缩与高效推理:综述
专知会员服务
94+阅读 · 2024年2月17日
NLP通用模型诞生?一个模型搞定十大自然语言常见任务
人工智能头条
10+阅读 · 2018年6月29日
深度学习文本分类方法综述(代码)
中国人工智能学会
28+阅读 · 2018年6月16日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
Arxiv
0+阅读 · 3月17日
VIP会员
最新内容
DeepSeek 版Claude Code,免费小白安装教程来了!
专知会员服务
10+阅读 · 5月5日
《美空军条令出版物 2-0:情报(2026版)》
专知会员服务
14+阅读 · 5月5日
帕兰提尔 Gotham:一个游戏规则改变器
专知会员服务
9+阅读 · 5月5日
【综述】 机器人学习中的世界模型:全面综述
专知会员服务
13+阅读 · 5月4日
伊朗的导弹-无人机行动及其对美国威慑的影响
相关VIP内容
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员