Retrieval-augmented generation

Retrieval-augmented generation

Retrieval-augmented generation (RAG) is a technique that enables large language models (LLMs) to retrieve and incorporate new information from external data sources. With RAG, LLMs first refer to a specified set of documents, then respond to user queries. These documents supplement information from the LLM's pre-existing training data. This allows LLMs to use domain-specific and/or updated information that is not available in the training data. For example, this enables LLM-based chatbots to access internal company data or generate responses based on authoritative sources. RAG improves LLMs by incorporating information retrieval before generating responses. Unlike LLMs that rely on static training data, RAG pulls relevant text from databases, uploaded documents, or web sources. According to Ars Technica, "RAG is a way of improving LLM performance, in essence by blending the LLM process with a web search or other document look-up process to help LLMs stick to the facts." This method helps reduce AI hallucinations, which have caused chatbots to describe policies that don't exist, or recommend nonexistent legal cases to lawyers that are looking for citations to support their arguments. RAG also reduces the need to retrain LLMs with new data, saving on computational and financial costs. Beyond efficiency gains, RAG also allows LLMs to include sources in their responses, so users can verify the cited sources. This provides greater transparency, as users can cross-check retrieved content to ensure accuracy and relevance. The term retrieval-augmented generation (RAG) was introduced in a 2020 paper that described combining a parametric language model with a non-parametric external memory accessed through retrieval at inference time. == RAG and LLM limitations == LLMs can provide incorrect information. For example, when Google first demonstrated its LLM tool "Google Bard" (later re-branded to Gemini), the LLM provided incorrect information about the James Webb Space Telescope. This error contributed to a $100 billion decline in Google's stock value. RAG is used to prevent these errors, but it does not solve all the problems. For example, LLMs can generate misinformation even when pulling from factually correct sources if they misinterpret the context. MIT Technology Review gives the example of an AI-generated response stating, "The United States has had one Muslim president, Barack Hussein Obama." The model retrieved this from an academic book rhetorically titled Barack Hussein Obama: America's First Muslim President? The LLM did not "know" or "understand" the context of the title, generating a false statement. LLMs with RAG are programmed to prioritize new information. This technique has been called "prompt stuffing." Without prompt stuffing, the LLM's input is generated by a user; with prompt stuffing, additional relevant context is added to this input to guide the model's response. This approach provides the LLM with key information early in the prompt, encouraging it to prioritize the supplied data over pre-existing training knowledge. == Process == Retrieval-augmented generation (RAG) enhances large language models (LLMs) by incorporating an information-retrieval mechanism that allows models to access and utilize additional data beyond their original training set. Ars Technica notes that "when new information becomes available, rather than having to retrain the model, all that's needed is to augment the model's external knowledge base with the updated information" ("augmentation"). IBM states that "in the generative phase, the LLM draws from the augmented prompt and its internal representation of its training data to synthesize" an answer. === RAG key stages === Typically, the data to be referenced is converted into LLM embeddings, numerical representations in the form of a large vector space. RAG can be used on unstructured (usually text), semi-structured, or structured data (for example knowledge graphs). These embeddings are then stored in a vector database to allow for document retrieval. Given a user query, a document retriever is first called to select the most relevant documents that will be used to augment the query. This comparison can be done using a variety of methods, which depend in part on the type of indexing used. The model feeds this relevant retrieved information into the LLM via prompt engineering of the user's original query. Newer implementations (as of 2023) can also incorporate specific augmentation modules with abilities such as expanding queries into multiple domains and using memory and self-improvement to learn from previous retrievals. Finally, the LLM can generate output based on both the query and the retrieved documents. Some models incorporate extra steps to improve output, such as the re-ranking of retrieved information, context selection, and fine-tuning. == Applications == Retrieval-augmented generation is used in applications where generated responses need to be grounded in external or frequently updated information. Commonly cited use cases include search engines, question-answering systems, customer support chatbots, enterprise knowledge assistants, content generation, recommendation systems, retail and e-commerce, and industrial or manufacturing workflows. In healthcare, RAG has been studied as a way to ground large language model outputs in external medical knowledge sources, although reviews have noted continuing challenges around evaluation, ethics, and clinical reliability. == Improvements == Improvements to the basic process above can be applied at different stages in the RAG flow. === Encoder === These methods focus on the encoding of text as either dense or sparse vectors. Sparse vectors, which encode the identity of a word, are typically dictionary-length and contain mostly zeros. Dense vectors, which encode meaning, are more compact and contain fewer zeros. Various enhancements can improve the way similarities are calculated in the vector stores (databases). Performance improves by optimizing how vector similarities are calculated. Dot products enhance similarity scoring, while approximate nearest neighbor (ANN) searches improve retrieval efficiency over K-nearest neighbors (KNN) searches. Accuracy may be improved with Late Interactions, which allow the system to compare words more precisely after retrieval. This helps refine document ranking and improve search relevance. Hybrid vector approaches may be used to combine dense vector representations with sparse one-hot vectors, taking advantage of the computational efficiency of sparse dot products over dense vector operations. Other retrieval techniques focus on improving accuracy by refining how documents are selected. Some retrieval methods combine sparse representations, such as SPLADE, with query expansion strategies to improve search accuracy and recall. === Retriever-centric methods === These methods aim to enhance the quality of document retrieval in vector databases: Pre-training the retriever using the Inverse Cloze Task (ICT), a technique that helps the model learn retrieval patterns by predicting masked text within documents. Supervised retriever optimization aligns retrieval probabilities with the generator model's likelihood distribution. This involves retrieving the top-k vectors for a given prompt, scoring the generated response's perplexity, and minimizing KL divergence between the retriever's selections and the model's likelihoods to refine retrieval. Reranking techniques can refine retriever performance by prioritizing the most relevant retrieved documents during training. === Language model === By redesigning the language model with the retriever in mind, a 25-time smaller network can get comparable perplexity as its much larger counterparts. Because it is trained from scratch, this method (Retro) incurs the high cost of training runs that the original RAG scheme avoided. The hypothesis is that by giving domain knowledge during training, Retro needs less focus on the domain and can devote its smaller weight resources only to language semantics. The redesigned language model is shown here. It has been reported that Retro is not reproducible, so modifications were made to make it so. The more reproducible version is called Retro++ and includes in-context RAG. === Chunking === Chunking involves various strategies for breaking up the data into vectors so the retriever can find details in it. Three types of chunking strategies are: Fixed length with overlap. This is fast and easy. Overlapping consecutive chunks helps to maintain semantic context across chunks. Syntax-based chunks can break the document up into sentences. Libraries such as spaCy or NLTK can also help. File format-based chunking. Certain file types have natural chunks built in, and it's best to respect them. For example, code files are best chunked and vectorized as whole functions or classes. HTML files should leave

