Skip to main content
Question 7. A developer is working on a chatbot application that will assist users with technical support questions. Which technique would be the most effective to ensure the chatbot provides answers based on the company’s technical documentation rather than general knowledge? Options: reinforcement learning from human feedback, retrieval-augmented generation, adversarial training, or self-supervised learning? Answer: Retrieval-augmented generation. Retrieval-augmented generation (RAG) is the most effective approach to ensure a chatbot grounds its answers in company-specific technical documentation. RAG combines a retrieval step that fetches the most relevant, authoritative documents or passages with a generative model that conditions its responses on those retrieved materials. This approach helps make answers traceable to company documentation and reduces hallucinations stemming from the model’s general pretraining. Why RAG is appropriate:
  • Grounding: RAG conditions the LLM’s output on retrieved documents so responses are tied to the company documentation rather than only the model’s pretraining.
  • Freshness and scope control: You can update the indexed documents independently of the generative model, keeping answers aligned with the latest documentation.
  • Traceability: Retrieval enables returning source passages or citations alongside answers, aiding verification and compliance.
  • Practical architecture: RAG maps well to a production stack that includes embeddings, a vector database, and a generative LLM that fuses retrieved context into final answers.
Typical RAG workflow:
  1. Preprocess and index company documentation (chunking, embedding, and storing vectors in a vector database).
  2. At query time, embed the user query and retrieve the top-k most relevant passages using vector search.
  3. Provide the retrieved passages as context to the generative model (often prepended to the prompt or used in a dedicated fusion module).
  4. Return the model’s response along with source citations or links to the retrieved documentation.
Short comparison to the other techniques listed:
  • Reinforcement learning from human feedback (RLHF): Useful for aligning behavior and improving conversational quality, but does not guarantee grounding in external documents by itself.
  • Adversarial training: Improves robustness to tricky or malicious inputs, but does not provide document grounding.
  • Self-supervised learning: Enhances general representations and knowledge from unlabeled data, but does not constrain responses to a specific documentation corpus.
How to implement a robust RAG pipeline (practical tips):
  • Use a high-quality embedding model that captures semantic similarity for your domain.
  • Chunk documents into reasonably sized passages (e.g., 200–1,000 tokens) with overlap to preserve context.
  • Store embeddings in a production-ready vector database (e.g., Pinecone, Milvus, Weaviate, or an open-source alternative).
  • Implement reranking and filtering to reduce noisy or out-of-scope retrievals before conditioning the LLM.
  • Always surface source citations and, when possible, links to the original documentation for verification.
Comparison table
Use a RAG pipeline with a reliable embedding model and a vector database for retrieval. Return retrieved sources with each response so users and auditors can verify the information against the company documentation.
References and further reading
The image describes a question about effective techniques for a chatbot to provide answers based on company-specific documentation, suggesting "Retrieval-augmented generation" as the solution.

Watch Video