Targeted Distillation for Sentiment Analysis

Yice Zhang, Guangyu Xie, Jingjie Lin, Jianzhu Bao, Qianlong Wang, Xi Zeng, Ruifeng Xu · OpenReview

Abstract

This paper presents a compact model that achieves strong sentiment analysis capabilities through targeted distillation from advanced large language models (LLMs). Our methodology decouples the distillation target into two key components: sentiment-related knowledge and task alignment. To transfer these components, we propose a two-stage distillation framework. The first stage, knowledge-driven distillation (KNOWDIST), transfers sentiment-related knowledge to enhance fundamental sentiment analysis capabilities. The second stage, in-context learning distillation (ICLDIST), transfers task-specific prompt-following abilities to optimize task alignment. For evaluation, we introduce SENTIBENCH, a comprehensive sentiment analysis benchmark comprising 3 task categories across 12 datasets. Experiments on this benchmark demonstrate that our model effectively balances model size and performance, showing strong competitiveness compared to existing small-scale LLMs.

Introduction

While Large Language Models (LLMs) like Llama-3-70B excel at sentiment analysis, their massive size makes them impractical for many real-world applications due to high latency and computational costs. Standard Knowledge Distillation (KD) aims to train a smaller "student" model to mimic a larger "teacher." However, generic distillation often fails when the size gap is large, as students may become "style mimics," learning to sound like the teacher without grasping the underlying logic. In sentiment analysis, this leads to poor performance on nuanced tasks like irony detection or stance analysis, where deep contextual understanding is required.

Methodology

To address these challenges, we propose a two-stage "Targeted Distillation" framework that decouples the process into fundamental knowledge acquisition and task alignment.

Stage 1: KNOWDIST (Knowledge-Driven Distillation)

This stage focuses on transferring the core understanding of sentiment. Instead of simple label prediction, the teacher (Llama-3-70B) is prompted to provide detailed analysis and rewrites from four perspectives: Expression, Target, Emotion, and Background. This multi-perspective approach forces the student to learn the reasoning traces behind sentiment construction.

Stage 2: ICLDIST (In-Context Learning Distillation)

The second stage focuses on "alignment"—teaching the model to format its knowledge for specific tasks. To prevent overfitting, we employ format and task diversification, varying label words and incorporating non-sentiment tasks from the Super-NaturalInstructions dataset to enhance general instruction-following capabilities.

The proposed two-stage distillation framework: KNOWDIST for knowledge transfer and ICLDIST for task alignment.

Evaluation: The SENTIBENCH Benchmark

We evaluate our framework using SENTIBENCH, a comprehensive benchmark consisting of 12 datasets across three categories:

  • Basic Sentiment Analysis (BSA): Document and sentence-level classification (e.g., IMDb, SST2).
  • Multifaceted Sentiment Analysis (MSA): Nuanced tasks like Irony detection and Stance analysis.
  • Fine-Grained Sentiment Analysis (FSA): Complex extraction tasks like Aspect Term Sentiment Analysis.

The distillation corpus comprises 1.5 million samples (1M for knowledge, 500k for alignment) derived from diverse sources like Yelp and Twitter.

Key Results and Insights

Our experiments demonstrate that targeted distillation allows small models to significantly outperform larger, non-distilled counterparts.

  • Efficiency and Performance: Our distilled 1.2B model achieved an average $F_1$-score of 60.77%, surpassing the original 3.2B model (59.50%). Furthermore, the distilled 3.2B model (68.41%) outperformed the original Llama-3-8B (67.22%).
  • Mastery of Nuance: The most dramatic improvement occurred in irony detection, where the 1.2B model saw a 38% absolute increase in $F_1$-score compared to its base version.
  • Generalization: Specialized distillation did not degrade general intelligence; the models showed slight improvements on the MMLU benchmark.
Model performance vs. size on SENTIBENCH. Distilled models (stars) significantly outperform base models of similar or larger sizes.

The core insight is that "knowing" sentiment and "performing" a task are distinct skills. Sequential training allows for a more robust internal representation. Multi-perspective prompting captures reasoning traces, while task diversity ensures the model generalizes beyond specific prompt formats.

Conclusion and Future Work

Despite these gains, the framework depends heavily on the teacher's accuracy; errors or biases in the teacher are directly transferred to the student. Additionally, while the models excel at classification, they still struggle with complex "tuple extraction" tasks (e.g., ASQP), which may require further specialized optimization. Future work will focus on quality control mechanisms to filter teacher responses and improving performance on structured extraction tasks.

Summary updated

BibTeX
@misc{zhang2025targeted,
  author = {Yice Zhang and Guangyu Xie and Jingjie Lin and Jianzhu Bao and Qianlong Wang and Xi Zeng and Ruifeng Xu},
  title = {{Targeted Distillation for Sentiment Analysis}},
  year = {2025},
  eprint = {2503.03225},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.03225},
}
Figure