Tractable Sharpness-Aware Learning of Probabilistic Circuits

Hrithik Suresh, Sahil Sidheekh, Vishnu Shreeram M. P, Sriraam Natarajan, Narayanan Chatapuram Krishnan

TL;DR

Deep Probabilistic Circuits (PCs) are powerful generative models capable of exact inference, but they are highly prone to overfitting when data is scarce. This paper demonstrates that the trace of the Hessian—a reliable proxy for loss-landscape sharpness—can be computed exactly and in linear time for PCs, unlike in deep neural networks where it is intractable. By minimizing this trace, the authors introduce a tractably sharpness-aware learning framework that steers optimization toward flatter minima, significantly boosting generalization.

What Problem Does This Paper Address?

Probabilistic Circuits (PCs) are a class of generative models celebrated for their ability to compute exact probabilities for complex queries (like marginals or conditionals) tractably. To handle real-world complexity, recent research has focused on making PCs deeper and more expressive, scaling them to millions of parameters.

However, much like deep neural networks (DNNs), these massive PCs suffer from severe overfitting when trained on limited or noisy data. From a geometric perspective, standard training algorithms often guide the model into narrow, sharp basins in the loss landscape. These sharp minima fit the training data perfectly but generalize poorly to unseen data.

While the deep learning community uses Sharpness-Aware Minimization (SAM) to find flatter regions, doing so requires expensive approximations because computing second-order derivatives (the Hessian matrix) is intractable for DNNs. This paper addresses the challenge of leveraging the unique structural properties of PCs to compute and optimize curvature information exactly and efficiently.

Methods

The authors explore the geometry of the PC log-likelihood landscape and introduce a Hessian-trace regularizer. Their technical approach unfolds in three main steps:

  1. Exact Hessian Derivation: They prove that for tree-structured PCs, the full Hessian matrix can be computed in closed form. For general directed acyclic graph (DAG) structured PCs, they show that while off-diagonal elements suffer from a combinatorial path explosion, the diagonal elements remain perfectly tractable.
  2. Linear-Time Trace Computation: Because the trace of a matrix is simply the sum of its diagonal elements, the authors show that the absolute Hessian trace for any PC simplifies to a clean sum of squared partial derivatives (circuit flows). This can be computed in a single forward-backward pass, scaling linearly ($O(|P||D|)$) with the number of parameters and dataset size.
  3. Sharpness-Aware Optimization: They integrate this trace penalty into both gradient-based learning (e.g., Adam) and Expectation-Maximization (EM). For EM, a direct formulation yields an unstable cubic update equation. To solve this, the authors elegantly reformulate the objective into a gradient-norm minimization problem, resulting in a stable, closed-form quadratic parameter update.
Visualization of the loss landscape flattening near converged parameters

Datasets

The authors evaluated their method across two distinct categories of datasets, evaluating models at various training-set fractions (1%, 5%, 10%, 50%, and 100%) to simulate data scarcity:

  • Synthetic Manifolds: 8 low-dimensional 2D and 3D datasets (including Spiral, Pinwheel, Helix, and Two Moons) used to visualize loss landscapes and verify mathematical exactness against PyTorch's autograd.
  • Real-World Benchmarks: The standard suite of 20 binary density estimation datasets (ranging from smaller domains like nltcs and msnbc to large ones like ad with 1,556 variables).

Key Insights and Ideas

  • The Tractability Synergy: The very structural constraints (smoothness and decomposability) that make PCs tractable for probabilistic inference also unlock the tractability of exact second-order geometric information.
  • The Gradient-Norm Surrogate Trick: Directly optimizing the Hessian trace in EM is computationally messy due to cubic equations. However, because PC gradients are strictly non-negative, minimizing the gradient norm acts as a perfect monotonic surrogate for minimizing the trace, simplifying the math into a clean quadratic form.
  • Linear vs. Exponential Scaling: While automatic differentiation (autograd) tools experience an exponential runtime explosion as a network's depth increases, the authors' custom sum-of-squared-gradients formula scales strictly linearly, making it practical for deep architectures.
Hessian trace computation time vs model depth

Key Results

  • Substantial Generalization Gains: In extreme data-scarce settings (1% of training data), the regularizer cut overfitting by up to 65%, flattened the loss surface by 89%, and boosted test log-likelihood by up to 49% for Einsum Networks on synthetic data.
  • Real-World Impact: On the 20 real-world binary benchmarks using PyJuice architectures at 1% data, the sharpness-aware EM algorithm delivered an average 7% improvement in test negative log-likelihood (NLL) and an 8% reduction in overfitting.
  • Landscape Flattening: Qualitative visualizations (as seen in Figure 1) confirm that standard training drops into sharp, narrow valleys, whereas the regularized model consistently settles into broad, flat minima.

Limitations and Future Work

The primary limitation acknowledged is that the regularizer's benefits diminish and eventually plateau as the volume of training data increases. At 100% data capacity, the authors even noted a marginal performance drop (<0.5% test NLL) in some scenarios, because the regularizer can unnecessarily push parameters away from a sufficient, naturally well-generalized optimum.

For future work, the authors suggest investigating whether PC loss landscapes contain "asymmetric valleys" (similar to those found in DNNs), developing a more robust theoretical framework for over-parameterized PCs, and designing alternative optimization strategies that exploit other forms of tractable second-order geometric information.

Summary updated

BibTeX
@inproceedings{suresh2026tractable,
  author = {Hrithik Suresh and Sahil Sidheekh and Vishnu Shreeram M. P and Sriraam Natarajan and Narayanan Chatapuram Krishnan},
  title = {{Tractable Sharpness-Aware Learning of Probabilistic Circuits}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i30.39771},
}
Figure