Paper commentary
Dolphin: A Programmable Framework for Scalable Neurosymbolic Learning
Dolphin runs neurosymbolic programs on the CPU and GPU together
- Problem Neurosymbolic frameworks slow down as symbolic programs grow, because they either run the symbolic logic on the CPU without batching or keep it on the GPU and run out of memory. Each option trades one bottleneck for another.
- Method Dolphin keeps each symbol as a Python object on the CPU and stores each probability as a batched PyTorch tensor on the GPU. Unlike earlier frameworks, the symbolic code can call arbitrary Python functions while the probability math stays batched.
- Results On SumN-15, Dolphin converged in 157.05 seconds, while Scallop needed 7.41e3 seconds, a factor of 47.18.
Why symbolic reasoning stalls on the CPU
Neurosymbolic programs pair a neural model with a symbolic program that reasons over the model's outputs. The symbolic side tracks every possible result and its weight, so the work grows exponentially as the program gets more complex. The paper calls the symbolic manipulations L and the probability tracking P. Deep learning usually copes with this by batching across samples.
Frameworks differ in how much of the symbolic work they batch on the GPU.
LTN keeps logits and discrete symbols as tensors on the GPU, so it batches both L and P there. This makes it highly performant on smaller tasks such as MNIST SumN. LTN takes around 90 seconds to converge for N= 5. LTN runs out of memory because the symbols and their probabilities must be grounded on the GPU.
Scallop and DeepProbLog run the neural models on the GPU but execute L and P on a separate CPU backend. This avoids GPU memory limits, but the lack of batched computation on the CPU slows training as complexity grows. Scallop needs around 15 minutes to converge for N= 5. At N= 10 and N= 15, Scallop needs around 1 and 2 hours to converge. Each option trades one bottleneck for another, which is the gap DOLPHIN targets.
Symbols on the CPU, tags on the GPU
DOLPHIN keeps each symbol as an ordinary Python object and each probability as a PyTorch tensor on the GPU. Symbolic steps run over the Python objects on the CPU, while the probability work runs over batched tensors on the GPU. In Figure 1, both the neural models and the symbolic program are written as PyTorch modules. Only the probabilistic computations (P) are vectorized on the GPU, whereas the symbolic computations (L) execute on the CPU.
Because the two parts are decoupled, the symbolic code can call arbitrary Python functions while the tag math stays on the GPU.

