FFN Fusion: Rethinking Sequential Computation in Large Language Models

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

Abstract

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.

Introduction

The massive scale of modern Large Language Models (LLMs) imposes a significant computational tax. Traditionally, transformer architectures are viewed as strictly sequential, requiring layer-by-layer computation. In distributed environments using Tensor Parallelism, this sequential nature creates a "synchronization tax," where GPUs must frequently communicate via all-reduce operations before proceeding. As models grow, these communication overheads and low GPU utilization for smaller sub-operations become primary bottlenecks for inference speed and cost. FFN Fusion challenges the assumption that LLM computation must be strictly sequential by identifying "natural opportunities" to execute layers in parallel.

Methods

The researchers developed a multi-stage optimization pipeline to reduce model depth and communication overhead without sacrificing representational capacity.

Structural Pruning and Dependency Analysis

The process begins with structural pruning using the "Puzzle" framework to identify and remove redundant attention layers. This often leaves behind consecutive "islands" of FFN layers. To determine which layers are suitable for fusion, the team employs a pairwise block dependency metric based on cosine distance. If removing a preceding layer does not significantly change the output of a subsequent layer, those layers are identified as candidates for fusion.

FFN Fusion Mechanism

The core innovation involves mathematically fusing sequential FFN layers (specifically SwiGLU variants) into a single, wider parallel operation. Instead of a sequential flow ($X \rightarrow FFN_1 \rightarrow FFN_2$), the model is transformed to compute them simultaneously ($X \rightarrow [FFN_1 + FFN_2]$). This reduction in synchronization points allows GPUs to remain active with larger matrix multiplications rather than waiting for inter-GPU data transfers.

The FFN Fusion pipeline: Step 1 removes redundant attention layers, and Step 2 fuses the resulting sequential FFNs into parallel blocks.

Results

The flagship application of this technique is Llama-Nemotron-Ultra-253B-Base, derived from Llama-3.1-405B-Instruct. Despite having approximately 150 billion fewer parameters, the model demonstrates remarkable efficiency and performance gains.

Efficiency and Cost

The 253B model achieves a 1.71x speedup in inference latency on NVIDIA H100 nodes. Furthermore, it delivers a 35x lower per-token cost at a batch size of 32. The removal of half the attention layers also reduced the KV-cache memory footprint by 2x, further enhancing deployment flexibility.

Benchmark Performance

Evaluation across a standard battery of benchmarks (MMLU, HumanEval, RULER 128K) shows that the model matches or exceeds its 405B parent. For example, it scored 84.92% on Arena Hard (compared to 72.56% for the 405B) and 9.19 on MT-Bench (compared to 9.06). These results indicate that the subsequent alignment and knowledge distillation phases successfully "healed" any minor accuracy drops caused by the structural fusion.

Accuracy vs. Latency comparison showing the Pareto improvement of Nemotron-Ultra-Base models over Llama-3.1-405B and Llama-3.3-70B.

Discussion and Conclusion

FFN Fusion reveals that deep LLMs are structurally "lazy," with many layers exhibiting high degrees of independence. This redundancy is more pronounced at larger scales, making FFN Fusion increasingly effective as models grow. While current inference frameworks like vLLM or TensorRT-LLM do not yet natively support the full block parallelization (Attention + FFN) explored in the paper's later sections, the success of the 253B model provides a clear path forward. Future research will focus on extending these techniques to Mixture-of-Experts (MoE) architectures and designing new neural architectures that prioritize parallel execution from the outset.

Summary updated

BibTeX
@inproceedings{bercovich2025ffn,
  author = {Akhiad Bercovich and Mohammad Dabbah and Omri Puny and Ido Galil and Amnon Geifman and Yonatan Geifman and Izhak Golan and Ehud Karpas and Itay Levy and Zach Moshe and Najeeb Nabwani and Tomer Ronen and Itamar Schen and Elad Segal and Ido Shahaf and Oren Tropp and Ran Zilberstein and Ran El-Yaniv},
  title = {{FFN Fusion: Rethinking Sequential Computation in Large Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=XUmGMBRv4M},
}
Figure