Elamur Research

Lobster: A GPU-Accelerated Framework for Neurosymbolic Programming

Paper · 2025 · Paul Biberstein, Ziyang Li, Joseph Devietti et al.

Summary

A neural network can recognize pieces of a dashed line in an image, but deciding whether those pieces connect the marked endpoints requires a different kind of computation. A logic program can answer the connectivity question by extending partial paths until it has found all the reachable pairs. The difficulty comes when the network is uncertain about which pieces it sees. The logic engine must carry that uncertainty through its rules and, during training, track how its answer depends on the network’s predictions. In existing systems such as Scallop, the network can run on a graphics processing unit, or GPU, while the rules run on the CPU. As the reasoning grows, the rules can dominate the work. Lobster brings that part of the program into the scope of GPU and parallel computing.

The authors start with Datalog, a language for stating which facts follow from other facts. Lobster translates its rules into relational operations and then into an intermediate language called APM, short for Abstract Parallel Machine. APM represents tables as separate columns and breaks operations such as joins into steps that can work on many rows in parallel. An extra column carries each row’s provenance tag, which can record information such as the proof behind a derived fact. The same execution machinery supports ordinary logical deduction, reasoning with uncertain facts, and differentiable reasoning, in which a final error signal can travel back through the rules to train the neural network.

The evaluation spans visual tasks, kinship inference from text, maze planning, probabilistic analysis, and ordinary graph queries. The paper reports an average speedup of 3.9x over Scallop across its application suite. End-to-end training speedups range from 1.2x to 16x, with the larger gains coming where rules account for more of the workload. The authors report unchanged task accuracy when replacing Scallop’s engine with Lobster in the differentiable comparisons. In the illustrative Pathfinder task, the neurosymbolic solution achieves 87.42% accuracy, compared with 71.40% for the purely neural approach. That accuracy comparison concerns the design of the solution. The engine comparison measures the time it takes to train or run it.

The gains depend on the workload and on how the execution is organized. In a scaling experiment on Pathfinder and maze planning, removing memory allocation and transfer scheduling optimizations brought symbolic runtime close to Scallop’s at larger problem sizes. A specialized GPU engine also finished some discrete queries faster or within a memory budget that Lobster exceeded. The paper’s contribution is a way to run several kinds of Datalog reasoning on the GPU through a shared compiler and runtime, with measurements that show where that approach pays off.

Deep dive: Lobster: A GPU-Accelerated Framework for Neurosymbolic Programming

Lobster compiles Datalog for GPUs, speeding up the logical rules that combine uncertain predictions and support end-to-end training. · about 37 minutes to read

The problem and its context

Where the work goes after prediction

The paper begins with a division of labor. Neural networks are useful when a program must make sense of an image or a passage of text. Rules are useful when the relationships among the things recognized in that input are known. In Pathfinder, the network can judge whether a line crosses between neighboring regions of an image. Once a set of possible connections is available, a rule can use it to decide whether a destination is reachable. A programmer can describe how to extend a known path directly. The network supplies evidence about which extensions are plausible.

The arrangement also changes what a training example needs to say. A Pathfinder image can be labeled with the answer to the connectivity question without specifying which pixels constitute each line segment. The neural network makes local predictions, and the symbolic program uses them to make the final prediction. If the symbolic computation is differentiable, an error at the end can supply information about how the local predictions should change. The authors use this kind of weak supervision to illustrate why the logic engine is part of the training computation as well as part of reasoning.

Datalog expresses the symbolic half in terms of relations and rules. A relation groups facts of the same shape. An edge relation, for example, can contain pairs of cells that appear to be connected. A rule describes when facts in one or more relations imply a fact in a target relation. When a rule uses facts of the same kind that it produces, its output can become input on a later round. That recursion lets a reachability program use the same description for a path that ends nearby and for one that extends across the image. The practical cost depends on how much work the rule triggers on the particular input.

For a graph with definite edges, reachability is a question about which pairs belong in the result. For observations from an image, the connection between adjacent regions is itself a prediction with an associated probability. A derived connection may have several supporting routes, and those routes may share edges. A reasoning engine must give alternatives an appropriate interpretation while combining the evidence needed for each particular route. Keeping the complete set of explanations can become too expensive, so a system may keep a bounded collection of proofs. That still leaves work to do whenever a rule extends a proof or several derivations yield the same fact.

Training adds a separate requirement. To pass an error back to the network, the symbolic computation needs enough information about which predictions affected its output. Two derived facts can have the same ordinary fields and very different dependencies on the original observations. An engine that only records the presence of a row leaves that information behind. The tags that preserve it increase memory use and make some operations more expensive. Recursion can repeat those operations over a growing set of candidates, so the place where the program states its rules most compactly can become the place where execution spends most of its time.

The capabilities of earlier systems

The authors describe DeepProbLog, Scallop, and ISED as systems that made it easier to write applications that combine neural computation and logic. Scallop is especially important to Lobster because it already provides the Datalog-based language and a way to choose how facts carry information through reasoning. Its symbolic engine runs on the CPU and can distribute different examples in a batch across CPU cores. That helps when there are many independent examples. A demanding example can still leave the engine with a large join or proof computation inside the work assigned to that example.

The paper also discusses CPU systems designed for large logic queries without a neural component. Soufflé, for instance, is a multicore Datalog engine. The authors point to the use of structures such as B-trees in efficient CPU implementations. Such structures suit a processor that can follow different paths through memory for different lookups. Lobster is designed around contiguous arrays and operations that let nearby GPU threads access nearby data. The choice of processor therefore changes the appropriate implementation of a relation, even when the rule that uses the relation stays the same.

