protologue

Retrieval & Tool Use

Grounding generation in external information and letting models call functions, search, and other tools.

Definitions

Function Calling
Function calling, or tool use, is a model capability in which the model outputs a structured request to invoke a developer-defined function with arguments, which the application executes and returns as a result to the model.
Hypothetical Document Embeddings
Hypothetical Document Embeddings (HyDE) improves retrieval by having a model write a hypothetical answer to the query, embedding that answer, and searching for real documents similar to it.
Model Context Protocol
The Model Context Protocol (MCP) is an open standard, introduced by Anthropic in 2024, that defines how applications expose tools, data resources, and prompt templates to language-model clients through a common client-server interface.
ReAct
ReAct is a prompting pattern that interleaves reasoning traces ("Thought") with actions such as tool calls ("Action") and their results ("Observation"), letting a model plan, act, and update its plan in a loop.
Retrieval-Augmented Generation
Retrieval-augmented generation (RAG) supplies a language model with passages retrieved from an external corpus at query time, so its output is grounded in that information rather than only in its trained parameters.
Self-RAG
Self-RAG trains a model to decide when to retrieve, and to emit special reflection tokens that critique whether retrieved passages are relevant and whether its own output is supported by them.
Structured Outputs
Structured outputs constrain a language model to produce responses that conform to a specified format, typically a JSON Schema, either through instructions or through constrained decoding that guarantees validity.
Toolformer
Toolformer is a method in which a language model teaches itself to use external tools, such as a calculator or search API, by generating candidate API calls in text and keeping those that reduce its prediction loss.