Training an LLM to effectively use information retrieval
Key Takeaways
The video discusses training large language models (LLMs) to effectively use information retrieval by proposing a training approach that teaches LLMs to generate a special token, RET, when they're not confident or don't know the answer to a question, and fine-tuning LLMs to improve accuracy and efficiency using the Pop QA dataset and adaptive retrieval methods like AdapT-LLM.
Full Transcript
hi everyone so I want to try something new in this channel what I'll be doing is I will be doing longer summaries of interesting large language model papers that I find and this would range from you how to combine large language models with information retrieval systems and how to build agentic workflows and so forth so I usually spend a lot of time going through archive papers uh but I realized that I miss out on opportunities to actually go deeper on some papers and what I want to do is I want to come from an angle of the application of large language models I do teach a lot about large language models you know the prompt engineering aspects of it how to build rag systems and you know I teach this to like startups I do a lot of technical Consulting as well and how to put these systems into the real world but there's a lot of interesting insights and new ideas that are coming through some of these research papers that you know a lot of these companies like meta and even universities right are presenting really interesting ideas so how to push forward large languish models you know and how to make them more effective uh for different applications so I want to start off with this interesting paper that I found yesterday this paper is about how to train llms to utilize information retrieval effectively so we know with rag systems when you are incorporating some information retrieval component to the system right you're getting some information that's external and that may have or may face some conflict with what the model already knows so there are a lot of really interesting papers that are kind of digging deeper into this question of when exactly should the language mod utilize context or external context from an information retrieval system and when not to use it the idea behind this paper from labruna campus and Es here from the different universities here uh is that you know these information retriever systems right they are used for different things and in this case the scope of the problem is on question answering they want to train a system or find you a system to make that decision when to use information retrieval and that's kind of really important especially in open domain question answering where sometimes the system will need to access external information or knowledge to be able to answer that question Faithfully or accurately so I think this is a great idea and you will see some of the results that they get and I think it provides a little bit of ideas on how to approach when you don't have right a really good way or good system to decide when to use context or not because I think a lot of people are building rack systems but just you know leveraging the rack system and not really focusing on when should we leverage the information retrieval system what they have done here is something that I've seen a lot now with a lot of the fine-tuning of llms to improve accuracy and efficiency so here they using what's called a special token so essentially they have an explicit token token re that decides when to use the retriable and when not to use it right so if the model the F model generates that token then you know the system would go into the into an information retrieval or use an information retrieval system to actually collect the additional knowledge or passages that it needs to answer the question I think the focus here is on this pop QA data set which has like 14,000 questions and it's going to be evaluated on this particular data set so what they have shown with this data set is that while llms relying sole on their performance parametric memories excel in addressing High popular questions from this St that the efficacy diminishes for low popularity questions where using IR becomes crucial right so that's really important that's why I think they needed to perform an extensive analysis on this problem now this is basically a summary or an overview of what this paper is presenting so at a high level we have you know where's a question usually that's coming from a user right and then we have a language model here that decides and this is going to be the fine-tune large language model we will get into what that fine-tune model is that fine tune model is referred to as adop llm we'll present the algorithm in a bit but here the step by step is the mod will generate R right if it it is confident that it needs some external information or it needs to retrieve external information that will Pro will provide us context to the language model eventually to answer the question and if it doesn't generate that then it will just go straight into answering because it's confident it has that probably um stored in its internal memory so it will just generate the answer correctly so I think this is very intuitive I think this is a really cool idea but we will see how effective this is in a bit so there's a lot of details there's extra readings you can find a lot of interesting readings here but I won't go through that what I will focus on is the main aspects of the approach so the first thing is this paper presents this adaptt llm method which extends the idea of adaptive retrieval so this is not a New Concept you can search the literature you will find more on adaptive retrieval seems to be a interesting idea that a lot of like researchers are focusing on and measuring whether it's really impactful for a rag system so that that's that's kind of what they're doing here and then here is basically a summary of the method here's the algorithm as well I the algorithm is quite straightforward to understand to be honest here is kind of an explanation to it first prompt containing the question is sent to the model so basically there is sort of like a prompt that's used um and then you can see here right so there is this initial this is the kind of the data set that you're building so it's it's a process to build that data set right for the Adaptive retrial part and you can see how the notation they use here um but you can see here that they have they're using these data sets right for creating the training data sets and I believe they're using let me see here it's more towards the end here they're using the NQ natural question data set and then also they're using this the standard question answering data set as well for creating that training data set uh the pop QA will be used for evaluation so that's kind of how they have configured this experiment so what they have done here is they have two different like processes here right and this algorithm explains it right so there's an if and then there's an else here so there building these instances that are used to finetune that model right so at the end we will have this particular uh set that of of of data that we're interested in creating and the way we're going to create is we're going to etherate over those training data sets where they provide a question a goal answer you know the passages right so this is kind of the notation here and then the first thing is we want to generate an answer first with the language model right and the and once we have that answer then we can check if that answer is a goal answer if it's a goal gold answer because we have access to that then what we're going to do is we're going to build you know an instance of that and we're going to use a parametric promp then we have a question then we have a golden answer right and that's added to the the data set that we're building so the parametric prompt here if you can read this closely you will see that it says you know for questions where the model response is accurate which is line four right here we build a training set instance incorporating a following prompt which we will call parametric prompt so there is this parametric prompt right this one right here that says answer the question Q if you need help answer R to get the context so it will build that prompt once it knows right the answer to it right and then alongside this prompt it also includes the corresponding question and the golden answer as well right so we can see here in this set that it also has a golden answer and that's it for those questions where the language model knows the answer is confident about the answer and then in contrast if the language model fails to produce a correct response to the question which is line eight right where in the else now in the else statement we build two different instances so there are two instances that are being created here right so the first one employs the parametric prompt which was used this is this prompt right here right with r designated as the answer so you know all like this one that uses gold answer right here in this one will'll use R right because this one will be telling the model or these are instances that will be telling the model that it needs to go into this kind of mode and it needs to retrieve this external information so that's how I understood that instance is useful for and so that's kind of one of those uh instances that are created and then also it will create right so you can see here it's indicating necessity for additional context so this will decide this will let the model or help the model to know when to use that additional context now the second context prompt encompasses contextual information alongside the question so this one also has some additional information here which is the additional context uh so for this instance we include the prompt the question from Q and The Golden answer from a and the corresponding context passage you can see here that there is a context prompt as well so there are two versions that are being created right this one doesn't have the r the reason that's really important right all of those instances this summarizes basically why it's important so it's says here this approach ensures that the model effectively learns to discern when context is necessary for answer questions or to provide a direct response when it suffices as well as answer directly when provided with context so that last one will help with that part right so that's kind of the different settings that it's aiming to try to satisfy and so you know this the straightforward fine-tuning those data sets are used and here we can start to see some of the the results that this model is producing so we can see here a little bit more closely here so this one is a performance comparison so they use the Lama 2 models by the way and it's I think the 7 billion model and so here you can see with the different data sets that were used a training set what they get in terms of the results and obviously these settings right here never retrieve is no retrieval used and I retrieve is always use retrial so these are kind of the two baselines that are compared with right so so you can see this is the method they are proposing you can see how there is definitely some improvement in terms of accuracy now this is not perfect obviously I think this is a very difficult data set this SP QA but you can see that it's already providing some interesting results and it hints at the fact that you know potentially building something like this that can decide for you automatically whether you need that extra context or not is going to be really helpful for the model especially given what I said earlier where we know that this systems and language models have conflict with you know producing faithful responses because there might be some knowledge conflict between these to systems that's something that's heavily researched but I think this particular approach is a really neat way to kind of address or you know aiming to address this particular Pro problem to some extent I've seen a lot of papers kind of presenting very similar ideas I I believe I shared another paper the other day that presents something really interesting where they go directly to try to ass says you know why exactly is there conflicts where exactly are these conflicts happening with this information retrieval system and the language mold so there's a lot of interesting research that's going on if you want to keep track of that I'll be doing more of those summaries or of those papers here in this channel the experiments and results section here so we have a bunch of experiments and results but I'll just kind of highlight there's a lot of like sections here that show the results that they're getting this one was I think the more the high level results which shows that this particular approach is effective but we're going to go into a few more details with the particular um approach here you can start to see that the effectiveness of using right this particular token how it improves especially when using that additional context it shows you how it improves compared to the never retrieve llm which is this part right so this a significant Improvement although at 33% I think it's quite low you know this is probably not production ready but I believe that if you're working on a spe a specific problem um you know you might be able to get this a lot higher so I think this is has a lot of potential even though there's a really low accuracy there and they go into that right they explain oh you know they get this very low results but you know the point they're trying to prove is that by training these modes to explicitly know when to when to add additional context they can get better results so I think what would be interesting to test out if you have something that you're trying or a data set that you're trying you can find you a small language mod you can even go smaller potentially for a t this I think this is where the power of small language mold actually comes in to be used you know to decide or build components like this in your overall system that is leveraging large language models there are a lot more results here I mean they show also that you know when you use a retriever you know normally you still have these kind of difficult situation or challenges where the system is not really performing as accurately as you may want and and this goes back to the point that I was calling out earlier which is this knowledge conflict uh but you can see here some additional results you can check out this table and you can read here more about table four and table three those are interesting additional results I'm not going to get into those because I want to keep this video short but I think those are interesting results to also kind of look at as well you can try to maybe compare also with you know uh create baselines with bigger systems you know these new systems like gp4 or cloud and so on but I think know these models are more capable obviously they're bigger systems they probably have you know more more access to more knowledge and so on so you know it'll be interesting to see how they perform and if you can build some kind of comparison so that would be it for this paper I mean the the big takeaway here as I mentioned was to potentially use these smaller language models to build you know these interesting components that can help increase the overall accuracy of your in this case like a rag system right so I think this is the way we should be using large langwich modes right in combination with you know what we already potentially have today like an information retrieval system so this paper was interesting hopefully it was interesting to you that's just a quick summary of it um hopefully there's kind of a takeaway for you here as well maybe you could use it in whatever you're building or doing research on and I'll be covering a lot more of these papers my style will be I will won go too much into details what I will be focusing on is trying to cover like interesting insights and interesting results that are more applicable to maybe the kind of applications that you're trying to build and so forth that's kind of the angle that I'm coming at there approach will be a little bit different because I'm more focusing on the application side of things so any paper that I see if you see any paper out there that you would potentially like me to summarize as well I'll I'll shoot for that as well if I can if I have the time but the idea is that I will kind of create some of these papers that I find interesting if you leave a like and if you comment on it and you subscribe to the channel that tells me a lot that this might be interesting for you so please do that for me and that'll be really helpful and I really appreciate that so catch you in the next one thank you for listening and goodbye
Original Description
This new paper presents an approach to train LLMs to effectively utilize information retrieval.
It first proposes a training approach to teach an LLM to generate a special token, RET, when it's not confident or doesn't know the answer to a question...
Paper: https://arxiv.org/abs/2404.19705
#ai #llms #machinelearning
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Elvis Saravia · Elvis Saravia · 44 of 60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
▶
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
101 ways to solve search (by Pratik Bhavsar)
Elvis Saravia
TLDR Generation of Scientific Documents | ML Interview #1 with Isabel Cachola
Elvis Saravia
Sentiment Analysis: Key Milestones, Challenges and New Directions
Elvis Saravia
Discriminative Adversarial Search for Abstractive Summarization (by Thomas Scialom)
Elvis Saravia
Question Understanding: COVID-Q: 1,600+ Questions about COVID-19
Elvis Saravia
Getting Started with NLP
Elvis Saravia
Building tools and frameworks for large-scale social media mining (by Dr. Juan M. Banda)
Elvis Saravia
TextAttack: A Framework for Data Augmentation and Adversarial Training in NLP
Elvis Saravia
Dive into Deep Learning (Study Group): Introduction to Deep Learning | Session 1
Elvis Saravia
Dive into Deep Learning (Study Group): Multilayer Perceptrons | Session 4
Elvis Saravia
How I read and annotate ML papers
Elvis Saravia
Keep Learning ML (Session 1) | DSV, CompLex, Modern tools for emotions
Elvis Saravia
Dive into Deep Learning (Study Group): Preliminaries | Session 2
Elvis Saravia
Keep Learning ML #2 | Language-conditioned policy learning, Effective ML Testing, EagerPy
Elvis Saravia
Dive into Deep Learning (Study Group): Linear Neural Networks | Session 3
Elvis Saravia
Dive into Deep Learning (Study Group): Multilayer Perceptrons | Session 4
Elvis Saravia
Keep Learning ML #3 | Contrastively Trained Structured World Models
Elvis Saravia
Dive into Deep Learning (Study Group): Deep Learning Computation with PyTorch | Session 5
Elvis Saravia
Dive into Deep Learning (Study Group): Convolutional Neural Networks | Session 6
Elvis Saravia
Dive into Deep Learning (Study Group): Modern CNNs | Session 7
Elvis Saravia
101 ways to solve neural search with Jina
Elvis Saravia
(Hopefully-Reusable) Life Lessons for PhD Students in NLP
Elvis Saravia
How to save the world and forward your career in 5 easy steps | Women in NLP Talks
Elvis Saravia
Prompt Engineering Overview
Elvis Saravia
Getting Started with the OpenAI Playground
Elvis Saravia
LM-Guided Chain of Thought
Elvis Saravia
Elements of a Prompt
Elvis Saravia
Reasoning with Intermediate Revision and Search with LLMs #chatgpt #ai #llms #science #programming
Elvis Saravia
General Tips for Designing Prompts
Elvis Saravia
Efficient Infinite Context Transformers #ai #machinelearning #research #llms #science
Elvis Saravia
Best Practices and Lessons Learned on Synthetic Data for Language Models #ai #machinelearning #genai
Elvis Saravia
Reducing Hallucinations in Structured Outputs via RAG #chatgpt #ai #llms #programming
Elvis Saravia
Basic Prompt Examples for LLMs
Elvis Saravia
LLM In Context Recall is Prompt Dependent #llms #ai #chatgpt #machinelearning
Elvis Saravia
Zero-shot Prompting Explained
Elvis Saravia
RAG Faithfulness #llms #ai #gpt4
Elvis Saravia
Understanding LLM Settings
Elvis Saravia
Llama 3 is here! | First impressions and thoughts
Elvis Saravia
Llama 3 is Here! #ai #llms #llama3
Elvis Saravia
Microsoft introduces Phi-3 | The most capable small language model?
Elvis Saravia
Microsoft introduces Phi-3! #ai #llms #microsoft
Elvis Saravia
Make Your LLM Fully Utilize the Context #ai #llms #machinelearning
Elvis Saravia
When to Retrieve? #ai #llms #machinelearning
Elvis Saravia
Training an LLM to effectively use information retrieval
Elvis Saravia
State-of-the-art open-source LLM judges #ai #machinelearning #gpt4
Elvis Saravia
Better and Faster LLMs via Multi-token Prediction
Elvis Saravia
AlphaMath Almost Zero #ai #science #machinelearning
Elvis Saravia
SWE-Agent | An LLM-based Software Engineering Agent
Elvis Saravia
[LLM NEWS] AlphaFold 3, xLSTM, OpenAI's Model Spec, DeepSeek-V2, OpenDevin CodeAct 1.0
Elvis Saravia
LLM-powered tool for web scraping #ai #chatgpt #engineering
Elvis Saravia
Learn about LLMs in this NEW course #ai #chatgpt #engineering
Elvis Saravia
[LLM NEWS] KANs, Gemma 10M Context, OpenAI Updates?, Automatic Prompt Engineering, Tokenizer Arena
Elvis Saravia
[LLM News] GPT4-o, Project Astra, Veo, Copilot+ PCs, Gemini 1.5 Flash, Chameleon
Elvis Saravia
Enhancing Answer Selection in LLMs #ai #machinelearning #engineering
Elvis Saravia
On exploring LLMs #ai #promptengineering #chatgpt
Elvis Saravia
Transformers Can Do Arithmetic with the Right Embeddings #ai #machinelearning #engineering
Elvis Saravia
[LLM News] xAI Series B, Codestral, LLM Guide, AutoGen Course, Symbolic Chain-of-Thought
Elvis Saravia
PR-Agent #ai #gpt4 #software
Elvis Saravia
Extracting features from Claude 3 Sonnet
Elvis Saravia
Has prompt engineering been solved?
Elvis Saravia
More on: LLM Foundations
View skill →Related Reads
🎓
Tutor Explanation
DeepCamp AI