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

Sorted LLaMA:解锁大型语言模型中间层在动态推理中的潜力

Sorted LLaMA: Unlocking the Potential of Intermediate Layers of Large Language Models for Dynamic Inference

Huawei Noah’s Ark Lab(华为诺亚方舟实验室);University of Waterloo(滑铁卢大学)

Parsa Kavehzadeh, Mojtaba Valipour, Marzieh Tahaei, Ali Ghodsi, Boxing Chen, Mehdi Rezagholizadeh

AI总结:

本文提出排序微调(SoFT)方法,将SortedNet扩展至生成式NLP,使LLaMA 2 13B无需预训练即可动态推理,解锁中间层潜力,在指令跟随和问答任务上优于标准微调和早退方法。

摘要:

大型语言模型(LLM)通过擅长理解和生成类人文本,彻底改变了自然语言处理(NLP)。然而,它们的广泛部署可能成本高昂。SortedNet是一种近期提出的训练技术,通过利用网络中的模块性并以嵌套方式按计算量/准确率对子模型进行排序,实现动态推理。我们将SortedNet扩展到生成式NLP任务,使大型语言模型无需任何预训练即可实现动态性,仅需将标准微调(SFT)替换为排序微调(SoFT)。我们的方法提升了模型效率,消除了推理过程中针对不同场景需要多个模型的需求。我们证明,该方法能够解锁Transformer中间层在生成目标输出方面的潜力。我们的子模型仍是原始模型的组成部分,从而最小化存储需求以及不同计算/延迟预算之间的转换成本。我们通过将所提方法应用于在Stanford Alpaca数据集上对LLaMA 2 13B进行指令跟随微调,以及在TriviaQA上进行闭卷问答微调,证明了其有效性。结果表明,与标准微调和SFT+ICT(早退)相比,子模型表现出优越性能,且均通过高效调优实现,推理过程中无需额外内存。

英文摘要:

Large language models (LLMs) have revolutionized natural language processing (NLP) by excelling at understanding and generating human-like text. However, their widespread deployment can be prohibitively expensive. SortedNet is a recent training technique for enabling dynamic inference by leveraging the modularity in networks and sorting sub-models based on computation/accuracy in a nested manner. We extend SortedNet to generative NLP tasks, making large language models dynamic without any Pre-Training and by only replacing Standard Fine-Tuning (SFT) with Sorted Fine-Tuning (SoFT). Our approach boosts model efficiency, eliminating the need for multiple models for various scenarios during inference. We show that this approach can unlock the power of intermediate layers of transformers in generating the target output. Our sub-models remain integral components of the original model, minimizing storage requirements and transition costs between different computational/latency budgets. The efficacy of our proposed method was demonstrated by applying it to tune LLaMA 2 13B on the Stanford Alpaca dataset for instruction following and TriviaQA for closed-book question answering. Our results show the superior performance of sub-models in comparison to Standard Fine-Tuning and SFT+ICT (Early-Exit), all achieved with efficient tuning and without additional memory usage during inference.

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

↑