In plain words: Instead of lining up an AI's steps or branching them into a tree, this lets the steps form a web, so ideas can be merged, looped, or boiled down. On sorting it raised quality 62% over the best tree-style setup while cutting costs over 31%.
Abstract
We introduce Graph of Thoughts (GoT): a framework that advances prompting capabilities in large language models (LLMs) beyond those offered by paradigms such as Chain-of-Thought or Tree of Thoughts (ToT). The key idea and primary advantage of GoT is the ability to model the information generated by an LLM as an arbitrary graph, where units of information ("LLM thoughts") are vertices, and edges correspond to dependencies between these vertices. This approach enables combining arbitrary LLM thoughts into synergistic outcomes, distilling the essence of whole networks of thoughts, or enhancing thoughts using feedback loops. We illustrate that GoT offers advantages over state of the art on different tasks, for example increasing the quality of sorting by 62% over ToT, while simultaneously reducing costs by >31%. We ensure that GoT is extensible with new thought transformations and thus can be used to spearhead new prompting schemes. This work brings the LLM reasoning closer to human thinking or brain mechanisms such as recurrence, both of which form complex networks.
Maciej Besta, Nils Blach, Ales Kubicek, Robert Gerstenberger, Michal Podstawski, Lukas Gianinazzi, Joanna Gajda, Tomasz Lehmann, Hubert Niewiadomski, Piotr Nyczyk, Torsten Hoefler
arXiv:2308.09687 · cs.CL, cs.AI, cs.LG · submitted Aug 18, 2023 · updated Feb 6, 2024
abstract · pdf · html
I was focusing more on an engineering perspective; modeling a complex LLM-and-code process as a dependency graph makes it easy to:
- add tracing to continuously measure and monitor even post-deployment
- perform reproducible experiments, a la time-rewinding debugging
- speed up iteration on prompts by caching the parts of the program you aren't working on right now
My test case was using GPT4 to implement the operators in a genetic algorithm, which tbh is a fascinating concept of its own. I drifted away after a while (curse that ADHD) but had a great time with the project in the meantime.