Our recent systematic evaluation of instruction-following models on IFEval reveals a counterintuitive finding: increasing the number of in-context examples can significantly degrade performance on constraint-following tasks.
Using the lighteval framework, we evaluated SmolLM2 variants and LFM2-350M across 0-shot through 5-shot configurations.
Across all three models, we observed significant degradation in both instruction-level strict accuracy and prompt-level strict accuracy as the number of shots increased.
IFEval tests a model's ability to follow specific, verifiable constraints:
When few-shot examples are added, models get distracted by the content patterns in those examples rather than focusing on the specific instructions of the current task. This observation aligns with recent research (arXiv:2501.10860v2), where similar experiments found that models "get distracted by the content of few-shot examples."
The model shifts from instruction parsing to pattern matching, causing it to miss or violate specific constraints in the target instruction.

The number of in-context examples must be carefully calibrated based on task objectives. While few-shot learning often improves performance on tasks requiring pattern recognition or domain knowledge transfer, it can degrade performance on tasks demanding strict constraint adherence. As noted in recent work on many-shot learning (arXiv:2501.04070v3), more shots don't universally improve outcomes.
Is this a prompting failure or a fundamental model alignment issue? How do you force your LLMs to prioritize instructions over example patterns? Questions to be addressed in a future blog.
Before selecting your prompting strategy:
For instruction-following benchmarks like IFEval that emphasize constraint compliance, zero-shot evaluation may actually be optimal.
References: