arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.18581cs.CL
收藏

通过LITE指令微调启用中间层解码以加速LLaMA推理

Accelerating LLaMA Inference by Enabling Intermediate Layer Decoding via Instruction Tuning with LITE

Arizona State University(亚利桑那州立大学)

Neeraj Varshney, Agneet Chatterjee, Mihir Parmar, Chitta Baral

AI总结:

针对大语言模型推理慢、成本高的问题,提出带中间层损失的指令微调方法LITE,结合token级动态置信度提前退出策略,在保持生成质量的同时显著降低LLaMA-2的推理计算成本。

摘要:

大语言模型(LLM)已在各类自然语言任务上取得了卓越性能,但其庞大的规模导致推理速度慢、计算成本高。针对这一问题,我们提出采用来自中间层的额外显式损失对LLM进行指令微调(LITE,即带中间层损失的指令微调),并证明该方法能让中间层获得“良好”的生成能力,且不会影响最终层的生成能力。我们在token层面从中间层执行“基于动态置信度的提前退出”,在不降低生成质量的前提下提升了文本生成效率。我们在Alpaca数据集上对LLaMA-2模型进行指令微调,并在四个不同的人类指令测试集上开展全面评估。结果显示,动态提前退出在保持响应生成质量的同时,带来了持续且可观的推理计算成本优化(7B模型降低37.86%,13B模型降低46.35%)。我们进一步从多个重要维度对结果展开深入分析,比如对比输出的语义相似度,以及通过比较输出中生成的token数量拆解效率提升的构成。综上,我们的工作致力于在保持生成质量的同时提升LLM推理效率,是推动其广泛应用的关键一步。

英文摘要:

Large Language Models (LLMs) have achieved remarkable performance across a wide variety of natural language tasks; however, their large size makes their inference slow and computationally expensive. Focusing on this problem, we propose to instruction tune LLMs with additional explicit losses from the intermediate layers (LITE) and show that it enables these layers to acquire 'good' generation ability without affecting the generation ability of the final layer. We perform 'dynamic confidence-based early exiting' at token level from the intermediate layers which improves the efficiency of text generation without compromising the quality of the generation. We conduct comprehensive experiments by instruction tuning LLaMA-2 models on the Alpaca dataset and holistically evaluate on four different human-instruction test sets. We show that dynamic early exiting achieves consistent and considerable inference computation cost improvements (37.86% for 7B and 46.35% for 13B model) while maintaining the generation quality of the responses. We further conduct a thorough analysis of the results over several important aspects, such as comparing the semantic similarity of the outputs and dissecting the efficiency improvements by comparing the number of tokens generated in the output. In summary, our work contributes to improving the efficiency of LLM inference while maintaining the generation quality, a crucial step en route to enabling their widespread adoption.

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

↑