Earlier GPU Datalog work included systems such as GDLog and FVLog. These systems show that relational operations and recursive evaluation can run on a GPU. The versions discussed in the paper support discrete reasoning, where a query produces facts without the richer annotations needed to carry probabilities or training information. FVLog also has a different interface. Its users express the workload in low-level relational operations. The authors describe its intended setting as large analytical jobs, whereas Lobster needs to handle repeated calls to a symbolic program inside a larger application.

ProbLog occupies a different part of the design space. It provides probabilistic logic reasoning, and the public version used in the paper evaluates probabilities exactly. There is earlier research on approximate evaluation in ProbLog, but that capability was unavailable in the version used for the experiments. The paper also distinguishes its execution semantics from the bottom-up approach taken by the other engines in the comparison. Those differences matter because a conditional probability query and an approximate best-proof query can involve different amounts and kinds of work even when both are written about the same domain.

The authors relate Lobster to frameworks for automatic differentiation, including PyTorch and TensorFlow. Those frameworks can compute derivatives through numerical operations. A recursive logic engine also needs to decide which tuples match, which facts are new, and how to merge rival derivations. Lobster addresses differentiation in the course of that relational computation. Its target is the interface between the numerical part of the application and the rules that work with predictions as facts.

This background explains why a custom GPU implementation of Pathfinder would address only part of the problem. A specialist could design kernels around the particular shape of an image grid and its reachability query. A general system must also support joins on other keys, projections that calculate new values, and tags whose contents depend on the form of reasoning. The compiler needs a vocabulary of operations broad enough to express those rules and narrow enough for the runtime to implement efficient parallel versions. APM is the authors’ answer to that requirement.

The method, step by step

From an image to facts a rule can use

Pathfinder illustrates the full route through the system. The input contains dashed lines and marked dots. The task is to decide whether a dashed route connects the marked locations. To give the logic program something it can work with, the authors divide the image into a square grid. Each cell represents a region of pixels, and edges in the grid define candidate connections for the neural network to score. The paper denotes the resulting lattice as follows.

Gₙ,ₙ

Here G denotes the lattice graph, and n is the discretization factor. The repeated n gives the dimensions of the square grid. A vertex represents a cell, and an edge represents a candidate connection between cells.

A convolutional network assigns a probability to each candidate edge. It also predicts the presence of a dot in each cell. These predictions are the inputs to the symbolic component. The layout of the image has become a collection of facts with typed fields and probabilities. A cell identifier can be represented as an unsigned integer, so the rules can work with pairs of identifiers without needing to inspect the pixels again.

0.97::edge(0, 1)

In this example, edge is a relation for connections between cells, and 0 and 1 are the cell identifiers. The double colon attaches the probability 0.97 to the candidate connection. That probability expresses the neural network’s confidence in the fact.

The rules compute transitive closure, which gives the reachability relation implied by repeatedly extending connections. An edge serves as the basis for a path. To extend a path, the program looks for an edge whose starting cell matches the path’s current ending cell. The resulting path has the original starting cell and the ending cell of the added edge. As new paths appear, they can themselves be extended. The endpoint predictions let the program use that result to ask whether the marked locations are connected.

is_endpoint(1) ∧ edge(1, 2) ∧ ··· ∧ edge(4, 5) ∧ is_endpoint(5)

The predicate is_endpoint identifies an endpoint, while edge identifies a candidate connection. The numbers are cell identifiers. The conjunction sign ∧ says that a proof uses all the listed facts, and the dots stand for the intervening edges along the route. This is one proof associated with a path between cells 1 and 5. Another route could support the same derived fact with a different collection of input facts and a different probability.

For Pathfinder, the authors use diff-top-1-proofs. This differentiable provenance keeps the most likely proof associated with a fact. The symbolic answer therefore depends on the network’s probabilities through the proof selected by the program. Training uses a connectivity label for each image. The error on that answer can be propagated through the logic engine to adjust the predictions used to reach it. The program supplies the definition of a path throughout training, and the neural network learns which local visual patterns support the facts that definition calls for.

How Lobster evaluates neural predictions with Datalog rules

The steps in order.

How Lobster evaluates neural predictions with Datalog rulesStep 1: Convert neural predictions into tagged input facts1. Convert neural predictions into tagged input factsStep 2: Plan Datalog rules as relational queries2. Plan Datalog rules as relational queriesStep 3: Compile each query to APM instructions3. Compile each query to APM instructionsStep 4: Store fields and tags in separate GPU columns4. Store fields and tags in separate GPU columnsStep 5: Evaluate joins and propagate provenance in parallel5. Evaluate joins and propagate provenance in parallelStep 6: Repeat with newly derived facts until convergence6. Repeat with newly derived facts until convergenceStep 7: Return query results for inference or training7. Return query results for inference or training

From a Datalog rule to relational algebra

Lobster reuses Scallop’s front end and query planner. The front end is the layer that accepts the program the user writes. The planner describes how to evaluate it in terms of table operations. This separation allows Lobster to preserve the rule interface and concentrate on how the work will run. The result of planning is a program for the Relational Algebra Machine, or RAM. Here RAM names an intermediate language. A RAM program describes which operations consume facts, how those operations depend on one another, and which relations receive their results.

ρ ← ε

