Few-shot learning: common challenges with this technique

Negative examples helped me clarify boundaries in production prompts at Tallyfy. The challenge is choosing useful failures, keeping examples consistent, and testing whether they improve the result. My 70/30 mix is a starting point to test, not a rule for every task.

On this page
  1. When do positive examples leave the boundary unclear?
  2. Are your examples using a consistent format?
  3. Testing and knowing when to stop
  4. What I keep coming back to

What you will learn

  1. Test whether negative examples help with the mistakes your model actually makes
  2. Choose relevant examples that cover the distinctions your task requires
  3. Treat my 70/30 mix as a starting point to test, not an established optimum
  4. Keep example formats consistent and compare results on held-out inputs

Positive examples can leave an important question unanswered: what should the model reject?

After three years building AI systems at Tallyfy and watching implementations fail in ways that surprised me, I found that bad examples could clarify what the model should avoid. This is one of the most underrated aspects of prompt engineering. There is also research on learning from negative examples, though that study trains model weights rather than testing examples placed in a prompt.

When do positive examples leave the boundary unclear?

AI models can learn from positive examples in a prompt without updating their weights. Negative examples can make an intended distinction more explicit, but they still need testing.

Think about teaching someone to identify a dog. Fifty photos of dogs helps. But they’ll probably still point at a wolf and say “dog.” Show them 3 dogs and 2 wolves with clear labels? Suddenly the boundary clicks. The distinction matters. The edge cases become visible.

A 2024 study of vulnerability prediction found that adding easy negative training examples improved performance, with gains plateauing at around 15 per positive. That result concerns trained classifiers, not a recommended ratio for LLM prompts.

I saw this pattern clearly when building customer service automation. Hundreds of perfect response examples still produced nonsense 30% of the time. Adding examples of terrible responses changed everything. Accuracy jumped to 94%. The model finally understood what to avoid.

When positive examples leave a distinction unclear, a labeled counterexample gives the model another way to identify it.

It does not guarantee that the model will apply the distinction correctly.

A classification system for Tallyfy needed to categorize support tickets. Showing examples of “bug reports” wasn’t working. The model kept misclassifying feature requests as bugs. Adding negative examples (“This is NOT a bug report, it’s a feature request”) made the distinction clear overnight.

MLflow’s evaluators can help compare results. Its correctness scorer uses expected facts, while retrieval groundedness checks answers against retrieved information. Compare your example sets on the same held-out cases before deciding whether to fine-tune.

Finding the right balance

After analyzing hundreds of production prompts, one ratio kept emerging: 70% positive, 30% negative.

Facebook’s search team studied blending random and hard negatives. Their 2020 paper found a useful 100:1 mix of easy to hard negatives for retrieval training. Both groups were negatives, so that result does not establish a positive-to-negative ratio for few-shot prompts.

As a starting experiment, show 7 examples of correct behavior and 3 clearly labeled examples of incorrect behavior. Then test whether those negatives help.

The 70/30 mix is a starting point from my work, not a rule across tasks and models. I think this is probably one of the most underappreciated levers in prompt engineering.

But the negative examples still need to be chosen carefully. Include cases relevant to the distinctions you need the model to make.

Need a thinking partner on this? Contact Blue Sheen.

Choosing negative examples that actually teach something

Start with negative examples near the boundary of correctness, but test whether easier examples help too.

The 1997 paper Learning when negative examples abound examines imbalanced classification, where negatives greatly outnumber positives. That is a different problem from choosing examples for an LLM prompt.

Three approaches to try:

Edge cases that almost work. For email classification, include messages close to the spam boundary, with the correct label made explicit. These can expose distinctions that obvious examples miss.

Common failure modes. Track where your model fails most often. Convert those failures into negative examples. This directly addresses your real weak points, not imagined ones.

Boundary violations. Find examples that break one specific rule while following all others. This keeps attention on one constraint at a time.

Building a content moderation system showed this clearly. Random inappropriate content as negative examples produced 72% accuracy. Deliberately selected edge cases produced 89%. Same number of examples, totally different outcomes.

Diversity matters, but three examples will not always beat twenty. Choose examples that are relevant, varied and clearly structured.

For document classification, include examples from the document types the system will actually see. Covering one type thoroughly can still leave other types untested. This is related to the fragmentation problem in AI implementations: the system needs a view of the work it is expected to handle.

Are your examples using a consistent format?

Example workflow using my 7-positive, 3-negative starting mix: standardize, validate, ship

This diagram illustrates the starting mix above. Keep the ratio only if testing supports it for your task.

