I · ReasoningExperimental·

Graph of Thoughts

also known as GoT, DAG Reasoning

Model reasoning as an arbitrary DAG so thoughts can be merged, refined, and aggregated across branches.

Context

A team is solving problems whose natural shape is not a chain or a tree but a graph in which partial results need to be combined: sorting where partial sorted runs have to be merged, set operations whose intermediate sets feed each other, or document-merge tasks where several draft sections converge into a single output. They have already tried plain chain-of-thought and tree-of-thoughts search and found that both shapes lose the dependency structure of the underlying problem.

Problem

In a tree-shaped search, each branch is explored in isolation and the model cannot reuse what one sibling branch has already computed when working on another. When the answer further depends on combining several intermediate results, the tree has no operator to merge them, so the same sub-computation is repeated under different branches and the joint answer has to be reassembled awkwardly at the end. Without explicit operators for generating, aggregating, refining and scoring partial thoughts in a directed graph, the reasoning is more expensive than it needs to be and the structure of the problem is not preserved.

Forces

  • Richer reasoning topology vs orchestration complexity.
  • Cross-branch reuse vs aggregation prompt cost.
  • DAG expressiveness vs cycle-safety enforcement.

Example

A research agent comparing five drug candidates across efficacy, safety, and cost gets stuck in tree-of-thoughts because each branch evaluates one candidate in isolation and cannot reuse a sub-analysis across siblings. The team rebuilds the reasoning state as a DAG: each per-candidate efficacy node feeds into a shared aggregation node that ranks candidates jointly, and a refine operator can revisit any node when new evidence appears. Intermediate scoring is computed once and merged across branches, and the final ranking cites the aggregation node as its source.

Diagram

Solution

Therefore:

Reasoning state is a DAG of thoughts. Operations include generate (CoT-style), aggregate (merge multiple thoughts), refine (improve one thought), and score. The orchestrator chains operations to produce a final thought; the agent can reuse intermediate nodes across branches.

What this pattern forbids. Thought operations must be composed via the named operators; ad-hoc reasoning outside the operator vocabulary is forbidden.

The smaller patterns that complete this one —

  • generalisesTree of ThoughtsSearch over a tree of partial reasoning states with explicit lookahead, evaluation, and backtracking.

And the patterns that stand alongside it, or against it —

  • complementsLanguage Agent Tree Search·Lift the agent loop into a search tree with a learned value function and backtracking.
  • composes-withBlackboard·Give multiple agents a shared, queryable workspace they can read from and write to as they collaborate.
  • complementsLLMCompiler·Take ReWOO's plan-as-DAG and run independent steps in parallel through a task-fetching dispatcher.

Neighbourhood

Click any neighbour to follow the language. Scroll to zoom, drag to pan.

References

Provenance