Skip to main content
QUICK REVIEW

[Paper Review] Label Supervised LLaMA Finetuning

Zongxi Li, Xianming Li|arXiv (Cornell University)|Oct 2, 2023
Topic ModelingComputer Science20 citations
TL;DR

This paper proposes label-supervised adaptation of LLaMA models (LS-LLaMA and LS-unLLaMA) for text classification and NER, showing strong gains over BERT/RoBERTa and even state-of-the-art NER when masks are removed.

ABSTRACT

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.

Motivation & Objective

  • Motivate why instruction-tuning may underperform in sequence and token classification tasks.
  • Propose a label-supervised adaptation of LLaMA that maps latent representations to a discriminative label space.
  • Demonstrate that Latent LLaMA representations can outperform larger generative LLMs and robust baselines on multiple benchmarks.
  • Investigate the impact of removing causal masks to improve token-level tasks like NER.

Proposed method

  • Extract latent representations from the final LLaMA layer and project them into the label space to compute cross-entropy loss.
  • Fine-tune with Low-Rank Adaptation (LoRA) to minimize the cross-entropy loss.
  • For token tasks, modify LLaMA to enable token-level classification via LlamaForTokenClassification and optionally remove causal masks to enable bidirectional attention (LS-unLLaMA).
  • Experiment with three pooling methods (max, average, last) and find max pooling works best for unmasked models.

Experimental results

Research questions

  • RQ1Can latent representations from LLaMA be effectively used for discriminant label prediction in text classification?
  • RQ2Does label-supervised finetuning of LLaMA outperform instruction-tuning and discriminative models on standard benchmarks?
  • RQ3What is the impact of removing the causal mask on token classification tasks like NER?
  • RQ4How do LS-LLaMA and LS-unLLaMA perform in multilingual and small-data regimes?
  • RQ5Is a smaller LLaMA-2 model (7B) sufficient to outperform larger discriminative models under label supervision?

Key findings

  • LS-LLaMA-2-7B achieves 96.67, 95.38, 91.87, 62.31 on SST2, AGNews, Twitter-Fin, SST5 respectively.
  • LS-LLaMA-2-13B achieves 96.90, 95.66, 91.20, 62.17 on SST2, AGNews, Twitter-Fin, SST5 respectively.
  • LS-unLLaMA-2-7B achieves 97.36, 95.68, 91.54, 60.50 on SST2, AGNews, Twitter-Fin, SST5 respectively.
  • LS-unLLaMA-2-13B achieves 92.77, 95.44, 87.94, 52.99 on SST2, AGNews, Twitter-Fin, SST5 respectively.
  • In NER, LS-unLLaMA outperforms LS-LLaMA, BERT, and RoBERTa baselines, with notable gains when causal masks are removed.
  • Removing causal masks from the decoder yields state-of-the-art NER results for LS-unLLaMA on CoNNL2003 and OntoNotes V5.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.