Label Supervised LLaMA Finetuning

📄 arXiv: 2310.01208v1 📥 PDF

作者: Zongxi Li, Xianming Li, Yuzhang Liu, Haoran Xie, Jing Li, Fu-lee Wang, Qing Li, Xiaoqin Zhong

分类: cs.CL

发布日期: 2023-10-02


💡 一句话要点

提出标签监督的LLaMA微调方法以提升分类任务性能

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大型语言模型 标签监督 微调方法 文本分类 命名实体识别 低秩适应 潜在表示

📋 核心要点

  1. 现有的指令微调方法在序列和标记分类任务中表现不佳,无法超越BERT等传统模型。
  2. 提出标签监督的微调方法,通过提取LLMs的潜在表示并投影到标签空间来进行分类任务。
  3. LS-LLaMA在文本分类任务中显著超越了规模十倍的LLMs,并在命名实体识别中达到了最先进的性能。

📝 摘要(中文)

近年来,大型语言模型(LLMs)的成功引起了学术界和工业界的广泛关注。为了增强开源LLMs的零样本和少样本泛化能力,研究者们进行了大量的微调工作。目前,主流的方法是指令微调,旨在通过自然语言指令训练LLMs完成实际任务。然而,这种方法在序列和标记分类任务中表现不佳。本文提出了一种标签监督的适应方法,旨在通过判别标签对LLMs进行微调。我们基于LLaMA-2-7B模型,提出了标签监督的LLaMA(LS-LLaMA),并在单个GeForce RTX4090 GPU上进行微调。实验结果表明,LS-LLaMA在文本分类任务中显著超越了规模十倍的LLMs,并在命名实体识别任务中取得了最先进的性能。

🔬 方法详解

问题定义:当前的指令微调方法在处理序列和标记分类任务时,往往无法提供足够的精确标签预测,导致性能不如传统模型如BERT。

核心思路:本文提出的标签监督微调方法,旨在利用LLMs的潜在表示进行精确的标签预测,而非生成多样化的文本响应。通过这种方式,模型能够更好地适应分类任务的需求。

技术框架:整体架构包括从LLaMA的最终层提取潜在表示,并将其投影到标签空间以计算交叉熵损失。模型通过低秩适应(LoRA)进行微调,以最小化该损失。

关键创新:最重要的创新在于引入标签监督的微调策略,使得LLMs在分类任务中能够超越传统模型,且无需复杂的提示工程或外部知识。

关键设计:在技术细节上,模型的损失函数采用交叉熵,网络结构基于LLaMA-2-7B,并通过LoRA进行高效微调,确保在单个GPU上也能实现良好的性能。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果显示,LS-LLaMA在文本分类任务中显著超越了规模十倍的LLMs,且在与BERT-Large和RoBERTa-Large等强基线的比较中,表现出一致的性能提升。此外,LS-unLLaMA在命名实体识别任务中达到了最先进的性能,展示了该方法的有效性。

🎯 应用场景

该研究的潜在应用领域包括文本分类、命名实体识别等自然语言处理任务。通过提升LLMs在这些任务中的表现,能够为实际应用提供更高效的解决方案,推动智能客服、信息检索等领域的发展。

📄 摘要(原文)

The recent success of Large Language Models (LLMs) has gained significant attention in both academia and industry. Substantial efforts have been made to enhance the zero- and few-shot generalization capabilities of open-source LLMs through finetuning. Currently, the prevailing approach is instruction-tuning, which trains LLMs to complete real-world tasks by generating responses guided by natural language instructions. It is worth noticing that such an approach may underperform in sequence and token classification tasks. Unlike text generation tasks, classification tasks have a limited label space, where precise label prediction is more appreciated than generating diverse and human-like responses. Prior research has unveiled that instruction-tuned LLMs cannot outperform BERT, prompting us to explore the potential of leveraging latent representations from LLMs for supervised label prediction. In this paper, we introduce a label-supervised adaptation for LLMs, which aims to finetuning the model with discriminant labels. We evaluate this approach with Label Supervised LLaMA (LS-LLaMA), based on LLaMA-2-7B, a relatively small-scale LLM, and can be finetuned on a single GeForce RTX4090 GPU. We extract latent representations from the final LLaMA layer and project them into the label space to compute the cross-entropy loss. The model is finetuned by Low-Rank Adaptation (LoRA) to minimize this loss. Remarkably, without intricate prompt engineering or external knowledge, LS-LLaMA substantially outperforms LLMs ten times its size in scale and demonstrates consistent improvements compared to robust baselines like BERT-Large and RoBERTa-Large in text classification. Moreover, by removing the causal mask from decoders, LS-unLLaMA achieves the state-of-the-art performance in named entity recognition (NER). Our work will shed light on a novel approach to adapting LLMs for various downstream tasks.