P

Active Prompting: Definition and Examples

Method that dynamically selects the most informative examples to include in a prompt, by identifying cases where the model is most uncertain to improve its reasoning performance.

Full definition

Active Prompting is an advanced prompt engineering technique inspired by active learning in machine learning. Its core principle is not to arbitrarily choose the few-shot examples included in a prompt, but to strategically select those that will bring the most benefit to the language model.

The process proceeds in several steps. First, the model generates multiple responses for a set of candidate questions. Then, the degree of uncertainty of the model on each question is measured (for example by observing the variance between the different responses). The questions where the model shows the most hesitation are then annotated by a human with detailed reasoning (chain-of-thought), and used as examples in the final prompt.

This approach solves a major problem of classic few-shot prompting: the choice of examples is often random or intuitive, which can lead to suboptimal results. Active Prompting rationalizes this choice by precisely targeting the model's weak areas.

Introduced by Diao et al. in 2023, this method has demonstrated significant improvements on arithmetic, logical, and commonsense reasoning tasks, surpassing fixed-example Chain-of-Thought prompting approaches.

Etymology

The term combines 'Active', borrowed from active learning where the algorithm actively chooses the data it most needs to learn, and 'Prompting', the practice of formulating instructions for a language model. The name reflects the idea that prompt construction is no longer passive (arbitrarily chosen examples) but active (examples selected based on model uncertainty).

Concrete examples

Mathematical reasoning — We identify that the model hesitates on problems involving successive percentages, then include an annotated example of this type in the prompt.

Here is an example of step-by-step resolution:
Q: An item costs 200€. It is discounted by 30%, then an additional 10% discount is applied. What is the final price?
A: Step 1: 200 × 0.70 = 140€ after the first discount. Step 2: 140 × 0.90 = 126€ after the second discount. The final price is 126€.

Now solve: An investment of 1000€ gains 15% in the first year then loses 10% in the second year. What is the final value?

Text classification — After detecting that the model often confuses sarcasm with sincere criticism, we add annotated examples targeting this ambiguity.

Classify the sentiment of each sentence. Here are particularly nuanced cases:

  • "Great, another delivery delay, what efficiency!" → Negative (sarcasm)
  • "The service was okay but nothing special" → Neutral (measured criticism)

Now classify: "Oh yes, 3 weeks for a response, that's true artistry."

Logical reasoning — The model shows uncertainty on syllogisms with multiple negations, so we include a guided example on this type of problem.

Practical usage

To apply Active Prompting, start by having the model generate multiple responses to your typical questions, then identify those where the responses vary the most. Then write detailed step-by-step reasoning for these difficult cases and include them as examples in your prompt. This approach is particularly cost-effective when you have a limited budget of examples and want to maximize their impact.

Related concepts

Chain-of-Thought PromptingFew-Shot PromptingSelf-ConsistencyActive Learning

FAQ

What is the difference between Active Prompting and classic Few-Shot Prompting?
Classic Few-Shot Prompting uses examples chosen manually or randomly, without any particular selection method. Active Prompting adds a step of analyzing the model's uncertainty to select the most useful examples — those where the model needs guidance the most. The result is a more effective prompt with the same number of examples.
Do I need advanced technical skills to use Active Prompting?
The full version of the method (measuring uncertainty via multiple sampling) requires API access and some programming skills. However, the principle can be applied in a simplified way: test your prompt on several cases, identify those where the model makes mistakes or hesitates, then add corrected examples for those specific cases. This iterative approach captures the essence of the method.
Does Active Prompting work with all language models?
Yes, the principle applies to any model capable of few-shot learning (GPT-4, Claude, Gemini, Llama, etc.). The gains vary depending on the model and task, but the idea of targeting examples to the model's weaknesses remains universally relevant. Benefits are typically more pronounced on complex reasoning tasks.

See also

How to use this prompt

  1. Copy the prompt with the button above.
  2. Paste it into ChatGPT, Claude or your favorite AI assistant.
  3. Replace the bracketed variables with your details, then refine the result.

About Prompt Guide

Prompt Guide is a free library of 2500+ ready-to-use prompts for ChatGPT, Claude and other AIs, with guides to learn prompting and tools to build and optimize your own prompts.

More definitions

Get new prompts every week

Join our newsletter.