Learn Before
Example of a RAG Prompting Template
In the Retrieval-Augmented Generation (RAG) framework, a prompting template, denoted as , 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 = {} ... {} input: {} output:", where through are the relevant documents retrieved from the datastore, and is the initial user context.
0
1
Tags
Foundations of Large Language Models
Ch.2 Generative Models - Foundations of Large Language Models
Foundations of Large Language Models Course
Computing Sciences
Related
A system is designed to answer user questions by first finding relevant information from a database. Given the components below, which option correctly constructs the final, augmented input that will be sent to the language model?
- Original User Input (x): "What are the main benefits of solar power?"
- Retrieved Documents (c1, c2):
- c1: "Solar energy is a renewable resource, meaning it won't run out."
- c2: "Using solar panels can lead to significant reductions in electricity bills."
- Prompting Template (g): "Based on the following information, answer the user's question.\n\nInformation:\n[retrieved documents]\n\nQuestion:\n[original input]"
Troubleshooting a RAG System's Output
In a system that enhances a language model's responses by first retrieving relevant information, the final input to the model is constructed from several components. Match each component from the formal expression
x' = g(c_1, ..., c_k, x)with its correct description.Example of a RAG Prompting Template