Scaling Sparse Fine-Tuning to Large Language Models
作者: Alan Ansell, Ivan Vulić, Hannah Sterz, Anna Korhonen, Edoardo M. Ponti
分类: cs.CL, cs.AI, cs.LG
发布日期: 2024-01-29 (更新: 2024-02-02)
💡 一句话要点
提出SpIEL以解决大语言模型稀疏微调的效率问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 稀疏微调 大语言模型 参数高效 动态修剪 指令微调 量化 优化器
📋 核心要点
- 现有的稀疏微调方法在处理大语言模型时,内存需求随模型规模增加而显著提升,限制了其应用。
- 本文提出的SpIEL方法通过维护参数索引和增量,采用动态修剪和再生长策略,提升了稀疏微调的效率。
- 实验结果显示,SpIEL在标准数据集上的指令微调任务中,性能优于LoRA,并且与量化和高效优化器兼容,便于扩展。
📝 摘要(中文)
大语言模型(LLMs)由于参数数量庞大,完全微调(如通过指令或人类反馈)变得困难。稀疏微调方法在性能上表现出色,但其内存需求与LLMs的规模成正比。本文提出了一种新的稀疏微调方法SpIEL,能够在指定的稀疏度下,维护参数索引数组及其相对于预训练值的增量。该方法通过更新活跃增量、修剪索引和再生长索引三个步骤进行迭代。实验表明,SpIEL在指令微调任务中,性能通常优于LoRA等流行的参数高效微调方法,并且在运行时间上表现相当。此外,SpIEL与量化和高效优化器兼容,便于扩展到更大规模的模型。
🔬 方法详解
问题定义:本文旨在解决大语言模型稀疏微调过程中的内存需求问题。现有方法在处理大规模模型时,内存消耗显著增加,导致效率低下。
核心思路:SpIEL方法通过维护参数索引和相应的增量,采用动态修剪和再生长策略,以实现高效的稀疏微调。该设计旨在减少内存占用,同时保持模型性能。
技术框架:SpIEL的整体流程包括三个主要步骤:更新活跃增量、修剪参数索引(基于增量的变化幅度)和再生长索引。再生长时,依据候选参数的累积梯度或使用高效的SM3优化器估算的动量进行选择。
关键创新:SpIEL的主要创新在于其动态修剪和再生长机制,使得稀疏微调在保持性能的同时,显著降低了内存需求。这与传统的静态稀疏方法形成鲜明对比。
关键设计:在SpIEL中,参数的稀疏度是可调的,用户可以根据需求设置。此外,增量的更新和修剪策略是基于参数变化的动态评估,确保了模型的高效性和适应性。实验中还展示了与量化和高效优化器的兼容性。
🖼️ 关键图片
📊 实验亮点
实验结果表明,SpIEL在标准数据集上的指令微调任务中,性能通常优于LoRA,且在运行时间上表现相当。具体而言,SpIEL在多个基准测试中实现了显著的性能提升,展示了其在大规模模型微调中的优势。
🎯 应用场景
该研究的潜在应用领域包括自然语言处理、对话系统和智能助手等。通过提高大语言模型的微调效率,SpIEL能够帮助开发更强大且资源友好的AI应用,推动智能系统在实际场景中的广泛应用。
📄 摘要(原文)
Large Language Models (LLMs) are difficult to fully fine-tune (e.g., with instructions or human feedback) due to their sheer number of parameters. A family of parameter-efficient sparse fine-tuning methods have proven promising in terms of performance but their memory requirements increase proportionally to the size of the LLMs. In this work, we scale sparse fine-tuning to state-of-the-art LLMs like LLaMA 2 7B and 13B. We propose SpIEL, a novel sparse fine-tuning method which, for a desired density level, maintains an array of parameter indices and the deltas of these parameters relative to their pretrained values. It iterates over: (a) updating the active deltas, (b) pruning indices (based on the change of magnitude of their deltas) and (c) regrowth of indices. For regrowth, we explore two criteria based on either the accumulated gradients of a few candidate parameters or their approximate momenta estimated using the efficient SM3 optimizer. We experiment with instruction-tuning of LLMs on standard dataset mixtures, finding that SpIEL is often superior to popular parameter-efficient fine-tuning methods like LoRA (low-rank adaptation) in terms of performance and comparable in terms of run time. We additionally show that SpIEL is compatible with both quantization and efficient optimizers, to facilitate scaling to ever-larger model sizes. We release the code for SpIEL at https://github.com/AlanAnsell/peft and for the instruction-tuning experiments at https://github.com/ducdauge/sft-llm.