RAG from Scratch |
Written by Nikos Vaggalis |
Tuesday, 10 December 2024 |
The "RAG from Scratch" tutorial by Langchain coupled with the "RAG playground" are two great educational resources that will help you kickstart your journey with RAG. LLMs are trained on data made available from their trainers. If you want to feed them your own data to perform queries on it, you can do it in two ways. The old way was by fine tuning the foundational model. Fine tuning while a perfectly valid technique, had a few downsides; it's resource intensive in both computing power and data volumes required while it has to be continuously updated when new data arrives. The other option and the more modern and lightweight approach, is through RAG or retrieval augmented generation. However, to utilize RAG you have to stick to a well-defined pipeline:
If that sounds too complicated, fear not as this new course by Langchain, will show you how to build a RAG system from scratch. Assembled as a 14-part short video youtube playlist, it starts with the absolute basics and moves along the pipeline to completion describing all the intermediate steps. And it does that by using its own Langchain framework, Python, the ChromaDB vectorstore, the ChatOpenAI interface and OpenAI's LLM. Here follows the complete list of the tutorials: 1. Overview Part 13 is about how RAG systems can handle "lower-level" questions that reference specific facts found in a single document or "higher-level" questions that distill ideas that span many documents, while part 14 and the ColBERT approach address the issue that occurs with embedding models compressing text into fixed-length (vector) representations that capture the semantic content of the document. While this compression is very useful for efficient search / retrieval, it puts a heavy burden on that single vector representation to capture all the semantic nuance and in some cases, irrelevant content can dilute the semantic usefulness of the embedding. All the code is hosted on the project's Github repo as Jupyter notebooks that you can download and run on your own machine. That's not all however. As a complimentary element to the course resource, there's the interactive RAG Playground (unrelated to Langchain). This playground lets you explore each step of the RAG pipeline through interactive visualizations. Therefore you can, practically at a glance and without writing any code, take a look at what's going on behind the scenes: Text Splitting
Vector Embedding & Similarity
Response Generation
All free and inside your browser. RAG demystified!
More InformationRelated ArticlesLearn To Chat with Your Data For Free
To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.
Comments
or email your comment to: comments@i-programmer.info |
Last Updated ( Tuesday, 10 December 2024 ) |