序列长度压缩可训练:arXiv 论文提出在嵌入层插入模块加速 LLM
Shorter Sequences, Faster Models: Sequence Length Compression as a Stackable Primitive for LLM Training and Inference
这篇论文挺有意思:不用改注意力机制,只在嵌入层加个小模块就能把序列压短,训练和推理都快,1M 上下文下 prefill 提速接近压缩倍数的平方,还能和 GQA 叠着用。做推理优化或自己预训练模型的工程团队可以细看实现细节。
arXiv 论文提出一种序列长度压缩方法:只需在嵌入层与 transformer 主干之间加一个归一化-投影模块,即可让 decoder-only LLM 原生在压缩序列上运行,包括其生成的 token。
训练构造让每个自回归解码状态恰好覆盖一次,消除训练与推理的不匹配,除压缩因子 X 外无需额外超参数。在 79M–537M 规模的受控实验中,质量随模型增大接近未压缩基线,2 倍压缩在 537M 参数时已接近持平。
压缩同时加速 prefill、decode 和训练,并与 GQA 乘性叠加,1M 上下文下 prefill 加速接近 X²,吞吐量测量覆盖到 7B 参数规模,且不需要新的推理内核。与以往只降低注意力单 token 成本的方法不同,压缩序列让 FFN 和逐 token 投影也随长度缩短,序列长度因此成为模型可训练的属性,可与现有效率方法组合使用。
Shorter Sequences, Faster Models: Sequence Length Compression as a Stackable Primitive for LLM Training and Inference
The efficiency of decoder-only LLMs is routinely improved by making attention cheaper per token: reducing KV-cache size, restricting the receptive field, or replacing the attention operator. All of these leave the number of tokens flowing through the network unchanged, so the FFNs and the token-wise projections continue to scale with full sequence length, and in most cases the attention cost does as well. Existing approaches that do shorten the sequence pay for it elsewhere, through restructured generation, separate decoders, or compression applied post hoc to a frozen model. We show that neither is necessary: a single normalization-projection module between the embedding layer and an otherwise unchanged transformer trunk suffices to pretrain a decoder-only LLM that operates natively on a compressed sequence, including the tokens it generates. A training construction that covers every autoregressive decoding state exactly once eliminates train-inference mismatch and requires no hyperparameters beyond the compression factor $X$. In controlled experiments at 79M--537M scale, with throughput measured up to 7B parameters, quality approaches parity with the uncompressed baseline as models grow (near parity at $2\times$ compression and 537M parameters), while sequence length compression accelerates prefill, decode, and training simultaneously, and stacks multiplicatively with GQA, with prefill speedups approaching $X^2$ at 1M context, all without requiring new inference kernels. Sequence length is therefore a trainable property of the model: compressing it shortens every part of the network and composes with existing efficiency methods.
本条情报归属 AITOP「论文」核心栏目,重点聚焦北美前沿实验室与硅谷科技巨头。在跨区域产业观察坐标中,该动态直接关联「AI 开发者工具链、Coding Agent 与工程化实践」研究主线,反映出当前技术演进与商业落地的最新风向。涉及核心实体与技术议题包括:LLM、KV Cache、GQA、推理加速,读者可通过下方标签进入对应专题页查阅历史脉络与关联对比。
信源核验说明:本文原始线索采编自「arXiv cs.LG」(@Marc Neumann),经 AITOP 多维评分管线结构化提炼。