Few-shot prompting exploits LLMs' in-context learning ability: show the model what 'good' looks like, and it copies the pattern. Example: instead of 'translate to French,' show three English→French pairs in the prompt before the actual sentence to translate. Accuracy gains can be 20-40% over zero-shot. The trick is choosing diverse, representative examples — three nearly-identical examples teach the model less than three varied ones. Common patterns: structured output examples (so the model returns JSON), domain examples (legal style, brand voice), edge case examples (so the model handles unusual inputs). Few-shot is most useful when fine-tuning is overkill — for one-off or low-volume tasks.
СЛОВАРЬ
Что такое Few-shot Prompting?
Showing an LLM 1-5 examples of input-output pairs in the prompt, before asking it to handle a new input — dramatically improves accuracy.
СВЯЗАННЫЕ ТЕРМИНЫ
Prompt Engineering
The practice of crafting input text (prompts) to get the best output from an LLM. A vague prompt gives vague answers; a structured prompt gives precise ones.
Zero-shot
Asking an LLM to do a task with no examples in the prompt — relying purely on the model's pre-trained knowledge.
Chain-of-Thought (CoT) Prompting
Asking an LLM to 'think step by step' before answering — significantly improves performance on reasoning tasks.
Назад к Словарь ИИ