Post by Ritikesh Choube
Senior AI Engineer | LangGraph · CrewAI · Google ADK · MCP | Multi-Agent Systems & RAG in Production | Tech Lead
Chain of Thought (COT) vs Tree of Thought (TOT) in Gen AI Planning Actions: Task: Find me the cheapest flight from Bombay to Delhi on April 06. LLM parses entities: "Bombay," "Delhi," "April 06" Steps: ->Search for flight using an API ->Compare prices from different airlines ->Select the cheapest option ->Book the ticket and confirm with the user Using external tools: Agent calls a flight search API Key Technologies Behind LLM Agents 1. Chain of Thought Reasoning (COT) Enables step-by-step logical reasoning Example: Math problem solved by breaking it into smaller steps 2. Tree of Thoughts (TOT) Instead of linear answers, AI explores multiple solutions in a tree structure Problem: LLMs are excellent at natural language tasks but struggle with multistep reasoning tasks like: Math word problems Logical reasoning Symbolic manipulation Proposed Solution: Chain of Thought Prompting A method that encourages LLMs to generate step-by-step intermediate reasoning before arriving at the final answer. Key Finding: COT significantly improves performance on complex reasoning tasks, even for extremely large models like PALM 540B. Then Why TOT? COT improves reasoning but follows a single path,If one step is wrong, the entire process fails Soln: TOT TOT generalizes COT by treating problem-solving as a search problem, allowing the model to: Explore different paths Evaluate them Backtrack if needed Example: Solving a Math Problem Given Numbers = [4, 9, 10, 13] Find a way to make 24 COT Step 1: 13-9 = 4 Step 2: 10-4 = 6 Step 3: 4*6 = 24 (Correct) But if Step 1 was wrong, model cannot recover TOT Step 1: (13-9 = 4) OR (10-4 = 6) Explore both Step 2: (4*6 = 24) OR (4+4 = 8) Step 3: Select the correct path TOT – Four Pillars 1. Thought Decomposition 2. Thought Generation 3. Thought Evaluation 4. Search Algorithm #llm #Data #Tools #Agents #Prompting