arXiv:2410.19185cs.AI2024-10被引 3

用定制提示优化剪枝版小模型,少样本学习效果接近原版。

Tailored-LLaMA: Optimizing Few-Shot Learning in Pruned LLaMA Models with Task-Specific Prompts

  • 剪枝至50亿/40亿参数,用任务专属提示+LoRA加速微调。
  • 压缩50%后分类任务准确率达86.54%,仅需50次示例。
  • 适合资源有限但需高效少样本学习的团队使用。

大语言模型在语言理解与生成上表现优异,但从头训练即使是最低复杂度的十亿参数模型也需巨大算力,对多数组织不经济。本文研究大模型的任务特定微调,采用任务专用数据集和提示,对两个剪枝至50亿和40亿参数的LLaMA模型进行微调。利用预训练权重,结合LoRA方法仅更新部分参数。为解决提示设计难题,提出一种新方法,在任务特异性与提示有效性双重约束下优化。先通过结构化剪枝将70亿参数模型缩减至50亿和40亿,再使用针对性提示并结合LoRA加速微调。实验表明,剪枝50%的模型微调不足一小时,即可在20%压缩比下恢复分类任务平均准确率95.68%,50%压缩比下达86.54%(少样本学习,50次示例)。验证显示,即使压缩至50%,模型在少样本分类与生成任务中仍保持超过基准模型65%的准确率,证明该定制方法在显著降低模型规模的同时维持高性能。

原文摘要 · Abstract (English)

Large language models demonstrate impressive proficiency in language understanding and generation. Nonetheless, training these models from scratch, even the least complex billion-parameter variant demands significant computational resources rendering it economically impractical for many organizations. With large language models functioning as general-purpose task solvers, this paper investigates their task-specific fine-tuning. We employ task-specific datasets and prompts to fine-tune two pruned LLaMA models having 5 billion and 4 billion parameters. This process utilizes the pre-trained weights and focuses on a subset of weights using the LoRA method. One challenge in fine-tuning the LLaMA model is crafting a precise prompt tailored to the specific task. To address this, we propose a novel approach to fine-tune the LLaMA model under two primary constraints: task specificity and prompt effectiveness. Our approach, Tailored LLaMA initially employs structural pruning to reduce the model sizes from 7B to 5B and 4B parameters. Subsequently, it applies a carefully designed prompt specific to the task and utilizes the LoRA method to accelerate the fine-tuning process. Moreover, fine-tuning a model pruned by 50\% for less than one hour restores the mean accuracy of classification tasks to 95.68\% at a 20\% compression ratio and to 86.54\% at a 50\% compression ratio through few-shot learning with 50 shots. Our validation of Tailored LLaMA on these two pruned variants demonstrates that even when compressed to 50\%, the models maintain over 65\% of the baseline model accuracy in few-shot classification and generation tasks. These findings highlight the efficacy of our tailored approach in maintaining high performance with significantly reduced model sizes.

小模型剪枝少样本学习LoRA

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。