Posts

When an LLM fails

Image
RAG is a term used around large language models, it means Retrieval-Augmented Generation. It is one of the ways to add specific knowledge to an existing large language model (LLM) in order to make it capable of answering more specific questions. The process is relatively straightforward, lets say we would like to add a specific book to our body of knowledge. One way to accomplish this is to process the book, usually a pdf file, and convert it to something (a vector database) the LLM can use to answer questions. Well, technically not the LLM but another part of the system called the retriever . We'll get back to it. The pdf will usually be read by some document loader from a popular open source framework for building LLM applications called LangChain. After we have the document loaded we will chunk it, split it into semantically related parts . And finally we will assign a list of numbers (a vector) to each chunk and we will store the vector and reference to the text chunk into our...