Abstract
Large language models (LLMs) have enabled a wide variety of real-world applications in various domains. However, creating a high-performing application with high accuracy remains challenging, particularly for subjective tasks like emotion recognition. Inspired by the SLT 2024 GenSER Challenge, this study investigates approaches to improving conversational emotion recognition (CER) by LLMs. Specifically, we explore how to retrieve high-quality examples in in-context learning (ICL) to enhance CER. We propose various strategies based on random and augmented example retrieval and also analyze the impact of conversational context on CER accuracy. Experiments were conducted on the three datasets including IEMOCAP, MELD and EmoryNLP. The results show that augmented example retrieval consistently outperforms other techniques under investigation across all datasets, highlighting the importance of retrieving coherent targeted examples and enhancing them through paraphrasing.
Introduction
Conversational Emotion Recognition (CER) is a critical yet challenging task in natural language processing. Emotions are inherently subjective and deeply embedded within the context of human dialogue. While state-of-the-art Large Language Models (LLMs) like Llama-3 exhibit impressive general capabilities, they often struggle with the subtle nuances of emotional expression in conversation.
Standard approaches to CER typically employ "Zero-Shot" prompting or "Few-Shot" learning with randomly selected examples. However, random examples can introduce unwanted bias or confuse the model. Furthermore, the optimal amount of "conversation history" required for an LLM to accurately predict emotion remains unclear. This research seeks to optimize example selection and context utilization to transform LLMs into more effective "emotion detectors."
Methodology: Augmented Example Retrieval (AER)
The researchers developed a three-tiered experimental framework to evaluate CER performance:
- Zero-Shot Baseline: Evaluated performance across varying context sizes (0 to 20 preceding utterances).
- In-Context Learning (ICL) with Random Examples: Provided the model with four random utterance-emotion pairs from a reference dataset.
- Augmented Example Retrieval (AER): This novel approach involves two main stages:
- Augmentation: A Mistral-7B model generates four paraphrases for every utterance in the reference dataset, significantly expanding the pool of potential examples.
- Retrieval: For any target utterance, a SentenceTransformer identifies the most semantically similar example from the augmented pool using cosine similarity.
The final prompt for the LLM (Llama-3.1-8B) includes this "most similar" example alongside three other distinct emotion examples to provide a balanced reference.
Key Insights and Results
The Impact of Conversational Context
A significant finding of this study is that "more context" does not always equate to "better performance." As shown in the baseline experiments, context utility varies significantly by dataset. In IEMOCAP, performance improved as context increased to 10 utterances before saturating. Conversely, for MELD and EmoryNLP, the models performed best with zero conversation context, likely due to the shorter, more self-contained nature of emotional bursts in those datasets.
Performance of AER
The AER method consistently outperformed both the zero-shot baseline and random ICL across all benchmarks:
- Accuracy Gains: On the EmoryNLP dataset, AER achieved a Macro F1 score of 0.570, a notable improvement over the 0.547 baseline.
- Semantic Anchoring: By retrieving semantically similar examples, AER provides a relevant "anchor" that helps the LLM navigate the specific nuances of a target sentence, mitigating the common "neutral bias" where models default to neutral labels when uncertain.
- Robustness to Noise: AER maintained its performance advantages even when processing "noisy" text from Automatic Speech Recognition (ASR) tools like Whisper. For instance, on "Hubertlarge" transcripts, AER improved the F1 score from 0.532 to 0.558.
Conclusion and Future Work
This study demonstrates that the method of example selection is just as vital as the inclusion of examples themselves in ICL. Augmented Example Retrieval provides a robust framework for improving CER by leveraging semantic similarity and paraphrasing.
Future research will explore larger model scales beyond the 8B parameter Llama-3.1 and expand the emotion categories to include a broader spectrum of human expression, such as frustration and sarcasm. Additionally, the team aims to evaluate these methods across diverse LLM families and richer datasets to further enhance the practical utility of conversational emotion recognition systems.
Summary updated