# Where to Approximate in Neurosymbolic Inference?

Tensor train recompression makes approximate neurosymbolic inference far more accurate

Samy Badreddine, Emile van Krieken, Luciano Serafini, Antonio Vergari · arXiv · 2026-11-10

- **Problem** Exact weighted model counting is #P-hard, so neurosymbolic methods approximate it by assuming factors are independent. That assumption ignores shared variables and can be arbitrarily wrong.
- **Method** APRICOT approximates each factor as a tensor train, multiplies factors exactly, and recompresses their products with SVD or interpolation. Only the final combination of a few circuits assumes independence.
- **Results** On Sudoku, arithmetic and scene tasks, APRICOT C's estimates are orders of magnitude more accurate than prior fuzzy independence reduction, and it scales past the SDD compiler on three tasks.

## Why exact counting gets stuck

Probabilistic NeSy systems pair a neural perception model with symbolic constraints, so inference asks how likely the predicted concepts are to satisfy the constraint. That probability is a weighted model count, and computing it exactly is #P-hard in general. A practical route compiles the constraint into a logical circuit and the neural distribution into a probabilistic circuit.

Those circuits can then be multiplied and summed to give the exact WMC, provided they have the required structural properties.

The 9×9 Sudoku rules decompose into N = 810 factors, each checking a pairwise constraint between two cells.

Many NeSy methods therefore approximate the WMC rather than compute it exactly. A common choice is the independence approximation, which assumes the factors are independent even when they share variables. Under that assumption, the WMC of a conjunction factorizes into the product of the factor WMCs. The approximation is only correct when the factor scopes are pairwise disjoint.

In general the scopes overlap, and the approximation can be arbitrarily bad.

The field lacked a systematic answer to where and when such an approximation should enter a pipeline. The paper addresses this gap by splitting bottom-up compilation into three stages where approximations can enter. Its stages cover compiling each factor, multiplying factors, and combining the remaining factors under independence. Approximating the factors themselves, rather than only the final product, is the route the paper develops next.

## Approximating factors instead of only the product

The paper splits bottom-up compilation into three stages: compiling each factor, multiplying factors until K remain, and combining the rest under an independence assumption. Figure 1 shows how existing methods fill these stages, and where the new APRICOT pipelines sit. Stages I and II were far less explored than the independence step, even though that step is common in practice.

The authors instantiate stages I and II with tensor train decompositions, which were used in NeSy only to approximate isolated factors.