or base64 encoded elements

Visual hull

A visual hull is a geometric entity created by shape-from-silhouette 3D reconstruction technique introduced by A. Laurentini. This technique assumes the foreground object in an image can be separated from the background. Under this assumption, the original image can be thresholded into a foreground/background binary image, which we call a silhouette image. The foreground mask, known as a silhouette, is the 2D projection of the corresponding 3D foreground object. Along with the camera viewing parameters, the silhouette defines a back-projected generalized cone that contains the actual object; this cone is called a silhouette cone. The intersection of the two silhouette cones defines a visual hull. which is a bounding geometry of the actual 3D object. When the reconstructed geometry is only used for rendering from a different viewpoint, the implicit reconstruction together with rendering can be done using graphics hardware. == In two dimensions == A technique used in some modern touchscreen devices employs cameras placed in the corners situated opposite infrared LEDs. The one-dimensional projection (shadow) of objects on the surface may be used to reconstruct the convex hull of the object. Visual hull generation method has also been used within experimental tele-meeting systems that aim to allow a user in a remote location to interact with virtual objects. The method uses multiple cameras to capture the real-world movements and interactions of the "sender", employing hardware-accelerated volumetric visual hull representation to create 3D volume from 2D multi-view images. Its ultimate aim is to allow 3D collaboration between the two users in the virtual realm, with the visual hull technique reducing the computational power required to allow this type of interaction and enabling the use of consumer goods such as the Wii Remote as a tool for interaction.

