AI Terms Dictionary

A comprehensive multilingual AI terminology dictionary

Definition

This method leverages the in-context learning capabilities of large language models by providing a few illustrative examples directly in the prompt. Unlike fine-tuning, which requires updating model weights, few-shot prompting allows users to steer the model’s output format, tone, or logic dynamically. It is highly effective for tasks like classification, translation, or code generation where specific patterns need to be demonstrated to the model before generating the final response.

Summary

Few-shot prompting is a technique where LLMs are provided with a small number of input-output examples within the prompt to guide their behavior.

Key Concepts

Use Cases

Code Example

1
2
3
4
5
6
response = llm.generate(
    prompt="Translate English to French:\n"
           "Hello -> Bonjour\n"
           "World -> Monde\n"
           "Cat -> ?"
)