In-Context Examples Matter: Improving Emotion Recognition in Conversation with Instruction Tuning

Hui Ma, Bo Zhang, Jinpeng Hu, Zenglin ShiarXiv 2025 · DOI

Introduction

Emotion Recognition in Conversation (ERC) is a critical task in natural language processing that involves identifying the emotional state of a speaker within a dialogue. The complexity of ERC stems from the intricate dependency between an utterance, the speaker's identity, and the preceding conversational history. While Large Language Models (LLMs) have shown promise, existing multi-stage instruction tuning approaches often fail to capture the dynamic interplay between these factors, leading to "weak alignment."

To address this, researchers have introduced InitERC, a novel one-stage framework that integrates in-context learning directly into the instruction tuning process. By retrieving and including relevant conversational examples in the tuning prompt, InitERC enables the model to jointly learn speaker characteristics and dialogue context, significantly outperforming previous state-of-the-art methods.

Methodology: The InitERC Framework

The core innovation of InitERC is its use of In-context Instruction Tuning. Unlike standard fine-tuning, which focuses on individual target utterances, InitERC provides the model with "demonstration examples" that serve as a reference for the task during the tuning phase.

Overview of the InitERC framework, illustrating the flow from demonstration pool construction to in-context instruction tuning.

The framework consists of four primary stages:

  1. Demonstration Pool Construction: A comprehensive library is built from the training data, where each entry includes the dialogue history, the current utterance with speaker ID, and the ground-truth emotion label.
  2. In-Context Example Selection: For a given input, a semantic retriever (Contriever-MS MARCO) identifies the $k$ most similar examples from the pool.
  3. Prompt Template Design: A unified prompt is constructed, combining a task description, the retrieved examples, and the target input. This structure guides the LLM to recognize patterns in how similar contexts are labeled.
  4. Instruction Tuning: The LLM (e.g., LLaMA-3.1-8B or Qwen2.5-7B) is fine-tuned using Low-Rank Adaptation (LoRA) on these example-rich prompts.

Experimental Setup

InitERC was evaluated on three benchmark datasets:

  • IEMOCAP: Dyadic conversations with 6 emotion classes.
  • MELD: Multi-party conversations from Friends with 7 classes.
  • EmoryNLP: Sitcom-based dialogues with a distinct set of 7 emotion categories.

Results and Analysis

InitERC achieved substantial performance gains across all benchmarks, setting new state-of-the-art (SOTA) records. On IEMOCAP, the model reached 92.65% w-F1, representing a 20.25% absolute increase over the previous best model. Similarly, improvements of 9.44% and 14.42% were observed on MELD and EmoryNLP, respectively.

The Impact of In-Context Examples

Ablation studies highlight that the inclusion of in-context examples during tuning is the primary driver of performance. Removing these examples caused the IEMOCAP score to drop significantly from 92.65% to 71.74%.

Performance (w-F1) as a function of the number of in-context examples (k) across IEMOCAP, MELD, and EmoryNLP.

As shown in the analysis of example quantity, performance generally improves as the number of examples ($k$) increases. However, the gains begin to plateau after $k=5$, which provides a good balance between accuracy and computational efficiency. Furthermore, the model demonstrated robustness to the ordering of these examples, suggesting that the semantic content of the demonstrations is more important than their sequence.

Conclusion

InitERC demonstrates that a one-stage in-context instruction tuning approach is highly effective for ERC. By aligning speaker identity and dialogue history through retrieved demonstrations, the framework overcomes the limitations of sequential tuning. While the approach introduces some computational overhead due to increased prompt length, the massive gains in accuracy establish a new paradigm for emotion recognition in complex conversational settings.

Summary updated

BibTeX
@misc{ma2025context,
  author = {Hui Ma and Bo Zhang and Jinpeng Hu and Zenglin Shi},
  title = {{In-Context Examples Matter: Improving Emotion Recognition in Conversation with Instruction Tuning}},
  year = {2025},
  eprint = {2508.11889},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.11889},
}
Figure