arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.07023cs.CL
收藏

MARS:使自回归模型实现多令牌生成

MARS: Enabling Autoregressive Models Multi-Token Generation

Nanyang Technological University(南洋理工大学);Singapore Management University(新加坡管理大学);Uppsala University(乌普萨拉大学)

Ziqi Jin, Lei Wang, Ziwei Luo, Aixin Sun

AI总结:

MARS通过轻量级微调方法,使自回归模型在单次前向传递中生成多个令牌,提升生成效率和吞吐量,同时保持模型性能。

摘要:

自回归(AR)语言模型通常逐个生成令牌,即使后续令牌在给定先前上下文时高度可预测。我们介绍了MARS(Mask AutoRegreSsion),一种轻量级微调方法,教会经过指令微调的AR模型在单次前向传递中预测多个令牌。MARS不添加架构修改、额外参数,生成一个仍可像原始AR模型一样调用的模型,无性能损失。不同于需要维护单独草案模型的推测解码,或如Medusa等多头方法,MARS只需在现有指令数据上继续训练。当逐个生成令牌时,MARS在六个标准基准上与AR基线匹配或超过。当允许每个步骤生成多个令牌时,它在保持基线水平准确性的同时,实现1.5-1.7倍的吞吐量。我们进一步开发了块级键值缓存策略用于批量推理,实现比使用KV缓存的Qwen2.5-7B的AR模型快1.71倍。最后,MARS通过置信度阈值支持实时速度调整:在高请求负载下,服务系统可实时提高吞吐量,无需切换模型或重启,提供部署中的实用延迟-质量调节旋钮。

英文摘要:

Autoregressive (AR) language models generate text one token at a time, even when consecutive tokens are highly predictable given earlier context. We introduce MARS (Mask AutoRegreSsion), a lightweight fine-tuning method that teaches an instruction-tuned AR model to predict multiple tokens per forward pass. MARS adds no architectural modifications, no extra parameters, and produces a single model that can still be called exactly like the original AR model with no performance degradation. Unlike speculative decoding, which maintains a separate draft model alongside the target, or multi-head approaches such as Medusa, which attach additional prediction heads, MARS requires only continued training on existing instruction data. When generating one token per forward pass, MARS matches or exceeds the AR baseline on six standard benchmarks. When allowed to accept multiple tokens per step, it maintains baseline-level accuracy while achieving 1.5-1.7x throughput. We further develop a block-level KV caching strategy for batch inference, achieving up to 1.71x wall-clock speedup over AR with KV cache on Qwen2.5-7B. Finally, MARS supports real-time speed adjustment via confidence thresholding: under high request load, the serving system can increase throughput on the fly without swapping models or restarting, providing a practical latency-quality knob for deployment.

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

↑