[论文解读] Label Supervised LLaMA Finetuning
本文提出对 LLaMA 模型进行标签监督的适应(LS-LLaMA 和 LS-unLLaMA),用于文本分类和命名实体识别(NER),在去除掩码时对 BERT/RoBERTa 乃至最先进的 NER 的性能均有显著提升。
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.
研究动机与目标
- 阐明为何指令微调在序列与标记分类任务中可能表现不佳。
- 提出一种对 LLaMA 的标签监督适配,将潜在表示映射到一个判别性标签空间。
- 证明 Latent LLaMA 表示在多个基准测试上可超越更大规模的生成式大语言模型和健壮基线。
- 研究去除因果掩码对改进如 NER 这样的标记级任务的影响。
提出的方法
- 从最后一层 LLaMA 提取潜在表示并将其投影到标签空间以计算交叉熵损失。
- 使用低秩适应(LoRA)进行微调以最小化交叉熵损失。
- 对于标记任务,修改 LLaMA 以通过 LlamaForTokenClassification 启用标记级分类,并可选地去除因果掩码以实现双向注意(LS-unLLaMA)。
- 尝试三种池化方法(最大、平均、最后)并发现最大池化在未屏蔽模型中效果最佳。
实验结果
研究问题
- RQ1LLaMA 的潜在表示是否可有效用于文本分类中的判别标签预测?
- RQ2在标准基准上,LLaMA 的标签监督微调是否优于指令微调和判别模型?
- RQ3去除因果掩码对如 NER 这样的标记分类任务有何影响?
- RQ4在多语言和小数据场景中,LS-LLaMA 和 LS-unLLaMA 的表现如何?
- RQ5在标签监督下,较小的 LLaMA-2 模型(7B)是否足以超越更大规模的判别模型?
主要发现
- LS-LLaMA-2-7B 在 SST2、AGNews、Twitter-Fin、SST5 的分别达到 96.67、95.38、91.87、62.31。
- LS-LLaMA-2-13B 在 SST2、AGNews、Twitter-Fin、SST5 的分别达到 96.90、95.66、91.20、62.17。
- LS-unLLaMA-2-7B 在 SST2、AGNews、Twitter-Fin、SST5 的分别达到 97.36、95.68、91.54、60.50。
- LS-unLLaMA-2-13B 在 SST2、AGNews、Twitter-Fin、SST5 的分别达到 92.77、95.44、87.94、52.99。
- 在 NER 任务中,LS-unLLaMA 的表现优于 LS-LLaMA、BERT 与 RoBERTa 基线,且在去除因果掩码时提升显著。
- 从解码器中移除因果掩码在 CoNNL2003 与 OntoNotes V5 上使 LS-unLLaMA 达到最先进的 NER 结果。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。