arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2601.15013cs.LGcs.DC
收藏

RadixMLP -- 用于因果变换器的批次去重

RadixMLP -- Intra-batch Deduplication for Causal Transformers

Michael Feil, Julius Lipp

AI总结:

RadixMLP通过利用MLP的位位置性质,减少因果变换器中重复计算的冗余,提升推理效率。

摘要:

因果变换器模型的批量推理工作负载经常处理具有共同前缀的序列,例如系统提示、少量示例或共享查询。标准推理引擎将每个序列独立处理,重复计算相同MLP激活值以应对每个共享前缀的副本。我们引入了RadixMLP,一种利用MLP、层归一化、线性投影和嵌入的位位置性质的技术,以消除这种冗余。RadixMLP动态地将批次映射到前缀tries,将共享段聚合成压缩表示进行位位置计算,并在注意力边界散射结果。RadixMLP是无状态的,并且在单次前向传递中运行。在使用Qwen3模型(0.6B到8B参数)的MS~MARCO v1.1端到端服务基准测试中,RadixMLP在现实的重新排序工作负载中实现了1.44-1.59倍的速度提升,在具有更长共享前缀的合成基准测试中实现了高达5倍的速度提升。我们的代码可在https://github.com/michaelfeil/radix-mlp上获得。

英文摘要:

Batch inference workloads for causal transformer models frequently process sequences that share common prefixes, such as system prompts, few-shot examples, or shared queries. Standard inference engines treat each sequence independently, redundantly recomputing identical MLP activations for every copy of the shared prefix. We introduce RadixMLP, a technique that exploits the position-wise nature of MLPs, LayerNorms, linear projections, and embeddings to eliminate this redundancy. RadixMLP dynamically maps batches to a prefix trie, gathering shared segments into a compressed representation for position-wise computation and scattering results back only at attention boundaries. RadixMLP is stateless and operates within a single forward pass. In end-to-end serving benchmarks on MS~MARCO v1.1 with Qwen3 models (0.6B to 8B parameters), RadixMLP achieves 1.44-1.59$\times$ speedups in realistic reranking workloads, with up to $5\times$ speedups on synthetic benchmarks with longer shared prefixes. Our code is available at https://github.com/michaelfeil/radix-mlp.

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

↑