Zum Inhalt springen

Advanced Prompt Techniques

Knowledge

You know Zero-Shot, Few-Shot, and Chain-of-Thought. Now you'll learn the next level: techniques that systematically solve complex problems -- from strategic Few-Shot to Prompt Chaining to Tree-of-Thought.

Strategic Few-Shot

Not every example is equally effective. Your choice of Few-Shot examples has a massive impact on the result:

  1. Diversity: Choose examples that cover different aspects of the task. If you're doing sentiment analysis, show positive, negative, AND neutral examples.
  2. Representativeness: Your examples should resemble the actual use case. Don't use trivial examples for complex tasks.
  3. Edge cases: Include at least one example that covers a boundary situation (e.g., an ambiguous sentence in sentiment analysis).
  4. Order: Place the most complex example last -- the LLM gives more weight to later examples.

Prompt Chaining

Instead of solving everything in a single prompt, you break the task into a chain:

Step 1 (Extraction): "Read this contract and extract all parties, deadlines, and obligations as a structured list."

Step 2 (Analysis): "Analyze the extracted contract points: What risks exist for Party A?"

Step 3 (Recommendation): "Based on the risk analysis: Formulate 3 concrete renegotiation points."

Each step receives the output of the previous one as input. This reduces complexity and increases precision.

Meta-Prompting

With Meta-Prompting, you don't write a prompt -- you have the LLM write the prompt for you:

I want to create a prompt that achieves the following goal:
[Describe your goal]

Write the best possible prompt for this.
Explain why you included certain elements.

This works particularly well because LLMs "know" which prompt structures are effective. It's like asking a prompt expert how to best frame the question.

Tree-of-Thought (ToT)

Tree-of-Thought extends Chain-of-Thought: instead of a single reasoning path, the LLM explores multiple parallel paths and evaluates them:

Consider the following problem: [Problem]

Develop 3 different solution approaches.
For each approach:
1. Describe the approach in 2-3 sentences
2. Evaluate pros and cons
3. Assign a success probability (high/medium/low)

Choose the best approach and execute it in detail.

Tree-of-Thought is particularly powerful for creative problem-solving and strategic decisions.

Understand

When to Use Which Technique?

SituationBest TechniqueWhy
Simple classificationFew-ShotExamples show the desired pattern
Complex calculationChain-of-ThoughtIntermediate steps prevent errors
Multi-stage analysisPrompt ChainingEach step focuses on one sub-task
Creative problem-solvingTree-of-ThoughtMultiple approaches are evaluated in parallel
Prompt optimizationMeta-PromptingThe LLM knows its own strengths
Critical decisionSelf-Consistency + CoTStatistical confidence through majority vote

Zero-Shot

Direct question, no examples

Ask a question
Answer
Example Prompt

What is photosynthesis?

Answer

Photosynthesis is the process by which plants convert sunlight into chemical energy...

When to use? For straightforward questions where the LLM has sufficient prior knowledge.

Match each situation to the appropriate prompt technique:

Meta-Prompting
Prompt Chaining
Tree-of-Thought
Few-Shot with edge cases
Email spam detection
 
Creating a market analysis report
 
Developing a business strategy
 
Finding the optimal prompt for a new project
 

Apply

Compare these techniques on a concrete example. Take the following task: "Create a marketing strategy for a sustainable fashion label."

Consider: Which technique would you choose and why? Try at least two different approaches (e.g., Prompt Chaining vs. Tree-of-Thought) and compare the results.

Your team needs to build an automated customer support bot. The bot must classify inquiries, route them to the right department, and generate an appropriate initial response. Which approach is most effective?

Reflect

Choosing the right prompt technique is like choosing the right tool: a hammer is great for nails, but not for screws. The art lies in analyzing the problem and then selecting the appropriate technique -- or combining them.