Example

Example of a RAG Prompting Template

In the Retrieval-Augmented Generation (RAG) framework, a prompting template, denoted as g()g(\cdot), is used to combine the original context with the retrieved documents. A typical example structures the augmented input by concatenating the fetched text pieces with the original query. It can be formatted as: "message = {c1\mathbf{c}_1} ... {ck\mathbf{c}_k} input: {x\mathbf{x}} output:", where c1\mathbf{c}_1 through ck\mathbf{c}_k are the relevant documents retrieved from the datastore, and x\mathbf{x} is the initial user context.

0

1

Updated 2026-04-23

Contributors are:

Who are from:

Tags

Foundations of Large Language Models

Ch.2 Generative Models - Foundations of Large Language Models

Foundations of Large Language Models Course

Computing Sciences