Live data from Hacker News

Scallop – A Language for Neurosymbolic Programming

scallop-lang.org

11–20 of 68 posts

Re: Scallop – A Language for Neurosymbolic Programming

#11
post #3
post #2

Ever since I learned about category theory and its relationship with symbolic reasoning I've suspected that AGI will come from elegantly combining symbolic reasoning and probabilistic reasoning. This is the first project I've seen that seems to be positioned that way. Very cool.

When LLMs code in order to reason, isn’t that a combination of probabilistic reasoning and symbolic reasoning?

Neural networks are actually somewhere in between. They don't directly operate on symbolic expressions or explicit logical rules. And while they rely on probabilistic aspects for training (and sometimes for inference), they rely more on continuous-valued transformations in extremely high dimensional spaces. But if your goal is human-like intelligence, they are a pretty good bet, because we know the human brain also doesn't perform symbolic reasoning at its core and these things only emerge as high-level behaviour from a sufficiently complex system. But it also makes neural networks (and us too) prone to failure modes that you would not see in strictly symbolic reasoning processes.

Re: Scallop – A Language for Neurosymbolic Programming

#13

A bit over my head - but can't Prolog achieve similar results?

Anything can do anything else given enough time and power, but I think: no, not without shenanigans. This has primitives for interfacing to nn's including foundation models so you can ask it (for example) to label images of cats and dogs using clip, then you can reason over the results.

So it's intended to combine nn reasoning and logical reasoning cleanly.

Re: Scallop – A Language for Neurosymbolic Programming

#14

If you like scallop, you are gonna love lobster: https://liby99.github.io/res/papers/lobster.pdf

Thank you.

you seem to be more in the know than me :) Please could you just sketch out a few bullets and explain the relationship between Scallop and Lobster and what you think is going on?

Re: Scallop – A Language for Neurosymbolic Programming

#15
Wow, I'm currently reading the Scallop paper, so funny to see it posted here!

I really love the concept. This isn't just differentiable neurosymbolic declarative probabilistic programming; Scallop has the flexibility of letting you use various (18 included) or custom provenance semirings to e.g. track "proofs" why a relational fact holds, not just assign it a probability. Sounds cool but I'm still trying to figure out the practicality.

Also worth pointing out that it seems that a lot of serious engineering work has been done on Scallop. It has an interpreter and a JIT compiler down to Rust compiled and dynamically loaded as a Python module.

Because a Scallop program (can be) differentiable it can be used anywhere in an end-to-end learning system, it doesn't have to take input data from a NN and produce your final outputs, as in all the examples they give (as far as I can see). For example you probably could create a hybrid transformer which runs some Scallop code in an internal layer, reading/writing to the residual stream. A simpler/more realistic example is to compute features fed into a NN e.g. an agent's policy function.

The limitation of Scallop is that the programs themselves are human-coded, not learnt, although they can implement interpreters/evaluators (e.g. the example of evaluating expressions).

Re: Scallop – A Language for Neurosymbolic Programming

#16

I wish this website explained what neurosymbolic means.

It's a combination of neural networks and symbolic reasoning. You can use a neurosymbolic approach by combining deep learning and logical reasoning:

A neural network (PyTorch) detects objects and actions in the image, recognizing "Jim" and "eating a burger" with a confidence score.

A symbolic reasoning system (Scallop) takes this detection along with past data (e.g., "Jim ate burgers 5 times last month") and applies logical rules like:

        likes(X, Food) :- frequently_eats(X, Food).

        frequently_eats(Jim, burgers) if Jim ate burgers > 3 times recently.
The system combines the image-based probability with past symbolic facts to infer: "Jim likely likes burgers" (e.g., 85% confidence).

This allows for both visual perception and logical inference in decision-making.

Re: Scallop – A Language for Neurosymbolic Programming

#17
post #14

If you like scallop, you are gonna love lobster: https://liby99.github.io/res/papers/lobster.pdf

Thank you. you seem to be more in the know than me :) Please could you just sketch out a few bullets and explain the relationship between Scallop and Lobster and what you think is going on?

I read the paper on Lobster a little bit. Scallop does its reasoning on the CPU - whereas Lobster is an attempt to move that reasoning logic to the GPU. That way the entire neurosymbolic pipeline stays on the GPU and the whole thing runs much faster.

Re: Scallop – A Language for Neurosymbolic Programming

#18

Wow, I'm currently reading the Scallop paper, so funny to see it posted here! I really love the concept. This isn't just differentiable neurosymbolic declarative probabilistic programming; Scallop has the flexibility of letting you use various (18 included) or custom provenance semirings to e.g. track "proofs" why a relational fact holds, not just assign it a probability. Sounds cool but I'm still trying to figure ou…

I'm wondering if this is a limitation though. If it can be learnt from training data, would it not be part of the neural network training data? I imagine we use Scallop to bridge the gap where we can't readily learn certain rules based on available data or perhaps we would prefer to enforce certain rules?

Re: Scallop – A Language for Neurosymbolic Programming

#19

If you like scallop, you are gonna love lobster: https://liby99.github.io/res/papers/lobster.pdf

Unfortunately it doesn't seem to be available yet. Scallop and Lobster are both from UPenn, and the Scallop website says "We are still in the process of open sourcing Scallop," so I assume it's a matter of time.
Post reply on HN