Improved Language Modeling by Decoding the Past

Siddhartha BrahmaACL 2019

Abstract

Language models often struggle to fully utilize immediate context, leading to suboptimal predictions. This paper introduces Past Decode Regularization (PDR), an auxiliary training task that requires the model to reconstruct the current input token from its prediction of the next token. By enforcing this "reverse" dependency, PDR incentivizes the retention of local contextual information. Experimental results on standard benchmarks like Penn Treebank and WikiText-2 demonstrate significant improvements in perplexity with negligible computational overhead during inference.

Introduction

The primary objective of language modeling is to predict the next token $x_{t+1}$ given a sequence of preceding tokens $x_{<t+1}$. While modern architectures like LSTMs use hidden states to capture context, they frequently fail to maintain a sufficiently rich representation of the immediate past, especially under heavy regularization. The authors observe a natural symmetry: a well-informed prediction for the future should logically retain traces of the current input. PDR addresses this by biasing the model to preserve contextual information without increasing parameter counts or inference latency.

Methods: Past Decode Regularization (PDR)

PDR introduces a secondary "reverse" task during the training phase. While the model standardly predicts $x_{t+1}$ from $x_t$, PDR attempts to "decode" $x_t$ from the predicted distribution of $x_{t+1}$.

  1. Soft Embedding Lookup: Rather than using a hard-max selection, the entire predicted probability vector for $x_{t+1}$ is multiplied by the embedding matrix. This "soft" lookup creates a continuous representation of the predicted future.
  2. Decoding Layer: This representation passes through a small, non-linear fully connected layer (with Tanh activation) to predict the current token $x_t$.
  3. Loss Function: The error from this backward prediction is added as a regularization term to the standard cross-entropy loss.
  4. Inference Efficiency: Crucially, the PDR-specific layers are discarded after training, ensuring zero additional cost during model deployment.

Key Insights

A primary effect of PDR is the reduction of entropy in the model's output distributions. By forcing the model to "remember" $x_t$ within its prediction for $x_{t+1}$, the hidden states become richer in local context. This leads to more confident and structured predictions.

Distribution of predicted token entropy for AWD-LSTM with and without PDR.

Unlike generic regularization techniques like dropout, PDR targets the structural logic of sequences, making it highly complementary to existing methods.

Experimental Results

The authors evaluated PDR across several word-level and character-level benchmarks using the AWD-LSTM architecture as a baseline. The results showed consistent improvements across the board:

  • Penn Treebank (PTB): Word-level perplexity dropped by 1.7 points (57.3 to 55.6).
  • WikiText-2 (WT2): A significant improvement of 2.3 points was observed (65.8 to 63.5).
  • Character-level Modeling: On PTBC, the model achieved a state-of-the-art 1.169 bits-per-character (BPC).
Training and validation perplexity over 1,200 epochs for AWD-LSTM and AWD-LSTM+PDR.

The training overhead is minimal, with less than a 3% increase in training time and a negligible increase in parameters (used only during training).

Discussion and Conclusion

While PDR shows strong gains on standard benchmarks, its impact diminishes on extremely large datasets like Gigaword, where models may naturally learn to retain context. Additionally, while this study focused on LSTMs, the principles of PDR are theoretically applicable to Transformers and other sequence-to-sequence architectures. Future work could explore these applications or adapt the "decoding the past" framework for non-textual sequential data. In summary, PDR offers a simple yet effective way to improve language model performance by better exploiting the inherent temporal dependencies in language.

Summary updated

BibTeX
@inproceedings{brahma2019improved,
  author = {Siddhartha Brahma},
  title = {{Improved Language Modeling by Decoding the Past}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2019},
  doi = {10.18653/v1/p19-1142},
}
Figure