Instruction Tuning with Retrieval-based Examples Ranking for Aspect-based Sentiment Analysis

Guangmin Zheng, Jin Wang, Liang-Chih Yu, Xuejie ZhangACL 2024

Abstract

Aspect-based Sentiment Analysis (ABSA) requires a fine-grained understanding of specific entities and their associated sentiments. While instruction tuning has improved Large Language Model (LLM) performance on such tasks, the selection of in-context examples remains a critical bottleneck. This paper introduces a novel framework that replaces static retrieval with a dynamic, model-aware ranking system. By employing an alternating training schema where a Language Model (LM) scores example "helpfulness" to optimize a retriever, the proposed method achieves state-of-the-art results across standard ABSA benchmarks.

Introduction

Aspect-based Sentiment Analysis (ABSA) moves beyond document-level sentiment to identify specific aspects (e.g., "the service") and their corresponding polarities (e.g., "positive"). Modern approaches leverage instruction tuning, providing LLMs with task descriptions and few-shot examples. However, the efficacy of this in-context learning is highly sensitive to example selection. Traditional retrieval methods often rely on surface-level similarity (e.g., BM25), which may find examples that look like the input but fail to provide the most instructive context for the model's specific generative objective.

Methodology

The core of this work is a "co-evolution" strategy between a Retriever ($R$) and an Inference Language Model ($LM$), specifically utilizing the flan-t5-base architecture. The framework consists of two primary phases: Example Retrieval and Task Inference.

Overview of the IT-RER-ABSA framework, illustrating the interaction between the retriever, the candidate ranking by the LM, and the final task inference.

Instruction Template

The model uses a structured prompt containing a task definition, $k$ retrieved examples (input-output pairs), and the target input $x_s$. This format ensures the LM has clear context for the specific ABSA subtask.

LM as a Scorer

To optimize the retriever, the LM itself serves as an evaluator. For a given target, the LM calculates the log-likelihood of the correct output when prompted with various candidate examples. Examples yielding higher likelihoods are treated as "positive" signals, while those with lower scores are "negative."

Alternating Training Schema

The system employs an iterative training process to align the retriever with the generator's needs:

  1. Retriever Optimization: The current LM scores examples, and the retriever is trained using contrastive learning to rank these "helpful" examples higher in the latent space.
  2. LM Fine-tuning: The updated retriever selects high-quality examples to further fine-tune the LM on the target task.
The alternating training schema showing the iterative co-evolution of the Retriever and the Language Model over time steps $t$.

Experimental Setup

The framework was evaluated on standard ABSA benchmarks, including SemEval-2014 (Laptop and Restaurant), SemEval-2015, and SemEval-2016. These datasets support three subtasks: Aspect Term Extraction (ATE), Aspect Term Sentiment Classification (ATSC), and Aspect Sentiment Pair Extraction (ASPE).

Results and Analysis

The proposed method, IT-RER-ABSA, consistently outperformed established baselines such as InstructABSA and BARTABSA.

  • Performance Gains: In the ATSC task on the Rest16 dataset, the model achieved an accuracy of 97.47%, a substantial leap from the previous ~89% baseline. In ASPE on Lap14, it reached an $F_1$ score of 81.49, surpassing previous generative models by over 2 points.
  • Alignment Advantage: Results indicate that the most "similar" example is not always the most instructive. Syntactic similarity often proves more beneficial for the model's generation phase than simple keyword overlap.
  • Ablation Study: Removing the alternating training schema led to a significant performance drop, confirming that the mutual adaptation of the retriever and LM is essential for success.

Conclusion

This research demonstrates that bridging the gap between retrieval and generation through model-aware ranking significantly enhances ABSA performance. By allowing the generator to "teach" the retriever what information is most useful, the system achieves a higher degree of task alignment. Future work will explore the applicability of this method to multi-lingual contexts and investigate dynamic selection of the number of examples ($k$) to further optimize inference efficiency.

Summary updated

BibTeX
@inproceedings{zheng2024instruction,
  author = {Guangmin Zheng and Jin Wang and Liang-Chih Yu and Xuejie Zhang},
  title = {{Instruction Tuning with Retrieval-based Examples Ranking for Aspect-based Sentiment Analysis}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.findings-acl.284},
}
Figure