The symbol ρ names the target relation. The expression ε is the relational query that produces facts for it, and the arrow directs those facts to the target. The query may take input from several relations and may pass through several operations before producing the table that the rule contributes to ρ.

The paper describes the query as a directed acyclic graph. Each node represents a table operation, and each edge records that the result of one operation is needed by another. The graph within a query has no cycle. Recursion occurs in the surrounding evaluation, where a derived relation can be available the next time the rule runs. This distinction lets the compiler produce a finite sequence of operations for a rule even when the runtime must evaluate that sequence repeatedly.

Projection, written π in the paper, transforms rows or chooses their fields. A reachability rule can use it to retain the starting and ending cells after the join has found a legal extension. Selection, written σ in the relational algebra, keeps rows according to a condition. A join, written ⊲⊳, matches rows on designated fields. A union, written ∪, gathers rows from its inputs. A product, written ×, forms pairs from them, while intersection, written ∩, concerns rows that are common to both. The precise operations on tags depend on how the output facts arise.

RAM also organizes rules into strata. A stratum is a group evaluated as a unit. The engine processes strata in order, bringing each to a point at which it has finished deriving results before continuing. The paper calls the database of input facts the extensional database, or EDB. The intensional database, or IDB, holds facts generated by rules. The distinction is useful even in a single recursive stratum. In Pathfinder, the observations of edges can remain constant during a query while the relation recording discovered paths changes from one pass to the next.

What a provenance tag means

A provenance tag adds computational information to a fact. For a discrete query, the presence of a fact is enough, so Lobster can use its unit provenance. A probabilistic query can use a numerical tag or a proof that refers to uncertain inputs. For training, a differentiable version preserves information needed to propagate the effect of an output back to the predictions it depends on. The rules can still describe the same relationships among the data columns. The chosen provenance supplies the instructions for handling the additional information.

(T, 0, 1, ⊕, ⊗)

In this description of a provenance semiring, T is the set of allowed tags. The symbols 0 and 1 denote the identities for combining alternatives and combining joint requirements, respectively. They are elements of the tag space and need not be stored as ordinary numbers. The operation ⊕ combines tags from alternative derivations of a fact. The operation ⊗ combines tags when a derivation needs facts together.

In a path extension, the previous path and the additional edge are joint requirements. The join combines their tags with ⊗. If two matches produce the same pair of endpoints, those matches provide alternative derivations. When the duplicate rows are brought together, ⊕ determines the tag for the retained fact. Distinguishing those operations is essential. One states how to form a proof from premises. The other states how to summarize more than one way of establishing a conclusion.

The paper uses Boolean formulas to explain a richer tag. A variable ν refers to a fact in the input database, and Pr(ν) is its associated probability. A formula ϕ belongs to a space of formulas denoted by Φ. In disjunctive normal form, such a formula is a set of alternative conjunctions, each of which describes the facts used by a proof. The Pathfinder expression is an example of a conjunction. Keeping several conjunctions can retain evidence from several routes. Keeping them all can make the formula grow as the rules continue to generate derivations.

Lobster implements 7 provenance semirings. The paper names the unit case, max-min-prob, add-mult-prob, top-1-proof, and differentiable forms of the probabilistic choices. The top-1-proof case retains a single conjunction at a time. When combining alternatives, it evaluates the probabilities of the proofs and keeps the more likely one. When combining premises, it merges the conjunctions and checks for conflicts. The resulting tag represents the retained proof. A different provenance can assign the same rule a different policy for summarizing evidence.

The compiler and runtime require a fixed storage size for tags of the chosen provenance. A compact numerical tag and a tag that represents a proof can each have their own storage requirements. For top-1-proof, the representation needs a capacity set in advance. The authors use a limit of 300 for proof size in the benchmarks. That bound and the restriction to a single proof let a proof tag fit into one fixed-width element of its register. The authors also describe compile-time knowledge of maximum proof size as a way to make the representation practical.

Why APM is a separate compiler layer

RAM describes computation using familiar operations such as joins. A GPU cannot execute that description directly. It needs instructions that specify how memory is laid out, how much output to reserve, and which work can proceed independently. Lobster introduces APM to make those decisions expressible separately from the source rules. The compiled program is a procedural sequence of instructions, but individual instructions operate on vectors of values and can expose parallel work inside each step.

compile :: RAM → [instr] × [reg]

The name compile denotes the translation function. The double colon introduces its type, and RAM denotes the input language. The arrow gives the direction of translation. Brackets denote sequences, with instr standing for APM instructions and reg for register names. The product sign × indicates that the function returns both the instruction sequence and the registers where the result is stored.

Compilation follows the dependency structure of the query. When an operator needs input tables, their producing expressions must be compiled before the operator that consumes them. Each compiled expression yields instructions and a location for the resulting columns. APM can then use those registers as the operands of later operations. The compiler also has a database context, denoted F with a tag-type subscript T in the paper. It provides schema information, such as which fields a relation contains, and the provenance needed to choose tag operations.

The representation of an APM register differs from the role of an ordinary scalar register. It holds a fixed-size buffer of values of the same type. A relation of arity n, meaning that each fact has n data fields, uses n registers of equal length for those fields and an extra register for the tags. The entries at a given index across the registers form a row. This layout means, for instance, that the ending cells of consecutive paths lie next to one another in memory even though the rows also have starting cells and potentially large proofs.

