Abstract
In this work, we tackle the scenario of understanding characters in scripts, which aims to learn the characters' personalities and identities from their utterances. We begin by analyzing several challenges in this scenario, and then propose a multi-level contrastive learning framework to capture characters' global information in a fine-grained manner. To validate the proposed framework, we conduct extensive experiments on three character understanding sub-tasks by comparing with strong pre-trained language models, including SpanBERT, Longformer, BigBird and ChatGPT-3.5. Experimental results demonstrate that our method improves the performances by a considerable margin. Through further in-depth analysis, we show the effectiveness of our method in addressing the challenges and provide more hints on the scenario of character understanding.
Introduction
Understanding a character in a narrative is a complex cognitive task that requires integrating information across vast spans of text. In the context of scripts—the blueprints for television and film—this task is particularly challenging. Unlike standard prose, where a narrator might explicitly describe a character's internal state, scripts rely almost entirely on multi-party dialogue and sparse scene descriptions. To truly "understand" a character, an AI must be able to connect disparate utterances into a coherent identity, maintaining consistency across thousands of lines of dialogue.
The Challenges of Script-Based Understanding
Current Pre-trained Language Models (PLMs) face two primary hurdles when processing script data:
- Textual Heterogeneity: Scripts are composed of multi-party conversations. A character's identity is not just defined by what they say, but by how they interact with others. Standard models often struggle to parse these social dynamics from raw dialogue.
- Extreme Document Length: Scripts are often exceptionally long, frequently exceeding the context window limits of modern PLMs. Because character traits are distributed globally throughout a script, a model that only sees a local snippet (e.g., 512 or 4096 tokens) cannot maintain a consistent "profile" of a character, leading to fragmented understanding.
Proposed Methodology: Multi-level Contrastive Learning
To address these challenges, we introduce a multi-level contrastive learning framework designed to create robust, global character embeddings. Our approach utilizes two novel loss functions that encourage the model to look beyond the immediate context window.
Summary-Conversation Contrastive Loss ($L_{Sum}$)
Scripts often include scene summaries that provide high-level descriptions of character actions and motivations. We treat the description of a character in a summary and their corresponding utterances in the dialogue as two different "views" of the same entity. By minimizing the distance between these representations in vector space, the model learns to link abstract character traits with specific conversational styles.
Cross-Sample Contrastive Loss ($L_{Cross}$)
To overcome the input length limitations of PLMs, we implement a cross-sample alignment strategy. We identify instances of the same character appearing in different text segments within a training batch. By forcing the model to align these representations, we encourage it to capture "global" information that persists across the entire script, effectively bypassing the constraints of the local context window.
Two-Stage Training Paradigm
Our framework follows a structured training process:
- Stage 1 (Contrastive Pre-training): The model is trained using a combination of supervised loss and our two new contrastive losses ($L_{Sum}$ and $L_{Cross}$). This stabilizes the learning of character-centric features.
- Stage 2 (Fine-tuning): The model is fine-tuned using only supervised signals to specialize in specific downstream tasks, such as character identification or guessing.
Experimental Setup and Results
We evaluated our framework against several strong baselines, including SpanBERT, Longformer, BigBird, and ChatGPT-3.5, across three primary benchmarks:
- Character Identification: Tasks involving Coreference Resolution and Character Linking.
- Character Guessing: Identifying the speaker of a masked utterance (TVSHOWGUESS dataset).
- Narrative Comparison: Using ROCStories to contrast script data with standard narrative structures.
Performance Gains
The proposed method consistently outperformed vanilla PLM architectures. For instance, on the TVSHOWGUESS dataset, our framework improved the Macro-F1 score of the Longformer-P-Large model from 75.92 to 76.52. In Character Linking tasks, SpanBERT-large saw a boost from 82.8 to 83.7 Macro-F1. Furthermore, our model achieved state-of-the-art (SOTA) results in Coreference Resolution across multiple metrics, including B3 and BLANC.
The LLM Gap
A notable finding was the performance of ChatGPT-3.5, which performed the worst among all tested baselines. While Large Language Models (LLMs) excel at general reasoning, they appear to struggle with tasks requiring deep, global consistency across long-form, domain-specific entities. This highlights the continued importance of specialized training frameworks for complex narrative understanding.
Discussion and Insights
Our analysis reveals that the multi-level contrastive approach is particularly effective for samples requiring "Global & In-depth Evidence." While baseline models can often identify characters based on local textual cues (like a name being mentioned), our framework excels at understanding long-term relationships and consistent personality traits. Visualization via T-SNE plots confirmed this, showing that character embeddings (e.g., for characters from the show Friends) formed significantly tighter and more distinct clusters compared to baseline models.
Conclusion and Future Work
This work demonstrates that multi-level contrastive learning can effectively bridge the gap between local dialogue and global character identity in scripts. By leveraging scene summaries and cross-sample alignment, we provide a path forward for AI to understand complex, long-form narratives. Future research will explore extending this approach to other domains, such as fiction understanding and long-document matching, where maintaining entity consistency over great distances remains a critical challenge.
Summary updated