Principle:Hpcaitech ColossalAI Retrieval Augmented QA
| Knowledge Sources | |
|---|---|
| Domains | RAG, NLP |
| Last Updated | 2026-02-09 00:00 GMT |
Overview
A retrieval-augmented generation pattern that combines document retrieval with LLM generation to answer questions grounded in specific knowledge sources.
Description
Retrieval-Augmented QA retrieves relevant document chunks for a user query, stuffs them into a prompt template alongside the query, and sends the combined context to an LLM for answer generation. ColossalQA extends this with query disambiguation (rephrasing ambiguous queries using conversation history) and rejection filtering (detecting when the retrieved context is insufficient to answer).
Usage
Use this as the complete QA pipeline after document loading, splitting, and indexing. It is the core of the RAG application.
Theoretical Basis
The RAG pipeline:
- Disambiguation: Rephrase query using conversation history for clarity
- Retrieval: Find top-k relevant document chunks
- Context Stuffing: Combine retrieved chunks into a single context string
- Generation: LLM generates answer conditioned on context + query
- Rejection Filter: Check response for rejection keywords; return fallback if insufficient context