🧠 Understanding LLM reasoning
Before diving into the techniques, let's understand why they work. Large language models (LLMs) do not "think" like we do. They predict the most probable next token. When you ask a complex question, the model can "jump" directly to an answer without going through the intermediate steps — and make a mistake.
Advanced prompting techniques exploit a simple idea: by forcing the model to explicitate its reasoning, we significantly improve the quality of its responses. It's like the difference between a student who directly writes the answer to a math problem and a student who shows all their reasoning.
The problem of implicit reasoning
Without explicit reasoning, a model can easily make mistakes on complex, multi-step problems. Let's take the example of a simple calculation: if Marie has 3 apples, gives half of them to Jean, and then buys 5 more, the model will often find the right answer. But for more complex word problems with numerous variables, skipping the intermediate steps frequently leads to logic errors.
⛓️ Chain-of-Thought (CoT): thinking step by step
The principle
Chain-of-Thought, introduced by Wei et al. in 2022 in a Google study, consists of asking the model to break down its reasoning into explicit steps before giving its final answer. This method has demonstrated a significant improvement in accuracy on reasoning tasks.
How to use it
The simplest form is to add "Think step by step" to your prompt. For example, faced with a price calculation involving a discount and VAT, a prompt without CoT presents a risk of error because the model might apply the calculations in the wrong order. By adding CoT, you guide the model by asking it to first calculate the price after the discount, then apply the VAT, and finally give the final price.
Advanced CoT: structuring the steps
For complex problems, explicitly structure the reasoning steps. This approach is particularly effective for project viability analysis: by asking the model to go through clearly defined steps (calculating the addressable market, projecting acquisitions, calculating LTV, LTV/CAC ratio, revenue projection, and then the verdict), you get a structured analysis where each calculation and each piece of reasoning is made explicit.
Zero-shot CoT vs Manual CoT
| Type | Description | Example |
|---|---|---|
| Zero-shot CoT | Simply adding "step by step" | "Solve this problem step by step" |
| Manual CoT | Explicitly defining the steps | "Step 1: ... Step 2: ..." |
| Auto-CoT | The model generates its own steps | "Break this problem down into sub-problems" |
Manual CoT is generally the most reliable because you control the structure of the reasoning.
When to use CoT
- ✅ Mathematical and logical problems
- ✅ Multi-factor analysis
- ✅ Code debugging
- ✅ Complex decision-making
- ✅ Legal or medical reasoning
- ❌ Not necessary for simple tasks (translation, paraphrasing)
- ❌ Can slow down creative tasks
🎯 Few-Shot Prompting: learning by example
The principle
Few-Shot prompting consists of providing concrete examples of input/output pairs before asking your question. The model understands the pattern and applies it to your case. According to OpenAI's 2023 research, this technique significantly improves accuracy on classification and format transformation tasks.
Few-Shot variants
| Variant | Number of examples | Use cases |
|---|---|---|
| Zero-shot | 0 examples | Simple tasks, clear instructions |
| One-shot | 1 example | Simple pattern to reproduce |
| Few-shot | 2-5 examples | Specific tasks, precise format |
| Many-shot | 5+ examples | Highly specialized tasks |
Few-Shot in practice
Example 1: Sentiment classification
By providing two or three examples of customer reviews with their sentiment (Positive, Negative, Neutral) and their associated category, the model identifies the expected pattern. When you submit a new review like "Beautiful interface but crashes every 5 minutes", it automatically reproduces the format to deduce the relevant sentiment and category.
Example 2: Format transformation
This variant is ideal for converting product descriptions into structured spec sheets. By showing an example with a backpack — where the free-text description is transformed into a table with characteristics like capacity, material, water resistance — the model applies the same structured extraction to any other product, such as a Bluetooth speaker.
Example 3: Specific writing style
Few-Shot also allows you to control the tone and level of language. By giving examples of technical sentences rewritten in accessible language for a mainstream blog, you teach the model to transpose complex concepts (microservices architecture, multi-head attention, RLHF) into simplified explanations that any reader can understand.
Few-Shot tips
- Choose diverse examples — covering edge cases
- Keep format consistency between examples
- Order from simple to complex — the model better understands the progression
- 3-5 examples are generally enough — beyond that, diminishing returns set in
- Test with different examples — some work better than others
🌳 Tree-of-Thought (ToT) : exploring multiple paths
The principle
Tree-of-Thought, proposed by Yao et al. in 2023, goes further than CoT. Instead of following a single reasoning path, the model explores multiple paths in parallel, evaluates each one, and selects the best.
To delve deeper into this topic, check out our guide Le guide ultime du prompt engineering en 2025.
It's like a chess player considering several possible moves before choosing one.
How to implement it
To implement ToT, ask the model to explore several distinct approaches for the same problem, then compare them. For example, to organize a tech conference for 200 people in Paris on a tight budget, you can ask the model to develop three approaches (premium venue with basic content, modest venue with top-tier speakers, hybrid format with in-person and streaming), evaluate each with its advantages, risks, and a score, and then synthesize them in a comparison table to recommend the best option.
ToT with self-evaluation
A powerful variant involves adding an elimination and merging phase. The model proposes several strategies, evaluates each one (strengths, weaknesses, ROI, feasibility score), eliminates the weakest one by justifying why, and then proposes a hybrid strategy combining the best elements of the remaining options. This method is particularly effective for marketing planning or product launches.
When to use ToT
| Situation | Is CoT enough? | Is ToT necessary? |
|---|---|---|
| Mathematical calculation | ✅ | ❌ |
| Strategic choice | ⚠️ | ✅ |
| Single problem solving | ✅ | ❌ |
| Complex planning | ⚠️ | ✅ |
| Creativity / brainstorming | ❌ | ✅ |
| Arbitrating between options | ⚠️ | ✅ |
📊 Overall comparison table
| Technique | Complexity | Tokens used | Best for | Reliability |
|---|---|---|---|---|
| Zero-shot | ⭐ | Low | Simple tasks | Variable |
| Few-shot | ⭐⭐ | Medium | Precise format, classification | High |
| CoT | ⭐⭐ | Medium-high | Logical reasoning | High |
| Few-shot + CoT | ⭐⭐⭐ | High | Complex problems with patterns | Very high |
| ToT | ⭐⭐⭐⭐ | Very high | Strategic decisions | Very high |
Cost vs Quality
A crucial point in 2025: these techniques consume more tokens (and therefore cost more). According to OpenRouter data in 2025, the cost of a ToT prompt can be 5 to 8 times higher than a simple zero-shot. Use OpenRouter to optimize your costs by automatically routing to the most suitable model.
| Technique | Average tokens (prompt) | Relative cost |
|---|---|---|
| Zero-shot | 50-200 | 1x |
| Few-shot (3 examples) | 300-800 | 3-4x |
| Detailed CoT | 200-500 | 2-3x |
| ToT (3 branches) | 500-1500 | 5-8x |
🔬 Bonus techniques: beyond the classics
Self-Consistency
Introduced by Wang et al. in 2022, this technique consists of running the same CoT prompt multiple times and taking the majority answer. Particularly useful for mathematical problems, it significantly reduces the error rate by asking the model to solve the same problem using three different approaches (algebraic, estimation, decomposition), then comparing the results to identify the most reliable answer in case of divergence.
Prompt Chaining
Rather than a single mega-prompt, break it down into a series of sequential prompts. Each step feeds into the next: a first prompt extracts the key points from a brief, a second generates creative proposals based on those points, a third evaluates and develops the best proposal into a detailed plan. This is exactly what OpenClaw allows you to do automatically.
ReAct (Reasoning + Acting)
Introduced by Yao et al. in 2022, this framework combines reasoning and actions. The model thinks, acts, observes the result, and then thinks again, alternating between phases of reflection ("What do I need to find?"), action (the steps to obtain the information), and observation (what is obtained), until it synthesizes a final answer. This approach is particularly effective for research and problem-solving tasks requiring iterative steps.
🎯 Quick choice guide
Use this decision tree to choose the right technique:
- Is your task simple (translation, short summary)? → Zero-shot is enough
- Do you have a specific format to reproduce? → Few-shot (2-5 examples)
- Does the task require logical reasoning? → Chain-of-Thought
- Do you need to compare several options/strategies? → Tree-of-Thought
- Is the task multi-step with dependencies? → Prompt Chaining (OpenClaw)
- Otherwise → Combine Few-shot + CoT
💡 Combining techniques
Real power comes from combination. For example, mixing Few-shot + CoT + self-evaluation is formidable for UX analysis: you provide an example of an analysis method (diagnosis, violated UX principle, solution, impact evaluation), then you ask the model to apply this same structure to a new problem — such as a 78% cart abandonment rate — by proposing three solutions, evaluating each one, and recommending the best one.
Advanced prompting techniques are not abstract theory — they are concrete tools that produce measurable results. Start with CoT for your reasoning tasks, add Few-shot when you have a format to reproduce, and move on to ToT for your strategic decisions.
With practice, these techniques will become as natural as writing an email. And with tools like OpenClaw to orchestrate prompt chains, you will be able to automate complex workflows that combine all these approaches.