TL;DR
A-NeSI (Approximate Neurosymbolic Inference) overcomes the scalability "wall" of probabilistic neurosymbolic learning by replacing exact, exponential-time symbolic reasoning with efficient neural approximations. By training these neural inference models on synthetic data generated from background knowledge, A-NeSI enables neurosymbolic systems to solve combinatorially complex tasks—like 9x9 visual Sudoku or 15-digit addition—that were previously computationally impossible.
What Problem Does This Paper Address?
The field of Probabilistic Neurosymbolic Learning (PNL) aims to combine the perceptual power of deep learning with the rigorous reasoning of symbolic logic. However, existing frameworks like DeepProbLog suffer from a massive scalability bottleneck: they rely on exact inference methods, specifically Weighted Model Counting (WMC).
WMC is #P-hard, meaning the time required to solve a problem grows exponentially with its complexity. For example, in a task like "MNISTAdd" (summing two handwritten numbers), increasing the number of digits from 1 to 15 increases the number of possible "worlds" to check from a few hundred to over $10^{15}$. Traditional PNL methods simply time out or run out of memory long before reaching this scale. A-NeSI aims to bridge this gap by providing a polynomial-time approximation that retains logical guarantees and explainability.
Methods
A-NeSI introduces a framework where the expensive symbolic reasoning step is approximated by two specialized neural networks:
- The Prediction Model ($q_\phi$): Approximates the probability of an output given a "belief" (the perception network's output).
- The Explanation Model ($q_\psi$): An optional model that identifies which symbolic "worlds" (e.g., specific digit assignments) best explain a given prediction.
Key Innovations: * Training on the Prior: Instead of relying solely on real-world training data, A-NeSI uses a "belief prior" to generate massive amounts of synthetic data. It samples random beliefs, uses the symbolic background knowledge to compute the correct output, and trains the inference models on these pairs. This allows the models to learn the "logic" of the problem offline. * Joint Matching Loss: Inspired by GFlowNets, the authors use a novel loss function to ensure the prediction and explanation models are consistent with each other and the underlying logic. * Symbolic Pruning: To ensure safety and logical validity, A-NeSI can use a "symbolic pruner." This component uses the background knowledge to zero out impossible paths during inference, guaranteeing that the model never predicts a logically inconsistent result.
Datasets
The authors evaluated A-NeSI on three challenging benchmarks designed to test combinatorial scaling:
- Multi-digit MNISTAdd: Summing two handwritten numbers with up to $N=15$ digits.
- Visual Sudoku Puzzle Classification: Identifying if a grid of MNIST digits constitutes a valid Sudoku ($4 \times 4$ and $9 \times 9$ grids).
- Warcraft Visual Path Planning: Predicting the shortest path across a map based on visual terrain costs ($12 \times 12$ and $30 \times 30$ grids).
Key Insights and Ideas
- Complexity Class Shift: By moving from exact WMC to neural approximation, the authors shift the reasoning complexity from exponential to polynomial. This is the primary driver of A-NeSI's scalability.
- Decoupling Perception and Reasoning: A-NeSI effectively decouples the learning of the perception model from the reasoning model. The reasoning model can be pre-trained or co-trained using synthetic data, which makes the overall training process much more robust.
- Safety is Not a Performance Tax: The experiments demonstrate that adding symbolic constraints (via the pruner) to ensure logical correctness does not degrade predictive accuracy; in fact, it often helps by narrowing the search space.
Key Results
- Exponential Scaling: A-NeSI successfully solved the 15-digit MNISTAdd task. For comparison, exact methods like DeepProbLog and DeepStochLog timed out at just 4 digits.
- Inference Speed: As shown in Figure 4, A-NeSI's inference time scales nearly linearly with problem size, whereas exact methods exhibit a vertical explosion in time.
- Sudoku Mastery: A-NeSI was the only method tested capable of performing better than random on $9 \times 9$ visual Sudoku puzzles, a task where exact inference methods failed to even compile the necessary logical circuits.
- Path Planning: On $30 \times 30$ Warcraft grids, A-NeSI significantly outperformed pure neural baselines, finding much shorter paths by leveraging its symbolic understanding of the grid structure.
Limitations and Future Work
- The "No Free Lunch" Theorem: While scalable, A-NeSI is an approximation. At the extreme scale of 15 digits, there was a slight drop in accuracy compared to the theoretical reference, suggesting the neural prediction model hadn't perfectly mastered the logic.
- Prior Sensitivity: The method's success depends heavily on the "belief prior." If the prior doesn't sufficiently cover the distribution of beliefs encountered during real-world testing, the approximation may fail.
- Future Directions: The authors suggest exploring more complex priors (like normalizing flows) for highly dependent variables and applying A-NeSI to less structured symbolic functions where the "logic" is harder to factorize.
Summary updated