Advanced Prompting: ToT, ReAct, and Chaining

Prompt Engineering · Advanced · Lesson 6

Take prompting to the next level with Tree of Thoughts, ReAct agents, and prompt chains.

Once you have mastered the fundamentals, three advanced techniques push prompting much further: Tree of Thoughts (ToT), ReAct, and prompt chaining. Together they turn a single question-answer exchange into structured problem solving.

Why this matters

The fundamental techniques work, but some tasks are too complex for a single prompt. Tree of Thoughts, ReAct, and chaining give you structure for those harder problems.

Core concepts

Tree of Thoughts treats reasoning like a branching tree. Instead of one chain of reasoning, you ask the model to generate several possible approaches, evaluate each one, and explore the most promising branch. This works well for planning, puzzles, and decisions with multiple viable paths.

ReAct combines reasoning with acting: the model alternates between thinking about the problem and taking actions, such as running a search, writing a file, or calling a tool. The pattern is "Thought, Action, Observation" repeated until the goal is reached.

Prompt chaining splits a big task into smaller prompts, where the output of one step becomes the input of the next. Instead of one giant prompt, you run a pipeline: outline, draft, critique, revise.

Step-by-step walkthrough

A ToT-style prompt looks like this: "List three different strategies for solving this problem. For each, state the key risk and the likely outcome. Pick the strongest strategy and develop it fully, explaining why the others lose."

ReAct is the engine behind many AI agents. The prompt sets the loop: "Thought: what do I need to find out? Action: [tool call]. Observation: [tool result]. Repeat until you can answer the user's question."

A practical chain for a blog post: Step one extracts the key points from your notes. Step two turns the points into a structured outline. Step three drafts each section. Step four critiques the draft against your style guide and rewrites it.

Real-world examples

Chaining has real advantages. Each step is shorter and easier to control, errors are isolated to one stage, and you can apply different techniques per stage - few-shot for extraction, chain of thought for analysis.

Advanced tips

All three techniques share a theme: decompose the problem and give the model structure. Whether you branch, act, or chain, you are replacing one-shot guesswork with deliberate, controllable steps.

Advanced techniques are more expensive and slower. Use them only when the task justifies it - genuinely complex, multi-step, or high-stakes work. Master the fundamentals before layering these on.

Practice exercises

Practice by taking a large task you would normally do in one prompt and splitting it into a three-step chain. Then try a ToT-style prompt on a decision with several options. Notice where structure improves the result.

Common mistakes to avoid

Reach for advanced techniques only when the task justifies the extra cost and complexity - structure should serve the problem, not the other way around.

Summary and next steps

Decompose, branch, or loop: pick the structure that matches the task, and keep the fundamentals underneath every advanced pattern.

Key Takeaways