The layout suits GPU memory access. The paper describes a warp as a group of 32 threads that execute instructions together on different data. When nearby threads read nearby entries from a column, their accesses can be coalesced, allowing the hardware to serve them efficiently. Placing the fields in separate arrays also means that a join can read the columns used as keys without first reading every other field and the provenance of each row. Later stages gather the values they need to produce the output.

APM requires explicit allocation and uses static single assignment, meaning that it gives each computed register value its own name. This makes the points where a buffer is created and where its value is used visible in the program. Allocation sites can be known in advance even when the buffer length depends on data calculated during execution. The compiled instruction sequence has no general branches or loops. Repetition happens outside the sequence, in the runtime’s evaluation of recursive strata. Within it, instructions such as sorting, scanning, or gathering have implementations designed to work across many rows.

How a projection and a join execute

Projection is the straightforward case. It applies the same expression independently to each input row. It therefore has an output position for each row before any duplicate handling, and the engine can allocate space for the projected columns using the input length. The operation leaves the row’s provenance attached because its immediate output comes from that input row. If different input rows project to the same tuple, deduplication can then bring their alternative tags together.

πₐ(ε)

Here π denotes projection, the subscript a stands for the projection function the paper writes as α, and ε is the input query that produces the table. The parentheses enclose the input to the projection. The function specifies which fields or calculated values each output row contains.

Lobster has separate execution paths for simple and calculated projections. Choosing or rearranging existing columns can be handled with column-wise memory copies. An expression involving arithmetic or comparisons is translated to bytecode for a small stack interpreter. Each GPU thread applies that program to its assigned fact and uses a fixed-size stack in thread-local memory. The language can thus express calculations over fields while keeping the same row-level execution pattern. The HWF workload has a practical need for arithmetic because the symbolic program calculates values from recognized handwritten expressions.

A join has harder memory and coordination requirements. In the path example, the engine tests whether a current path ends where a candidate edge starts. A path might match no edge, a single edge, or multiple edges. The output length is therefore a property of the keys and their repetitions, instead of a length the compiler can read from the input schema. The program also needs to remember which source rows supplied each match so that it can gather their fields and combine their tags.

Lobster first builds a hash index on one of the inputs. For each relevant row from the other input, it then counts the matches available through that index. These counts form a histogram of how many output entries the input rows will produce. An exclusive prefix sum gives each row an offset by adding the counts belonging to earlier rows. With offsets assigned, each row’s matches can be emitted into a separate part of an output buffer. The same counting gives the size needed to allocate that buffer.

The matching stage produces row indices into the input tables. Gather instructions use them to assemble the output columns. Tag combination requires access to the associated row in each input, even if later projection will drop the two matching key fields or any other columns. For each match, the runtime applies the provenance conjunction operation to the tags of the source rows. This separation between matching and materializing the output lets the mechanics of the hash join serve several forms of reasoning.

The hash table supports concurrent insertions and lookups without locks. It deals with collisions by probing nearby positions in a contiguous array. The table stores references to rows in the source columns, which lets the runtime support different numbers of fields without putting entire tuples in the index. Resolving a collision can require another read from the source to check the key. The tradeoff is an additional memory access in that case in exchange for a simpler index whose entries need only point back to the facts.

Sorting and merging complete other parts of the relational work. Lexicographic sorting can place identical tuples next to one another. A reduction then applies the provenance operation for alternatives to the duplicates. A merge instruction can also combine already sorted tables. These operations matter to a recursive program because the outputs of queries join an existing collection of facts. The engine needs to maintain that collection and identify which rows should be available as new input on the next pass.

How recursive rules and batches run

The runtime repeats the compiled instructions until a stratum reaches its least fixed point, the state at which the rules have finished deriving facts from the given input. A direct implementation could apply all the rules again to everything derived so far. Much of that work would repeat matches from earlier passes. Semi-naive evaluation avoids this by separating the facts that have just become available from those that the engine has already used in previous rounds.

Lobster uses delta, recent, and stable parts of the database. Delta holds the facts produced during the current pass. Recent holds the facts produced on the previous pass. Stable holds the older facts. In the reachability example, a newly discovered path belongs to the frontier that can now be extended by an edge. A path already considered with those same edges need not be extended again just because other paths have since been found. Where a rule uses multiple inputs, the planner’s task is to account for the combinations that contain new information.

At the end of a pass, the runtime merges the recent facts into the stable part and makes the current delta the new recent part. The appendix describes initialization with the incoming database as recent and the other parts empty. Its execution algorithm tracks database size in order to stop when the rules add no facts. The instructions for maintaining the partitions, including deduplication and merging, are themselves expressed in APM. Thus the operations that manage the frontier are parallelized in addition to the joins that discover new facts.

Independent examples can also share a single physical table. In Pathfinder, each image has its own graph, and the cell identifiers may repeat across images. Lobster places a sample identifier in an additional column. A batched table has the following register layout.

[rₛ, r₁, …, rₙ, rₜ]

The brackets enclose the register sequence. The register rₛ contains sample identifiers. The registers from r₁ through rₙ hold the ordinary fields, where n is the arity of the relation and the ellipsis represents the intervening registers. The register rₜ holds the provenance tags. Each position across the sequence represents a fact belonging to the sample named at that position in rₛ.

A join must include the sample identifier among its matching fields. If two paths from unrelated images mention the same cell, their identifiers prevent the join from treating those cell references as a match. The derived facts keep their sample identifiers, so the output can be separated into results for the original examples. The authors explain the intended equivalence using a batch of three databases. Evaluating the combined database should provide the same information as evaluating those databases separately. Because each operator already parallelizes over rows, the same kernels can distribute work across the combined input. The paper notes that batches seldom exceed 256 samples, allowing a one-byte sample identifier per row in that setting.

