←back to thread

Learn Prolog Now

(lpn.swi-prolog.org)
226 points rramadass | 2 comments | | HN request time: 0.001s | source
Show context
disambiguation ◴[] No.45902807[source]
I am once again shilling the idea that someone should find a way to glue Prolog and LLMs together for better reasoning agents.

https://news.ycombinator.com/context?id=43948657

Thesis:

1. LLMs are bad at counting the number of r's in strawberry.

2. LLMs are good at writing code that counts letters in a string.

3. LLMs are bad at solving reasoning problems.

4. Prolog is good at solving reasoning problems.

5. ???

6. LLMs are good at writing prolog that solves reasoning problems.

Common replies:

1. The bitter lesson.

2. There are better solvers, ex. Z3.

3. Someone smart must have already tried and ruled it out.

Successful experiments:

1. https://quantumprolog.sgml.net/llm-demo/part1.html

replies(15): >>45903080 #>>45903178 #>>45903192 #>>45903204 #>>45903228 #>>45903263 #>>45903361 #>>45903376 #>>45903458 #>>45903841 #>>45904155 #>>45904166 #>>45904490 #>>45906435 #>>45907115 #
jodrellblank ◴[] No.45903192[source]
> "4. Prolog is good at solving reasoning problems."

Plain Prolog's way of solving reasoning problems is effectively:

    for person in [martha, brian, sarah, tyrone]:
      if timmy.parent == person:
        print "solved!"
You hard code some options, write a logical condition with placeholders, and Prolog brute-forces every option in every placeholder. It doesn't do reasoning.

Arguably it lets a human express reasoning problems better than other languages by letting you write high level code in a declarative way, instead of allocating memory and choosing data types and initializing linked lists and so on, so you can focus on the reasoning, but that is no benefit to an LLM which can output any language as easily as any other. And that might have been nice compared to Pascal in 1975, it's not so different to modern garbage collected high level scripting languages. Arguably Python or JavaScript will benefit an LLM most because there are so many training examples inside it, compared to almost any other langauge.

replies(6): >>45903331 #>>45903911 #>>45904372 #>>45905822 #>>45906071 #>>45907029 #
nuc1e0n ◴[] No.45903331[source]
What makes you think your brain isn't also brute forcing potential solutions subconciously and only surfacing the useful results?
replies(4): >>45903373 #>>45903697 #>>45904109 #>>45906445 #
troupo ◴[] No.45904109{3}[source]
human brains are insanely powerful pattern matching and shortcut-taking machines. There's very little brute forcing going on.
replies(1): >>45906216 #
1. nutjob2 ◴[] No.45906216{4}[source]
Your second sentence contradicts your first.
replies(1): >>45907398 #
2. troupo ◴[] No.45907398[source]
Pray tell how it contradicts the first.

Just note: human pattern matching is not Haskell/Erlang/ML pattern matching. It doesn't go [1] through all possible matches of every possible combination of all available criteria

[1] If it does, it's the most powerful computing device imaginable.