What Few-Shot Learning Is and Where It Comes From
Few-shot learning in the context of LLMs borrows the term from a broader machine learning concept, but the mechanism is different. In classical machine learning, few-shot learning refers to training a model to generalise from a small number of training examples, typically through meta-learning. In the LLM context, no additional training happens. Instead, the examples are provided in the prompt as in-context demonstrations. The model uses its pre-trained understanding of pattern matching and instruction following to apply the demonstrated pattern to new inputs within the same conversation. This works because large language models have been trained on such a wide variety of text that they have learned general problem-solving heuristics that can be applied from examples alone. The number of examples that constitutes few-shot is typically 1 to 10. One example is sometimes called one-shot. No examples is zero-shot. More than around ten examples starts to consume significant context window and often yields diminishing returns compared to fine-tuning.
When Few-Shot Prompting Outperforms Zero-Shot
Few-shot prompting consistently outperforms zero-shot on tasks where the desired output format is non-standard, the task involves domain-specific conventions the model may not have encountered frequently in training, or accuracy on edge cases is critical. Classification tasks are a strong case: providing examples of each class label alongside representative inputs substantially improves classification accuracy compared to only describing the labels in words. Data extraction tasks benefit similarly. If you need an LLM to extract structured fields from free-text documents in a specific JSON format, showing two or three examples of the input document paired with the correctly extracted JSON dramatically reduces formatting errors and field misattribution. Tone and style adaptation is another strong use case. If your product generates customer-facing text that must match a specific brand voice, examples of that voice are more effective than prose descriptions of it. Zero-shot excels when the task is well-represented in the model's training distribution and the output format is standard. For anything novel or format-specific, few-shot is the better starting point.
Designing Effective Few-Shot Examples
The quality of few-shot examples matters as much as their quantity. Poorly chosen examples can confuse the model or introduce biases that hurt performance on real inputs. Several principles consistently improve example quality. Coverage: examples should cover the main variation in the input space you care about. If your inputs vary in length, domain vocabulary, or structure, your examples should sample that variation rather than all being similar. Edge case inclusion: include at least one example that represents a challenging or ambiguous case your product will encounter in production, paired with the correct output. The model learns from both the typical cases and the difficult ones. Format consistency: every example should follow exactly the same structure. If your format uses a particular delimiter, label, or field ordering, apply it uniformly. Any inconsistency in the example format leaks into output inconsistency. Recency: if the model will process inputs from a specific time period or domain, examples from that context outperform generic examples. Avoid synthetic examples that feel constructed rather than representative of real inputs.
Few-Shot vs Fine-Tuning: When to Escalate
Few-shot prompting is the right starting point for most tasks because it requires no infrastructure, no training data pipeline, and no additional cost beyond prompt tokens. However, there are situations where fine-tuning is the better investment. If you need consistent behaviour across thousands of different task variations and providing enough examples in-context is impractical, fine-tuning captures that knowledge in the model weights. If your examples are so numerous that they consume a significant fraction of the context window and leave little room for the actual input, fine-tuning reclaims that context. If you have strict latency requirements and a long few-shot section adds meaningful time to inference, moving knowledge to weights via fine-tuning reduces prompt length. The practical decision rule: start with few-shot, measure accuracy against a held-out evaluation set, and escalate to fine-tuning only when few-shot has plateaued and you have a curated training dataset of at least several hundred high-quality examples.
Regulatory and Compliance Considerations
For UK and EU product teams, few-shot examples that contain personal data raise GDPR compliance questions. If you store customer documents and then use them as few-shot examples in production prompts sent to a third-party LLM API, those documents pass through the API provider's infrastructure. Under UK GDPR and EU GDPR, this constitutes personal data processing by a third-party processor, requiring a data processing agreement with the API provider. The ICO's guidance on AI and data protection is relevant here. For products in regulated sectors, examples containing financial data fall under FCA guidance on data governance. Examples containing patient data from NHS Digital systems are subject to data sharing agreements. The safest approach is to use synthetic or anonymised examples that demonstrate the task structure without including real personal data. This also reduces the risk of inadvertently training the model toward rare personal details present in specific examples.
Few-Shot Prompting in SpeedMVPs AI Builds
At SpeedMVPs, few-shot prompt design is a standard part of AI feature development. For every classification, extraction, or generation task in an AI MVP, we develop an example set during the discovery and build phase, test it against representative inputs, and iterate based on failure analysis. Prompt files are version-controlled alongside application code and included in the documentation package handed over at delivery. This means clients inherit not just a working product but the reasoning behind prompt design decisions. For tasks where few-shot performance is insufficient, we scope fine-tuning as a separate engagement with clear evaluation criteria and dataset requirements. All AI MVP projects are delivered in 2-3 weeks from GBP 8,000, with full code and prompt ownership transferred to the client.