Avoiding repeated allocation, indexing, and transfers

Explicit allocations give the runtime a way to reduce memory management overhead. Temporary registers from an APM pass share an iteration lifetime. When there is room for an arena, the runtime allocates its working buffers from a common region by advancing a pointer, then reclaims the region together when the pass is over. The sizes can still reflect the actual data. The advantage comes from avoiding a separate general-purpose allocation and deallocation for every temporary buffer.

When the memory budget makes an arena unsuitable, the runtime can retain and reuse buffers at their allocation sites. The fixed instruction sequence identifies which site produces each buffer across passes. The authors observe that a buffer’s required length on one pass tends to be related to its length on the next. Holding on to available capacity can then reduce the number of allocations during a fix-point computation. An earlier GPU Datalog system used a similar approach for a particular merge buffer. APM makes the same idea available across allocation sites.

The runtime can also reuse a hash index when the relation it indexes stays constant. The edge inputs in Pathfinder are fixed for the duration of a query, even as the discovered paths change. Building the index over those edges on every pass would repeat work. APM can mark the index register as static, which means it is initialized on the first pass and remains available afterwards. The paper relates this to linear recursion, in which a join has at most one input from the derived database. Such joins often give the compiler a fixed input to index.

Transfer scheduling addresses the cost of moving facts between the CPU and GPU. Lobster uses a heuristic that counts recursive joins to identify the stratum likely to do the most work. It can then broaden the GPU region to include adjacent computations in the dependency graph, looking for a boundary where the inputs and outputs to be moved are small. This matters when relations used by the expensive stratum are produced or consumed nearby. Keeping those computations on the same device can avoid moving their intermediate results across the boundary.

Within the GPU region, separate relational operators execute sequentially. The parallelism is among rows or other pieces of work within an operator. The authors consider scheduling separate operators together, but report that the limited amount of host-to-device traffic in their design leaves little opportunity to hide transfers behind computation. The implementation combines Rust, C++, and CUDA with the reused Scallop front end. The authors make the Lobster code publicly available.

Experiments and results

What the comparisons measure

The evaluation treats Lobster primarily as a different engine for carrying out a neurosymbolic program. The training comparison measures total time to convergence, including the neural computation. The inference comparisons measure runtime after the neural component has been trained. The paper also studies the symbolic portion on its own as selected inputs grow, then evaluates probabilistic and discrete programs for which neural training is outside the timing comparison. These measurements answer different questions about how much of the workload the engine can accelerate.

Scallop is the main baseline for the differentiable tasks because it can run the same logic programs with the relevant provenance and carry the training computation through the rules. The authors report that the neural networks reach identical accuracy with the two engines on these tasks. The runs for a given task also take the same number of training epochs. An epoch is a pass through the training data. As a result, differences in total training time can be interpreted in terms of the execution cost of the pipeline without attributing them to different convergence schedules.

The probabilistic comparisons include Scallop and an attempt to run ProbLog. Scallop and Lobster use approximate reasoning in those workloads, while the available ProbLog implementation uses exact inference. The authors’ output-equivalence account for the logic programs should be read alongside that distinction. Matching a program and provenance between Scallop and Lobster helps isolate the runtime. An exact-inference system also faces the work needed to satisfy its own semantics. Its runtime provides context for the practical cost of the workload, with a different inference procedure in the comparison.

The discrete baselines are Soufflé on the CPU and FVLog on the GPU. For discrete tasks, the unit provenance gives Lobster the ordinary fact-processing workload. This allows comparison with systems that lack probability and differentiation support. FVLog is especially useful because a comparison only with Scallop or Soufflé would leave open whether the same workload could run efficiently using a more specialized GPU implementation.

The main machine for the nondiscrete benchmarks had two 20-core Intel Xeon CPUs, a GeForce RTX 2080 Ti, and 768 GB of RAM. The authors ran the discrete benchmarks on another system because those datasets needed more device memory. It had two 24-core Intel Xeon CPUs, 1.5 TB of RAM, and an NVIDIA A100 with 80 GB of device memory. Runtime comparisons within the discrete group should therefore be read in the context of that hardware. The discrete and differentiable results characterize different workloads and machines.

Differentiable tasks and end-to-end training

Pathfinder, PacMan-Maze, HWF, and CLUTRR make up the differentiable group described in the benchmark table. Each uses diff-top-1-proofs, but the rules do different work. Pathfinder evaluates whether the neural observations support a path across an image. PacMan-Maze plans movement from a visual representation of a maze after a convolutional network predicts where enemies are. HWF interprets handwritten symbols and calculates the value of the expression they form. CLUTRR follows chains of stated family relationships to infer a relationship that is implicit in a passage.

The inputs and available supervision help explain the variety in the experiments. Pathfinder training uses an image-level connectivity label. HWF likewise supplies the expression’s final value, allowing the recognizer and rule evaluator to contribute to the final answer. HWF expressions can have different lengths, so processing each example independently can assign very different amounts of work to different parts of a batch. CLUTRR starts with text describing family relationships. Its hardest examples in the evaluation require a reasoning chain of length 10. A longer chain means the correct relationship may depend on combining more intermediate facts.

Curriculum learning is the approach PacMan-Maze takes. After starting to learn in a 5-by-5 maze, the agent moves to a 20-by-20 grid. The rules plan a safe route using the image-based predictions. Symbolic work therefore depends on what the agent must consider as it acts, including how many times the planner needs to run before it reaches the goal. The study uses that task to examine a setting where the symbolic engine can consume a large portion of training time.

Pathfinder also supplies an accuracy comparison with a purely neural approach. The result is useful for understanding the choice of application. The rule-based solution makes reachability explicit and uses learned predictions for local observations. The accuracy figures compare that division of labor with a purely neural solution on the same task. The authors’ claim about replacing Scallop with Lobster rests on the timing comparison under the same rule program and the reported equality of accuracy.

Classification accuracy on the Pathfinder task

The neurosymbolic solution using a reachability program outperforms the purely neural approach.

Classification accuracy on the Pathfinder taskPurely neural approach: 71.40Purely neural approach71.40Neurosymbolic solution illustrated with Lobster (this paper): 87.42Neurosymbolic solution illustrated withLobster (this paper)87.42
The numbers
System or settingaccuracy %
Purely neural approach71.40
Neurosymbolic solution illustrated with Lobster (this paper)87.42

For the differentiable benchmarks, training runs until convergence. The resulting end-to-end speedups over Scallop span 1.2x to 16x. These figures include the neural computation executed by PyTorch, which already uses the GPU in the comparison. The time spent there limits the reduction possible for the pipeline as a whole. This is the application of Amdahl’s law in the paper. Improving the symbolic component can only remove time from that component and any associated overhead. The full runtime still includes the neural part of training.

PacMan-Maze is the authors’ example of a task with enough symbolic work to benefit strongly under that measure. In other tasks more of the time can already be spent executing the neural computation. The range across training tasks is therefore more informative than a single number would be. It shows that using the same engine does not fix the fraction of runtime attributable to logic. The task and the way the neural and symbolic stages interact determine that fraction.

Inference after the network has been trained

The inference experiments use pretrained neural components and report average times across samples. For CLUTRR, the input consists of relationship graphs from 13 text passages. The HWF comparison evaluates 160 formulas of length 13. Pathfinder uses 1216 images. For PacMan-Maze, the benchmark solves 50 mazes on a 15x15 grid. The PacMan-Maze test grid and the grids used in its training curriculum describe separate experimental conditions.

Removing training changes the balance between perception and reasoning. The network still needs to make predictions, but learning from the outcome is no longer part of the run. The paper reports that CLUTRR and Pathfinder devote less of their runtime to neural computation during inference than in training. Lobster consequently achieves greater speedups over Scallop in these inference comparisons. The graphs and rules still have to be evaluated for the inputs. In Pathfinder, for example, learning to recognize likely edges does not precompute the path through the next image.

The authors observe a different pattern for PacMan-Maze. Lobster’s inference speedup is smaller than its training speedup. Their explanation is that a trained agent solves the maze in fewer steps, reducing the share of total runtime spent planning. The paper presents this as a likely interpretation. It illustrates a property of workloads in which reasoning is called repeatedly during interaction. The number of calls can change when the neural component improves, even if a single symbolic evaluation has the same implementation.

The paper also increases the problem size in Pathfinder and PacMan-Maze. For Pathfinder, the input is analyzed at a finer grid resolution. The symbolic engine can then have more cells and candidate connections to consider. For maze planning, the authors enlarge the maze. They time the symbolic computation against Scallop to isolate the part Lobster changes. The observed speedup grows until it levels off at larger sizes, which the authors attribute to saturation of the GPU’s memory bandwidth. These scaling measurements describe the rule engine more directly than the end-to-end timing does.

Probabilistic inference across programs and sequences

Probabilistic Static Analysis carries confidence annotations through an analysis of source programs. The output can use the propagated values to rank alarms, giving lower visibility to results that the system considers less likely. The benchmark is a test of computing and aggregating uncertain facts. It uses the provenance named minmaxprob in the benchmark table. The authors compare the time needed to perform that analysis across a range of source programs and report significant speedups over Scallop.

RNA secondary structure prediction gives the probabilistic engine a different kind of input. A transformer supplies probabilities, and a Datalog program parses an RNA sequence according to a context-free grammar. In this setting, the grammar constrains which structural analyses can be composed from smaller pieces of the sequence. The benchmark uses top-1 proof provenance. It draws 475 sequences from ArchiveII, covering lengths from 28 to 175. The experiment times probabilistic reasoning over those inputs.

ProbLog reached the 2-hour timeout on the probabilistic workloads except for the static analysis of sunflow-core. For that program, it ran 30 times slower than Lobster and 60% slower than Scallop. According to the authors, exact inference in the public implementation of ProbLog explains much of the gap. The outcome gives a practical comparison among the available systems under their respective procedures. It does not establish the cost of running exact inference in Lobster or of giving ProbLog the approximation used by the other engines.

The RNA benchmark also shows where launching and organizing GPU computation can be less effective for a small input. For the shortest sequence, at 28 base pairs, Lobster was 40% slower than Scallop. Lobster was faster on the remaining sequences, with speedups often reaching two orders of magnitude in the paper’s account. Speedup increased with sequence length. The authors point to longer sequences as a setting where the efficiency gain could be especially valuable. Their measurements concern runtime for the grammar-based program on ArchiveII.

Discrete graphs and pointer analysis

