Larger-Context Language Modelling with Recurrent Neural Network

Tian Wang, Kyunghyun Cho

Abstract

In this work, we propose a novel method to incorporate corpus-level discourse information into language modelling. We call this larger-context language model. We introduce a late fusion approach to a recurrent language model based on long short-term memory units (LSTM), which helps the LSTM unit keep intra-sentence dependencies and inter-sentence dependencies separate from each other. Through the evaluation on four corpora (IMDB, BBC, Penn TreeBank, and Fil9), we demonstrate that the proposed model improves perplexity significantly. In the experiments, we evaluate the proposed approach while varying the number of context sentences and observe that the proposed late fusion is superior to the usual way of incorporating additional inputs to the LSTM. By analyzing the trained larger-context language model, we discover that content words, including nouns, adjectives and verbs, benefit most from an increasing number of context sentences. This analysis suggests that larger-context language model improves the unconditional language model by capturing the theme of a document better and more easily.

Introduction

Traditional statistical language models (LMs) often operate under the "sentence-as-an-island" assumption, treating each sentence as an independent unit. However, in natural discourse, word choice is heavily influenced by the broader context established in preceding sentences. This paper addresses the challenge of incorporating document-level context into Recurrent Neural Networks (RNNs) without compromising the model's ability to learn intra-sentence syntax.

Methodology: Early vs. Late Fusion

The authors explore how to represent and integrate context from preceding sentences ($S$). Context is represented using three methods: Bag-of-Words (BoW), Sequence of BoW (SeqBoW), and Attention-based SeqBoW.

The core innovation is the Late Fusion architecture. In a standard Early Fusion setup, the context vector is concatenated with the current word input. This often leads to the context information being "washed out" by the LSTM's complex nonlinear gates. In contrast, Late Fusion processes the current sentence normally and then uses a separate gating mechanism ($r_t$) to decide how much external context should influence the final hidden state. This creates a more direct path for context information, mitigating the vanishing gradient problem.

Comparison of Early Fusion (a) and Late Fusion (b) architectures.

Experimental Results

The model was evaluated on four diverse corpora: IMDB (movie reviews), BBC (news), Penn TreeBank (benchmark), and Fil9 (Wikipedia).

Across all datasets, the larger-context models significantly outperformed standard LSTMs. For instance, on the IMDB dataset, perplexity dropped from approximately 97 for a standard LSTM to around 82 for the Late Fusion model using 8 sentences of context. The results consistently showed that Late Fusion outperformed Early Fusion and that performance scaled positively with the number of context sentences.

Perplexity results across four datasets (IMDB, Penn TreeBank, BBC, Fil9) for different context sizes and fusion methods.

Analysis and Conclusion

Part-of-Speech (POS) analysis revealed that the performance gains were primarily driven by better predictions of "content words" (nouns, adjectives, and verbs) rather than "function words" (like the or and). This suggests that the larger-context model effectively captures the "theme" or "topic" of a document.

In conclusion, Late Fusion provides a robust mechanism for incorporating long-range dependencies into LSTMs. By separating the learning of syntax and theme, the model achieves significant gains in language modeling accuracy, particularly for thematic content. Future work may extend this approach to other sequence-to-sequence tasks like Machine Translation.

Reference: Wang, T., & Cho, K. (2016). Larger-Context Language Modelling with Recurrent Neural Network. Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, 1319–1329.

Summary updated

BibTeX
@inproceedings{wang2016larger,
  author = {Tian Wang and Kyunghyun Cho},
  title = {{Larger-Context Language Modelling with Recurrent Neural Network}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2016},
  url = {https://openreview.net/forum?id=ry4t52gObr},
}
Figure