🔍📚 Retrieval augmentation uses an external knowledge base as a "window" into the world — we explore how to implement this for LLMs using @LangChainAI, reducing hallucinations and keeping info up to date
📖🔧 To give LLMs relevant source knowledge, we create a knowledge base:
- We start with a dataset (e.g., a subset of Wikipedia)
- Split it into chunks
- Generate embeddings (numerical representations) of the "human meaning" behind each chunk
🌐🗃️ We store these embeddings in the @pinecone vector database, which can scale to billions of records and help us manage this knowledge efficiently — we just add, delete, and update records!
Much easier than retraining a giant LLM for each new doc 😅
🤖🔗 After this, we can connect LangChain to our vector DB and add an LLM that can generate responses based on the info retrieved from our knowledge base
📜🔖 But we're still not sure if the generated text is hallucinated or not — unfortunately there's no sure-fire way to solve this (yet...)
However, we can help our users by adding citations to the LLM's responses using @LangChainAI's RetrievalQAWithSourcesChain
• • •
Missing some Tweet in this thread? You can try to
force a refresh
I built a ChatGPT @lex_fridman plugin that allows to chat with the collective wisdom contained across 499 of Lex's podcasts and videos... Here's how I built it 🧵
Started by:
- downloading Lex MP3s via @YouTube API
- transcribing audio to text with @OpenAI's large Whisper model
- (optional) hosted the new "lex-transcripts" dataset on @huggingface datasets!