Table of Contents
Fetching ...

Unraveling Emotions with Pre-Trained Models

Alejandro Pajón-Sanmartín, Francisco De Arriba-Pérez, Silvia García-Méndez, Fátima Leal, Benedita Malheiro, Juan Carlos Burguillo-Rial

TL;DR

This paper tackles emotion recognition from open-ended text by comparing fine-tuning of pretrained models against prompt-engineered large language models across three scenarios. It demonstrates that fine-tuned transformers (notably RoBERTa) deliver strongest six-class emotion detection (approaching or achieving ~90% precision/recall), while general-purpose LLMs lag unless prompt design is simplified and emotions are grouped. A hybrid approach—leveraging fine-tuned models for precision and prompting strategies for flexibility—offers robust performance with practical implications for sentiment analysis, HCI, and user-behavior understanding. The work also provides reproducible prompt templates and a framework for evaluating prompt designs and emotion-grouping strategies, with clear directions for future multimodal extensions and broader LLM testing.

Abstract

Transformer models have significantly advanced the field of emotion recognition. However, there are still open challenges when exploring open-ended queries for Large Language Models (LLMs). Although current models offer good results, automatic emotion analysis in open texts presents significant challenges, such as contextual ambiguity, linguistic variability, and difficulty interpreting complex emotional expressions. These limitations make the direct application of generalist models difficult. Accordingly, this work compares the effectiveness of fine-tuning and prompt engineering in emotion detection in three distinct scenarios: (i) performance of fine-tuned pre-trained models and general-purpose LLMs using simple prompts; (ii) effectiveness of different emotion prompt designs with LLMs; and (iii) impact of emotion grouping techniques on these models. Experimental tests attain metrics above 70% with a fine-tuned pre-trained model for emotion recognition. Moreover, the findings highlight that LLMs require structured prompt engineering and emotion grouping to enhance their performance. These advancements improve sentiment analysis, human-computer interaction, and understanding of user behavior across various domains.

Unraveling Emotions with Pre-Trained Models

TL;DR

This paper tackles emotion recognition from open-ended text by comparing fine-tuning of pretrained models against prompt-engineered large language models across three scenarios. It demonstrates that fine-tuned transformers (notably RoBERTa) deliver strongest six-class emotion detection (approaching or achieving ~90% precision/recall), while general-purpose LLMs lag unless prompt design is simplified and emotions are grouped. A hybrid approach—leveraging fine-tuned models for precision and prompting strategies for flexibility—offers robust performance with practical implications for sentiment analysis, HCI, and user-behavior understanding. The work also provides reproducible prompt templates and a framework for evaluating prompt designs and emotion-grouping strategies, with clear directions for future multimodal extensions and broader LLM testing.

Abstract

Transformer models have significantly advanced the field of emotion recognition. However, there are still open challenges when exploring open-ended queries for Large Language Models (LLMs). Although current models offer good results, automatic emotion analysis in open texts presents significant challenges, such as contextual ambiguity, linguistic variability, and difficulty interpreting complex emotional expressions. These limitations make the direct application of generalist models difficult. Accordingly, this work compares the effectiveness of fine-tuning and prompt engineering in emotion detection in three distinct scenarios: (i) performance of fine-tuned pre-trained models and general-purpose LLMs using simple prompts; (ii) effectiveness of different emotion prompt designs with LLMs; and (iii) impact of emotion grouping techniques on these models. Experimental tests attain metrics above 70% with a fine-tuned pre-trained model for emotion recognition. Moreover, the findings highlight that LLMs require structured prompt engineering and emotion grouping to enhance their performance. These advancements improve sentiment analysis, human-computer interaction, and understanding of user behavior across various domains.
Paper Structure (27 sections, 8 equations, 7 figures, 11 tables)

This paper contains 27 sections, 8 equations, 7 figures, 11 tables.

Figures (7)

  • Figure 1: System diagram.
  • Figure 2: Comparison between fine-tuned and general-purpose models.
  • Figure 3: Confusion matrix with three classes.
  • Figure 4: Confusion matrix with two classes.
  • Figure : Gemma prompt and answer template.
  • ...and 2 more figures