Clement Farabet

Clément Farabet is a computer scientist and AI expert known for his contributions to the field of deep learning. He served as a research scientist at the New York University. He serves as the Vice President of Research at Google DeepMind and previously served as the VP of AI Infrastructure at NVIDIA. His scholarly work received over 11,000 citations with an h-index of 21. == Education == In 2008, Farabet earned a master's degree in electrical engineering with honors from Institut national des sciences appliquées (INSA) de Lyon, France. In 2010, Farabet received his PhD at Université Paris-Est, co-advised by Professors Laurent Najman and Yann LeCun. His thesis focused on real-time image understanding and introduced multi-scale convolutional networks and graph-based techniques for efficient segmentations of class prediction maps. He successfully defended his thesis in 2013. == Career == In 2008, after completing his Master's degree, Farabet joined Professor Yann LeCun's laboratory at the Courant Institute of Mathematical Sciences at New York University. His Master's thesis work on reconfigurable hardware for deep neural networks resulted in a patent. He continued his collaboration with Yann LeCun, and in 2009, he began working with Yale University's e-Lab, led by Eugenio Culurciello. This collaboration eventually led to the creation of TeraDeep. He began his career as a researcher, contributing to the development of LuaTorch, one of the first AI frameworks, which later evolved into PyTorch, widely recognized and adopted globally. == Startups == Farabet co-founded MadBits, a startup with a focus on web-scale image understanding. The company was acquired by Twitter in 2014. Following this acquisition, Farabet co-founded Twitter Cortex, a team dedicated to building Twitter's deep learning platform for various applications, including recommendations, search, spam detection, and NSFW content and ads. == Publications == Farabet, Clement; Couprie, Camille; Najman, Laurent; LeCun, Yann (August 2013). "Learning Hierarchical Features for Scene Labeling". IEEE Transactions on Pattern Analysis and Machine Intelligence. 35 (8): 1915–1929. Bibcode:2013ITPAM..35.1915F. doi:10.1109/TPAMI.2012.231. PMID 23787344. S2CID 206765110. LeCun, Yann; Kavukcuoglu, Koray; Farabet, Clement (2010). "Convolutional networks and applications in vision". Proceedings of 2010 IEEE International Symposium on Circuits and Systems. pp. 253–256. doi:10.1109/ISCAS.2010.5537907. ISBN 978-1-4244-5308-5. S2CID 7625356. Collobert, Ronan; Kavukcuoglu, K.; Farabet, C. (2011). "Torch7: A Matlab-like Environment for Machine Learning". Neural Information Processing Systems. Couprie, Camille; Farabet, Clément; Najman, Laurent; LeCun, Yann (16 January 2013). "Indoor Semantic Segmentation using depth information". arXiv:1301.3572 [cs.CV]. Farabet, Clement (2011). "NeuFlow: A runtime reconfigurable dataflow processor for vision". CVPR 2011 Workshops. pp. 109–116. doi:10.1109/CVPRW.2011.5981829. ISBN 978-1-4577-0529-8. S2CID 851574. Farabet, Clement (2009). "CNP: An FPGA-based processor for Convolutional Networks". 2009 International Conference on Field Programmable Logic and Applications. pp. 32–37. doi:10.1109/FPL.2009.5272559. S2CID 5339694. Farabet, Clement (2010). "Hardware accelerated convolutional neural networks for synthetic vision systems". Proceedings of 2010 IEEE International Symposium on Circuits and Systems. pp. 257–260. doi:10.1109/ISCAS.2010.5537908. ISBN 978-1-4244-5308-5. S2CID 6542026.

Abeba Birhane

