AWS Certified AI PractitionerFoundation ModelsMedium
A startup is building an intelligent assistant that needs to understand user queries, retrieve relevant information from a proprietary knowledge base, and then generate a coherent and accurate answer based on the retrieved information. The goal is to minimize factual inaccuracies (hallucinations) and provide up-to-date responses. Which technique is best suited for this architecture?
- AZero-shot prompting
- BPure fine-tuning of a large language model (LLM)
- CRetrieval-Augmented Generation (RAG)
- DReinforcement Learning from Human Feedback (RLHF)
Show answer & explanationAnswer & explanation
Correct answer: C. Retrieval-Augmented Generation (RAG)
Retrieval-Augmented Generation (RAG) directly addresses the requirements by retrieving relevant, up-to-date information from an external knowledge base and using it to ground the LLM's generation, significantly reducing hallucinations and improving factual accuracy.
Why the other options are wrong
- A. Zero-shot prompting relies solely on the model's pre-trained knowledge, which can be outdated or prone to hallucination without external grounding.
- B. Pure fine-tuning might still lead to hallucinations and won't inherently provide access to external, up-to-date knowledge.
- D. RLHF helps align model behavior with human preferences but doesn't directly solve the problem of accessing external knowledge or preventing hallucinations from outdated internal knowledge.
Retrieval-Augmented Generation (RAG)
A technique that enhances large language models by retrieving relevant information from an external, authoritative knowledge base before generating a response, thereby improving factual accuracy and reducing hallucinations.
- Combines retrieval and generation steps
- Reduces model hallucinations
- Provides access to up-to-date and domain-specific information
Memory trick: RAG Retrieves Answers Grounded.