A model can become very good at explaining its training examples while becoming worse at explaining anything else. I find this tension especially interesting in probabilistic circuits: models whose structure makes many probability queries exact and efficient. We can trust the calculation without yet trusting the distribution it learned.
In Tractable Sharpness-Aware Learning of Probabilistic Circuits, we study this gap through the shape of the learning objective. Our question is whether a circuit's structure can help us recognize fragile solutions and steer learning toward less fragile ones.
This is joint work with Hrithik Suresh, Vishnu Shreeram M. P., Sriraam Natarajan, and Narayanan C. Krishnan. Hrithik and I contributed equally.
A good fit is not the whole story
A probabilistic circuit builds a distribution from simple pieces. Leaf nodes describe individual variables. Product nodes combine distributions over disjoint variable sets. Sum nodes mix alternatives. With the appropriate structural conditions, a question involving missing variables can be answered by evaluating the circuit rather than estimating a difficult integral.
That computational advantage does not remove the usual learning problem. A large circuit still has many parameters to estimate. With only a few observations, it can fit details that do not persist in the wider population.
We look at the negative log-likelihood, or NLL: the loss used to measure how well a model explains data. Lower is better. Imagine changing the model's parameters slightly and asking how much the loss changes. Near a sharp solution, a small change can have a large effect. Near a flatter solution, the same change has a smaller effect.
Here, the landscape is in parameter space. We are changing model weights, not moving an observation through input space. A narrow peak in a plotted probability density and a sharp optimum of the training loss are different objects.
Try the same small change
The illustration below offers a way to see that distinction. Compare two analytical toy loss curves using the same parameter displacement. Their curvatures stay fixed at 8 and 1 while you move the perturbation; compare the increase from each curve's zero-loss starting point.
Interactive illustration
The same perturbation, two different costs
Move one parameter displacement across two fixed toy loss curves. Both minima start at zero; their curvatures stay at 8 and 1.
Loss increase, from 0 to 3, on the same vertical scale.
- Sharp curve: loss increase
- 0.490
- Flat curve: loss increase
- 0.061
For any equal nonzero displacement, this sharp curve costs eight times as much. That ratio is built into the toy curves, not a result measured in the paper.
This is an educational illustration, not a reproduction of our experiments. It evaluates two fixed quadratic functions; it does not train a circuit or sample a dataset. A one-dimensional slice helps explain sensitivity, but it does not measure every direction in a real circuit's parameter space.
That last point matters. We need a quantity we can compute across the model, rather than relying only on an appealing picture.
Curvature without the whole matrix
The Hessian collects second derivatives of a function. Its diagonal measures curvature along individual parameter coordinates; its off-diagonal entries describe interactions between coordinates. Its trace is the sum of the diagonal entries.
Our key result concerns the circuit's sum-node weights. For a fixed observation and one such weight, hold the other weights and the leaf distributions fixed. The circuit likelihood is linear in that individual weight. This makes its second derivative zero, and gives a useful identity for the second derivative of its logarithm.
The log-likelihood diagonal is the negative square of the corresponding first derivative. Consequently, the positive curvature quantity we use—the absolute trace of the log-likelihood Hessian, equivalently the trace for NLL over these coordinates—can be written as:
The order here is important: compute the squared scores for each example, then add them. Squaring a gradient after averaging across examples is a different calculation.
Circuit flows provide these first derivatives through a forward and backward pass. We can therefore compute the trace exactly in time linear in circuit size and the number of examples, without constructing a full Hessian or sampling a stochastic trace estimate.
This statement uses the paper's direct sum-weight coordinates. It is not a claim about the Hessian in arbitrary neural parameters, leaf parameters, or softmax logits. Even a slider that changes two mixture weights together follows a different direction from a partial derivative that holds every other weight fixed.
Turning a measure into a learning rule
Once curvature is available, we can use it during learning. For gradient-based training, we add a weighted curvature penalty to NLL. The model must balance explaining the observations against settling into a highly sensitive solution.
We also study expectation-maximization, or EM, a common way to train circuits. Its usual update uses expected edge counts to adjust mixture weights. Directly adding the squared-score constraint leads to a cubic update equation.
To obtain a simpler rule, we instead use a related gradient penalty. The relevant scores are nonnegative, so controlling them provides a way to control their squares. This surrogate leads to a quadratic update with a nonnegative closed-form root. The implementation then normalizes the weights and uses running-average smoothing.
The distinction is worth keeping clear: an exact curvature identity does not make every subsequent optimization step exact. The simpler EM rule is a practical surrogate, not an algebraically identical replacement for the original squared penalty. The appendix also describes fixing the normalization multiplier and renormalizing in practice.
What the experiments tell us
We evaluated the approach on eight synthetic two- and three-dimensional manifold datasets and twenty standard binary density-estimation datasets. We used Einsum Networks with gradient-based training for the synthetic experiments, and PyJuice Hidden Chow-Liu Trees with EM for the binary benchmarks.
Within each comparison, the baseline and regularized model used the same architecture and experimental setup. We varied the fraction of available training data while keeping the held-out validation and test partitions fixed. Reported results average five independent trials, and regularization strength was selected using validation performance.
The strongest gains appeared where data were scarcest. At the 1% training fraction, the synthetic experiments reported an average 89.24% reduction in sharpness and 49.53% reduction in test NLL. On the binary benchmarks at that fraction, the average test-NLL improvement was 7.12%.
These are different collections of experiments, not interchangeable headline numbers. They are also relative changes in particular metrics, not percentages of predictions made correct.
The boundary of the result is informative too. At the 50% and 100% training fractions on the binary benchmarks, average test NLL became slightly worse: the reported improvements were −0.48% and −0.31%. Individual datasets also varied. Reducing curvature did not guarantee a better test score in every setting.
What I take from this
For me, the useful connection is between tractable inference and tractable learning diagnostics. Circuit structure gives us more than a fast probability calculation: it also exposes information about the geometry of the objective we optimize.
Our experiments support curvature regularization particularly in limited-data settings. They do not establish a universal guarantee that flatter solutions generalize better, or a guarantee under a changed test distribution. Sharpness is a local, coordinate-dependent proxy; held-out performance remains essential.
The paper's broader invitation is to use a model's structure when designing how it learns. If a circuit can reveal a useful learning signal exactly, we can ask what other decisions that signal might help us make.
Sources and further reading
Read the paper and supplementary material for the derivations, update rules, complete tables, and experimental settings. Full authors: Hrithik Suresh*, Sahil Sidheekh*, Vishnu Shreeram M. P., Sriraam Natarajan, and Narayanan C. Krishnan (*equal contribution).