Most active commenters

    ←back to thread

    Learn Prolog Now

    (lpn.swi-prolog.org)
    207 points rramadass | 13 comments | | HN request time: 0.864s | source | bottom
    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(14): >>45903080 #>>45903178 #>>45903192 #>>45903204 #>>45903228 #>>45903263 #>>45903361 #>>45903376 #>>45903458 #>>45903841 #>>45904155 #>>45904166 #>>45904490 #>>45906435 #
    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(5): >>45903331 #>>45903911 #>>45904372 #>>45905822 #>>45906071 #
    1. 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 #
    2. mkirsten ◴[] No.45903373[source]
    Can you try calculating 101 * 70 in your head?
    replies(3): >>45903488 #>>45903556 #>>45904347 #
    3. hacker_homie ◴[] No.45903488[source]
    I think therefore I am calculator?
    4. ang_cire ◴[] No.45903556[source]
    Um, that's really easy to do in your head, there's no carrying or anything? 7,070

    7 * 101 = 707 * 10 = 7,070

    And computers don't brute-force multiplication either, so I'm not sure how this is relevant to the comment above?

    replies(2): >>45904373 #>>45904833 #
    5. dbtc ◴[] No.45903697[source]
    Just intuition ;)
    6. troupo ◴[] No.45904109[source]
    human brains are insanely powerful pattern matching and shortcut-taking machines. There's very little brute forcing going on.
    replies(1): >>45906216 #
    7. johnisgood ◴[] No.45904347[source]
    Very easy to solve, just like it is easy to solve many other ones once you know the tricks.

    I recommend this book: https://www.amazon.com/Secrets-Mental-Math-Mathemagicians-Ca...

    replies(1): >>45904808 #
    8. polotics ◴[] No.45904373{3}[source]
    I think it is very relevant, because no brute-forcing is involved in this solution.
    replies(1): >>45906109 #
    9. jabbywocker ◴[] No.45904808{3}[source]
    Completely missing the point on purpose?
    10. jabbywocker ◴[] No.45904833{3}[source]
    It’s almost like you’re proving the point of his reply…
    11. nutjob2 ◴[] No.45906109{4}[source]
    That's not true, the 'brute force' part is searching for a shortcut that works.
    12. nutjob2 ◴[] No.45906216[source]
    Your second sentence contradicts your first.
    13. jodrellblank ◴[] No.45906445[source]
    Because I can solve problems that would take the age of the universe to brute force, without waiting the age of the universe. So can you: start counting at 1, increment the counter up to 10^8000, then print the counter value.

    Prolog: 1, 2, 3, 4, 5 ...

    You and me instantly: 10^8000