GraphGPT: Extrapolating knowledge graphs from unstructured text
github.com
github.com
I once worked on AI Dungeon and we had a similar idea to parse the story so far into a graph, so that we could manage long-term memory outside of the context window (which was only 2048 tokens).
Coreference is hard. ("he took the sword"... who is he?) Updating the graph is also hard. (As the story progresses, new facts contradict old facts. Jenny was dating Tom, but now she's dating Mike.)
And knowing what to do with the knowledge graph is hard too, especially if you don't know the schema up front. The only thing we could think to use it for was... programmatically turning relevant sections back into text and prepending it to the context window. (There were easier ways to get a similar effect.)
Why can’t graphs properly model time or sequences?
You could have some heuristics to handle this and then you add another relation "has met" and suddenly you need a whole new set of heuristics.
But rdf style and labeled property graph data modeling approach have multiple ways of dealing with this.
Facts can contradict each other. Old facts are not lost. Querying requires a notion of time - “as of”.
Curious what other (easier) ways you found to accomplish the same effect?
I'll venture that once truly long range correlations can be managed (at scales 100-1000x what's possible with current GPTs), all the issues about logical reasoning can be answered by training on the right corpus and applying the right kinds of human guided reinforcement.
I can't help but think, is this the voice in our heads?
Never expected to see this near the top of HN, but here we are! Super cool to see so much excitement around my weekend hack. Happy to answer any questions on the project.
I posted a couple demo videos on Twitter, in case anyone is interested: https://twitter.com/varunshenoy_/status/1620511932930490372?...
Just bring your own OpenAI API Key.
Now you just use text output to generate raw json and parse that. Crazy times.
Here's an example (my work): https://aclanthology.org/2021.naacl-main.67.pdf
TLDR of the input/output: https://madaan.github.io/res/tldr/graph_gen_tldr.jpg
Some work from AllenAI: https://proscript.allenai.org/
I was expecting this would make Newman, Jerry and Kramer all neighbours of each other, but it only did it for Newman and Kramer.
In general, GraphGPT tends to be very conservative in adding nodes/relationships. Not sure why, but probably deserves more investigation.
Does anyone know how to extract the nodes and links (edges and vertices) in text (JSON perhaps) or tabular form to input into other systems (like, say, Neo4j)?
It's not quite battle tested, but think I gotta sleep and take a look at it tomorrow.