![Figure 1: Where can we approximatewhen compiling structured-decomposable circuits? We unify bottom-up approaches in a three-step pipeline:(Step I)compiles each…](https://refivu.com/papers/74587851-411d-4452-aa81-05d587b5de7d/figures/figure-d6cf61de73dc770a76ac5408969fffe7.png?thumb=512)

**Figure 1** :Where can we approximatewhen compiling structured-decomposable circuits? We unify bottom-up approaches in a three-step pipeline:(Step I)compiles each factor ϕj into an exact or relaxedcircuit,(Step II)multiplies the resulting N circuits down to K exactlyor usingrecom- pression strategies, and(Step III)combines any K \>1 remaining circuits with anindependence (fuzzy) approximation. Existing methods correspond to specific combinations of exact or approximate operations, but the framework also allows for new TT-based APRICOT strategies yet to be explored.

[Original paper](https://arxiv.org/abs/2611.13862v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Samy Badreddine, Emile van Krieken, Luciano Serafini, Antonio Vergari · Where to Approximate in Neurosymbolic Inference? · Original paper figure · Extracted the figure area from page 2 of the original PDF.

The key idea is to approximate each factor as a tensor train (TT), which keeps the structure needed for tractable multiplication. A factor's approximated circuit doesn't encode a Boolean function; it approximates the factor up to an ϵ-error. The authors expect this to help because dependencies between factors are multiplied in before the independence step, instead of being dropped.

Single-factor compression isn't enough, because products of approximated factors still grow exponentially.

Recompression uses TT-ROUND and HATT, which truncate with SVD-style steps, or TCI and RSI, which use interpolation. HATT projects the Hadamard product against a TT sketch and applies SVDs only on small sketched matrices. TCI interpolates the product at a small set of chosen entries, without forming a Kronecker core or an SVD on a full unfolding.

RSI sketches each input TT independently with a Khatri-Rao product sketch, then uses interpolative decompositions instead of SVDs. The SVD-based strategies were more reliable than the interpolation-based ones in the Sudoku ablation.

The paper calls the resulting pipelines APRICOT, and the variants differ in which steps are exact and which are recompressed. APRICOT A uses PREMUL and TT-SVD, with MUL in Step II and INDEP in Step III. APRICOT C keeps recompressed multiplication in Step II but drops the independence step, so it has no INDEP column.

## How an APRICOT pipeline runs

An APRICOT pipeline starts from N factors and ends with K circuits, and its first step decides which small factors to multiply densely. The grouping is cast as a hypergraph partitioning problem, where each variable creates a hyperedge that links the factors whose scopes contain it. Minimizing the number of cut hyperedges keeps factors that share variables together, which implements the dependency objective.

Each factor gets a conservative weight equal to the log of the product of its variable sizes, because the exact dense size of a group is not additive. The resulting dense tensors are then converted to tensor trains with an initial TT-SVD, whose rank is one of the settings varied in the ablation.

Step II pairs circuits until K remain, and the pairing order decides which dependencies are captured before the approximation stops. When a product is too large, it is recompressed under a maximum rank R, which the truncation algorithms enforce. Compilation halts when the accumulated Frobenius error bound exceeds a chosen tolerance.

The K remaining circuits are then combined under the independence approximation, so the estimate is the product of their individual WMCs. Stopping at K greater than 1 is where the approximation budget is spent, because the dependencies between those K groups are ignored. Each choice in Step II therefore trades exactness of the captured dependencies against the size of the intermediate tensors.

Tensor network contraction usually runs to completion, so the APRICOT schedule must also account for where it stops.

## Sudoku compilation results

The Sudoku ablation uses 4×4, 6×6 and 9×9 boards, because their model counts can be derived analytically and checked. The 4×4 board works as a sanity check, since both exact SDD compilation and suitable TT configurations recover its count to numerical precision. The 6×6 board compiles only with d4, a non-structured-decomposable compiler, and not with SDDs.

For the 9×9 board, the authors know of no existing compiler that solves it, and the 6.67×10 21 valid configurations serve as the reference count.

The error is the absolute log10 ratio between the estimated and ground-truth model count, so zero means an exact count. Applying the independence step to a plain SDD pipeline gives an estimate of approximately zero, which the authors call hardly usable. The fuzzy estimates depend on the encoding, so matching the number of final circuits K doesn't give matching behaviour between SDD and APRICOT.

Multiplying factors exactly before the independence step always improves fidelity significantly.

Recompression during multiplication gives the strongest accuracies in the ablation. SVD-based strategies are more reliable than interpolation-based ones, with no significant difference between randomization strategies. To separate count accuracy from constraint fidelity, the authors compute average precision on 1000 model and 1000 non-model Sudoku samples.

On 9×9, some points reach good aggregate error after much recompression but miss the actual models, so the authors favour halting on the accumulated Frobenius error bound.

## Weighted inference on arithmetic and CLEVR

The authors ask whether the compilation strategies stay effective when the circuits are queried with weights. They compare each circuit estimate against an exact compilation or a task-specific exact reference, across 64 shared random weightings. For each weighting, they take the absolute base-10 log-ratio between estimated and reference WMC, then report the median of those 64 errors.

Compilation time is plotted next to these medians, so accuracy and cost appear together in Figure 4. They read the error as a scale: an error of 1 means the estimate is typically off by a factor of 10. Figure 4 covers the four tasks, CLEVR-Diff, MNISTAdd, MNISTMul and CountDiff, across their problem sizes.

![Figure 4: Median absolute log WMC error and compilation time across tasks and problem sizes. Exact SDD compilation becomes infeasible on harder problems. Full…](https://refivu.com/papers/74587851-411d-4452-aa81-05d587b5de7d/figures/figure-e521313515507986a598a2b1499653ae.png?thumb=512)

**Figure 4** : Median absolute log WMC error and compilation time across tasks and problem sizes. Exact SDD compilation becomes infeasible on harder problems. Full TT reduction (APRICOT C) can scale further while producing estimates orders of magnitude more accurate than fuzzy.

[Original paper](https://arxiv.org/abs/2611.13862v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

On MNISTAdd, both SDDs with a suitable vtree and APRICOT scale with the number of digits. They scale this way because both exploit the carry-chain structure of the addition. On the harder tasks, CLEVR-Diff, MNISTMul and CLEVR-CountDiff, the exact SDD compiler becomes infeasible and runs out of memory. APRICOT C keeps scaling beyond the SDD compiler on these three tasks.

Independence reduction is cheap, but it drops the dependencies between factors and loses inference fidelity. TT recompression keeps those dependencies approximately, in a representation that stays manageable. The authors present this trade-off as the practical reason to use TT recompression.

## Learning: when dependencies matter

Learning is scored by concept accuracy, the fraction of individual concepts predicted correctly, and by output accuracy, which is a per-instance exact match. Output accuracy needs every part of the output to be right, so it can fall with problem size even when individual concepts stay accurate. For ViSudo-Classification and both CLEVR tasks, the authors measure concept accuracy up to a permutation, because the exact concepts aren't identifiable from the label signal.

On Visual Sudoku and CLEVR-Diff, independence reduction is competitive, with all baselines achieving close to 99% concept accuracy. That leaves little room for improvement, so these tasks don't separate the methods. On the arithmetic programs and CLEVR-CountDiff, preserving dependencies improves learning. Exact compilation and APRICOT C preserve agreement between factor computations and vastly outperform the fuzzy baseline.

The gap doesn't follow the domain: CLEVR-Diff and CLEVR-CountDiff differ in it, which points to the constraint structure.

![Figure 5: Concept and output accuracy across tasks and problem sizes. APRICOT matches exact compilation when the latter is feasible, and outperforms fuzzy in l…](https://refivu.com/papers/74587851-411d-4452-aa81-05d587b5de7d/figures/figure-bf09248dab05a67a1f4bb5d9e9f3f750.png?thumb=512)

**Figure 5** : Concept and output accuracy across tasks and problem sizes. APRICOT matches exact compilation when the latter is feasible, and outperforms fuzzy in larger regimes.

[Original paper](https://arxiv.org/abs/2611.13862v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

The authors hypothesize that the difference comes from auxiliary symbolic variables introduced by the factorization. In MNISTAdd, each position k has a factor over the input digits A\_k and B\_k, the output digit Y\_k, and the carries. The factor is A\_k + B\_k + C\_{k-1} = Y\_k + 10 C\_k, so a carry links two adjacent positions. Joint marginalization forces the two factors sharing a carry to agree on its value.

Independent marginalization can allow inconsistent carries, which weakens the supervised signal from Y\_k to A\_k and B\_k.

Some error bars are wide because of optimization failures rather than average behavior. On arithmetic, nearly half of the fuzzy seeds fail in the same way. The authors say task-specific tuning may reduce these failures, and the aggregate results still support the trends.

## Limitations and open questions

The authors say the approximations stop being reliable on sparse Boolean tensors, because most TT decompositions and recompressions aren't tailored to that regime. TCI and RSI are named as the clearest examples, and the authors leave methods for that regime to future work. Sudoku was only compiled up to 9x9, and the 9x9 board is unsolved by any existing compiler.

The 6x6 board is only compilable with d4, since SDDs can't handle it, so the exact-compilation evidence thins out quickly with size.

The learning evidence covers two Visual Sudoku tasks and four tasks built on arithmetic and CLEVR programs. Each of these results is averaged over ten runs, with error bars for standard deviation. The CLEVR tasks reuse scenes from Stammer et al., and the arithmetic and distinct-counting programs introduce auxiliary symbolic variables. The authors don't test whether the learning pattern holds on other programs, so that stays open.

They also suggest a future study of how program factorization, particularly auxiliary-variable structure, affects gradient-based learning beyond compiled NeSy methods.

## Paper info

- **Authors**: Samy Badreddine, Emile van Krieken, Luciano Serafini, Antonio Vergari
- **Venue**: arXiv · Preprint
- **First published**: 2026-11-10
- **Added**: 2026-11-11
- **Updated**: 2026-11-10
- **Version**: v1
- **arXiv**: 2611.13862
- **Category**: cs.LG
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info, commentary and permitted figures from the original paper

[Original paper ↗](https://arxiv.org/abs/2611.13862v1) · [PDF ↗](https://arxiv.org/pdf/2611.13862v1)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Abstract

Probabilistic neurosymbolic methods rely on weighted model counting (WMC) to combine neural predictors with symbolic constraints. Exact WMC is #P-hard and typically scales poorly, so many methods resort to approximations. By unifying existing approaches under a three-step bottom-up approximate compilation pipeline, we study where approximation budget is best allocated. Inspired by tensor networks, we instantiate two steps with tensor train decompositions and derive new pipelines that exactly multiply approximated factors and recompress their products via SVD- or interpolation-based schemes. Across six tasks in Sudoku, arithmetic reasoning, and scene understanding, and across increasing problem sizes, our pipelines produce WMC estimates orders-of-magnitude more accurate than prior methods. This translates into stronger downstream learning on tasks where reasoning relies on tight interactions between symbolic factors, where cruder approximations ignore these dependencies. Our pipelines open novel design space for effective approximate compilation of challenging probabilistic reasoning tasks.

## Quote from the paper

Samy Badreddine, Emile van Krieken, Luciano Serafini, Antonio Vergari (2026). Where to Approximate in Neurosymbolic Inference?. arXiv:2611.13862v1. https://arxiv.org/abs/2611.13862v1

**BibTeX**

```
@misc{badreddine2026where,
  title = {{Where to Approximate in Neurosymbolic Inference?}},
  author = {Samy Badreddine and Emile van Krieken and Luciano Serafini and Antonio Vergari},
  year = {2026},
  eprint = {2611.13862},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.13862v1}
}
```

## Other paper commentary

- [The RSI Tax: When Recursive Self-Improvement Is Not Worth the Cost](https://refivu.com/en/papers/27ca4d33-7272-4984-ad0f-113af313d3b6-the-rsi-tax-when-recursive-self-improvement-is.md)
- [The AI Era's Lines of Code? A Case Study on What an Engineer's Token Spend Measures](https://refivu.com/en/papers/39d25821-8637-434b-a777-c0a0904348ea-the-ai-era-s-lines-of-code-a.md)
- [Counting Under Disagreement: Dollar-Weighted Measurement, Selective Machine Labelling and Budgeted Human Review from Disagreeing AI Readers of Administrative Text](https://refivu.com/en/papers/af261e08-56f4-4c82-95e0-57ec1ecf0304-counting-under-disagreement-dollar-weighted-measurement.md)
- [Near-Optimal Sample Complexity of Deterministic Agnostic PAC Learning](https://refivu.com/en/papers/39c5e4f6-4a92-4c1d-b07b-0e6ecad3cdc4-near-optimal-sample-complexity-of-deterministic-agnostic-pac.md)
- [RadRef: A Reference-Free Metric for Radiology Report Generation](https://refivu.com/en/papers/c021bdd5-9b56-4971-9197-cb24eda10255-radref-a-reference-free-metric-for-radiology-report.md)
- [Programming Prescience: Issues in Human Construction of Forecasting Bots](https://refivu.com/en/papers/34469e6b-3cef-4c1e-b57c-1b0537e2c995-programming-prescience-issues-in-human-construction-of.md)
- [PARDIG: Global Precipitation Estimates Learned from Sparse Satellite Observations](https://refivu.com/en/papers/8108ee23-08a5-4bd5-974b-58000b1daa2b-pardig-global-precipitation-estimates-learned-from-sparse.md)
- [Optimal Last-Iterate Bounds for Nonexpansive Stochastic Approximation](https://refivu.com/en/papers/4ba112d6-e289-4a95-8d3e-1b5aca564d84-optimal-last-iterate-bounds-for-nonexpansive-stochastic.md)
- [Benchmarking LLM Next-Step Recommendations with Knowledge Space Theory](https://refivu.com/en/papers/c00fbc04-958e-425f-ab35-8f16a51c4a0a-benchmarking-llm-next-step-recommendations-with-knowledge.md)
- [Closing the BF16-FP16 Convergence Speed Gap in RL Post-Training with Stochastic Rounding](https://refivu.com/en/papers/f9fb9b28-f396-4ff4-ba93-e6dfad9e0f45-closing-the-bf16-fp16-convergence-speed-gap-in.md)
- [Pair-Merge Tokenisation Is Hard to Approximate on Binary Strings and Strongly NP-Hard on Unary Datasets](https://refivu.com/en/papers/7b59982c-1b8e-455b-a8a8-a893b6f95b07-pair-merge-tokenisation-is-hard-to-approximate-on.md)
- [How Post-Training Influences Verbalized Algorithmic Computation in Language Models](https://refivu.com/en/papers/c2f0c796-ac4e-4e6c-bad7-290457e1c07c-how-post-training-influences-verbalized-algorithmic.md)

## Terms in this paper

- [Average Precision](https://refivu.com/en/terms/1764eaa249a6-average-precision)
- [DeepProbLog](https://refivu.com/en/terms/b520512d0dca-deepproblog)
- [MNISTAdd](https://refivu.com/en/terms/475ad3e1479a-mnistadd)
- [SDD](https://refivu.com/en/terms/bb43d25c358c-sdd)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/74587851-411d-4452-aa81-05d587b5de7d-where-to-approximate-in-neurosymbolic-inference)