Figure 1 : Illustration of the execution of a neurosymbolic program for the kinship reasoning task CLUTRR. While existing neurosymbolic frameworks run the neural models on the GPU, they run the symbolic program entirely on either the CPU (e.g. Scallop) or the GPU (e.g. Logic Tensor Networks), rendering them inefficient in terms of compute and memory, respectively. In DOLPHIN, both neural models and symbolic programs are specified as PyTorch modules, but only probabilistic computations (P) are vectorized on GPU whereas symbolic computations (L) execute on CPU.
Original paper · CC BY 4.0 · Aaditya Naik, Jason Liu, Claire Wang, Amish Sethi, Saikat Dutta, Mayur Naik, Eric Wong · Dolphin: A Programmable Framework for Scalable Neurosymbolic Learning · Original paper figure · Extracted the figure area from page 1 of the original PDF.The programmer wraps a network's logits in a Distribution, which pairs a set of candidate symbols with a batch of tags. In the SumN program, each CNN output becomes a Distribution over the digits 0 to 9. The apply function then adds these Distributions one at a time, storing each result back into D res. The logits enter the Distribution directly, so the tags stay connected to the network's outputs.
The tags are tensors that keep their gradients, so backpropagation reaches the network through the whole symbolic program. Each Distribution carries its gradients and metadata alongside the batch of logits. Training uses the probabilities of the output symbols in a loss, which lets the network learn from the symbolic result. The loss is computed with GETPROBS, which extracts those probabilities from the tags of the output Distribution.
How apply and union combine tags
APPLY is the main operation, and it runs in two stages that resemble map and reduce. The map stage builds the set of results, where each result carries the conjunction of the tags of its input symbols. \[ R=\{(f(s_1,\dots,s_k),\; t_1\otimes\cdots\otimes t_k)\mid D_i(s_i)=t_i,\ i=1,\dots,k\} \] The function runs sequentially on the CPU, so it can use regex parsing, image processing or eval().
The reduce stage gathers the tags of each output symbol, \[ M(s)=\{t\mid (s,t)\in R\} \], and disjoins them. The output tag is \[ D_{\mathrm{res}}(s)=\bigoplus_{t\in M(s)} t \].
Take the digit distributions D1 and D2 from the example, where D1 gives 0.00 to digit 0 and 0.90 to digit 1, and D2 gives 0.78 to digit 0 and 0.09 to digit 1. Output symbol 1 arises from 0 plus 1 or from 1 plus 0, so its tag combines both cases. \[ D'(1)=(D_1(0)\otimes D_2(1))\oplus(D_1(1)\otimes D_2(0)) \] Under DAMP this tag takes the value 0.70 in the example, and a different provenance would give a different value.
UNION merges two distributions into the union of their symbols, and any symbol present in both gets its tags disjoined. The example gives symbol 0 the tags 0.01 and 0.63, which combine to 0.64. UNION is what lets a recursive program such as PathFinder add newly built paths to the paths found so far.
The conjunction and disjunction are fixed by a provenance, which the developer picks as they would a hyperparameter. DAMP uses the probability interval [0,1] as its tag space, with conjunction as a product and disjunction as a sum clamped to [0,1]. DAMP assumes its input distributions are mutually exclusive and independent, and that assumption is what lets it compute efficiently.
DTKP-AM keeps up to k proofs per symbol, stored as a k by |I| tensor whose rows hold proof probabilities. Its disjunction takes the union of two tag tensors, and its conjunction takes an element-wise minimum over the normalized entries of proof pairs. This approximates the weighted model counting that Scallop uses for DTKP, so it can run on the GPU.

Table 1 : DOLPHINprovenances implemented in PyTorch.
Original paper · CC BY 4.0Training time against Scallop and LTN
DOLPHIN's training times are measured on the same protocol for every tool, so the comparison stays fair across baselines. Each tool ran three times until convergence or a soft timeout of 10 hours, and the average best accuracy and training time were reported. The scaling factor α is the ratio of a baseline's total training time to DOLPHIN's total training time.
Against Scallop, the gap grows with problem size, because Scallop's CPU-bound backend slows down as the symbolic program gets larger. On SumN-15, DOLPHIN converged in 157.05 seconds, while Scallop needed 7.41e3 seconds, a factor of 47.18. On CLUTRR-3, the gap is smaller: DOLPHIN took 807.12 seconds against 4.29e3 seconds for Scallop. The paper reports DOLPHIN at about 5x faster than Scallop for chains of length 3 and about 8.5x for length 4, so the gap widens as the reasoning chain grows.

Table 2 : Training times (in seconds) for DOLPHINand Scallop on all benchmarks. Training times more than 10 hours are highlighted in red. The scaling factor α is the ratio of the total training times of Scallop to DOLPHIN.
Original paper · CC BY 4.0On the larger HWF, Path and Mugen versions, the baselines time out within 10 hours while DOLPHIN still converges. Across all baselines and benchmarks, DOLPHIN averages a 13.95x speedup. DOLPHIN's worst case on these harder benchmarks is 5.5 hours.
Against LTN on SumN-5, DOLPHIN needed 53.86 seconds, while LTN needed 92.54 seconds, a factor of 1.72. That gap is small, because LTN handles the simple SumN-5 task on the GPU well. LTN runs out of memory on SumN-10 on an 11 GB GPU, due to the combinatorial explosion of symbols. DOLPHIN converged on SumN-10 in 104.91 seconds.
Per epoch, the gap is larger still, with a per-epoch scaling factor of up to 280x on HWF-19 where baselines time out. Averaged over those cases, the per-epoch factor is 40.6x. The authors say this lets DOLPHIN train for more epochs in the same time, which allows it to reach higher accuracy.
Accuracy and the choice of provenance
DOLPHIN reaches state-of-the-art accuracy among general-purpose neurosymbolic frameworks in all cases except CLUTRR. On CLUTRR, DOLPHIN's accuracy is slightly lower than Scallop's, so the speed gain there doesn't come with a accuracy win. As the benchmarks scale up, DOLPHIN's accuracy grows relative to the baselines, because they either report lower accuracy or fail to converge within 10 hours.
Black-box sampling techniques such as ISED lose accuracy on HWF, and Scallop on PathFinder-256 runs too slowly per epoch to converge. On the largest dataset versions, DOLPHIN beats the second-best benchmark by up to 20% on HWF and 33% on Path. Scallop and IndeCateR+ eventually reach accuracies comparable to DOLPHIN when given no timeout, but they need much more training time.
The authors use DAMP for the MNIST, CLUTRR and Mugen benchmarks, and DTKP-AM for HWF and PathFinder, choosing whichever gives the best accuracy. Each HWF step concatenates expressions and partially parses them, which makes it hard for DAMP tags to capture the program's semantics.
For all variations of Path, CLUTRR and Mugen, both provenances reach comparable accuracies, with DTKP-AM having a slight edge. DAMP is also cheaper to train, taking around 24.19 seconds less per epoch than DTKP-AM on average. So the provenance choice is a tunable trade-off: DAMP for speed on tasks where it stays accurate, DTKP-AM where proof structure matters.
Limitations and the scope of the comparisons
DOLPHIN asks users to write their programs in a batched manner. Batched programming is a common pattern in deep learning, but it may be restrictive for users who are new to it. The paper doesn't describe a way to avoid this requirement, so newcomers need to learn the batched style first.
DOLPHIN doesn't support non-deterministic symbolic programs, and the authors leave this for future work. The representation that generative models need, such as Causal LLMs, hasn't been investigated yet. DOLPHIN works well with most models, but the authors didn't test generative models.
The authors run every experiment except CLUTRR on machines with two 20-core Intel Xeon Gold 6248 CPUs and four NVIDIA GeForce RTX 2080 Ti (11 GB) GPUs. CLUTRR runs on a single NVIDIA A100 40GB GPU because RoBERTa needs more GPU memory at a batch size of 16. Each tool runs three times until convergence or a soft timeout of 10 hours, so the speed numbers belong to those machines.
The authors compare DOLPHIN against Scallop on all benchmarks, but ISED and IndeCateR+ only on SumN and HWF. ISED already fails to scale on SumN-10 and HWF-7, and IndeCateR+ doesn't support recursive structures. LTN runs out of memory on SumN-10, so the authors compare it only on SumN, and they couldn't write HWF in LTN.
The 47x, 62x, and 3.49x factors cover only the benchmarks where baselines finish within the soft timeout.
Paper info
- Authors
- Aaditya Naik, Jason Liu, Claire Wang, Amish Sethi, Saikat Dutta, Mayur Naik, Eric Wong
- Venue
- arXiv · Preprint
- First published
- 2024-10-4
- Added
- 2026-10-29
- Updated
- 2025-12-29
- Version
- v6
- arXiv
- 2410.03348
- Category
- cs.LG
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
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
Neurosymbolic learning enables the integration of symbolic reasoning with deep learning but faces significant challenges in scaling to complex symbolic programs, large datasets, or both. We introduce DOLPHIN, a framework that tackles these challenges by supporting neurosymbolic programs in Python, executing complex symbolic reasoning on the CPU while vectorizing probabilistic computations and gradient propagation on the GPU. Across 13 benchmarks spanning tasks over text, image, and video data, with symbolic reasoning features like recursion and black-box functions, DOLPHIN converges to state-of-the-art accuracies on the more complex benchmarks while existing frameworks such as Scallop, ISED, and IndeCateR+ fail to converge within the time limit. On simpler benchmarks, DOLPHIN matches their performance, while achieving these results 1.71x to 62x faster than the baselines. Overall, DOLPHIN advances the scalability of neurosymbolic frameworks, achieving state-of-the-art efficiency and convergence on difficult benchmarks where existing frameworks struggle. The code is published at https://github.com/Dolphin-NeSy/Dolphin.
Quote from the paper
Aaditya Naik, Jason Liu, Claire Wang, Amish Sethi, Saikat Dutta, Mayur Naik, Eric Wong (2024). Dolphin: A Programmable Framework for Scalable Neurosymbolic Learning. arXiv:2410.03348v6. https://arxiv.org/abs/2410.03348v6
BibTeX
@misc{naik2024dolphin,
title = {{Dolphin: A Programmable Framework for Scalable Neurosymbolic Learning}},
author = {Aaditya Naik and Jason Liu and Claire Wang and Amish Sethi and Saikat Dutta and Mayur Naik and Eric Wong},
year = {2024},
eprint = {2410.03348},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2410.03348v6}
}