Learn Before
Structure of a Complete RAG Prompt for Question Answering
A complete prompt for a Retrieval-Augmented Generation (RAG) system typically combines three key components: an instruction, the user's question, and the retrieved context. The instruction guides the model on how to utilize the provided information. This is followed by the user's query. Finally, the retrieved texts are presented, often introduced by a transitional phrase like The information regarding this question is given as follows:, to provide the necessary context for generating an answer.
0
1
Tags
Ch.3 Prompting - Foundations of Large Language Models
Foundations of Large Language Models
Foundations of Large Language Models Course
Computing Sciences
Related
Example Question for RAG-Based Answering
Challenge of Inaccurate Text Retrieval in RAG
Controlling LLM Dependency on Retrieved Context in RAG
Challenge of Developing a Universal Prompting Strategy for RAG
Structure of a Complete RAG Prompt for Question Answering
A system is designed to answer user questions by first finding a relevant text and then using a language model to generate a response based only on the information within that text. A user asks, 'What are the primary health benefits of regular exercise?' The system retrieves the following text: 'Consistent physical activity strengthens the heart muscle, which improves cardiovascular efficiency and lowers the risk of heart disease. It also aids in weight management by burning calories.' Which of the following generated answers best demonstrates the language model correctly performing its task?
A developer is building a system to answer user questions using retrieved information. For the user query 'What are the key differences between llamas and alpacas?', the system retrieves the following text: 'Llamas and alpacas are both South American camelids. Llamas are significantly larger, often weighing up to 400 pounds, while alpacas are smaller, typically under 200 pounds. A key distinguishing feature is their ears; llamas have long, banana-shaped ears, whereas alpacas have short, spear-shaped ears. Furthermore, llamas are primarily used as pack animals due to their size and strength, while alpacas are bred for their fine, luxurious fiber.' Which of the following represents the most effective and well-structured input to send to the language model to generate the final answer?
Analyzing an Erroneous Answer in a Retrieval-Based System
LLM Refusal to Answer due to Insufficient or Irrelevant Context
Learn After
Example Prompt Instruction for Faithfulness and Abstention
A developer is constructing a message to send to a large language model to answer a user's question based on a retrieved document. The developer has the following three components:
- The Instruction:
You are a helpful assistant. Answer the user's question based *only* on the provided text. If the information is not in the text, state that the answer cannot be found. - The User's Question:
What is the boiling point of ethanol? - The Retrieved Context:
Ethanol, a volatile, flammable, colorless liquid, has a boiling point of 78.37 °C.
Which of the following arrangements of these components creates the most effective and logically structured message for the model to process and follow the instructions correctly?
- The Instruction:
Diagnosing a Faulty Q&A System Prompt
Task Definition and Grounding in RAG Prompts
Constructing a RAG Prompt