Live data from Hacker News

I accidentally turned LLM memory into program analysis

pwning.systems

71–80 of 93 posts

Re: I accidentally turned LLM memory into program analysis

#73
post #62

I encountered this with trying to have LLMs populate facts about electoral campaigns. Like when a candidate drops out, when endorsements happen, but also if a candidate is un-endorsed or drops and rejoins. It also needed to handle if any of these facts were incorrect. I settled on a knowledge graph in Postgres and downloading/storing the source documents so it could iterate on past results without more scraping or ne…

I had similar problems to solve for trading advice, complex project reasoning etc.

I settled on simplicity, extended it to serve clear, useful purpose.

Started with markdown database, single fact per line, structured/parseable (subject VERB object). This can be easily diffed/reviewed etc in git. Then added optional metadata (confidence, tags, persisted comments for natural language, uncertainty for numeric values, context, timestamps/spans), querying, alternative sqlite3 backend, self describing VERBS, z3 solver etc.

Those kind of graph information systems are great to quickly structure knowledge in a way that LLMs and humans can use/act on/loop on. Creating ontology, linking, some rules and actions and kicking it so it all munches and spits out results that feed back in so it self evolves. It's very natural for llms to query/update/restructure those graphs (also good for humans because it's very terse, essential information only).

There is no need to create k8s style complexity/services/what-not, it all works well from single sqlite db file or bunch of markdown (.cave in my case) files.

It's also interesting to see how well local open weight models are dealing with information arranged this way.

Re: I accidentally turned LLM memory into program analysis

#75
I couldn't quite figure out Lemmalog's latest benchmark stats from the README but it sounds cool!

I heard of Scallop, that also uses Datalog for neurosymbolic programming, I wonder where Lemmalog fits with Scallop? I know little about Datalog so sorry if this is a dumb question!

Re: I accidentally turned LLM memory into program analysis

#76

I reached a similar conclusion: LLMs should only really sit at the terminals of request fulfilment. 1. User request understanding: natural language -> a more rigorous representation, in my case Datalog. 2. Result interpretation: facts and derived facts -> natural language. Between those terminals, the work should be mechanical reasoning over some ontology or formal knowledge structure. That connects to another princi…

I guess efforts like Google's OKF, which teach the llm to manage the ontology directly, are the opposite of what you want.

The weathering need is real. An llm equivalent of dbms analysing usage pattern to tune indexes.

Re: I accidentally turned LLM memory into program analysis

#77
Isn't that why we created models and graphs before ? Maybe now the uml to source roundtrip can be solved with LLMs. Back in 2010s that's where it was stuck.

Note: I wonder how many people reified their codebase as logical facts to query or investigate it more deterministically. I've been trying for a while, still not far but getting there.

Re: I accidentally turned LLM memory into program analysis

#78
post #26

So he's using an LLM to generate data stored in an "is_a" representation. That's so classic AI. Soon, he'll discover that he needs quantifiers. Then that "for all" is too strong sometimes, and he needs "for most". That way lies Cyc. It's not a bad idea. But it does have a history.

In general, what all the big LLM providers are doing is moving towards classical & neural (neuro-symbolic) AI - even though they dont publicly admit it because that would counter their claims for years of "scale is all you need" (which has vanished with diminishing returns, see $MS / altman's GPT-5 bet).

It's strange to frame this as classical vs scale. Us humans have a powerful inference engine in our heads. We also use a calendar to avoid re-deriving everything from first principles before we've had our morning coffee. Businesses couple many creative (human) agents together. They also have processes and rules.

Re: I accidentally turned LLM memory into program analysis

#80
What a great write up. One of the few long form contents that I just opened and read from top to bottom without planning for it or keeping the tab open to read later. Great job.

I’ve been battling the same problem, and I solved it by keeping the state in my brain, long focus hours, and breaking down the problem to smaller chunks that agents could almost one-shot. That made me the bottleneck, and although I can do it for codebases I’m familiar with, working on totally new projects has been very painful.

I’m going to test it in my own vuln research workflow.

Post reply on HN