Entangling Machine Learning with Quantum Tensor Networks

Constantijn van der Poel, Dan ZhaoarXiv 2024

Abstract: This paper examines the use of tensor networks, which can efficiently represent high-dimensional quantum states, in language modeling. It is a distillation and continuation of the work done in (van der Poel, 2023). To do so, we will abstract the problem down to modeling Motzkin spin chains, which exhibit long-range correlations reminiscent of those found in language. The Matrix Product State (MPS), also known as the tensor train, has a bond dimension which scales as the length of the sequence it models. To combat this, we use the factored core MPS, whose bond dimension scales sub-linearly. We find that the tensor models reach near perfect classifying ability, and maintain a stable level of performance as the number of valid training examples is decreased.

Introduction

Capturing long-range dependencies remains a fundamental challenge in sequence modeling. In natural language, the context provided by a word at the start of a sentence can radically alter the interpretation of a word at the end. While Transformer architectures currently lead the field, their computational demands are significant.

This research explores Matrix Product States (MPS), a class of tensor networks originally developed to simulate complex quantum systems. Mathematically, MPS are adept at representing high-dimensional states with intricate internal correlations. However, standard MPS models face a scaling bottleneck: to capture long-range "entanglement" or correlations, the "bond dimension"—a measure of internal capacity—typically grows linearly with sequence length, limiting practical application for long-form text.

A standard Matrix Product State (MPS) representation where each circle represents a tensor core connected by bond dimensions.

Methodology

To address the scaling issue, the researchers compared three primary architectures against a traditional neural baseline:

  1. Dense Core MPS: The standard approach where each sequence token is represented by a single "core" tensor.
  2. Factored Core MPS: A novel architecture where the core is factorized into a vertical stack of smaller tensors, aiming for sub-linear scaling of the bond dimension.
  3. Skip-Factored Core MPS: An evolution of the factored core that incorporates "skip connections" to ensure information integrity as it propagates through the vertical stack.
  4. Neural Baseline: A standard Multi-Layer Perceptron (MLP) used as a benchmark.

A critical technical hurdle was initialization. Standard random initialization proved ineffective for factored cores. The authors implemented a Singular Value Decomposition (SVD) scheme to "warm start" the factored models, ensuring they mimic a properly initialized dense model at the onset of training.

The factorization process using SVD to decompose a core tensor M into U, D, and V components for efficient initialization.

Datasets: The Motzkin Spin Chain

The models were tested on the Motzkin Spin Chain dataset. This synthetic "language" consists of sequences (length $n=16$) governed by strict hierarchical rules, similar to matching parentheses in code. It exhibits power-law scaling correlations, providing a rigorous "stress test" for learning long-range structures. Out of approximately 43 million possible sequences, only 2% are valid Motzkin chains, requiring the models to learn precise structural discrimination.

Key Results and Insights

Superior Performance and Efficiency

Both Dense and Factored MPS models achieved near-perfect classification, with a ROC AUC of ~0.9999. This significantly outperformed the MLP baseline, which reached only 0.77. Remarkably, the Skip-Factored core achieved this using only 1,920 parameters, compared to over 66,000 for the MLP.

Inductive Bias and Robustness

The tensor networks demonstrated a powerful "inductive bias," naturally aligning with the hierarchical structure of the data. Furthermore, when training data was restricted to just 1% valid chains, the TN models maintained high accuracy, whereas the neural baseline's performance degraded sharply.

The Batch Size Paradox

An unexpected finding was that these tensor models performed significantly better with smaller batch sizes. In contrast to standard deep learning where large batches often improve stability, large batches here hindered the learning process entirely, suggesting a unique optimization landscape for tensor-based architectures.

Discussion and Future Work

While the Motzkin chains serve as an excellent proxy for structural complexity, they remain a synthetic testbed. Future research must evaluate these factored cores on large-scale, real-world natural language datasets. Additionally, the "batch size paradox" and the potential of complex-valued tensors—closer to the native mathematics of quantum mechanics—offer promising avenues for increasing representational power. Currently, the lack of standardized software libraries for tensor networks remains a hurdle for broader adoption in the AI community.

Summary updated

BibTeX
@misc{poel2024entangling,
  author = {Constantijn van der Poel and Dan Zhao},
  title = {{Entangling Machine Learning with Quantum Tensor Networks}},
  year = {2024},
  eprint = {2403.12969},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.12969},
}
Figure