Efficient Large Language Model Inference with Neural Block Linearization

Mete Erdogan, Francesco Tonin, V. Cevher
5/1/2025
2 citations
transformer-attention

No official code found. Best implementation: LIONS-EPFL/NBL (10 stars).

Abstract

The high inference demands of transformer-based Large Language Models (LLMs) pose substantial challenges in their deployment. To this end, we introduce Neural Block Linearization (NBL), a novel framework for accelerating transformer model inference by replacing self-attention layers with linear approximations derived from Linear Minimum Mean Squared Error estimators.

Show full abstract

NBL leverages Canonical Correlation Analysis to compute a theoretical upper bound on the approximation error. Then, we use this bound as a criterion for substitution, selecting the LLM layers with the lowest linearization error. NBL can be efficiently applied to pre-trained LLMs without the need for fine-tuning. In experiments, NBL achieves notable computational speed-ups while preserving competitive accuracy on multiple reasoning benchmarks. For instance, applying NBL to 12 self-attention layers in DeepSeek-R1-Distill-Llama-8B increases the inference speed by 32% with less than 1% accuracy trade-off, making it a flexible and promising solution to improve the inference efficiency of LLMs. The implementation is available at: https://github.com/LIONS-EPFL/NBL.

View on arXivView PDF

Code Implementations(1)

LIONS-EPFL/NBLCommunity25%

Efficient Large Language Model Inference with Neural Block Linearization

103

Similar Papers

Cite this paper

@article{erdogan2025efficient,
  title  = {Efficient Large Language Model Inference with Neural Block Linearization},
  author = {Mete Erdogan and Francesco Tonin and V. Cevher},
  year   = {2025},
  eprint = {2505.21077},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2505.21077},
  url    = {https://doi.org/10.48550/arXiv.2505.21077},
  journal = {Neural Information Processing Systems}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.21077.svg)](https://codeofpaper.com/paper/2505.21077)

Discussion