Supervised Learning with Quantum-Inspired Tensor Networks

E. Miles Stoudenmire, David J. SchwabarXiv 2016

Abstract

This paper presents a framework for supervised learning that leverages Matrix Product States (MPS), a tensor network format from quantum physics, to represent high-dimensional weight vectors. By employing a sweeping optimization algorithm, the authors demonstrate competitive performance on image classification tasks like MNIST, achieving error rates below 1%. The approach offers adaptive model complexity and linear scaling with dataset size.

Introduction: The Challenge of High-Dimensional Learning

In machine learning, particularly in non-linear kernel learning, we often map input data into an extremely high-dimensional "feature space" to make it easier to classify. However, this leads to a massive problem: the weight vector $W$ needed to make decisions becomes exponentially large, making it impossible to store or optimize directly.

Standard approaches use the "kernel trick" to avoid dealing with these vectors explicitly. Stoudenmire and Schwab tackle this from a different angle: What if we could compress that massive weight vector into a manageable, efficient format? They look to condensed matter physics, where "Tensor Networks" are used to represent the complex, high-dimensional wavefunctions of many-particle systems using only a small number of parameters.

Methodology

The authors propose a two-step approach:

1. Feature Mapping

Each input (like a pixel in a grayscale image) is mapped to a small, normalized vector using trigonometric functions. The entire image is then represented as the tensor product of all these local vectors, creating a "product state" in a massive feature space.

Mapping image pixels to local feature vectors in a high-dimensional space.

2. MPS Parameterization and Inference

Instead of a giant weight vector, the model uses a Matrix Product State (also known as a Tensor Train). This represents the weights as a chain of small, interconnected tensors. The decision function $f^\ell(\mathbf{x})$ is then computed by contracting this weight MPS with the input feature map.

The decision function is computed by contracting the weight MPS $W^\ell$ with the input feature map $\Phi(\mathbf{x})$.

3. The Sweeping Algorithm

To train the model, they adapt the Density Matrix Renormalization Group (DMRG) algorithm. Instead of updating the whole network at once, the algorithm "sweeps" back and forth along the chain, optimizing two neighboring tensors at a time.

A standout feature of this method is its adaptivity. During the SVD (Singular Value Decomposition) step of the sweep, the algorithm can decide how many "virtual indices" (the bond dimension) to keep. This allows the network to grow in complexity where the data has strong correlations and shrink where it doesn't.

Key Insights

  • Automatic Regularization: The "bond dimension" ($m$) acts as a built-in regulator. A small $m$ forces the model to stay simple, preventing overfitting, while a large $m$ allows it to capture intricate patterns.
  • The "Zig-Zag" Path: Because MPS is inherently one-dimensional, the authors mapped 2D image pixels into a 1D chain using a "zig-zag" ordering to keep spatially nearby pixels close on the chain, capturing local correlations.
  • Generative Potential: Since the mathematics is identical to quantum wavefunctions, the decision function can be interpreted as a probability distribution, suggesting potential for "perfect sampling" and generative tasks.

Results

  • High Accuracy: On the MNIST dataset, the model achieved a test set error of 0.97% (with $m=120$), competitive with models using convolutional layers. The authors downsampled the original $28 \times 28$ images to $14 \times 14$ to speed up training.
  • Rapid Convergence: The sweeping algorithm typically required only two or three passes over the data to reach high accuracy.
  • Non-Linear Power: Toy model tests demonstrated the network's ability to learn complex, non-linear decision boundaries, such as interlocking spirals.

Limitations and Future Work

The primary limitation is the 1D nature of the MPS. While effective for MNIST, 1D chains are not the most natural fit for 2D or 3D data. Higher-dimensional tensor networks, like PEPS (Projected Entangled Pair States), might be more powerful but are significantly harder to optimize. Future work includes exploring stochastic gradient descent (SGD) integration and unsupervised learning applications.

Summary updated

BibTeX
@misc{stoudenmire2016supervised,
  author = {E. Miles Stoudenmire and David J. Schwab},
  title = {{Supervised Learning with Quantum-Inspired Tensor Networks}},
  year = {2016},
  eprint = {1605.05775},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1605.05775},
}
Figure