Skip to main content
QUICK REVIEW

[Paper Review] Tensor Networks for Probabilistic Sequence Modeling

Jacob Miller, Guillaume Rabusseau|arXiv (Cornell University)|Mar 2, 2020
Tensor decomposition and applicationsMathematics42 references5 citations
TL;DR

This paper introduces a uniform matrix product state (u-MPS) model for probabilistic sequence modeling, leveraging tensor network structure to enable O(log n) depth parallel evaluation of sequences and a novel recursive sampling algorithm that generates sequences conditioned on arbitrary regular expressions. The method achieves state-of-the-art generalization on limited-data sequence tasks and enables new forms of structured generation and regularization.

ABSTRACT

Tensor networks are a powerful modeling framework developed for computational many-body physics, which have only recently been applied within machine learning. In this work we utilize a uniform matrix product state (u-MPS) model for probabilistic modeling of sequence data. We first show that u-MPS enable sequence-level parallelism, with length-n sequences able to be evaluated in depth O(log n). We then introduce a novel generative algorithm giving trained u-MPS the ability to efficiently sample from a wide variety of conditional distributions, each one defined by a regular expression. Special cases of this algorithm correspond to autoregressive and fill-in-the-blank sampling, but more complex regular expressions permit the generation of richly structured data in a manner that has no direct analogue in neural generative models. Experiments on sequence modeling with synthetic and real text data show u-MPS outperforming a variety of baselines and effectively generalizing their predictions in the presence of limited data.

Motivation & Objective

  • To develop a differentiable, differentiable sequence model based on tensor networks that avoids nonlinear activation functions.
  • To enable highly parallel evaluation of long sequences using u-MPS, achieving O(log n) depth evaluation.
  • To design a recursive sampling algorithm that generates sequences conditioned on arbitrary regular expressions, extending beyond autoregressive and fill-in-the-blank generation.
  • To explore new regularization techniques in sequence modeling by penalizing or incentivizing pattern matching via regex constraints.
  • To demonstrate superior generalization and structured generation capabilities on synthetic and real-world text datasets.

Proposed method

  • The model uses a uniform matrix product state (u-MPS) as a differentiable sequence model with no nonlinear activation functions, relying on multiplicative tensor interactions.
  • The u-MPS is trained via gradient descent with negative log-likelihood loss using the Adam optimizer on sequence data.
  • A novel recursive sampling algorithm, REGSAMP, generates unbiased samples from the u-MPS distribution conditioned on a regular expression R by recursively decomposing R into subexpressions and sampling from their respective transfer operators.
  • The algorithm leverages the correspondence between u-MPS transfer operators and regular expression structure, enabling efficient sampling even for complex regex patterns like Σ*tΣ* or R1|R2.
  • The method supports regularization by modifying the training objective to favor or penalize sequences matching a given regex, enabling applications in bias mitigation and code generation.
  • JAX's JIT compilation is used to optimize the recursive regex sampling implementation, reducing computational overhead despite its general-purpose nature.

Experimental results

Research questions

  • RQ1Can u-MPS models achieve efficient parallel evaluation of long sequences, and what is the theoretical depth complexity of such evaluation?
  • RQ2Can a u-MPS model generate sequences conditioned on arbitrary regular expressions, and how does this generalize beyond standard autoregressive or fill-in-the-blank sampling?
  • RQ3How does the u-MPS model generalize to longer sequences when trained on limited data, especially for non-local correlations?
  • RQ4Can regex-conditioned sampling and regularization be effectively applied to real-world text generation tasks such as email address generation or bias mitigation?
  • RQ5What is the computational and memory efficiency of the recursive sampling algorithm across different regex structures?

Key findings

  • The u-MPS model evaluates sequences of length n in O(log n) depth, enabling highly parallel inference and training, a significant improvement over standard RNNs.
  • The recursive sampling algorithm, REGSAMP, efficiently generates unbiased samples conditioned on any regular expression R, including complex patterns like Σ*tΣ* or R1|R2, with runtime O(L_R d D^3) and memory O(L_R D^2).
  • On synthetic Tomita grammar datasets, the u-MPS model outperformed LSTMs and Transformers in both sampling and string completion tasks, especially with limited training data (1,000 vs. 10,000 strings).
  • The model successfully generalized non-local correlations—such as parity and balance constraints—beyond the training sequence length, demonstrating strong inductive bias.
  • In real-world email address generation, the u-MPS model achieved 98.7% correctness on unconditionally sampled strings when judged against the regex R_e = [\w-.]+@([\w-]+.)*[\w-][\w-]+.
  • The use of JIT compilation in JAX reduced the overhead of the general-purpose regex sampling algorithm, making it practical for real-world deployment.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.