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

  1. The problem is split into subtasks, each treated as a thought node.
  2. A generate operation creates new thoughts; an aggregate operation gathers several into one node.
  3. A refine operation evaluates a thought and has it rewritten to improve it.
  4. 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

TermHow it differs
GraphRAGGraph 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 graphsGraph 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.

ON-PREMISES EXAMPLE

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.

Sources

In the glossary: Glossary, E to L

What does this term mean for your infrastructure?

We can work out together in a technical assessment how it maps onto your data, hardware and security requirements.

Request a technical assessment →

This site sets no cookies. Visitor numbers are counted in aggregate using a cookieless method that does not identify anyone. See the Privacy Policy for details.