TensorX
返回文献探索

Paper · arXiv 2309.08968

Sorted LLaMA: Unlocking the Potential of Intermediate Layers of Large Language Models for Dynamic Inference Using Sorted Fine-Tuning (SoFT)

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

23 upvotesSeptember 16, 2023arXiv 预印本
AI 摘要

Sorted Fine-Tuning extends SortedNet to generative NLP tasks, enhancing efficiency and speed of large language models without the need for multiple models or complex pretraining.

SortedNetdynamic inferencenetwork modularitysub-modelscomputation/accuracy characteristicsSorted Fine-TuningSupervised Fine-Tuninglarge language modelsgenerative NLPintermediate layerstransformersstorage requirementsLLaMa 2Stanford Alpaca datasetPandaLM benchmark

Abstract

The rapid advancement of large language models (LLMs) has revolutionized natural language processing (NLP). While these models excel at understanding and generating human-like text, their widespread deployment can be prohibitively expensive. SortedNet is a recent training technique for enabling dynamic inference for deep neural networks. It leverages network modularity to create sub-models with varying computational loads, sorting them based on computation/accuracy characteristics in a nested manner. We extend SortedNet to generative NLP tasks, making large language models dynamic without any pretraining and by only replacing standard Supervised Fine-Tuning (SFT) with Sorted Fine-Tuning (SoFT) at the same costs. Our approach boosts model efficiency, eliminating the need for multiple models for various scenarios during inference. We show that using this approach, we are able to unlock the potential 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. By applying this approach on LLaMa 2 13B for tuning on the Stanford Alpaca dataset and comparing it to normal tuning and early exit via PandaLM benchmark, we show that Sorted Fine-Tuning can deliver models twice as fast as the original model while maintaining or exceeding performance.

北京市昌平区探索星信息技术及软件开发工作室

京ICP备2026059466号
Sorted LLaMA: Unlocking the Potential of Intermediate Layers of Large Language Models for Dynamic Inference Using Sorted Fine-Tuning (SoFT) | TensorX