arXiv:2503.18908cs.LG2025-03

通过融合前馈层实现并行计算,显著提升大模型推理速度。

FFN Fusion: Rethinking Sequential Computation in Large Language Models

  • 识别并融合连续前馈层,变串行为并行,减少计算延迟。
  • 在2530亿参数模型上实现1.71倍加速,每令牌成本降低35倍。
  • 适用于大模型优化,尤其适合追求高效推理的开发者。

我们提出FFN Fusion,一种架构优化技术,通过识别和利用自然存在的并行化机会,减少大语言模型中的串行计算。核心洞察是,在移除特定注意力层后,连续的前馈网络(FFN)层通常可并行化且对精度影响极小。我们开发了一套系统方法,将此类序列融合为并行操作,显著降低推理延迟,同时保持模型行为一致。应用于Llama-3.1-405B-Instruct,我们构建了名为Llama-Nemotron-Ultra-253B-Base(Ultra-253B-Base)的高效模型,该模型实现1.71倍推理延迟加速和35倍更低的每令牌成本,且在各类基准测试中表现优异。在490亿至2530亿参数模型上的大量实验表明,FFN Fusion在更大规模下效果更显著,并可与量化、剪枝等现有优化技术互补。最令人意外的是,部分包含注意力和前馈层的完整Transformer块也可并行化,暗示了神经架构设计的新方向。

原文摘要 · Abstract (English)

We introduce FFN Fusion, an architectural optimization technique that reduces sequential computation in large language models by identifying and exploiting natural opportunities for parallelization. Our key insight is that sequences of Feed-Forward Network (FFN) layers, particularly those remaining after the removal of specific attention layers, can often be parallelized with minimal accuracy impact. We develop a principled methodology for identifying and fusing such sequences, transforming them into parallel operations that significantly reduce inference latency while preserving model behavior. Applying these techniques to Llama-3.1-405B-Instruct, we create Llama-Nemotron-Ultra-253B-Base (Ultra-253B-Base), an efficient and soon-to-be publicly available model that achieves a 1.71X speedup in inference latency and 35X lower per-token cost while maintaining strong performance across benchmarks. Through extensive experiments on models from 49B to 253B parameters, we demonstrate that FFN Fusion becomes increasingly effective at larger scales and can complement existing optimization techniques like quantization and pruning. Most intriguingly, we find that even full transformer blocks containing both attention and FFN layers can sometimes be parallelized, suggesting new directions for neural architecture design.

大模型优化并行计算推理加速架构创新

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。