2025-03-25 · 专家 · 机器学习 · 自然语言处理

FFN Fusion: Rethinking Sequential Computation in Large Language Models

FFN Fusion 通过并行化序列中的 FFN 层,显著提高了大型语言模型的推理速度和效率,同时保持或提升了模型性能。

更新于 2025-03-25。作者:Akhiad Bercovich、Mohammad Dabbah、Omri Puny、Ido Galil、Amnon Geifman、Yonatan Geifman、Izhak Golan、Ehud Karpas、Itay Levy、Zach Moshe、Najeeb Nabwani、Tomer Ronen、Itamar Schen、Elad Segal、Ido Shahaf、Oren Tropp、Ran Zilberstein、Ran El-Yaniv。

中文摘要

我们提出了FFN融合,这是一种架构优化技术,通过识别并利用并行化的自然机会来减少大型语言模型中的顺序计算。我们的关键洞察是,前馈网络(FFN)层的序列,尤其是那些在移除特定注意力层后留下的层,通常可以并行化而最小化对准确性的影响。我们开发了一种原理性的方法来识别和融合此类序列,将它们转换为并行操作,这可以显著减少推理延迟,同时保持模型的行为。将这项技术应用于Llama-3.1-405B-Instruct,我们创建了Llama-Nemotron-Ultra-253B-Base(Ultra-253B-Base),这是一个高效且即将公开发布的模型,它在推理延迟上实现了1.71倍的速度提升,每令牌成本降低了35倍,同时在所有基准测试中保持了强大的性能。通过对49B到253B参数范围内的模型进行广泛的实验,我们证明了FFN融合在更大规模上变得越来越有效,可以补充现有的优化技术,如量化修剪。最引人入胜的是,我们发现甚至包含注意力和FFN层的完整Transformer块有时也可以并行化,这为神经网络架构设计指出了新的方向。

英文摘要

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.

解读

一句话总结

FFN Fusion 通过并行化序列中的 FFN 层,显著提高了大型语言模型的推理速度和效率,同时保持或提升了模型性能。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源