Towards Quantum Language Models

Ivano Basile, Fabio TamburiniEMNLP 2017

Abstract

Language modeling is a fundamental task in natural language processing, traditionally dominated by N-gram models and, more recently, Recurrent Neural Networks (RNNs). This paper explores a novel approach: the Quantum Language Model (QLM). By leveraging the mathematical framework of Quantum Probability Theory (QPT), specifically the concepts of interference and entanglement, the QLM captures complex linguistic dependencies more effectively than classical stochastic models. Experimental results on the TIMIT corpus demonstrate that QLMs achieve lower perplexity and superior speech recognition accuracy compared to state-of-the-art neural models.

Introduction

The core challenge of language modeling is predicting the next word in a sequence. While classical models like N-grams and RNNs/LSTMs have seen significant success, they may be limited by the "rigidity" of classical probability when modeling the non-linear, long-range dependencies of human language. This research investigates whether the mathematical formalism of quantum mechanics—independent of quantum hardware—can provide a more expressive framework for language. By treating language as a quantum system, we can model a "potentially infinite" history through quantum memory effects.

Methodology

The QLM represents the state of a language sequence using density matrices ($\rho$). Words are mapped to projectors ($\Pi_w$), and the probability of a word is determined by measuring the system. Between words, the system undergoes unitary evolution ($U$), representing the transition logic.

A critical innovation is the inclusion of an ancillary system of dimension $D$. In a standard quantum measurement, the state collapses, which would destroy the history of the sequence. By coupling the main system to this "fictitious" ancillary system, the model creates entanglement, allowing it to maintain a complex memory of the entire sequence history. Training involves optimizing these unitary matrices on a Stiefel manifold, ensuring they maintain their mathematical properties while minimizing prediction error.

Experimental Evaluation

The model was evaluated using the TIMIT corpus, focusing on phonetic transcriptions. Two types of evaluation were performed:

  1. Intrinsic Evaluation: Measuring perplexity (PPL) to assess the model's predictive power.
  2. Extrinsic Evaluation: Integrating the QLM into the Kaldi ASR toolkit for N-best rescoring to evaluate its impact on Phone Error Rate (PER).

Results

The QLM demonstrated superior performance in both intrinsic and extrinsic metrics.

Perplexity Analysis

As shown in Figure 1, the QLM achieved a perplexity of 12.99, outperforming traditional 5-gram models (17.33) and even sophisticated neural architectures like RNNs (13.32) and LSTMs (13.17). The performance improved as the dimension of the ancillary system ($D$) increased, highlighting the value of the quantum memory effect.

Comparison of perplexity (PPL) across various language models on the TIMIT corpus.

Speech Recognition Performance

In the context of automatic speech recognition (ASR), the QLM consistently provided the best rescoring results. When used to rescore N-best lists from various Kaldi acoustic models (e.g., tri3, SGMM2), the QLM-interpolated models achieved the lowest Phone Error Rates. For instance, in the tri3 setup, the QLM reached a PER of 20.35%, significantly better than the RNNLM's 21.07%.

Phone Error Rate (PER) results for N-best rescoring using different language models within the Kaldi ASR framework.

Conclusion and Future Work

This work demonstrates that quantum logic provides a powerful tool for NLP, even on classical hardware. The QLM's ability to model interference and maintain memory via entanglement leads to state-of-the-art performance on phonetic datasets. However, scalability remains a challenge; the current matrix-based approach is limited to small vocabularies. Future research will focus on scaling these models to full-scale natural language using generalized quantum measurements (POVMs) and word-vector-based projections.

Summary updated

BibTeX
@inproceedings{basile2017towards,
  author = {Ivano Basile and Fabio Tamburini},
  title = {{Towards Quantum Language Models}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2017},
  doi = {10.18653/v1/d17-1196},
}
Figure