Language Modeling with Deep Transformers

Kazuki Irie, Albert Zeyer, Ralf Schlüter, Hermann Ney

Introduction

Language modeling (LM) is a cornerstone of modern Automatic Speech Recognition (ASR) systems. While Long Short-Term Memory (LSTM) networks have long been the standard for capturing temporal dependencies in text, the rise of Transformer architectures in Natural Language Processing (NLP) has prompted a re-evaluation of their utility in ASR. This paper investigates the application of deep autoregressive Transformer models to language modeling, specifically focusing on their performance relative to LSTMs and the necessity of explicit positional information.

Methodology

The authors utilize a Transformer decoder architecture, characterized by a stack of layers containing multi-head self-attention and position-wise feed-forward networks. To adapt this for language modeling, autoregressive masking is applied to ensure that predictions for a given token only depend on preceding context.

A significant focus of the study is the impact of model depth. The researchers explored configurations ranging from shallow stacks to extremely deep models of up to 96 layers. These models were integrated into both hybrid ASR systems (via lattice rescoring) and end-to-end (E2E) systems (via shallow fusion) to evaluate their real-world impact on speech recognition accuracy.

The Implicit Position Hypothesis

A fundamental assumption in Transformer research is the need for positional encodings (PE) to overcome the permutation-invariant nature of self-attention. However, this study proposes an "Implicit Position" hypothesis: in autoregressive models, the increasing context size at each step provides a natural signal of the "arrow of time."

Experimental results support this, showing that removing sinusoidal positional encodings does not degrade performance and can even lead to slight improvements in perplexity. Visualization of attention weights reveals that without PE, the model's first layer specializes in focusing on the immediate predecessor (the diagonal), effectively learning its own positional representation.

First layer attention with PE

Experimental Results

The models were evaluated on the LibriSpeech 960hr dataset using both word-level (200K) and subword-level (10K BPE) vocabularies.

Perplexity and Scaling

A 42-layer Transformer achieved a perplexity (PPL) of 57.7 on the LibriSpeech test set, outperforming the best LSTM baseline (63.2). The study also found that Transformers scale more effectively with depth than width; for a fixed parameter count, deeper models consistently yielded better results.

ASR Performance

The improvements in language modeling translated directly to lower Word Error Rates (WER):

  • Hybrid Systems: WER on the "test-other" set dropped from 5.9% (LSTM) to 5.6%.
  • End-to-End Systems: WER on "test-other" improved from 9.9% (LSTM) to 9.3%.

Conclusion

Deep Transformers represent a significant advancement over LSTMs for ASR language modeling. The discovery that explicit positional encodings are optional in autoregressive settings simplifies model design and suggests that the inherent structure of the task provides sufficient temporal information. Furthermore, the superior scaling properties of deep Transformers indicate that further performance gains are likely as computational budgets increase.

Summary updated

BibTeX
@misc{irie2019language,
  author = {Kazuki Irie and Albert Zeyer and Ralf Schlüter and Hermann Ney},
  title = {{Language Modeling with Deep Transformers}},
  year = {2019},
  eprint = {1905.04226},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1905.04226},
}
Figure