Efficient Probabilistic Tensor Networks

Marawan Gamal Abdel Hameed, Guillaume RabusseauarXiv 2025 · DOI

Abstract

Training Probabilistic Tensor Networks (PTNs) has traditionally required choosing between the numerical stability of complex, slow algorithms like Density Matrix Renormalization Group (DMRG) and the speed of simple but unstable Stochastic Gradient Descent (SGD). This paper introduces Logarithmic Scale Factors (LSF), a method that makes SGD training for PTNs numerically stable. LSF enables 10x faster training than traditional methods and scales to distributions with 10x more variables than previously possible, while remaining fully compatible with modern automatic differentiation frameworks.

Introduction

Generative models such as Diffusion models or Transformers are powerful synthesis tools but often struggle with exact probabilistic inference—answering questions like "What is the probability of X given Y?". Computing these marginal and conditional distributions typically requires summing over an exponential number of states, which is computationally intractable for standard deep learning architectures.

Tensor Networks (TNs), particularly Matrix Product States (MPS), offer a solution by allowing for tractable marginalization. However, training them effectively has been a persistent challenge. Physicists typically use DMRG, which is stable but computationally expensive, high in memory usage, and incompatible with Automatic Differentiation (AD) frameworks like PyTorch. Conversely, standard SGD is fast and AD-compatible but suffers from extreme numerical instability; as the number of variables (cores) increases, values within the network grow or shrink exponentially, leading to immediate numerical overflow or underflow.

Methods: Logarithmic Scale Factors (LSF)

The authors provide a theoretical foundation for why standard SGD fails, proving that the expected values or variances of tensor entries grow exponentially with the number of variables. For Non-Negative MPS, instability stems from exponential growth in the magnitude of expected values; for Born Machines, it arises from exponential growth in variance. This is not a mere implementation detail but a fundamental mathematical property of the architecture.

To resolve this, they propose Logarithmic Scale Factors (LSF). Instead of computing the massive product of matrices directly—which leads to immediate overflow—LSF normalizes intermediate results at every step of the chain. By factoring out these scale factors and performing the final loss calculation in log-space, the approach keeps intermediate values within a safe numerical range. This method is numerically stable, AD-compatible, and efficient, as it avoids the expensive Singular Value Decompositions (SVD) and fourth-order tensor materialization required by DMRG.

Comparison of training algorithms: (a) DMRG, (b) SGD, and (c) the proposed LSF method, with (d) performance metrics showing LSF's advantages in latency, memory, and stability.

Experimental Evaluation

The LSF method was evaluated on generative modeling tasks using the MNIST dataset (flattened into 784-dimensional vectors) and a suite of 20 density estimation benchmarks ranging from 16 to 1,556 variables (e.g., nltcs, jester, dna, and ad). Key findings include:

  • Speed and Efficiency: On MNIST, LSF achieved a 10x reduction in latency compared to DMRG. It also demonstrated superior memory efficiency, using as little as 8 MB compared to 334 MB for specific high-dimensional configurations.
  • Scalability: While vanilla SGD typically fails on systems with more than 100 variables, LSF successfully trained networks with up to 10,000 cores. It modeled the ad dataset (1,556 variables), a feat previously impossible for SGD-based PTNs which were often limited to roughly 22 variables.
  • Performance: LSF achieved Negative Log-Likelihood (NLL) scores competitive with state-of-the-art Probabilistic Circuits (like EiNet) and traditional Tensor Network methods, but with significantly better scaling properties.

Conclusion

By introducing a simple yet effective way to track logs of scale factors, LSF removes the traditional barriers to training Probabilistic Tensor Networks. It allows PTNs to be trained using standard deep learning optimizers, paving the way for their integration as layers within larger, end-to-end differentiable neural networks. Future work includes exploring adaptive rank methods to further enhance the flexibility of the LSF-SGD approach.

Summary updated

Abstract

Tensor networks (TNs) enable compact representations of large tensors through shared parameters. Their use in probabilistic modeling is particularly appealing, as probabilistic tensor networks (PTNs) allow for tractable computation of marginals. However, existing approaches for learning parameters of PTNs are either computationally demanding and not fully compatible with automatic differentiation frameworks, or numerically unstable. In this work, we propose a conceptually simple approach for learning PTNs efficiently, that is numerically stable. We show our method provides significant improvements in time and space complexity, achieving 10x reduction in latency for generative modeling on the MNIST dataset. Furthermore, our approach enables learning of distributions with 10x more variables than previous approaches when applied to a variety of density estimation benchmarks. Our code is publicly available at github.com/marawangamal/ptn.
BibTeX
@misc{hameed2025efficient,
  author = {Marawan Gamal Abdel Hameed and Guillaume Rabusseau},
  title = {{Efficient Probabilistic Tensor Networks}},
  year = {2025},
  eprint = {2510.00382},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.00382},
}
Figure