Working with the Chain of Draft Technique Through Computational Thinking
Better Prompting with COD
The "Chain of Draft Technique" proposes a excellent approach, mirroring the way we took rough notes in school.
I was studying in YPS , Mohali , India and making rough notes , sketches and doodling was way of Schooling and Learning …
This method, I mean COD while seemingly intuitive, demands a deeper understanding of computational, systematic, and modeling thinking.
Let's delve into this technique and explore how to bridge the gap between its promise and practical application.
The Chain of Draft Technique: A Return to Rough Notes
Imagine your school days, scribbling notes with symbols, abbreviations, and step-by-step breakdowns. This is the essence of the Chain of Draft Technique. Its proponents suggest abandoning verbose, conversational prompts in favor of concise, structured commands.1
1. Variables and Symbols: Precision in Prompting
Instead of writing, "Summarize the key arguments from the article about climate change," we might use:
SUMMARIZE [ARTICLE: climate_change_article]
KEY_POINTS [ARTICLE: climate_change_article] -> OUTPUT: [SUMMARY]
Here, ARTICLE
is a variable, and ->
represents a processing step. This allows for greater clarity and reusability.
Example:
Instead of: "Translate this English sentence to French: 'The cat sat on the mat.'"
We could use:
TRANSLATE [SOURCE_LANG: English, TEXT: "The cat sat on the mat.", TARGET_LANG: French]
2. Equations: Step-by-Step Logic
Complex tasks can be broken down into a series of "equations," guiding the LLM through a logical process.
Example:
Problem: "Write a short story outline based on the theme of 'lost technology.'"
Chain of Drafts:
THEME = "lost technology"
CHARACTERS = [PROTAGONIST: inventor, ANTAGONIST: corporation]
SETTING = [TIME: future, LOCATION: remote island]
PLOT = [INTRO: discovery, CONFLICT: corporation pursuit, RESOLUTION: technology hidden]
OUTPUT = [STORY_OUTLINE: CHARACTERS + SETTING + PLOT]
3. Hints: Guiding the LLM's Thought Process
Just as we'd jot down reminders in our notes, hints can guide the LLM's output.
Example:
Prompt: "Write a poem about nature."
Chain of Drafts:
POEM [THEME: nature, STYLE: haiku, HINT: focus on sensory details]
The Challenge: Bridging the Thinking Gap
While the Chain of Draft Technique offers significant advantages, it requires a shift in our cognitive approach.
1. Computational Thinking: Breaking Down Problems
Computational thinking involves decomposing complex problems into smaller, manageable steps.2
Example:
Problem: "Write a recipe for a vegan chocolate cake."
Computational thinking:
Identify the necessary ingredients.
Break down the baking process into individual steps.
Consider the order of operations.
Define the desired output (a vegan chocolate cake).
2. Systematic Thinking: Understanding Relationships
Systematic thinking involves recognizing patterns and relationships within complex systems.3
Example:
Analyzing customer feedback for a product launch:
Identify recurring themes and sentiments.
Group feedback into categories (e.g., usability, features, pricing).
Analyze the relationships between different feedback categories.
Develop insights into customer satisfaction.
3. Modeling Thinking: Abstract Representations
Modeling thinking involves creating abstract representations of real-world problems or concepts.4
Example:
What it is: Modeling thinking is the ability to create simplified representations of complex systems, allowing us to understand and manipulate them. This could be a mental model, a diagram, or a mathematical equation.
How it is required: LLM responses are based on models of language and knowledge.5 Chain of Drafts requires users to create models of their desired output, and the steps to get there.
Examples:
Creating a flow chart to represent a business process.
Developing a mathematical model to predict sales trends.
Creating a simplified diagram that shows how a computer network functions.
In the case of the recipe, the list of ingredients and the order of actions is a simple model of the process.
Chain of Thoughts (COT) vs. Chain of Drafts (COD)
Chain of Thoughts: Relies on the LLM to generate intermediate reasoning steps in natural language.6
Chain of Drafts: Requires the user to explicitly define the steps using variables, equations, and hints.
Example:
Prompt: "What is the capital of France?"
Chain of Thoughts: "France is a country in Europe. The capital of France is Paris."7
Chain of Drafts:
CAPITAL [COUNTRY: France] -> OUTPUT: Paris
Prompt: "Write a short story about a detective solving a crime."
Chain of thoughts: LLM will generate multiple paragraphs of story telling.
Chain of Drafts:
CRIME = [TYPE: robbery, LOCATION: museum]
DETECTIVE = [NAME: John Smith, TRAITS: observant, logical]
CLUES = [FINGERPRINTS, WITNESS_TESTIMONY]
SUSPECTS = [MUSEUM_GUARD, ART_THIEF]
SOLUTION = [DETECTIVE + CLUES + SUSPECTS -> SOLVE(CRIME)]
OUTPUT = [SHORT_STORY: SOLUTION]
The Path Forward: Training and Education
To fully leverage the Chain of Draft Technique, we must invest in training and education that fosters computational, systematic, and modeling thinking.
By equipping users with these skills, we can unlock the true potential of LLMs and revolutionize how we interact with artificial intelligence.