Skip to content

in-context learning (ICL)

In-context learning (ICL) is when a pretrained model performs a new task by conditioning on natural-language instructions and (optionally) input-output demonstrations included in the prompt, without updating its internal parameters. Demonstrations were traditionally limited to a handful, but larger context windows have made many-shot ICL practical. A single prompt can now carry hundreds or even thousands of examples.

Zero-shot, one-shot, and few-shot prompting are settings of ICL that differ only in how many demonstrations the prompt carries. The prompt conditions the model’s behavior rather than training it.

In practice, the success of ICL depends heavily on different factors, such as how many examples are included, which ones are chosen and how diverse they are, their order, how the instruction is phrased, and how the prompt is formatted.

Prompt Engineering: A Practical Example

Tutorial

Prompt Engineering: A Practical Example

Learn prompt engineering techniques with a practical, real-world project to get better results from large language models. This tutorial covers zero-shot and few-shot prompting, delimiters, numbered steps, role prompts, chain-of-thought prompting, and more. Improve your LLM-assisted projects today.

intermediate ai data-science

For additional information on related topics, take a look at the following resources:


By Leodanis Pozo Ramos • Updated Sept. 19, 2026