Fundamentals

Few-Shot Learning

Quick Answer

Providing a few examples in the prompt to teach the model how to perform a task.

Few-shot learning involves including a small number of input-output examples in your prompt to demonstrate the desired behavior. For instance, you might show 2-5 examples of correct translations before asking the model to translate new text. This approach leverages the model's in-context learning ability without requiring fine-tuning. Few-shot prompting is often more effective than natural language instructions alone and works across diverse tasks. The number of examples, their quality, and their order all impact performance.

Last verified: 2026-04-08

Compare models

See how different LLMs compare on benchmarks, pricing, and speed.

Browse all models →