Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
105 views
RAG Notes
Notes for RAG
Uploaded by
sanjaych333
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save RAG notes For Later
Download
Save
Save RAG notes For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
105 views
RAG Notes
Notes for RAG
Uploaded by
sanjaych333
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save RAG notes For Later
Carousel Previous
Carousel Next
Save
Save RAG notes For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 4
Search
Fullscreen
Retrievalaugmented generation (RAG) combines large language models (LLMs) with retrieval 2-1 Explain the main parts of a RAG system and how they work. ‘Ans. A RAG (retrieval-augmented generation) system has two main components: the retriever and the generator. The retriever searches for and collects relevant information from extemal sources, like databases, documents, or websites. ‘The generator, usually an advanced language model, uses this information to create clear and accurate text. ‘The retriever makes sure the system gets the most up-to-date information, while the generator combines this with its own knowledge to produce better answers, Together, they provide more accurate responses than the generator could on its own. Q.2 What are the main benefits of using RAG instead of just relying on an LLM's internal knowledge? Ans. If you rely only on an LLM’s builtin knowledge, the system is limited to what it was trained ‘on, which could be outdated or lacking detail. roving ame say nae emt tm tr on, This approach also reduces “hallucinations"—errors where the model makes up facts—because the answers are based on real data. RAG is especially helpful for specific fields like law, medicine, or tech, where up-to-date, specialized knowledge is needed. Q.3 What types of external knowledge sources can RAG use? ‘Ans. RAG systems can gather information from both structured and unstructured external sources: © Structured sources include databases, APIs, or knowledge graphs, where data is organized and easy to search. ¢ Unstructured sources consist of large collections of text, such as documents, websites, oF archives, where the information needs to be processed using natural language understanding.This flexibility allows RAG systems to be tailored to different fields, such as legal or medical use, by pulling from case law databases, research journals, or clinical trial data. 2.4 Does prompt engineering matter in RAG? ‘Ans. Prompt engineering helps language models provide high-quality responses using the retrieved information. How you design a prompt can affect the relevance and clarity of the ‘output. '* Specific system prompt templates help guide the model. For example, instead of having a simple out-of-the-box system prompt like “Answer the question,” you might have, “Answer the question based only on the context provided.” This gives the model explicit instructions to only use the context provided to answer the question, which can reduce the probability of hallucinations. ‘¢ Few-shot prompting involves giving the model a few example responses before asking it to generate its own, so it knows the type of response you're looking for. ¢ Chain-of-thought prompting helps break down complex questions by encouraging the ‘model to explain its reasoning step-by-step before answering. Q.5 How does the retriever work in a RAG system? What are common retrieval methods? ‘Ans. In a RAG system, the retriever gathers relevant information from extemal sources for the generator to use. There are different ways to retrieve information. ‘One method is sparse retrieval, which matches keywords (e.g., TF-IDF or BM25). This is simple but may not capture the deeper meaning behind the words. Another approach is dense retrieval. which uses neural embeddings to understand the meaning of documents and queries. Methods like BERT or Dense Passage Retrieval (DPR) represent documents as vectors in a shared space, making retrieval more accurate. ‘The choice between these methods can greatly affect how well the RAG system works, (Q.6 What are the challenges of combining retrieved Information with LLM generation? ‘Ans, Combining retrieved information with an LLM’s generation presents some challenges. For instance, the retrieved data must be highly relevant to the query as irrelevant data can confuse the model and reduce the quality of the response. Additionally, if the retrieved information conflicts with the model's internal knowledge, it can create confusing or inaccurate answers. As such, resolving these conflicts without confusing the user is crucial.Fal th syle an format of reeved data may not lays match the mod's usual wring ot lormating, making i ard forthe modelo agate he nlomation smh 27 Whats the role ofa vector database in RAG? [Ans @ RAG systom,a vector database helps manage and store dense embeddings of ox ‘These embedcngs are numancal representations that capture te meaning of words and traces, created by models ke BERT or Open nen a query is made, is ambeddng is compared othe stored ones inthe database o fad ‘amar document. Th makes faster and more accurate to reteve the ight infrmaton. The [process heb the system quekly locate and pul up the most relevant infomation, improving ‘bom he speed and accuracy of retioval {8 what are some common ways to evaluate RAG systems? [Ans To evalusle @ RAG system, you need 10 look at both the retieval and generation Metis tke precaion (now many reeved documents ere rlevet) and recall how any of he toll relevant documents wee found) can be vaed ere. 1+ For the generator, matics Ike BLEU and ROUGE can be used Yo compare the erected isto huran-wrten examples o 9098 quay. For dowirean aah ike ueston-answerng, matics ike Ft score, pecislon, ar recs ‘so be used to evaluate the overat RAG sytem, 12.9 How do you handle ambiguous or incompleto quer telovant results? Ina RAG system to ensure [Ana. Handing ambiguous or incomplete queries in a RAG system roquies strategies to ensure ‘hat reevant an accurate nfermaton s etveved despite the lack of Gary 9 he user's mp (One approach i 1 iglament query raoament technique, where th system automaticaly ‘suggests ications or aformutates the ambiguous gry nto a more prise ono Dasa’ O0 Known pattems or previous ilerctona. Tha can svelve taking folowup questons of ‘roning te ser wih multe optns 6 narrow down thew nent Another method is 10 rtieve 4 diverse set of documents that cover mute possible Interpretations of he quer. By retiving a range of ess te system ensures that even fhe ‘ers vague, some relevant nlomatin i kayo be coed,Intermediate RAG Interview Questions 2.10 How do you choose the right retriever for a RAG application? ‘Ans. Choosing the right retriever depends on the type of data you're working with, the nature of the queries, and how much computing power you have. For complex queries that need a deep understanding of the meaning behind words, dense retrieval methods like BERT or DPR are better. These methods capture context and are ideal for tasks like customer support or research, where understanding the underlying meanings matter. if the task is simpler and revolves around keyword matching, or if you have limited computational resources, sparse retrieval methods such as BM25 or TF-IDF might be more suitable. These methods are quicker and easier to set up but might not find documents that don't match exact keywords. The main trade-off between dense and sparse retrieval methods is accuracy versus ‘computational cost. Sometimes, combining both approaches in a hybrid retrieval system can help balance accuracy with computational efficiency. This way, you get the benefits of both dense and sparse methods depending on your needs. Q.11 Describe what a hybrid search Is. ‘Ans. Hybrid search combines the strengths of both dense and sparse retrieval methods. For instance, you can start with a sparse method like BM25 to quickly find documents based on keywords. Then, a dense method like BERT re-ranks those documents by understanding their context and meaning. This gives you the speed of sparse search with the accuracy of dense methods, which is great for complex queries and large datasets. Q.12 Do you need a vector database to implement RAG? If not, what are the alternatives? Ans. A vector database is great for managing dense embeddings, but it's not always necessary. Alternatives include: © Traditional databases: If you're using sparse methods or structured data, regular relational or NoSQL databases can be enough. They work well for keyword searches. Databases like MongoDB or Elasticsearch are good for handling unstructured data and full-text searches, but they lack deep semantic search. © Inverted indices: These map keywords to documents for fast searches, but they don't capture the meaning behind the words.
You might also like
NVIDIA-GEN-AI-Cheat-Sheet
PDF
No ratings yet
NVIDIA-GEN-AI-Cheat-Sheet
97 pages
MongoDB Sales Presentation
PDF
No ratings yet
MongoDB Sales Presentation
35 pages
Object Oriented Analysis and Design Notes
PDF
No ratings yet
Object Oriented Analysis and Design Notes
62 pages
Developing Retrieval Augmented Generation (RAG) Based LLM Systems From Pdfs - An Expert Report
PDF
No ratings yet
Developing Retrieval Augmented Generation (RAG) Based LLM Systems From Pdfs - An Expert Report
36 pages
2024-05-EB-A Compact GuideTo RAG
PDF
No ratings yet
2024-05-EB-A Compact GuideTo RAG
38 pages
10 Salesforce Einstein Features
PDF
No ratings yet
10 Salesforce Einstein Features
13 pages
WEEK - 5 SOLID Principles
PDF
No ratings yet
WEEK - 5 SOLID Principles
23 pages
Git and GitHub For Beginners
PDF
No ratings yet
Git and GitHub For Beginners
19 pages
Hands-On Lab With LLMs and Gen AI Within IDC
PDF
No ratings yet
Hands-On Lab With LLMs and Gen AI Within IDC
57 pages
AI Privacy Risks and Mitigations in Large Language Models
PDF
No ratings yet
AI Privacy Risks and Mitigations in Large Language Models
102 pages
Agent Based Models Are Here and Disrupting GPT RAG 1717410571
PDF
No ratings yet
Agent Based Models Are Here and Disrupting GPT RAG 1717410571
12 pages
LangChain_Academy_-_Introduction_to_LangGraph_-_Motivation
PDF
No ratings yet
LangChain_Academy_-_Introduction_to_LangGraph_-_Motivation
17 pages
Agentic_RAGs_1740054167
PDF
No ratings yet
Agentic_RAGs_1740054167
10 pages
FAANGPath Simple Template 1
PDF
No ratings yet
FAANGPath Simple Template 1
2 pages
How To Become Architect
PDF
No ratings yet
How To Become Architect
22 pages
Salesforce AI Specialist Demo
PDF
No ratings yet
Salesforce AI Specialist Demo
16 pages
Building A Talking AI With LLAMA + RAG - by Stefanoz - Oct, 2024 - Medium
PDF
No ratings yet
Building A Talking AI With LLAMA + RAG - by Stefanoz - Oct, 2024 - Medium
23 pages
Building a Smarter RAG_ Implementing Graph-based RAG with Neo4j _ by Vinay Jain _ Nov, 2024 _ Medium
PDF
No ratings yet
Building a Smarter RAG_ Implementing Graph-based RAG with Neo4j _ by Vinay Jain _ Nov, 2024 _ Medium
13 pages
1. Application Of Large Language
PDF
No ratings yet
1. Application Of Large Language
75 pages
Graph RAG
PDF
No ratings yet
Graph RAG
7 pages
Ai Fundamentals
PDF
No ratings yet
Ai Fundamentals
15 pages
Generative AI For Software Developers Syllabus
PDF
No ratings yet
Generative AI For Software Developers Syllabus
8 pages
Knowledge Graphs v Vector Databases and when not to use them!
PDF
No ratings yet
Knowledge Graphs v Vector Databases and when not to use them!
3 pages
What Is Natural Language Processing?
PDF
No ratings yet
What Is Natural Language Processing?
5 pages
Gen Ai Solutions
PDF
No ratings yet
Gen Ai Solutions
14 pages
10 Most Asked LLM Interview Questions
PDF
No ratings yet
10 Most Asked LLM Interview Questions
12 pages
GenAI_Interview_Questions-Draft
PDF
No ratings yet
GenAI_Interview_Questions-Draft
27 pages
Build Whatsapp Chatbot With Flask and Open Source LLM - LLAMA3? - by Mayankchugh Jobathk - Medium
PDF
No ratings yet
Build Whatsapp Chatbot With Flask and Open Source LLM - LLAMA3? - by Mayankchugh Jobathk - Medium
23 pages
GenAI POC - Training
PDF
100% (1)
GenAI POC - Training
43 pages
Generative AI Interview Questions and Answers
PDF
No ratings yet
Generative AI Interview Questions and Answers
7 pages
Guide to Fast GraphRAG
PDF
No ratings yet
Guide to Fast GraphRAG
7 pages
AI Institutes
PDF
No ratings yet
AI Institutes
98 pages
Cyara Building Smarter Chatbots Ebook 20230123
PDF
No ratings yet
Cyara Building Smarter Chatbots Ebook 20230123
21 pages
Weaviate Advanced RAG Techniques eBook
PDF
100% (1)
Weaviate Advanced RAG Techniques eBook
13 pages
LangChain & RAG
PDF
No ratings yet
LangChain & RAG
62 pages
Data Science
PDF
No ratings yet
Data Science
64 pages
RFP AMSTablet
PDF
No ratings yet
RFP AMSTablet
2 pages
ServiceNow Architect (AD)
PDF
No ratings yet
ServiceNow Architect (AD)
2 pages
320 Cohort 9 Report Final
PDF
No ratings yet
320 Cohort 9 Report Final
46 pages
Veeva Vault RIM Suite Datasheet - NA
PDF
No ratings yet
Veeva Vault RIM Suite Datasheet - NA
2 pages
CS 8520: Artificial Intelligence: Knowledge Representation
PDF
No ratings yet
CS 8520: Artificial Intelligence: Knowledge Representation
30 pages
PDF Based Question &answering Using Langchain and Openai Api
PDF
No ratings yet
PDF Based Question &answering Using Langchain and Openai Api
58 pages
Slide Deck Data Analysis With Databricks
PDF
No ratings yet
Slide Deck Data Analysis With Databricks
115 pages
RAG - The Future of LLMs - LinkedIn
PDF
No ratings yet
RAG - The Future of LLMs - LinkedIn
7 pages
GenAI Pinnacle Roadmap
PDF
100% (1)
GenAI Pinnacle Roadmap
8 pages
Data Pipelines From Zero To Solid
PDF
No ratings yet
Data Pipelines From Zero To Solid
58 pages
salesforce_spring25_release_notes
PDF
No ratings yet
salesforce_spring25_release_notes
685 pages
Neo4j - GraphRAG - 2024
PDF
100% (1)
Neo4j - GraphRAG - 2024
23 pages
Data Engineering 6 Months Plan
PDF
No ratings yet
Data Engineering 6 Months Plan
3 pages
Social Network Analytics Session2
PDF
No ratings yet
Social Network Analytics Session2
34 pages
Introducing Einstein Search For Commerce
PDF
No ratings yet
Introducing Einstein Search For Commerce
11 pages
Ebook - Unleash The Next Wave of Productivity With AI A Practical Guide For IT Leaders
PDF
No ratings yet
Ebook - Unleash The Next Wave of Productivity With AI A Practical Guide For IT Leaders
9 pages
Driverless A I Booklet
PDF
No ratings yet
Driverless A I Booklet
120 pages
ServiceNow - Novant - Health Story 2 PDF
PDF
No ratings yet
ServiceNow - Novant - Health Story 2 PDF
2 pages
Multimodal RAG Systems Hands-On Guide
PDF
No ratings yet
Multimodal RAG Systems Hands-On Guide
7 pages
Social Network Analytics Session1
PDF
No ratings yet
Social Network Analytics Session1
35 pages
Building A Multi-LLM Chatbot With Langchain - OpenAI and Ollama - by Gayani Parameswaran - Medium
PDF
No ratings yet
Building A Multi-LLM Chatbot With Langchain - OpenAI and Ollama - by Gayani Parameswaran - Medium
13 pages
Generative AI Notes
PDF
No ratings yet
Generative AI Notes
1 page
UML Diagrams: by Daniel Damaris Novarianto S
PDF
No ratings yet
UML Diagrams: by Daniel Damaris Novarianto S
50 pages
Interview Questions on RAG
PDF
No ratings yet
Interview Questions on RAG
6 pages