Quantum Language Model with Entanglement Embedding for Question Answering

Yiwei Chen, Yu Pan, Daoyi Dong · DOI

Abstract

This paper introduces a Quantum-inspired Language Model with Entanglement Embedding (QLM-EE) designed for Question Answering (QA) tasks. By representing word sequences as entangled quantum states rather than simple mixtures, the model captures complex, non-classical semantic correlations. QLM-EE achieves state-of-the-art performance on benchmark datasets with significantly fewer parameters than classical counterparts, while providing a mathematically transparent framework for understanding semantic bonds through quantum mechanics.

Introduction

Traditional Neural Network Language Models (NNLMs) are powerful but often operate as "black boxes," limiting their utility in critical applications. While previous Quantum Language Models (QLMs) attempted to use quantum probability, they often treated sentences as a simple "mixture" or sum of individual words. This approach fails to capture how word meanings change based on context—for example, the difference between "turn" and "turn on."

The authors argue that these inseparable semantic associations are analogous to quantum entanglement. By failing to model these correlations, standard models limit their expressive power and transparency. QLM-EE addresses this by explicitly embedding entanglement into the language representation.

Comparison of mixed, product, and entangled quantum states in language modeling.

Methodology

The QLM-EE architecture follows a three-step process to transform raw text into a similarity score for QA matching:

  1. Complex-valued Word Embedding: Each word is converted into a "pure state" represented as a complex-valued unit vector. This allows the model to represent a superposition of multiple potential meanings, or sememes.
  2. Entanglement Embedding (EE) Module: The core innovation involves taking an $N$-gram sequence and combining the word states using a tensor product. A complex-valued linear transformation is then applied to "entangle" these states, representing correlations that cannot be decomposed into individual word meanings.
  3. Virtual Quantum Measurement: To extract features, the model performs "measurements" by calculating the inner product between the entangled state and learned measurement vectors. This mimics the collapse of a quantum system into a definite state.

Finally, the similarity between a question and a candidate answer is calculated using Quantum Fidelity, a standard metric for comparing quantum states.

End-to-end architecture of the QLM-EE model for Question Answering.

Key Insights and Interpretability

QLM-EE offers a unique layer of "post-hoc interpretability" through physics-based metrics. The authors use von Neumann entanglement entropy to quantify the strength of semantic links. Their findings show that set phrases (e.g., "how long") exhibit high entanglement, while random word combinations show low entanglement.

Furthermore, the model demonstrates extreme parameter efficiency. Because the state space of a quantum system grows exponentially ($D^N$), QLM-EE achieves superior results with a word embedding dimension of just $D=8$. In contrast, classical models typically require dimensions between 50 and 300 to reach comparable performance.

Experimental Results

The model was evaluated on two major benchmarks: TREC-QA and WikiQA.

  • TREC-QA: QLM-EE achieved a Mean Average Precision (MAP) of 0.7713, surpassing the previous state-of-the-art quantum model (CNM, 0.7701) and classical models like aNMM-1 (0.7385).
  • WikiQA: The model reached a MAP of 0.6956, significantly outperforming the classical Bigram-CNN (0.6190) and the previous CNM (0.6748).

Conclusion

By modeling feature extraction as a measurement process and semantic bonds as entanglement, QLM-EE provides a more mathematically transparent alternative to standard deep learning layers. While currently running on classical hardware, the model sets a precedent for using quantum mechanical principles to improve the efficiency and interpretability of natural language processing. Future work will explore adaptive measurement operations to further refine feature extraction on larger, more complex datasets.

Summary updated

BibTeX
@article{chen2020quantum,
  author = {Yiwei Chen and Yu Pan and Daoyi Dong},
  title = {{Quantum Language Model with Entanglement Embedding for Question Answering}},
  journal = {IEEE Trans. Cybernetics},
  year = {2020},
  doi = {10.1109/tcyb.2021.3131252},
}
Figure