What is graph of thoughts?
Graph of thoughts is a reasoning method that arranges a language model's intermediate thoughts as nodes of a graph with their dependencies as edges, allowing thoughts not only to branch but also to be merged and iteratively refined.
Unlike tree of thoughts, whose branches never join, it lets results from different branches combine in one node while a thought can loop back to refine itself, suiting work that splits a problem and later combines the parts.
- Topic
- Prompts, context, reasoning and generation
- Also known as
- GoT
- Origin
- 2023, Besta et al.
How graph of thoughts works
- The problem is split into subtasks, each treated as a thought node.
- A generate operation creates new thoughts; an aggregate operation gathers several into one node.
- A refine operation evaluates a thought and has it rewritten to improve it.
- Nodes are scored and the final answer comes from the best combination; the order of operations is defined beforehand as a plan.
In more detail
Built-in reasoning models versus structured graph orchestration
With the rise of native RL-trained reasoning models (such as OpenAI o-series, DeepSeek-R1 and extended-thinking models), explicit GoT prompting is rarely needed for single-prompt puzzles or short reasoning tasks. Instead, GoT-style DAG orchestration remains valuable in enterprise engineering as a structured map-reduce and verification pipeline for large multi-document workloads that exceed a single context or require deterministic intermediate checkpoints.
Graph of operations versus graph reasoning state
In Besta et al.'s architecture, execution is separated into two graphs: the Graph of Operations (GoO), which defines the static blueprint of transformations (Generate, Aggregate, Refine, Score, KeepBestN) and the Graph Reasoning State (GRS), which tracks the live intermediate thoughts and edges generated at runtime.
Token and latency cost and dependence on the evaluator
Because GoT uses many intermediate generation, scoring and refinement calls, token consumption and latency grow rapidly compared to Chain-of-Thought or single-pass long-context prompting. Moreover, if the scoring function (LLM-as-a-judge or rule-based evaluator) is noisy, weak thoughts can be retained or merged, propagating errors into the final result.
Commonly confused terms
| Term | How it differs |
|---|---|
| GraphRAG | Graph of Thoughts is a prompting/reasoning orchestration framework over LLM-generated text thoughts, whereas GraphRAG retrieves and synthesises context from an external knowledge graph built over documents before generation. |
| Agentic workflow graphs | Graph of Thoughts executes a predefined Graph of Operations (typically a static orchestration plan over thoughts), whereas general multi-agent or LangGraph workflows dynamically route control flow across tools, external APIs, memory and human approvals. |
Why graph of thoughts matters for on-premises AI
Graph of thoughts can give a more orderly flow than chain or tree of thoughts in split-and-merge work, such as dividing a large document set and combining each part's result. The cost is many model calls plus the engineering effort to design the operation plan. Run in-house, data stays inside, but latency and GPU load go into the capacity plan. It is not needed for every task and is first compared with simpler methods.
A law firm uses graph of thoughts to compare termination conditions across many contracts in-house; each contract is summarised in a node, summaries become a comparison table in an aggregation node and a refinement step checks it.
Common questions
How does graph of thoughts differ from tree of thoughts?
In tree of thoughts branches proceed separately. In graph of thoughts thoughts from different branches can be merged and iteratively refined.
What work suits graph of thoughts?
Work that splits a problem into parts and later combines their results: multi-document comparisons, sorting or merging tasks.
Related terms
Sources
- Besta et al., Graph of Thoughts: Solving Elaborate Problems with Large Language Models, 2023
- Yao et al., Tree of Thoughts: Deliberate Problem Solving with Large Language Models, 2023
In the glossary: Glossary, E to L