Consider a toy parcel-sorting problem. We have a small dataset containing parcel weights and whether a higher postage band applies. Suppose an expert gives us one rule: for the same delivery service, making a parcel heavier should not make the higher band less likely.
A model trained on a few examples might miss that pattern. Perhaps the observed parcels happen to leave a gap, or a few labels are noisy. The expert's rule gives us a way to guide learning where the examples alone leave room for many explanations.
This is the kind of problem we studied in A Unified Framework for Human-Allied Learning of Probabilistic Circuits, published at AAAI 2025. I worked on it with Athresh Karanam, Saurabh Mathur, and Sriraam Natarajan. Athresh, Saurabh, and I contributed equally.
The parcel example is a teaching illustration, not a dataset or application evaluated in our paper.
Another source of guidance
Learning from data asks a model to explain the examples it sees. Domain knowledge describes relationships we would like its distribution to respect, including relationships that the available examples may only weakly reveal.
For the parcel model, we can compare the probability of the higher band at two weights while holding the service fixed. If the heavier parcel receives a lower probability, the model violates the proposed rule.
Here, x_light and x_heavy denote the two weights, with x_heavy greater than x_light; c fixes the delivery service.
The rule does not provide the correct probability at every weight. It specifies an ordering. That leaves the data to help determine the shape of the distribution within the guidance we have supplied.
Why use probabilistic circuits?
A probabilistic circuit represents a joint probability distribution through mixtures, factorizations, and simple leaf distributions. With suitable structural conditions, we can evaluate marginal and conditional probabilities efficiently.
That ability is useful for learning from knowledge. Advice often concerns a probability: two situations should have similar likelihoods; one outcome should become more likely as an input increases; or one variable should stop adding information in a particular context.
The circuit gives these statements quantities we can calculate and differentiate. We can then measure how far its current distribution departs from them and adjust its parameters during learning.
Our paper focuses on parameter learning for a given circuit structure. The framework guides the distribution represented by that structure; it does not automatically redesign the structure to make every possible rule feasible. The problem formulation and constraint definitions describe this scope.
Turn advice into a measurement
The common ingredient in the framework is a measurable violation. A piece of knowledge becomes an equality or inequality involving tractable functions of the circuit's probabilities. A penalty records how much that relationship is violated.
An equality might ask for the same density before and after rearranging a set of points. An inequality might ask for one conditional probability to be at least as large as another.
We evaluate each constraint over a domain set: the situations or pairs of situations where it should apply. This part deserves care. A rule that makes sense for one context may be inappropriate elsewhere. In the parcel illustration, the fixed-service condition belongs in the rule's domain.
The framework can incorporate a range of advice when its violation has the required differentiable representation. The supplement's constraint and domain-set tables make those choices explicit.
Learning with a penalty
We combine the usual data-fitting objective with a penalty for violating the supplied knowledge. Written as a loss to minimize, its basic form is:
Here, θ denotes the model parameters, xₙ is an observed example, and V aggregates the measured constraint violations.
The first term rewards explaining the observed examples. The second gives the advice a role in parameter updates. The weight λ controls how strongly the current optimization emphasizes the penalty.
The paper's procedure starts from a data-trained model and increases the penalty weight over successive optimization stages. This gives a practical way to seek better agreement with the constraints. It also makes the tradeoff visible when the knowledge is inconsistent or cannot be represented perfectly by the chosen circuit.
For several pieces of advice, their penalties can be combined. The learning algorithm describes a staged procedure for incorporating them.
Try the tradeoff
Interactive illustration
A little advice, with a visible tradeoff
For one fixed postal service, suppose heavier parcels should be at least as likely to enter a higher price band. Our two toy observations disagree with that advice.
Probability of a higher price band
- Adjusted: lighter parcel
- 60.0%
- Adjusted: heavier parcel
- 50.0%
The remaining violation is 10.00 percentage points, compared with 30.00 points in the observations. The rule fits better, while the adjusted values move away from the observations.
We minimize J = (p₁ − 0.7)² + (p₂ − 0.4)² + λ max(0, p₁ − p₂)², where p₁ is the lighter parcel’s probability. Every finite λ here leaves a positive gap: this soft penalty reduces the violation without enforcing exact satisfaction.
The illustration uses two constructed observations: a 70% probability for the lighter parcel and 40% for the heavier one. We fit two adjusted probabilities with squared error, adding a squared penalty whenever the lighter parcel has the higher value. The controls show the exact minimizer of this small convex objective at each penalty weight.
Every finite weight in this example leaves a positive gap. The penalty reduces the violation without enforcing exact satisfaction. Its squared-error objective is chosen for explanation; it is not the paper's likelihood-based circuit training. The displayed data and lines are not reported experimental results or a postal pricing model.
The aim is to make the two sources of guidance legible. A small penalty can leave violations almost untouched. An overly strong one can overwhelm the data-fitting objective. The appropriate balance depends on the advice, the domain, and the model.
More than one kind of knowledge
The same setup accommodates several useful forms of advice.
- Symmetry: changing an irrelevant ordering should preserve the probability assigned to an example. Reordering points in a set is one such case.
- Context-specific independence: in a stated context, observing one variable should not change the conditional distribution of another.
- Monotonic influence: increasing an input should shift an outcome in a specified direction.
- Preferences and class-imbalance guidance: a model can be encouraged to respect probabilistic preferences or place greater emphasis on avoiding a particular kind of mistake.
The paper also describes synergy between variables and privileged information available during training. The latter needs a soft interpretation: forcing the prediction with and without an informative extra variable to agree exactly would erase the very contribution we hoped to use. The supplement discusses that qualification.
What the experiments showed
We evaluated the framework using RatSPN and EinsumNet, with the same model architectures for the constrained and data-driven comparisons. The experiments included Bayesian-network-generated data, UCI datasets, set-based image representations, a synthetic helix, and clinical study data.
The helix gives a particularly clear illustration. Training covered one turn of a noisy spiral; testing extended over two turns. A generalization constraint connected points separated by a full turn. It supplied a repeated relationship the model could use beyond the observed training region.
In Table 2, EinsumNet's mean test log-likelihood on this task changed from −5.1 ± 0.2 without the constraint to −2.7 ± 0.1 with it, across three trials. Higher log-likelihood means the model assigned greater probability density to the held-out observations. This result concerns the particular helix setup; it does not establish general extrapolation from arbitrary rules.
The set-based image experiments similarly used permutation invariance as guidance. The reported learning curves showed less overfitting in the evaluated constrained models. Clinical experiments assessed model fit on study data, rather than prospective improvements in patient care.
Room for imperfect advice
Expert knowledge can be incomplete, inconsistent, or appropriate only within a limited context. Constraint evaluation may also use a sampled subset of the possible situations. Satisfying those sampled constraints does not establish universal compliance.
The paper provides a convergence statement under additional conditions, including determinism and feasibility. General neural parameter optimization with finite training does not inherit an unconditional guarantee of finding a globally correct model.
For me, the useful possibility is a more explicit conversation between what the data suggests and what people know. We can state the guidance, inspect its violations, and evaluate whether incorporating it helps in the setting at hand.
Sources and further reading
The full paper and supplement, AAAI record, and authors' implementation provide the formal definitions and experimental details.