liveBook · Manning

One-shot learning

As explained in Knowledge Graphs and LLMs in Action

One-shot learning is performing a task after receiving one task-specific example.

One-shot learning performs a task after receiving one task-specific example, typically alongside a task description. With a pretrained language model, the example guides domain-specific extraction without additional model training. section 5.3.3

A practical one-shot workflow:

  • Provide one ambitious example using complete, clean entity names and relations. section 5.3.3
  • Run quick prompt iterations, then generate and inspect a small knowledge graph for systematic failures. section 5.3.3
  • Move to fine-tuning when repeated prompt improvements still produce unsatisfactory results. section 5.3.3

Entity-aware extraction

A prompt can demonstrate that “Prof. Chem.” means Professor of Chemistry and that “Stanford” means Stanford University, encouraging cleaner knowledge-graph relations and reducing later entity cleansing. section 5.3.3

How Knowledge Graphs and LLMs in Action covers it

How deep it goes
Defines the prompting pattern, gives iteration and validation advice, and stops short of solving complex reasoning ambiguities.
Examples
Uses contextual interpretations of “Prof. Chem.” and “Stanford,” plus mini-knowledge-graph inspection.
What it assumes
Assumes a pretrained language model and teaches task guidance through a description plus one example.
What you can do after
Apply it via prompt engineering, validate outputs through small knowledge graphs, and switch to fine-tuning when necessary.
How it connects
Connects zero-shot learning, prompt engineering, fine-tuning, entity resolution, and knowledge graphs.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Knowledge Graphs and LLMs in Action. The section links point to the parts of the book it draws on.