The transitive closure benchmark removes probabilities and training from the workload. It asks for the directed reachability relation of a graph. The authors draw their inputs from the SNAP repository and choose graphs that require at least one second to process. The reported comparison uses Soufflé as the CPU reference and includes FVLog as the GPU reference. ProbLog reached the 2-hour timeout on the inputs. When Scallop completed, the paper reports a 30-90x slowdown relative to Soufflé. Lobster beat Soufflé in the reported comparison and often surpassed FVLog.

The Same Generation workload uses the same graphs but derives a different relation. It pairs nodes that can be reached from a common ancestor at the same distance. The paper gives elapsed seconds for Lobster and FVLog as well as out-of-memory outcomes. On fe-sphere, Lobster finished in 3.91 seconds, while FVLog needed 12.99 seconds. On CA-HepTH, the respective runtimes were 2.16 seconds and 6.40 seconds. On SF.cedge, Lobster completed in 14.01 seconds and FVLog in 23.72 seconds. These rows show the varying size of the runtime advantage on data both systems could finish.

Same Generation runtime on the fe-sphere graph

Lobster finishes the graph query sooner than the specialized GPU baseline.

Same Generation runtime on the fe-sphere graphFVLog: 12.99FVLog12.99Lobster (this paper): 3.91Lobster (this paper)3.91
The numbers
System or settingseconds
FVLog12.99
Lobster (this paper)3.91

Memory failures occur in both directions in the Same Generation results. On ego-Facebook and loc-Brightkite, Lobster finishes while FVLog runs out of memory. On vsp_finan, Lobster runs out of memory while FVLog completes in 90.10 seconds. There are also inputs on which neither engine finishes within the available memory. These outcomes matter independently of the times of successful runs. A runtime comparison over shared successes alone would leave out cases where the engines’ different intermediate data requirements decide whether the task can run at all.

Context Sensitive Pointer Analysis, or CSPA, computes relationships among pointers in a program while taking context into account. The authors follow the GDLog setup for the logic program and the input graphs. In the comparison against FVLog, Lobster completes linux in 1.81 seconds, compared with 3.91 seconds, and postgres in 3.32 seconds, compared with 4.39 seconds. FVLog leads on httpd, completing in 2.57 seconds to Lobster’s 3.61 seconds. The paper reports a geometric mean speedup of 1.27x for Lobster over FVLog. That mean summarizes a group in which the faster engine depends on the input.

Context Sensitive Pointer Analysis runtime on the linux input

Lobster finishes sooner than FVLog on this pointer analysis input.

Context Sensitive Pointer Analysis runtime on the linux inputFVLog: 3.91FVLog3.91Lobster (this paper): 1.81Lobster (this paper)1.81
The numbers
System or settingseconds
FVLog3.91
Lobster (this paper)1.81

These discrete tests ask whether an engine built to support tags and differentiable execution can remain competitive when it is used for ordinary Datalog. The unit provenance lets it use its general compilation and execution strategy on that workload. The results put its performance in the range of a specialized GPU engine, with substantial wins on some inputs, losses on others, and memory failures that vary with the dataset.

What the ablations show

Allocation and transfer scheduling in recursive workloads

The explicit ablation uses the scalable Pathfinder and PacMan-Maze settings. It compares symbolic runtime against Scallop under several Lobster configurations. The configurations use neither optimization, stratum scheduling alone, allocation optimizations alone, or their combination. In these comparisons the symbolic task and problem size are held fixed while the runtime changes how it manages temporary working memory and the boundary between devices. Timing the symbolic stage helps keep differences in neural computation out of the comparison.

The scheduling change addresses where relations are evaluated. When a large stratum runs on the GPU, the automatic choice about which neighbors to move with it can determine how much intermediate data crosses between the host and device. A graph query can perform its join quickly and still spend time exchanging the large relations that supply or receive its results. Extending GPU execution to nearby strata, where that makes the boundary smaller, targets this cost. It leaves the derivations required by the program intact.

The allocation change addresses a cost that recurs inside strata. A pass can produce intermediate arrays for matching, gathering, sorting, and merging. The next pass follows the same sequence of instructions, frequently with comparable array sizes. Arena allocation or reuse of buffer capacity reduces the management overhead of that pattern. The ablation groups the allocation optimizations together, so it evaluates the effect of that part of the design as a package.

The authors report that without both allocation optimization and stratum scheduling, Lobster’s performance falls close to Scallop’s at problem sizes greater than 20 in these scaling tests. With the optimizations enabled, Lobster maintains a larger advantage as the inputs grow, before the speedup levels off. The paper links the plateau to GPU memory bandwidth. The comparison shows that the basic mapping of queries to parallel GPU operators depends on how efficiently the runtime supplies those operators with memory and keeps their inputs available on the device.

The scope of that finding is the symbolic stage on the two adjustable workloads. The experiment changes the image analysis resolution or the maze size. It does not establish the same performance threshold for an RNA sequence length, a graph size, or a different GPU. The configurations also leave the rest of the compiler and runtime in place. The result cannot isolate the contribution of columnar storage, hash index reuse, sample tagging, or any single relational kernel.

What the other comparisons help explain

The training and inference comparisons show how the amount of symbolic work can affect the apparent gain from the same engine. In Pathfinder and CLUTRR, inference gives relatively more weight to reasoning, and speedups are larger there. PacMan-Maze shows a smaller inference gain. The authors’ explanation invokes fewer steps by the trained agent, which would leave the planner with fewer occasions to contribute to total runtime. These are workload comparisons. They give context for the observed speedups without independently varying every factor that changes between training and inference.

