Comprehensive and Efficient Distillation for Lightweight Sentiment Analysis Models

Guangyu Xie, Yice Zhang, Jianzhu Bao, Qianlong Wang, Yang Sun, Bingbing Wang, Ruifeng Xu

TL;DR

This paper introduces COMPEFFDIST, a novel framework for creating efficient, lightweight sentiment analysis models through knowledge distillation. It tackles the limitations of existing methods by automatically generating diverse instructions and intelligently filtering training data, enabling small models to match the performance of much larger ones with significantly less data.

What Problem Does This Paper Address?

Large language models (LLMs) have shown impressive capabilities in sentiment analysis, but their massive size makes them impractical for many real-world applications due to high computational costs. Knowledge distillation offers a solution by transferring knowledge from large "teacher" models to smaller "student" models. However, current distillation methods for sentiment analysis face two major hurdles:

  1. Limited Instruction Diversity: Manually crafting instructions that cover the vast spectrum of sentiment nuances (like tone, emotion, sarcasm, context) is labor-intensive and often insufficient for comprehensive knowledge transfer.
  2. High Computational Cost: Using large datasets of user texts to prompt teacher models for distillation is computationally expensive, hindering practical deployment.

Methods

COMPEFFDIST addresses these challenges with two core modules:

  1. Attribute-Based Automatic Instruction Construction:
    • Attribute Enumeration: The framework prompts a teacher LLM to identify and list sentiment-related attributes present in user texts.
  2. Attribute Clustering: Similar attributes are grouped into broader "analytical perspectives" using embedding models and affinity propagation clustering.
  3. Task & Instruction Generation: For each perspective, the teacher LLM brainstorms diverse tasks (classification, extraction, etc.) and then synthesizes detailed instructions with examples. This automates the creation of comprehensive instruction sets, reducing manual effort.
  4. Difficulty-Based Data Filtering:
    • Ranking-Based Difficulty Metric: Instead of traditional perplexity, this metric assesses how well a student model can reproduce a teacher's response for a given instruction-text pair. It focuses on the rank of the correct token within the model's predicted probabilities, better suited for sentiment analysis's often categorical outputs.
  5. Proxy Model (Optional): A lightweight model is trained to predict difficulty without needing teacher responses, further reducing prompting costs.
  6. Difficulty-Prioritized Sampling: Data samples are filtered to reduce the proportion of "easy" examples, which contribute less to learning. This boosts data efficiency and reduces computational load.

Datasets

  • User Text Corpus: IMDb, Yelp, Amazon, and Twitter datasets were used for attribute enumeration and instruction generation.
  • Distillation Dataset: A total of 100K instruction-user text pairs were generated and then filtered to approximately 50K for distillation.
  • Evaluation Benchmark: SENTIBENCH (Zhang et al., 2025) was used for evaluating sentiment analysis capabilities across various tasks.

Key Insights and Ideas

  • Automated Instruction Generation is Key: Manually creating diverse instructions is a bottleneck. Automatically generating them based on identified sentiment attributes significantly improves coverage and reduces human effort.
  • Difficulty Matters for Efficiency: Not all data is equally valuable for distillation. Filtering out simpler examples dramatically improves data efficiency, allowing models to reach high performance with much less data.
  • Perplexity is a Poor Fit for Sentiment: Traditional perplexity metrics, common in text generation, are not ideal for evaluating sentiment analysis tasks where outputs are often categorical. A ranking-based metric is more appropriate.
  • Small Models Can Be Powerful: With the right distillation strategy, surprisingly small models (e.g., 3B parameters) can achieve performance comparable to much larger models (e.g., 70B parameters).

Key Results

  • Performance Parity: COMPEFFDIST enables 3B student models to match the performance of 20x larger teacher models on most sentiment analysis tasks.
  • Data Efficiency: The approach achieves the same performance level as baseline methods using only 10% of the distillation data.
  • Improved Complex Context Handling: The method significantly improves student models' ability to handle texts with implicit sentiment and multiple polarities, showing average gains of over 11% and 15% in complex context tasks.
  • Ranking-Based Metric Superiority: The proposed ranking-based difficulty metric outperforms perplexity and other simpler metrics for filtering.

Limitations and Future Work

  • Task-Level Deduplication: The framework currently lacks operations for deduplicating generated tasks or filtering low-quality ones, which could further improve data efficiency.
  • Teacher Response Quality Control: The method doesn't explicitly control for potential biases or errors in the teacher model's responses, which could be transferred to the student. Incorporating quality assurance techniques is suggested but would increase computational costs.
  • Proxy Model Accuracy: While the proxy model reduces prompting costs, it's less accurate than the ranking-based metric because it doesn't see the teacher's response.
  • Future Directions: The authors suggest exploring task-level deduplication, quality control for teacher responses, and further research into robust difficulty estimation methods.

Summary updated

BibTeX
@inproceedings{xie2025comprehensive,
  author = {Guangyu Xie and Yice Zhang and Jianzhu Bao and Qianlong Wang and Yang Sun and Bingbing Wang and Ruifeng Xu},
  title = {{Comprehensive and Efficient Distillation for Lightweight Sentiment Analysis Models}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2025},
}
Figure