Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Workflow:Diagram of thought Diagram of thought DoT Iterative Reasoning

From Leeroopedia
Knowledge Sources
Domains LLM_Reasoning, Prompt_Engineering, DAG_Construction
Last Updated 2024-09-15 12:00 GMT

Overview

End-to-end process for solving complex reasoning problems using the Diagram of Thought (DoT) iterative reasoning framework within a single LLM.

Description

This workflow guides a user through the complete process of applying the Diagram of Thought framework to a complex problem. DoT enables a single language model to construct a Directed Acyclic Graph (DAG) of reasoning steps by alternating between three internalized roles: proposer (generates candidate reasoning steps), critic (evaluates propositions for logical soundness), and summarizer (synthesizes validated evidence into a final answer). The entire reasoning process is self-contained within one autoregressive model, eliminating the need for external controllers, multi-agent orchestration, or search algorithms. The output is an auditable reasoning trace that can be verified and analyzed.

Usage

Execute this workflow when you have a complex reasoning problem (mathematical, logical, analytical, or multi-step) that benefits from structured exploration and self-correction, and you want an auditable trail of the reasoning process. This is particularly suited for problems where linear Chain-of-Thought reasoning is insufficient because the solution space requires branching, backtracking, or parallel evidence lines.

Execution Steps

Step 1: Problem Formulation

Define the problem clearly and encapsulate it within the DoT framework. The problem statement should be specific enough for the model to begin proposing concrete reasoning steps. Wrap the problem in the problem role tag so the model recognizes it as the root node of the reasoning DAG.

Key considerations:

  • State the problem unambiguously with all necessary context
  • Include any constraints or boundary conditions
  • The problem node becomes node id=1 in the reasoning graph

Step 2: System Prompt Configuration

Load the DoT iterative reasoning system prompt into the LLM session. This prompt instructs the model to alternate between the three roles (proposer, critic, summarizer) using XML-tagged sections. The system prompt establishes the behavioral contract: the proposer generates atomic steps, the critic validates or invalidates them, and the summarizer synthesizes only validated propositions.

Key considerations:

  • Use the full iterative-reasoner prompt from the repository
  • The prompt defines the XML tag structure and role responsibilities
  • Ensure the model supports system-level prompting

Step 3: Iterative Propose and Critique

The model enters the propose-critique loop. The proposer role generates one or more concrete, atomic reasoning steps that advance toward the solution, building upon previous validated propositions. The critic role then evaluates each proposition for logical consistency, accuracy, and soundness, marking each as validated or invalidated. If a proposition is invalidated, the proposer refines or branches to an alternative approach.

What happens:

  • Proposer emits a candidate step with declared dependencies
  • Critic analyzes the step and provides a natural language critique
  • Valid steps are marked validated; flawed steps are marked invalidated
  • Invalidated steps trigger refinement or alternative branches
  • The cycle repeats, building up the reasoning DAG incrementally

Step 4: Convergence Check

After several propose-critique iterations, assess whether sufficient validated evidence has accumulated to answer the problem. The summarizer role reviews the DAG of propositions and critiques to determine if the reasoning is complete. If gaps remain, the cycle returns to Step 3 for additional propose-critique iterations.

Key considerations:

  • The summarizer only considers validated propositions
  • Incomplete reasoning triggers another propose-critique cycle
  • Convergence occurs when all necessary reasoning branches are validated

Step 5: Final Synthesis

The summarizer role constructs the final answer by synthesizing information exclusively from validated propositions. It extracts and organizes the valid reasoning steps into a coherent chain-of-thought, citing the specific proposition IDs used. The result is a well-grounded conclusion backed by an auditable trail of validated evidence.

What happens:

  • Summarizer reviews all validated nodes in the DAG
  • Extracts the logical chain connecting problem to conclusion
  • Produces the final answer with references to supporting propositions
  • The reasoning trace remains available for post-hoc verification

Execution Diagram

GitHub URL

Workflow Repository