cs.LGNov 24, 2026

Casper: A Projection-Based Neurosymbolic Layer for Scalable & Guaranteed Constraint Satisfaction

Authors: Lohith Konathala, Luca Andolfi, Eleonora Giunchiglia

Organizations: Imperial College London

Abstract

Many real-world problems demand exact constraint satisfaction to be meaningfully solved, yet existing neurosymbolic methods face a stark trade-off: those that guarantee satisfaction fail to scale, while those that scale must resort to approximation. Meanwhile, traditional deep learning approaches offer no satisfaction guarantees at all. In this paper, we propose Casper, a neurosymbolic layer that simultaneously (i) guarantees constraint satisfaction, (ii) scales at inference time, (iii) is fully automated, requiring no problem-specific engineering, and (iv) is fully differentiable, making it composable with any neural predictor both at training and at inference time. Casper casts constraint satisfaction as a closed-form Euclidean projection onto the constraint-feasible region, computable in a single forward pass. Experiments across MNIST arithmetic (up to 1024 digits), Sudoku solving, and Warcraft pathfinding show that Casper is the only method that produces guaranteed-valid outputs at scale: on 30×3030\times30 Warcraft grids, exact baselines time out and approximate ones produce valid paths less than 7% of the time, while Casper produces them 100% of the time.

Figures & tables

Appendix figures & tables11 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

Oct 3, 2026

Only Project Once: Projection-Adaptive Loss for Exact Constraint Satisfaction

Precise constraint satisfaction is a prerequisite to deploying learned models in many areas, motivating methods that repair raw neural predictions with a repair procedure. Current methods unroll multiple repair steps in training and softly penalize constraint violations that remain after the unroll. This is compute- and memory-intensive, lacks robustness when the repair fails to converge, and surrenders most of the constraint satisfaction work to the repair. Our central finding is that, contrary to common practice, a single detached projection step suffices in training. We accomplish this with a Projection-Adaptive Loss (PAL), which uses the constraint residual after this single step to adaptively weigh constraint penalties on the raw prediction. In experiments, PAL is the only method that retains virtually perfect feasibility on extremely nonlinear constraints, and matches or outperforms current methods on synthetic and engineering benchmarks. Because it only requires a single detached projection step, PAL trains 2.5x faster than the canonical repair-based method (DC3) on its own ACOPF benchmark. PAL can also be trained when constraints are expensive to evaluate (e.g., via neural surrogates), a setting where current unrolled methods are memory-intractable.
Mar 19, 2026

AS2 -- Attention-Based Soft Answer Sets: An End-to-End Differentiable Neuro-Soft-Symbolic Reasoning Architecture

Neuro-symbolic systems typically combine neural perception with discrete symbolic solvers, limiting end-to-end optimization. We introduce Attention-Based Soft Answer Sets (AS2^2), a fully differentiable neuro-symbolic architecture that replaces discrete solving with a continuous approximation of the Answer Set Programming (ASP) immediate-consequence operator TPT_P. AS2^2 maintains probability distributions over finite symbol domains and learns by minimizing the fixed-point residual of a probabilistic version of TPT_P, enabling differentiation through constraint checking without external solvers during training or inference. For spatial constraint-satisfaction tasks, AS2^2 replaces positional embeddings with constraint-group membership embeddings derived directly from declarative ASP specifications, making the model independent of arbitrary position indexing. On Visual Sudoku, AS2^2 achieves 99.89% raw cell accuracy and 100% constraint satisfaction after greedy decoding, without external solvers. On CLEVR-Hans, AS2 achieves 99.94% on CLEVR-Hans3 and 87.77% on CLEVR-Hans7. These results demonstrate that differentiable fixed-point reasoning, constraint-aware attention, and declarative constraint specifications can match or outperform pipeline-based and solver-based neuro-symbolic approaches while preserving end-to-end differentiability.
Feb 19, 2026

Differentiable Symbolic Planning: A Neural Architecture for Constraint Reasoning with Learned Feasibility

Neural networks excel at pattern recognition but struggle with constraint reasoning -- determining whether configurations satisfy logical or physical constraints. We introduce Differentiable Symbolic Planning (DSP), a neural architecture that performs discrete symbolic reasoning while remaining fully differentiable. DSP maintains a feasibility channel (phi) that tracks constraint satisfaction evidence at each node, aggregates this into a global feasibility signal (Phi) through learned rule-weighted combination, and uses sparsemax attention to achieve exact-zero discrete rule selection. We integrate DSP into a Universal Cognitive Kernel (UCK) that combines graph attention with iterative constraint propagation. Evaluated on three constraint reasoning benchmarks -- graph reachability, Boolean satisfiability, and planning feasibility -- UCK+DSP achieves 97.4% accuracy on planning under 4x size generalization (vs. 59.7% for ablated baselines), 96.4% on SAT under 2x generalization, and maintains balanced performance on both positive and negative classes where standard neural approaches collapse. Ablation studies reveal that global phi aggregation is critical: removing it causes accuracy to drop from 98% to 64%. The learned phi signal exhibits interpretable semantics, with values of +18 for feasible cases and -13 for infeasible cases emerging without supervision.