Implementation:Diagram of thought Diagram of thought Full Vs Minimal Template Selection
| Knowledge Sources | |
|---|---|
| Domains | Prompt_Engineering, Configuration |
| Last Updated | 2026-02-14 04:30 GMT |
Overview
Concrete selection between the full 67-line DoT prompt template and the minimal 34-line template for use as a customization base. This implementation documents the two template artifacts provided by the Diagram of Thought repository and the logic for choosing between them based on task requirements and model capability.
Description
The Diagram of Thought repository provides two template options that serve as starting points for building domain-specific DoT prompts:
- Full prompt (
prompts/iterative-reasoner.md, L1-67): A detailed 67-line template containing five structural sections -- role declarations introducing the three XML-tagged roles, comprehensive role and responsibility descriptions with explicit objectives and behavioral instructions for each role (<proposer>,<critic>,<summarizer>), a four-step iterative process flow, formatting guidelines covering clarity, logical progression, tag usage, and natural language requirements, and a complete example interaction demonstrating the expected XML tag alternation pattern.
- Minimal template (
README.md:L63-97, 34 lines): A concise template that introduces the four roles (<problem>,<proposer>,<critic>,<summarizer>), embeds the typed serialization protocol (@node,@edge,@statusrecords) inline, and provides a single structural walkthrough showing role alternation interleaved with record annotations. This template omits detailed role descriptions and formatting guidelines, relying on the model to generalize from the compact specification.
The key differences between the two templates:
| Aspect | Full Template | Minimal Template |
|---|---|---|
| Lines | 67 | 34 |
| Role descriptions | Detailed objectives, instructions, output format per role | Brief inline role names |
| Process flow | Explicit four-step cycle description | Implicit via structural walkthrough |
| Formatting guidelines | Dedicated section (clarity, progression, tags, NL) | Omitted |
| Example interaction | Complete XML tag alternation example | Structural template with placeholders |
| Typed records | Not included | @node, @edge, @status inline
|
| Roles defined | 3 (<proposer>, <critic>, <summarizer>) |
4 (<problem>, <proposer>, <critic>, <summarizer>)
|
Usage
When preparing to customize a DoT prompt for a specific domain. The template selection occurs before any domain-specific modifications are applied to the prompt content. The selected template becomes the base artifact that is then tailored with custom role instructions, domain constraints, and task-specific examples.
Code Reference
Source Location
- Repository: Diagram of Thought
- Full template:
prompts/iterative-reasoner.md:L1-67(entire file) - Minimal template:
README.md:L63-97(inline code block)
Signature
def select_template(mode: str = "full") -> str:
"""Select a DoT base prompt template for downstream customization.
Parameters
----------
mode : str
"full" - Load the detailed 67-line template from prompts/iterative-reasoner.md.
Includes role descriptions, process flow, formatting guidelines,
and example interaction.
"minimal" - Return the concise 34-line template (README.md:L63-97).
Includes typed serialization records inline, omits detailed
role descriptions and formatting guidelines.
Returns
-------
str
Base prompt text ready for customization.
"""
...
Import
# File I/O -- no external dependencies required
import os
# Full template: read from file
with open("prompts/iterative-reasoner.md", "r") as f:
full_template = f.read()
# Minimal template: defined inline (sourced from README.md:L63-97)
minimal_template = """You are a single model that performs Diagram-of-Thought (DoT) reasoning.
Your goal is to build a graph of reasoning steps to solve the problem.
You will use the following roles: <problem>, <proposer>, <critic>, and <summarizer>.
When possible, interleave typed records for auditability:
@node id=<n> role={problem|proposer|critic|summarizer}
@edge src=<i> dst=<n> kind={use|critique|refine} (must have i < n)
@status target=<i> mark={validated|invalidated}
..."""
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| template_mode | "minimal" | Yes | Selects which base template to return. "full" loads the 67-line detailed prompt from prompts/iterative-reasoner.md. "minimal" returns the 34-line concise template from README.md:L63-97.
|
| configuration | dict | No | Task requirements that inform the selection decision. May include fields such as rigor_level (how strict the critic should be), model_capability (estimated capability of the target LLM), task_familiarity (whether the task type is well-known to the model), and token_budget (maximum tokens available for the system prompt).
|
Outputs
| Name | Type | Description |
|---|---|---|
| base_prompt_text | str | The selected base prompt template as a string, ready for downstream customization (adding domain-specific role instructions, constraints, examples, etc.) before being loaded into an LLM session. |
Usage Examples
Loading Both Templates
def select_template(mode: str = "full") -> str:
"""Select a DoT base prompt template for downstream customization."""
if mode == "full":
with open("prompts/iterative-reasoner.md", "r") as f:
return f.read()
elif mode == "minimal":
return """You are a single model that performs Diagram-of-Thought (DoT) reasoning.
Your goal is to build a graph of reasoning steps to solve the problem.
You will use the following roles: <problem>, <proposer>, <critic>, and <summarizer>.
When possible, interleave typed records for auditability:
@node id=<n> role={problem|proposer|critic|summarizer}
@edge src=<i> dst=<n> kind={use|critique|refine} (must have i < n)
@status target=<i> mark={validated|invalidated}
..."""
else:
raise ValueError(f"Unknown template mode: {mode!r}. Use 'full' or 'minimal'.")
# Load the full template (67 lines, detailed guidance)
full_prompt = select_template("full")
print(f"Full template: {len(full_prompt.splitlines())} lines")
# Load the minimal template (34 lines, concise with typed records)
minimal_prompt = select_template("minimal")
print(f"Minimal template: {len(minimal_prompt.splitlines())} lines")
Tradeoff Decision Guide
def choose_template(model_capability: str, task_familiarity: str) -> str:
"""Decide which DoT template to use based on model and task characteristics.
Parameters
----------
model_capability : str
"high" for frontier models (GPT-4, Claude Opus, etc.)
"medium" or "low" for smaller or less capable models.
task_familiarity : str
"high" if the task type is well-known (math, logic, code).
"low" if the task is novel or domain-specific.
Returns
-------
str
The selected base prompt template text.
"""
if model_capability == "high" and task_familiarity == "high":
# Concise, token-efficient -- capable models generalize from minimal instruction
template = select_template("minimal")
else:
# Detailed, more guidance -- helps less capable models or novel tasks
template = select_template("full")
return template
# Example: frontier model on a familiar reasoning task
template = choose_template(model_capability="high", task_familiarity="high")
# -> Returns the minimal 34-line template (token-efficient)
# Example: smaller model on a novel domain
template = choose_template(model_capability="medium", task_familiarity="low")
# -> Returns the full 67-line template (more behavioral guidance)