liveBook · Manning

Few-shot learning

As explained in Deep Learning with R, Third Edition

Few-shot learning is adapting or directing a model to perform a task from only a small number of examples.

Few-shot learning teaches a model a new task from only a handful of supervised examples—too few for standard gradient descent. Instead of fine-tuning, a model can receive examples in a prompt and generate the requested output. section 16.1

Translation by example

Provide several English–French pairs, then leave the requested translation incomplete: “sea otter => loutre de mer,” “peppermint => menthe poivrée,” “plush giraffe => peluche girafe,” followed by “cheese =>”. The model infers the task and supplies an answer without fine-tuning. section 16.1

Translate English to French:

sea otter => loutre de mer
peppermint => menthe poivrée
plush giraffe => peluche girafe
cheese =>

Inspect the complete translation prompt and its demonstrations before testing the unfinished query. section 16.1

How Deep Learning with R, Third Edition covers it

How deep it goes
Defines prompted learning and contrasts it with gradient descent, but stops short of implementation details or formal analysis.
Examples
Uses English-to-French translation demonstrations for sea otter, peppermint, plush giraffe, and cheese.
What you can do after
Apply it via prompting by supplying a few task examples and requesting the corresponding output.
How it connects
Connects prompting with fine-tuning, gradient descent, pretraining, text generation, and hallucination.

Also explained in

Compare how 18 books explain few-shot learning →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with R, Third Edition. The section links point to the parts of the book it draws on.