用轻量方法让大模型高效做文本分类,效果媲美甚至超越BERT。
Fine-Tuning Causal LLMs for Text Classification: Embedding-Based vs. Instruction-Based Approaches
- 用模型最后一层嵌入做序列表示,搭配4位量化与低秩适配训练。
- 单标签分类上性能持平或超过BERT,参数量仅其十分之一。
- 适合资源受限场景,尤其推荐直接利用内部表征的嵌入法。
本文研究在资源受限条件下,如何高效微调解码器型大语言模型(LLM)用于下游文本分类任务。对比两种方法:(1) 在预训练因果LLM末尾添加分类头,使用其最终标记嵌入作为序列表征进行微调;(2) 采用指令微调方式,以提示-响应格式进行分类。为实现单张GPU上对高达80亿参数模型的微调,结合4位量化与低秩适配(LoRA)实现参数高效训练。在两个专利数据集上的实验表明:嵌入头方法在单标签分类任务中表现优于或匹配微调后的BERT基线,且训练参数减少10至30倍;指令微调仅在多标签场景下具备竞争力,且需至少1亿可训练参数规模。结果证明,在有限计算资源下,直接利用因果LLM内部表示并结合高效微调技术,可获得强大分类性能。论文讨论了各方法优劣,并给出实际优化建议与未来方向。
原文摘要 · Abstract (English)
We explore efficient strategies to fine-tune decoder-only Large Language Models (LLMs) for downstream text classification under resource constraints. Two approaches are investigated: (1) attaching a classification head to a pretrained causal LLM and fine-tuning it on the task, using the LLM's final-token embedding as a sequence representation, and (2) instruction-tuning the LLM in a prompt-to-response format for classification. To enable single-GPU fine-tuning of models up to 8B parameters, we combine 4-bit model quantization with Low-Rank Adaptation (LoRA) for parameter-efficient training. Experiments on two patent benchmarks, a 5-class single-label internal corpus and the public WIPO-Alpha multi-label dataset with 14 categories, show that the embedding-head approach matches or exceeds fine-tuned BERT baselines on single-label classification while training 10-30x fewer parameters. Instruction-tuning is competitive only in the multi-label regime, and only with substantially larger trainable budgets of at least 100M parameters. These results demonstrate that directly leveraging the internal representations of causal LLMs, together with efficient fine-tuning techniques, yields strong classification performance under limited computational resources. We discuss the advantages of each approach and outline practical guidelines and future directions for optimizing LLM fine-tuning in classification scenarios.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。