arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.18592cs.CLcs.AI
收藏

二维早退优化大语言模型推理

Two-dimensional early exit optimisation of LLM inference

Institute for Research and Applications of Fuzzy Modelling(模糊建模研究与应用研究所);University of Ostrava(奥斯特拉瓦大学);Institute of Computer Science(计算机科学研究所);Faculty of Philosophy and Science(哲学与科学学院);Silesian University in Opava(奥帕瓦西里西亚大学)

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

AI总结:

本文提出一种二维早退策略,通过协调层间和句子间早退实现大语言模型分类任务的计算优化,实验表明在不同规模的LLM上能显著提升推理速度。

摘要:

我们引入了一种二维(2D)早退策略,该策略协调层间和句子间的早退以实现大语言模型中的分类任务。通过逐句处理输入并逐步激活更深的层,我们的方法实现了超过单独优化任一维度的乘法计算节省。在四个最先进的LLM(Llama 3.1、Llama 3.2、Gemma、Qwen;3B-8B参数)上对三个情感分类数据集的实验评估显示,对于简单的任务,与最优的层间早退相比,速度提升了1.4-2.3倍,且在复杂多类问题上具有渐进退化。微调会减少但不会消除这一优势。该方法模型无关,仅需轻量级分类适配器,并与量化和剪枝等互补效率方法正交。我们的发现表明,当语义信息在输入结构中可预测地累积时,二维早退策略表现优异,暗示其可能适用于超出情感分类的序列处理任务。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