TL;DR
CTSketch is a novel neurosymbolic learning algorithm that scales to problems orders of magnitude larger than previous methods by decomposing symbolic programs into tree structures and compressing them using tensor sketching. This approach enables fast, fully differentiable end-to-end training entirely through simple tensor operations on the GPU, successfully tackling tasks as massive as summing 1,024 handwritten digits from a single final label.
What Problem Does This Paper Address?
Neurosymbolic learning bridges the gap between neural networks (excellent at perception, like identifying digits) and symbolic programs (excellent at hard logic, like computing a mathematical formula). The goal is to train the neural network using only the final output of the combined system as supervision.
To do this, the system must solve the Weighted Model Counting (WMC) problem: calculating the probability distribution of the final symbolic output based on the probabilistic predictions of the neural network. However, exact WMC is computationally brutal. As the number of inputs grows, the state space explodes exponentially. Existing frameworks either time out due to this combinatorial explosion (white-box logic approaches) or suffer from slow convergence and low accuracy on large tasks (black-box sampling approaches).
Methods
The authors introduce CTSketch, which scales neurosymbolic inference using two core techniques:
- Program Decomposition: Instead of representing a massive symbolic program as one giant operation, CTSketch breaks it down into a tree structure of smaller sub-programs. For example, a program adding four digits ($sum_4$) is decomposed into two layers of two-digit additions.
- Tensor Sketching: The exact input-output relationship of each sub-program is summarized as a tensor. To prevent these tensors from growing too large, CTSketch applies Tensor-Train Singular Value Decomposition (TT-SVD). This compresses high-dimensional tensors into a product of low-rank "cores" with minimal reconstruction error.
During inference, CTSketch passes the neural network's probability distributions sequentially through these compressed cores. By performing simple matrix multiplications directly on the low-rank sketches, it avoids ever reconstructing the full giant tensors, keeping the computation fast and fully differentiable on GPUs.
Datasets
The framework was evaluated on a diverse set of neurosymbolic benchmarks:
- MNIST Sum ($sum_n$): Summing $n$ handwritten digits ($n \in \{2, 4, 6, 8, 10\}$), scaling up to $sum_{1024}$.
- Multi-digit Addition ($add_n$): Computing the sum of two $n$-digit numbers ($n$ up to 100).
- Visual Sudoku: Predicting whether a $4\times4$ or $9\times9$ board of images is a valid Sudoku grid.
- Sudoku Solving: Solving a $9\times9$ Sudoku puzzle where empty cells are represented by MNIST zeros.
- Hand-Written Formula (HWF): Evaluating handwritten mathematical expressions containing digits and operators.
- Leaf Identification & Scene Classification: Two tasks utilizing GPT-4 as a black-box symbolic reasoner to identify plant species or classify room types from predicted features.
Key Insights and Ideas
- Provable Error Bounds: Unlike neural-network-based approximation methods (such as A-NeSI) which lack guarantees, tensor sketching allows the authors to derive a strict theoretical bound on the maximum approximation error of the output distribution based on the SVD truncation error.
- The Power of Low Rank: Complex symbolic logic can often be compressed aggressively. For instance, in the $sum_{1024}$ task, a sketching rank of just $\rho = 2$ was sufficient to yield a reconstruction error of less than $1\times10^{-5}$ across all layers.
- Bypassing the Logic Engine: By translating the symbolic program entirely into tensor operations, CTSketch eliminates the need for external logic programming engines during training, allowing the entire pipeline to leverage standard GPU acceleration natively.
Key Results
CTSketch significantly pushed the boundaries of what neurosymbolic models can solve:
- Unprecedented Scale: CTSketch was the only method capable of solving the $sum_{1024}$ task, achieving a per-digit accuracy of 93.69% despite receiving supervision only on the final sum. All baseline methods failed or timed out at or before $sum_{256}$.
- Dramatic Speedups: On the $add_{15}$ task, CTSketch required an average of just 1.70 seconds per epoch. In comparison, the next fastest scalable baseline, IndeCateR, took 23.07 seconds, while DeepSoftLog required over 20 minutes per epoch.
Limitations and Future Work
The primary limitation of CTSketch is that it requires manual decomposition of the symbolic program into a tree of sub-programs. For highly intricate or unstructured tasks, designing this architecture by hand can be difficult or impractical.
To address this, the authors point to future work focused on automating this decomposition process using program synthesis techniques. Additionally, they suggest exploring streaming tensor sketching methods, which would iteratively update the compressed sketches rather than initializing them upfront, further reducing the initial memory footprint.
Summary updated