liveBook · Manning

In-context learning

In-context learning is a model’s adaptation of its behavior to examples, instructions, or other information in its input context without updating its parameters.

How 3 Manning books explain it

LLM Customization and Fine-Tuning

A technique in which a model uses examples and instructions in its prompt to perform a task without updating its weights.

How it is used
Provides a low-overhead baseline for adapting model behavior before committing to training.
How deep it goes
Explains prompt design, held-out evaluation, cost tradeoffs, and escalation criteria, with a worked ticket-classification workflow.
Examples
Uses eight labeled examples and 100 held-out tickets to evaluate a twelve-category help-desk classifier.
What you can do after
Build a few-shot classifier and evaluate whether its accuracy and operating cost justify deployment or further adaptation.

Read how LLM Customization and Fine-Tuning explains in-context learning →

Retrieval Augmented Generation, The Foundational Ideas

In-context learning is a model adaptation method in which a model learns from information provided in its prompt without modifying its internal weights.

How it is used
Uses prompt-provided information to connect a general generator with changing or specialized knowledge.
How deep it goes
Defines prompt-based adaptation and demonstrates concatenation, while stopping short of changing model weights or detailing training internals.
Examples
Uses a BART generator that concatenates a retrieved passage with a question before generation.
What you can do after
Apply it via retrieval-augmented generation by updating retrieved corpus content without retraining the generator.

Read how Retrieval Augmented Generation, The Foundational Ideas explains in-context learning →

Deep Learning with R, Third Edition

In-context learning is the adaptation of a model's output behavior from examples or instructions supplied within the current input context without parameter updates.

How it is used
Frames prompt-based behavior as apparent adaptation and tests whether it reflects memorization or genuine generalization.
How deep it goes
Contrasts memorized vector-function retrieval with new-skill acquisition and stops short of explaining model internals.
Examples
Uses leopard-print sofas, novel puzzles, prompt rewording, and large-integer addition to expose familiarity-dependent behavior.
What you can do after
Evaluate/understand whether prompt-based success reflects memorization, interpolation, or adaptation to genuinely novel tasks.

Read how Deep Learning with R, Third Edition explains in-context learning →

Also covered in

What to know first

Related concepts

Questions about in-context learning

What is in-context learning?

In-context learning is a model’s adaptation of its behavior to examples, instructions, or other information in its input context without updating its parameters.

Which Manning books explain in-context learning?

LLM Customization and Fine-Tuning, Retrieval Augmented Generation, The Foundational Ideas and Deep Learning with R, Third Edition.

What should I know before learning in-context learning?

Manning books that teach in-context learning usually introduce language model, prompt, accuracy and context window first.

What is the difference between in-context learning and fine-tuning?

In-context learning is a model’s adaptation of its behavior to examples, instructions, or other information in its input context without updating its parameters. Fine-tuning is the continued training of a pretrained model on targeted data or objectives to adapt its parameters or behavior to a task, domain, or use.

What kinds of in-context learning are there?

Kinds of in-context learning include few-shot learning and retrieval-augmented generation.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.