Abeba Birhane is an Ethiopian-born cognitive scientist who works at the intersection of complex adaptive systems, machine learning, algorithmic bias, and critical race studies. Birhane's work with Vinay Prabhu uncovered that large-scale image datasets commonly used to develop AI systems, including ImageNet and 80 Million Tiny Images, carried racist and misogynistic labels and offensive images. She has been recognized by VentureBeat as a top innovator in computer vision and named as one of the 100 most influential persons in AI 2023 by TIME magazine. == Early life and education == Birhane was born in Ethiopia. She received her Bachelors of Science in Psychology and a Bachelors of Arts in Philosophy from The Open University. In 2015, she completed her Master of Science in Cognitive Science and, in 2021, her Ph.D. at the Complex Software Lab in the School of Computer Science at University College Dublin. == Career and research == Birhane studied the impacts of emerging AI technologies and how they shape individuals and local communities. She found that AI algorithms tend to disproportionately impact vulnerable groups such as older workers, trans people, immigrants, and children. Her research on relational ethics won the best paper award at NeurIPS’s Black in AI workshop in 2019. She has also studied and written about algorithmic colonization driven by corporate agendas. Her work in decolonizing computational sciences addressed the inherited oppressions in current systems especially towards women of color. In 2020, Birhane and Vinay Prabhu, principal machine learning scientist at UnifyID, published a paper examining the problematic data collection, labelling, classification, and consequences of large image datasets. These datasets, including ImageNet and MIT's 80 Million Tiny Images, have been used to develop thousands of AI algorithms and systems. Birhane and Prabhu found that they contained many racist and misogynistic labels and slurs as well as offensive images. This resulted in MIT voluntarily and formally taking down the 80 Million Tiny Images dataset. More recently, Birhane has worked with Rediet Abebe, George Obaido, and Sekou Remy on researching the barriers to data sharing in Africa. They found that power imbalances are significant in the data sharing process, even when the data comes from Africa. Their research was published at the ACM Conference on Fairness, Accountability, and Transparency. In 2024, Birhane established the AI Accountability Lab research group at Trinity College Dublin. == Selected awards == 2019 NeurIPS Black in AI Workshop Best Paper Award 2020 Venture Beat AI Innovations Award in the category Computer Vision Innovation (received with Vinay Prabhu) 2021 100 Brilliant Women in AI Ethics Hall of Fame Honoree 2022 Lero Director’s Prize for PhD/PostDoctoral Contribution. 2023 100 Most Influential People in AI by TIME magazine

The Best Free AI Resume Builder for Beginners

Curious about the best AI resume builder? An AI resume builder is software that uses machine learning to help you get more done — it combines speed, accuracy, and an interface that just works. Hands-on testing shows real-world results vary, so a short free trial is the smartest way to decide. Whether you are a beginner or a pro, the right AI resume builder slots into your workflow and pays for itself fast. Read on for hands-on impressions, pricing tiers, and the standout features that matter.

Clubdjpro

ClubDJPro (often referred to as ClubDJ) is a DJ console and video mixing tool developed by Cube Software Solutions Inc. software. It was released in June 2005. == User interface == ClubDJPro has a GUI that was designed to allow aesthetic revisions via Skins. The skin engine that ClubDJPro uses allows for the ability to expand the software to take up the entire screen. As of 4.4.3.3 there are 3 user changeable skins included in the program which are changeable in the preferences tab. They are called 'AquaLung', 'Eleanor', and 'Grabber'. == Editions == ClubDJPro is available in two different editions, with separate features depending upon their target consumer group. DJ Edition - Can play audio files only. VJ Edition - Contains all of the features of the DJ Edition, in addition to support for video, karaoke, and visualizations. == Supported MIDI Controllers == Supported since version 2.0: Hercules Console Hercules Console MK2 Hercules Control MP3 PCDJ DAC-2 Controller == History == The initial "final release" of ClubDJPro was released on June 24, 2005. On June 26, 2009, the 4th iteration of the ClubDJPro software was released. The development of the software and website appears to have halted. As of March 2018 the website continues to show a new version "Coming Spring 2016".

Top 10 AI Chatbots Compared (2026)

Shopping for the best AI chatbot? An AI chatbot is software that uses machine learning to help you get more done — it keeps getting smarter as the underlying models improve. Pricing, accuracy, and the size of the model behind the tool are the three factors that most affect daily usefulness. Whether you are a beginner or a pro, the right AI chatbot slots into your workflow and pays for itself fast. Below we compare features, pricing, and real output so you can choose with confidence.