Inconsistent formatting can obscure what you want the model to produce.

Your examples might be carefully chosen, but mixed formats can leave the intended output format unclear.

I spent weeks debugging a data extraction system before finding the issue. Some examples used JSON. Others used XML. Some had comments, others didn’t. The model couldn’t separate format from content. Once we standardized everything, performance jumped without changing a single example.

Prompt versioning tools can help you compare revisions. Test a formatting change against the same inputs so you can see whether it helps.

Here is a template to try:

POSITIVE EXAMPLE 1:
Input: [exact format they'll use]
Output: [exact format you want]
Why this is correct: [brief explanation]

NEGATIVE EXAMPLE 1:
Input: [a realistic input]
Output: [incorrect output]
Why this is wrong: [specific violation]

Use the same structure so input, output and explanatory labels stay distinct.

Testing and knowing when to stop

A few successful inputs are not enough to judge a prompt. Test it on cases representative of the work it will handle.

If all 20 steps must succeed independently at 95% reliability each, the chance of completing the whole sequence is about 36% (0.95 to the power of 20). That is a brutal number. In LangChain’s public survey of 1,340 respondents, conducted November 18 to December 2, 2025, 89% reported agent observability and 52.4% reported offline evaluations. These figures describe the survey respondents, not all teams, and offline evaluation is only one kind of testing.

A few things that actually work for testing:

Holdout validation. Keep test cases out of the examples used to build and tune your prompt. Include typical cases from the task, as well as edge cases, to check how it handles unseen inputs.

Adversarial testing. Try to break your prompt. Use edge cases, malformed inputs, weird formatting. If it survives this, it might survive production.

A/B testing in production. This is where prompt engineering discipline becomes important. Helicone reported processing over 2 billion LLM interactions in its May 2025 article. Logging can support comparisons, but volume alone does not make a test valid. Compare prompt versions on the same task and measure the outcomes that matter.

Progressive rollout. Start with a small share of traffic, for example 5%. Monitor closely. Scale gradually. At Tallyfy, this methodology caught a prompt that seemed 95% accurate in testing but was actually 67% accurate with real user input.

The common mistakes I see repeatedly: using only positive examples (like teaching someone to drive by only showing correct driving), selecting negatives that are too hard (which can collapse the very distinctions you are trying to teach), ignoring format consistency, and assuming a prompt that works on GPT-5.5 will work on Claude. It won’t, always.

Sometimes few-shot learning just isn’t enough. The task is too complex. The variations are too numerous. Investigate when accuracy plateaus despite better examples, edge cases multiply faster than you can document them, or performance varies wildly between similar inputs. Fifty examples is not a hard limit: many-shot research has found gains with hundreds or thousands. Separately, adding examples will not resolve access-control problems such as those discussed in RAG security.

Sometimes fine-tuning is the proper answer. Compare it against your prompt-based approach on the same evaluation set.

What I keep coming back to

Evaluation-tool overviews can help you explore the options. The useful question is whether a tool helps you find errors in your own task.

(Update, June 2026: the economics shifted since I wrote this. Million-token context windows on the current model lineup mean you can pack far more examples into a single prompt than you used to, and adaptive thinking lets a model reason about boundary cases on its own. That makes fitting your 7 positives and 3 negatives cheap and easy. It does not change the ratio or the principle below. More room for examples is not a reason to dump in fifty.)

Correction, November 17, 2026: the June note overstates what a larger context window proves. More capacity does not establish a best example ratio or guarantee low cost. The 70/30 mix remains my starting suggestion, and the many-shot research above shows why fifty examples is not a general ceiling.

The point I keep coming back to is to test examples of mistakes alongside correct responses. Keep the negatives that help the model handle the distinctions your task requires.

About the Author

Amit Kothari is an experienced consultant, advisor, coach, and educator specializing in AI and operations for executives and their companies. With 20+ years of experience, he is the Co-founder and CEO of Tallyfy® (raised $3.6m, the Workflow Made Easy® platform) and founding partner at Blue Sheen, which helps small and medium-sized companies get their whole team using AI. Originally British and now based in St. Louis, MO, Amit combines deep technical expertise with real-world business understanding. Read Amit's full bio →

Disclaimer: The content in this article represents personal opinions based on extensive research and practical experience. While every effort has been made to ensure accuracy through data analysis and source verification, this should not be considered professional advice. Always consult with qualified professionals for decisions specific to your situation.

Contact meMore about me

Blue Sheen helps small and medium-sized companies get their whole team using AI.

Contact me Follow 10k+