arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.01208cs.CL
收藏

标签监督式LLaMA微调

Label Supervised LLaMA Finetuning

Hong Kong Metropolitan University(香港都会大学);Hong Kong Polytechnic University(香港理工大学);Shanghai 100me Internet Technology Co., Ltd.(上海一零零米互联网科技有限公司);Lingnan University(岭南大学)

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

AI总结:

针对指令微调大语言模型在分类任务上表现不佳的问题,提出标签监督式LLaMA微调方法,通过LoRA利用隐表示做标签预测,在文本分类和NER任务上取得优异性能。

摘要:

大语言模型(LLM)近期取得的成功在学术界和工业界都引发了广泛关注。已有大量研究通过微调来提升开源大语言模型的零样本和少样本泛化能力。目前主流的方法是指令微调,即通过训练大语言模型遵循自然语言指令生成回复,以此完成现实世界的任务。值得注意的是,这类方法在序列分类和词元分类任务上可能表现不佳。与文本生成任务不同,分类任务的标签空间有限,在这类任务中,精准的标签预测比生成多样化、类人化的回复更重要。此前的研究表明,经过指令微调的大语言模型表现无法超越BERT,这促使我们挖掘利用大语言模型的隐表示进行有监督标签预测的潜力。本文提出一种面向大语言模型的标签监督适配方法,旨在利用判别式标签对模型进行微调。我们以基于LLaMA-2-7B构建的标签监督式LLaMA(LS-LLaMA)对该方法进行评估,LLaMA-2-7B是规模相对较小的大语言模型,可在单张GeForce RTX4090 GPU上完成微调。我们从LLaMA的最后一层提取隐表示,将其投影到标签空间以计算交叉熵损失,并通过低秩适配(Low-Rank Adaptation, LoRA)微调模型以最小化该损失。值得注意的是,在无需复杂提示工程或外部知识的情况下,LS-LLaMA的表现大幅超越了规模是其十倍的大语言模型,并且在文本分类任务上,相比BERT-Large和RoBERTa-Large等强基线模型也有稳定的性能提升。此外,通过移除解码器中的因果掩码,LS-unLLaMA在命名实体识别(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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