Transformers to Learn Hierarchical Contexts in Multiparty Dialogue for Span-based Question Answering

Changmao Li, Jinho D. Choi

Abstract

We introduce a novel approach to transformers that learns hierarchical representations in multiparty dialogue. First, three language modeling tasks are used to pre-train the transformers: token- and utterance-level language modeling and utterance order prediction. These tasks learn both token and utterance embeddings for better understanding in dialogue contexts. Then, multi-task learning between utterance prediction and token span prediction is applied to fine-tune for span-based question answering (QA). Our approach is evaluated on the FriendsQA dataset and shows improvements of 3.8% and 1.4% over the two state-of-the-art transformer models, BERT and RoBERTa, respectively.

Introduction

Most state-of-the-art language models, such as BERT and RoBERTa, are pre-trained on formal, structured text like Wikipedia or news articles. While these models excel at standard Question Answering (QA), they often struggle with the unique challenges of multiparty dialogues. Dialogue presents two primary difficulties: colloquialism, where language is informal and distinct from standard pre-training corpora, and heterogeneity, where a dialogue is a sequence of utterances from different speakers that follow a hierarchical structure (tokens within utterances, utterances within a dialogue).

This research aims to bridge this gap by teaching Transformers to understand the boundaries and relationships between individual speakers' turns through a hierarchical architecture.

Methodology

The proposed approach consists of a two-stage pipeline: specialized hierarchical pre-training followed by multi-task fine-tuning.

Hierarchical Pre-training

To bake "dialogue awareness" into the model, three sequential tasks are employed during pre-training:

  1. Token-level Masked LM (t-MLM): The standard approach where random tokens are masked across the entire dialogue.
  2. Utterance-level Masked LM (u-MLM): Tokens are masked within a single utterance, forcing the model to create a robust embedding ($e^c_i$) that captures the essential features of that specific turn.
  3. Utterance Order Prediction (UOP): The model is presented with a dialogue where the second half of the utterances are shuffled and must predict if the sequence is in the correct order. This teaches the model the logical flow of context between speakers.
Hierarchical Pre-training Tasks: (a) Token-level MLM, (b) Utterance-level MLM, and (c) Utterance Order Prediction.

Multi-task Fine-tuning

For span-based QA, the model performs two tasks simultaneously to effectively "zoom in" on the answer:

  • Utterance ID Prediction (UID): The model first identifies which specific utterance contains the answer.
  • Token Span Prediction: Using Multi-Head Attention (MHA), the model compares the question against the identified utterance to find the exact start and end tokens.
Multi-task Fine-tuning Architecture for Utterance ID and Token Span Prediction.

Experimental Setup and Results

The study utilized the FriendsQA dataset, consisting of transcripts from the TV show Friends. To prevent data leakage where scenes from the same episode appear in both training and testing sets, the authors re-split the data by episodes: Seasons 1-4 were used for fine-tuning, while Seasons 5-10 were used for additional pre-training.

The proposed models, BERTour and RoBERTaour, were compared against standard baselines using Span Matching (SM) as the primary metric. Results indicated significant performance gains:

  • BERTour improved over the baseline BERT by 3.8%.
  • RoBERTaour improved over the baseline RoBERTa by 1.4%, achieving a new state-of-the-art score of 69.6% SM.

Analysis showed the model performed best on "Where" and "When" questions but faced more difficulty with "Why" and "How" questions, which require deeper inference across multiple turns.

Conclusion

This work demonstrates that incorporating hierarchical structure and utterance order into Transformer models significantly improves performance in multiparty dialogue QA. By treating dialogue as more than a flat sequence of tokens, the model better captures the "who said what" dynamics of conversation. Future research will focus on improving entity resolution and cross-utterance reasoning to better handle complex, inferential questions.

Summary updated

BibTeX
@inproceedings{li2020transformers,
  author = {Changmao Li and Jinho D. Choi},
  title = {{Transformers to Learn Hierarchical Contexts in Multiparty Dialogue for Span-based Question Answering}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2020},
  url = {https://openreview.net/forum?id=S5L-KeZHlb5},
}
Figure