cs.CLMar 27, 2026

Two-dimensional early exit optimisation of LLM inference

Authors: Jan Hůla, David Adamczyk, Tomáš Filip, Martin Pavlíček, Petr Sosík

Organizations: Institute for Research and Applications of Fuzzy Modelling, University of Ostrava, 70200 Ostrava, Czech Republic · Institute of Computer Science, Faculty of Philosophy and Science, Silesian University in Opava, 74601 Opava, Czech Republic

Abstract

We introduce a two-dimensional (2D) early exit strategy that coordinates layer-wise and sentence-wise exiting for classification tasks in large language models. By processing input incrementally sentence-by-sentence while progressively activating deeper layers, our method achieves multiplicative computational savings that exceed those from optimizing either dimension independently. Experimental evaluation across four state-of-the-art LLMs (Llama 3.1, Llama 3.2, Gemma, Qwen; 3B-8B parameters) on three sentiment classification datasets demonstrates additional speed-ups of 1.4--2.3×\times over optimal layer-wise early exit for simpler tasks with vanilla models, with graceful degradation on complex multi-class problems. Fine-tuning reduces but does not eliminate this advantage. The approach is model-agnostic, requires only lightweight classification adapters, and is orthogonal to complementary efficiency methods such as quantization and pruning. Our findings indicate that 2D early exit strategies excel when semantic information accumulates predictably across input structure, suggesting possible applicability to sequence-processing tasks beyond sentiment classification.

Figures & tables

Appendix figures & tables2 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. The Diminishing Returns of Early-Exit Decoding in Modern LLMs

    Mar 24, 2026Rui Wei, Rui Du, Hanfei Yu +4Early-Exit Neural NetworksLLM Inference Acceleration

  2. River-LLM: Large Language Model Seamless Exit Based on KV Share

    Apr 20, 2026Yingtao Shen, An ZouDecoder-Only Language ModelsKV-Cache Management

  3. FlexEE: Self-Speculative and KV-Compatible Early Exiting for Offloading-Aware LLM Inference

    Sep 15, 2026Qihu Xie, Ziwei Li, Yi KangEfficient Language Model InferenceLLM Inference