Introduction
Emotion Recognition in Conversation (ERC) is a critical task in natural language processing that involves identifying the emotional state of speakers in a dialogue. Unlike standard sentiment analysis, ERC must account for complex social dynamics, specifically intra-speaker dependency (emotional inertia within an individual) and inter-speaker dependency (emotional influence between participants).
While Pre-trained Language Models (PLMs) like BERT and XLNet have set new benchmarks in NLP, they face significant hurdles in ERC. Standard PLMs are often limited by fixed input lengths (typically 512 tokens), which restricts their ability to capture long-range historical context. Furthermore, their vanilla self-attention mechanisms treat all tokens uniformly, failing to distinguish between different speakers in a multi-party conversation.
The DialogXL Framework
To address these challenges, we introduce DialogXL, an "all-in-one" model that adapts the XLNet-base architecture for the nuances of dialogue. DialogXL incorporates two primary innovations: Utterance Recurrence and Dialog-Aware Self-Attention.
Utterance Recurrence
Standard XLNet utilizes "segment recurrence," which caches hidden states from previous fixed-length text segments. In dialogue datasets, these segments often contain substantial padding to maintain uniform batch sizes, leading to inefficient memory usage. The authors found that standard XLNet's memory waste rate can exceed 60% due to this padding.
DialogXL replaces this with utterance-level recurrence. By storing only the hidden states of actual utterance tokens and discarding padding or special tokens, the model significantly increases its effective memory capacity. This "compact" memory allows DialogXL to maintain context for up to 1,000 historical words, providing a much deeper emotional history than standard PLMs.
Dialog-Aware Self-Attention
To model multi-party dynamics without introducing complex external structures like Graph Neural Networks (GNNs), DialogXL modifies the attention masking strategy within the Transformer blocks. The attention heads are divided into four specialized categories:
- Global Heads: Provide broad context by attending to all historical utterances.
- Local Heads: Focus on the immediate context by attending to the most recent $\omega$ utterances.
- Speaker Heads: Capture intra-speaker dependency by attending only to previous utterances from the same speaker.
- Listener Heads: Capture inter-speaker dependency by attending to utterances from other participants.
By leveraging these specialized heads, the model learns to weight historical information based on both temporal distance and speaker identity.
Experimental Evaluation
DialogXL was evaluated on four major ERC benchmarks: IEMOCAP, MELD, DailyDialog, and EmoryNLP. The model achieved state-of-the-art (SOTA) performance across all datasets, outperforming both vanilla PLMs and specialized models like DialogueGCN.
The performance gains were most notable on the IEMOCAP dataset, which features long, multi-turn dialogues. DialogXL achieved an F1-score of 65.94, a substantial improvement over vanilla XLNet (61.33). On the MELD dataset, the model reached an F1 of 62.41, significantly surpassing the previous best of 58.18.
Ablation studies confirmed the importance of the specialized attention heads. Removing the Speaker and Listener heads resulted in a drop of approximately 4 F1 points on IEMOCAP, highlighting the necessity of modeling speaker roles for accurate emotion recognition.
Conclusion and Future Directions
DialogXL demonstrates that modeling dialogue structure through efficient memory management and specialized attention masking can significantly enhance ERC performance. By remaining an "all-in-one" architecture, it avoids the complexity of hybrid models while capturing long-range dependencies.
Future work will address current limitations, such as the model's occasional over-reliance on emotionally charged keywords and its difficulty in detecting abrupt emotional shifts. Additionally, extending DialogXL to incorporate multimodal cues (audio and visual) represents a promising avenue for further research.
Summary updated