Inter-document Contextual Language model

Quan Hung Tran, Ingrid Zukerman, Gholamreza HaffariNAACL 2016

TL;DR

This paper introduces an "Inter-document Contextual Language Model" that significantly improves language modeling accuracy by incorporating information not just from within a document, but also from related documents. By leveraging the tree-like structure of online discussions (like Reddit), their model achieves state-of-the-art results, demonstrating the value of broader contextual understanding.

What Problem Does This Paper Address?

Traditional language models (LMs) predict the next word based on a limited history of preceding words, either through n-grams or even RNNs that consider the entire preceding sentence. While effective, these models miss out on a wealth of contextual information available in the wider ecosystem of related documents. Imagine trying to understand a single comment on Reddit without seeing the original post it's replying to, or other comments in the same thread – you'd be missing crucial context. This paper aims to bridge that gap by developing an LM that can tap into this "inter-document" context, hypothesizing that this broader understanding will lead to more accurate predictions.

Methods

The authors build upon existing Recurrent Neural Network (RNN) and Long Short-Term Memory (LSTM) based language models. Their core innovation is an architecture that incorporates context from parent posts and sibling posts in a tree-like discussion structure.

  • Baseline RNN-LSTM: A standard LSTM model that processes words sequentially, using the hidden state to capture context.
  • Document Context LMs (DCLMs): These models extend RNN-LSTMs by incorporating information from preceding sentences. The paper specifically re-implements two types:
  • Context-to-context (ccDCLM): Concatenates the final hidden state of the previous sentence with the current sentence's word vectors.
  • Context-to-output (coDCLM): Applies additional context directly to the word-decoding phase.
  • Inter-document Contextual Language Model (PS-ccDCLM): This is their proposed model. It extends the ccDCLM by incorporating context from the parent post and sibling posts. They define functions to combine these contextual vectors (parent, sibling, and sentence) into a single context vector that influences the word prediction.
  • Training Strategies: They explore two training methods:
  • Disconnected (disC): Error signals are confined to the current time step.
  • Fully Connected (fulC): Error signals propagate back through time steps, allowing for better learning of long-range dependencies. They found fulC to be superior.

Datasets

The primary dataset used is a large collection of Reddit comments, totaling approximately 1.7 billion comments as of December 2015. This data is naturally structured as comment threads, forming a tree-like repository. They filtered threads to ensure a minimum of three comments and removed those with deleted comments. The dataset was split into training, testing, and validation sets.

Key Insights and Ideas

  • The Power of Broader Context: The most significant insight is that going beyond sentence-level context to include inter-document context (parent and sibling posts) demonstrably improves language model performance.
  • Reddit's Structure is Key: The tree-like structure of Reddit discussions is well-suited for this inter-document contextual modeling, allowing for clear identification of parent and sibling relationships.
  • Fully Connected Training is Crucial: The fulC training strategy significantly outperforms disC training, highlighting the importance of allowing error signals to propagate for effective contextual learning.
  • Parent Context is More Informative than Siblings (Individually): While combining parent and sibling context is best, initial experiments suggest that parent context alone provides a stronger signal than sibling context alone.

Key Results

The paper reports significant reductions in perplexity (a measure of how well a probability model predicts a sample) for their proposed model.

  • Their best model, PS-ccDCLM, achieved a perplexity of 159 on the test set.
  • This is a substantial improvement over the best baseline, ccDCLM (trained with fulC), which had a perplexity of 176.
  • The inter-sentence context (ccDCLM) reduced perplexity by 9% compared to a vanilla RNN-LSTM (184).
  • The inter-document context (PS-ccDCLM) further reduced perplexity by an additional 5% compared to ccDCLM.
  • These improvements were statistically significant, confirmed by a Friedman test.

Limitations and Future Work

  • Limited Sibling Context: Currently, the model only considers the "closest older-sibling" of a post, deeming it the most related. The authors acknowledge that exploring combinations of multiple sibling posts is a direction for future work.
  • Reliance on Final Hidden Vector: The model relies on the final hidden vector of sentences and posts for contextual information. They propose exploring other methods for combining contextual information.
  • Beyond Trees: The current model is designed for tree-like structures. Future work could extend the model to handle more complex inter-document structures.
  • CoDCLM Limitations: The authors note that the context-to-output (coDCLM) approach, when applied to a larger context (like an entire previous document), might not effectively summarize the whole document, as it primarily relies on the last sentence's hidden unit. They address this by combining it with the context-to-context approach.

Summary updated

BibTeX
@inproceedings{tran2016inter,
  author = {Quan Hung Tran and Ingrid Zukerman and Gholamreza Haffari},
  title = {{Inter-document Contextual Language model}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2016},
  url = {https://openreview.net/forum?id=SyWQK7ZdZH},
}
Figure