Neurosymbolic learning aims to combine the "perception" capabilities of neural networks with the rigorous "reasoning" of symbolic programs. For instance, a model might use a Convolutional Neural Network (CNN) to read handwritten digits and a Python program to sum them. To train the CNN using only the final sum as a label, the system must solve the Weighted Model Counting (WMC) problem: calculating the probability of every possible input combination that could lead to that specific sum.
The Scalability Bottleneck
The primary challenge in neurosymbolic learning is the exponential explosion of WMC. As the number of inputs grows, the number of possible combinations becomes astronomical. Traditional "white-box" methods (like logic programming) quickly hit a memory wall, while "black-box" methods (like sampling) suffer from high variance and slow convergence. Historically, this bottleneck has limited neurosymbolic tasks to a small handful of inputs, such as adding 4 or 10 digits.
The CTSketch Framework
To overcome these limitations, the authors introduce CTSketch, a novel framework that scales neurosymbolic models to problems with thousands of inputs—orders of magnitude larger than previous state-of-the-art methods. CTSketch relies on two core innovations:
- Program Decomposition: Instead of treating the symbolic program as one monolithic block, CTSketch decomposes it into a tree or chain of sub-programs. For example, a sum of 1,024 digits can be broken down into a binary tree of 2-digit addition modules.
- Tensor Sketching (TT-SVD): Each sub-program is represented as a tensor summary ($\phi$) that maps input distributions to output distributions. To prevent these tensors from becoming prohibitively large, the authors employ Tensor-Train Singular Value Decomposition (TT-SVD). This technique "sketches" a high-dimensional tensor into a product of small, low-rank "cores."
During inference, the model bypasses traditional logical reasoning. Instead, it performs a sequence of differentiable tensor-vector multiplications. This approach is highly efficient, fully differentiable, and runs natively on GPUs. The authors also provide a theoretical error bound, proving that the approximation error remains controlled even with significant compression.
Key Results and Insights
The researchers evaluated CTSketch on a diverse battery of benchmarks, including MNIST Sum (scaling up to $n=1024$), Multi-digit Addition (up to $n=100$), Visual Sudoku, Handwritten Formula (HWF) evaluation, and LLM-based reasoning tasks (Leaf & Scene Classification).
- Unprecedented Scale: CTSketch successfully trained a model on the
sum1024task. Most baselines (like Scallop or DeepSoftLog) timed out or ran out of memory at just $n=64$. - High Accuracy with Weak Supervision: On the 1,024-digit sum task, the neural predictor achieved 93.69% per-digit accuracy, despite only receiving supervision on the final total sum.
- Lightning-Fast Convergence: In the
add100task (adding two 100-digit numbers), CTSketch reached high accuracy in seconds, often converging before baseline methods could finish a single training epoch. - The "Low-Rank" Surprise: One of the most striking findings is that even for complex arithmetic, a very low approximation rank (e.g., $\rho=2$) is often sufficient. For the
sum1024task, a rank-2 sketch yielded a reconstruction error of less than $1e-5$. - Bridging the White-Box/Black-Box Divide: By using the structure of the program (white-box) but treating the components as differentiable summaries (black-box efficiency), CTSketch can handle external API calls—like prompting an LLM—which traditional logic-based frameworks struggle to incorporate.
Limitations and Future Directions
While CTSketch pushes the boundaries of neurosymbolic scalability, it has a few limitations:
- Manual Decomposition: Currently, users must manually define how to break the symbolic program into sub-programs. Future work could leverage automated program synthesis to discover these decompositions organically.
- Language Expressivity: CTSketch is designed for tensor-encodable tasks rather than serving as a general-purpose logic language. The target program must be representable as a composition of tensors.
- Streaming Sketches: The current implementation requires enumerating inputs to initialize the tensor. Adopting streaming tensor sketching could iteratively refine the sketches during training, further reducing the initial memory footprint.
Summary updated