Principle:Spcl Graph of thoughts Graph of Operations Construction
| Knowledge Sources | |
|---|---|
| Domains | Graph_Reasoning, DAG_Construction |
| Last Updated | 2026-02-14 12:00 GMT |
Overview
Structural pattern for building a directed acyclic graph of thought operations that defines the execution plan for LLM reasoning.
Description
A Graph of Operations (GoO) is a directed acyclic graph where:
- Nodes are operations -- discrete reasoning steps such as Generate, Score, Aggregate, KeepBestN, Selector, and GroundTruth
- Edges represent data flow dependencies -- an edge from operation A to operation B means B consumes the thoughts produced by A
The GoO is the execution plan that prescribes what reasoning steps to perform and in what order. It is constructed before execution begins and is then traversed by the Controller at runtime.
Two construction methods are provided, each suited to different graph topologies:
append_operation(operation)-- Adds the new operation as a successor of all current leaf operations. This is ideal for building linear chains and simple fan-out topologies. Each call extends the graph from its current frontier. This is the simpler API and covers IO, CoT, and basic branching patterns.add_operation(operation)-- Respects explicit predecessor and successor links that have been pre-configured on the operation object. This enables construction of arbitrary DAG topologies, including fan-in (aggregation) patterns where multiple branches converge. This is required for true GoT topologies.
The distinction between the four major reasoning paradigms -- IO, CoT, ToT, and GoT -- is entirely determined by the GoO structure:
- IO (Input-Output): A single Generate operation. One node, no edges.
- CoT (Chain of Thought): A linear chain of Generate operations. Each produces one thought that feeds the next.
- ToT (Tree of Thought): A tree structure where Generate operations branch (producing multiple candidates), followed by Score and KeepBestN operations that prune branches.
- GoT (Graph of Thought): An arbitrary DAG that includes aggregation -- multiple branches merge via Aggregate operations, enabling the LLM to combine insights from independent reasoning paths.
Usage
Use this principle when designing the reasoning strategy for a new problem. The key design decisions are:
- What operations are needed? Identify the reasoning steps: generation, scoring, selection, aggregation, ground truth evaluation.
- What is the topology? Determine whether a linear chain suffices or whether branching and merging are needed.
- Which construction API to use? Choose
append_operationfor simple chains and fan-out. Chooseadd_operationfor arbitrary DAGs with fan-in.
Theoretical Basis
Reasoning Paradigms as Graph Topologies
The GoT paper establishes that different LLM reasoning paradigms correspond to different graph topologies:
IO (Input-Output):
# Single node -- one LLM call, no chaining
goo = GraphOfOperations()
goo.append_operation(Generate(1, 1))
Topology: [Generate]
CoT (Chain of Thought):
# Linear chain -- each step feeds the next
goo = GraphOfOperations()
goo.append_operation(Generate(1, 1))
goo.append_operation(Generate(1, 1))
goo.append_operation(Generate(1, 1))
Topology: [Generate] -> [Generate] -> [Generate]
ToT (Tree of Thought):
# Branching with selection -- generate multiple candidates, keep best
goo = GraphOfOperations()
goo.append_operation(Generate(1, 5)) # 1 input, 5 candidates
goo.append_operation(Score(my_scorer)) # score all 5
goo.append_operation(KeepBestN(1)) # keep best 1
Topology: [Generate(1->5)] -> [Score] -> [KeepBestN]
GoT (Graph of Thought):
# Arbitrary DAG with aggregation -- branches merge
goo = GraphOfOperations()
gen1 = Generate(1, 1)
gen2 = Generate(1, 1)
agg = Aggregate(2)
agg.add_predecessor(gen1)
agg.add_predecessor(gen2)
goo.add_operation(gen1)
goo.add_operation(gen2)
goo.add_operation(agg)
Topology:
[Generate1] --\
--> [Aggregate]
[Generate2] --/
The key insight is that GoT subsumes all other paradigms. Any IO, CoT, or ToT graph is also a valid GoT graph. The additional expressive power of GoT comes from aggregation edges that allow merging information from independent reasoning branches -- something that tree-structured approaches cannot represent.
Design Patterns
Common GoO construction patterns include:
- Divide and conquer: Generate (split) -> parallel branches -> Aggregate (merge)
- Generate-score-select: Generate (N candidates) -> Score -> KeepBestN
- Iterative refinement: Generate -> Score -> KeepBestN -> Generate (improve) -> Score -> KeepBestN
- Hybrid: Combinations of the above, forming multi-level DAGs