RNA sequence length provides another scaling comparison. The shortest case favors Scallop, and longer sequences increasingly favor Lobster. The result is consistent with a GPU engine needing enough relational work to make its organization and launch costs worthwhile. The experiment varies the input rather than disabling particular features, so the curve does not identify which part of Lobster accounts for the pattern. It demonstrates where the balance falls on the measured sequences for the chosen grammar and provenance.

The discrete comparisons show a further dimension of the runtime tradeoff. The paper connects Lobster’s competitiveness against FVLog to the opportunity to optimize an intermediate program. The results compare complete engines, including their data structures and allocation behavior. The Same Generation failures illustrate the significance of those differences. Lobster can finish some inputs that exceed FVLog’s memory capacity in the experiment, while the reverse occurs on vsp_finan. That evidence describes how the implementations behave on particular graphs. The allocation and scheduling ablation is the direct component-level test.

Limitations

Limits the authors state

Lobster implements the single-proof case of top-k provenance. The implementation does not keep the general collection of up to k proofs per fact. Selecting the most likely proof makes storage and computation more manageable, but an answer supported by several routes can have information that this representation discards. An application that needs contributions from multiple alternative explanations faces a different inference problem from the one evaluated with top-1-proof. The authors suggest the approach could be extended to larger k, while the reported results cover the special case they implement.

The proof representation also needs a size bound known before evaluation. The authors set the proof-size limit to 300 and say it was sufficient for their benchmark suite. Because a tag takes a fixed-size slot beside the data fields, the limit has a direct implementation purpose. A program with larger proofs would require another capacity choice or a change in representation. The benchmark establishes that the chosen bound covers its workloads, while the needs of other programs depend on how their derivations grow.

The paper formulates its translation for a substantial fragment of Datalog and concentrates the formal presentation on a recursive stratum. APM supports a defined vocabulary of operations that the compiler and runtime know how to map efficiently. Arbitrary computations that fall outside that vocabulary do not acquire the same execution properties by being used alongside a logic program. The front end can reuse Scallop’s planning for supported programs, but the execution guarantees described in the method concern what the compiler can express in APM.

The authors also describe limits in the parallelization and memory behavior. Relational operators run sequentially with parallel work inside them. Their experiments find that speedup levels off on sufficiently large inputs in the scalability tests, which they connect to memory bandwidth. In the discrete evaluation, available device memory prevents Lobster from completing some graphs. A GPU can accelerate operations on relations that fit its execution strategy while still running out of space for the specific intermediates a query generates.

Limits of the evidence

The main evaluation tests performance given a logic program. In the differentiable comparison, Scallop and Lobster use the same program, reach the same accuracy, and converge in the same number of epochs for a particular task. That is appropriate for testing an execution engine. It leaves questions about generalization, training data requirements, and accuracy relative to other ways of solving each task outside the main evidence. Pathfinder’s accuracy comparison concerns the neural and symbolic decomposition for that task. It provides no basis for attributing a prediction improvement to the GPU backend itself.

Comparisons across different probabilistic systems require attention to the kind of answer being computed. ProbLog’s timeout results are informative about the available exact engine in the benchmark. The approximate procedures used by Lobster and Scallop can avoid some of the work exact inference requires. The comparison shows how these implementations behave on the chosen workloads, alongside a difference in the service they provide. Likewise, the RNA experiment reports processing speed. It does not establish improved agreement with measured RNA structures or validate a new biological prediction procedure.

The benchmarks span several application domains, but the decisive workload characteristics are more specific than the domain labels. The useful comparisons depend on relation sizes, join behavior, the amount of recursion, the fit of the chosen provenance, and how much of the pipeline time is already spent on the GPU. The authors select differentiable examples from Scallop with an eye to workloads that can be scaled and use graph inputs intended to involve measurable work. A small query can favor the CPU, as the shortest RNA case shows. A data-heavy query can reach a limit in either GPU memory capacity or memory traffic.

The ablation identifies the value of allocation and transfer scheduling in the selected scaling tests. Other design choices are supported by explanations of their mechanics and by results for the complete system. A direct causal ranking of those choices would require comparisons that vary them individually while holding the remainder of Lobster fixed. Similarly, the differences between Lobster and FVLog in the discrete tasks combine many implementation decisions. The paper’s explanation for particular memory failures is an interpretation of those results. The measurements themselves establish which system finished each input under the available memory budget.

What came after

There is no documented follow-up to trace from Lobster’s results. Scallop, FVLog, and the earlier work on provenance semirings are part of the paper’s technical lineage. Lobster’s own experiments establish how its compiler and runtime behaved on the evaluated workloads. Subsequent adoption or extension of APM, its GPU execution strategy, or its proof representation remains unestablished here.

Cite

Cite as Paul Biberstein, Ziyang Li, Joseph Devietti and Mayur Naik. 2025. Lobster: A GPU-Accelerated Framework for Neurosymbolic Programming. arXiv:2503.21937.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.1145/3760250.3762232 · arXiv 2503.21937

@misc{biberstein2025lobster,
  title = {{Lobster: A GPU-Accelerated Framework for Neurosymbolic Programming}},
  author = {Paul Biberstein, Ziyang Li, Joseph Devietti and Mayur Naik},
  year = {2025},
  doi = {10.1145/3760250.3762232},
  eprint = {2503.21937},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.1145/3760250.3762232}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/biberstein-2025-lobster-gpu-accelerated-framework-neurosymbolic/