Перейти к основному содержимому

СЛОВАРЬ

Что такое 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.

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.

СВЯЗАННЫЕ ТЕРМИНЫ

Назад к Словарь ИИ