What is the Relationship between Tensor Factorizations and Circuits (and How Can We Exploit it)?

Lorenzo Loconte, Antonio Mari, Gennaro Gala, Robert Peharz, Cassio de Campos, Erik Quaeghebeur, Gennaro Vessio, Antonio Vergari

Abstract

This paper establishes a formal duality between tensor factorizations and probabilistic circuits, revealing that circuits are essentially sparse hierarchical tensor factorizations. By bridging these previously siloed fields, the authors introduce a modular "Lego block" framework for building efficient, GPU-friendly probabilistic models. The research introduces novel architectures like Quad-Graphs and compressed Canonical Polyadic (CP) layers, demonstrating significant improvements in scalability and performance across image and tabular datasets.

The Siloed Worlds of Tensors and Circuits

In machine learning, two distinct communities have historically addressed similar problems using different paradigms. The Tensor Factorization (TF) community focuses on decomposing massive multidimensional arrays into manageable components (e.g., Tucker or CP decompositions) for dimensionality reduction. Conversely, the Probabilistic Circuit (PC) community constructs deep computational graphs to represent complex probability distributions, ensuring that operations like marginalization remain mathematically tractable.

A probabilistic circuit (left) and its numerical evaluation (right), illustrating the structured computational graph used for tractable inference.

Despite their conceptual overlap, these fields remained disconnected. TFs were viewed as shallow mathematical tools, while PCs were seen as deep generative models. This paper addresses this gap by proving that a standard Tucker factorization is equivalent to a shallow circuit, while hierarchical factorizations correspond to deep circuits. This connection allows researchers to apply tensor optimization techniques to speed up circuits and use circuit structures to enhance the expressiveness of tensor models.

Methods: The "Lego Block" Framework

The authors establish a rigorous mathematical mapping between the two fields and propose a tensorized approach to model construction. Instead of building circuits node-by-node, they define four fundamental "Lego blocks"—Input, Hadamard Product, Kronecker Product, and Sum layers—that can be stacked to create Tensorized Circuits.

A shallow circuit representation of a tensor factorization, where sum and product nodes map directly to tensor indices and weights.

Key methodological innovations include:

  • Novel Architectures: The introduction of Quad-Graphs (QG) and Quad-Trees (QT), which partition data more efficiently than traditional methods, particularly for image data.
  • Compressed Layers: Replacing computationally heavy Tucker layers with CP layers and shared-parameter variants ($CP^S$, $CP^{XS}$). These use Canonical Polyadic decomposition to drastically reduce parameter counts while maintaining model expressiveness.
  • Unified Pipeline: A four-step process involving building a Region Graph, populating it with tensorized layers, "folding" layers for GPU parallelism, and optimizing via gradient descent.

Key Insights and Results

The researchers evaluated their framework on image datasets (MNIST, CelebA) and UCI tabular benchmarks. Several key insights emerged:

  1. Circuits as Sparse Tensors: A probabilistic circuit is effectively a blueprint for factorizing a massive, implicit probability tensor. The circuit's structure determines the factorization's efficiency.
  2. Scalability: The new QT and QG architectures proved significantly faster and more memory-efficient than industry standards like the Poon-Domingos structure. CP layers allowed for much larger hidden widths on standard GPU hardware compared to Tucker layers.
  3. Performance and Compression: The QG-CP-K architecture provided an optimal balance of accuracy and speed for images. Furthermore, the authors demonstrated that heavy models could be "distilled" into compressed CP-based versions with minimal loss in accuracy, often serving as a superior initialization for further training.
  4. High-Dimensional Success: On complex tabular data, simpler CP factorizations often outperformed complex Tucker layers, suggesting that simpler structures are easier for optimizers to navigate in high-dimensional spaces.

Conclusion and Future Work

By unifying tensor factorizations and probabilistic circuits, this work provides a powerful toolkit for efficient probabilistic modeling. While the framework currently supports continuous and discrete variables, future research will explore automated neural architecture search to optimize model structures and the integration of complex non-linear functions like normalizing flows into the tensorized context.

Summary updated

BibTeX
@article{loconte2025what,
  author = {Lorenzo Loconte and Antonio Mari and Gennaro Gala and Robert Peharz and Cassio de Campos and Erik Quaeghebeur and Gennaro Vessio and Antonio Vergari},
  title = {{What is the Relationship between Tensor Factorizations and Circuits (and How Can We Exploit it)?}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2025},
  url = {https://openreview.net/forum?id=ezRIbTaao9},
}
Figure