full-title:: [Retrieval Augmented Generation (RAG) | Pinecone](https://omnivore.app/me/retrieval-augmented-generation-rag-pinecone-18f3dfe758e) site:: [pinecone.io](https://www.pinecone.io/learn/retrieval-augmented-generation/) author:: Zachary Proser labels:: [[RAG]] date-saved:: [[03-05-2024]] date-published:: [[03-08-2023]] date-archived:: [[03-05-2024]] is-archived:: 10 source:: [[Omnivore]] state:: [[archived]] - ### Highlights - id:: 6c705bb6-ce85-42ab-ae4f-542755572041 > Prompt engineering means testing and tweaking the instructions you provide your model to attempt to coax it to do what you want. > It’s also the cheapest option to improve the accuracy of your GenAI application because you can quickly update the instructions provided to your GenAI application’s LLM with a few code changes. > It refines the responses your LLMs return but cannot provide them with any new or dynamic context, so your GenAI application will still lack up-to-date context and be susceptible to hallucination. [⤴️](https://omnivore.app/me/retrieval-augmented-generation-rag-pinecone-18f3dfe758e#e09d286e-5730-419c-a207-ebc0257432ee) omnivore-note:: [[prompt-engineering]] #card #omnivore-note-color - id:: 001e7087-f911-4e0e-b469-8ce3b6cc9f59 > Fine-tuning is the process of retraining a foundation model on new data. It can certainly be cheaper than building a foundation model from scratch. Still, this approach suffers from many of the same downsides of creating a foundation model: you need rare and deep expertise and sufficient data, and the costs and technical complexity of hosting your model in production don’t go away. [⤴️](https://omnivore.app/me/retrieval-augmented-generation-rag-pinecone-18f3dfe758e#e3fb37d9-df0b-4b9d-9c8f-758b5259e637) - > Fine-tuning: adapting a foundation model to your domain’s data. [⤴️](https://omnivore.app/me/retrieval-augmented-generation-rag-pinecone-18f3dfe758e#947af387-a413-4a83-9622-340f45749101) - > when it is performing tasks to enhance its accuracy and performance. [⤴️](https://omnivore.app/me/retrieval-augmented-generation-rag-pinecone-18f3dfe758e#a0c7e33f-493a-440d-8383-816be0efc4df) - id:: 381d03b0-dbc8-4596-8a26-9fde75675e90 > Retrieval Augmented Generation (RAG) in AI is a technique that leverages a database to fetch the most contextually relevant results that match the user's query at generation time. [⤴️](https://omnivore.app/me/retrieval-augmented-generation-rag-pinecone-18f3dfe758e#691f65eb-8341-4bff-a3d4-bed6f8316c4d) - > Few organizations have the financial and human resources to produce and deploy foundation models. [⤴️](https://omnivore.app/me/retrieval-augmented-generation-rag-pinecone-18f3dfe758e#0be6dab9-fd0d-4c26-a7b6-07b90a046851) - > The reason LLMs like ChatGPT feel so bright is that they've seen an immense amount of human creative output - entire companies’ worth of open source code, libraries worth of books, lifetimes of conversations, scientific datasets, etc., but, critically, this core training data is static. [⤴️](https://omnivore.app/me/retrieval-augmented-generation-rag-pinecone-18f3dfe758e#beb10d34-17f5-47d3-bfd3-58ca5eba117f) - > RAG provides up-to-date information about the world and domain-specific data to your GenAI applications. [⤴️](https://omnivore.app/me/retrieval-augmented-generation-rag-pinecone-18f3dfe758e#32fbb9c7-90f1-44c2-ad4a-0fc215339aff) - > You can store proprietary business data or information about the world and have your application fetch it for the LLM at generation time, reducing the likelihood of hallucinations. The result is a noticeable boost in the performance and accuracy of your GenAI application. [⤴️](https://omnivore.app/me/retrieval-augmented-generation-rag-pinecone-18f3dfe758e#864ab0e7-bfa5-4964-b238-ededad21b61b) - > LLMs lack context from private data - leading to hallucinations when asked domain or company-specific questions. [⤴️](https://omnivore.app/me/retrieval-augmented-generation-rag-pinecone-18f3dfe758e#d0705d40-9630-49d9-b81b-bbf7bb343322) - > generation time: [⤴️](https://omnivore.app/me/retrieval-augmented-generation-rag-pinecone-18f3dfe758e#49d5e92a-2ae2-4b64-9ff6-f53aae176217) - > Retrieval Augmented Generation allows GenAI to cite its sources and improves auditability. [⤴️](https://omnivore.app/me/retrieval-augmented-generation-rag-pinecone-18f3dfe758e#21045a54-c375-44e0-9697-335238673027) - > In addition to addressing the recency and domain-specific data issues, RAG also allows GenAI applications to provide their sources, much like research papers will provide citations for where they obtained an essential piece of data used in their findings. [⤴️](https://omnivore.app/me/retrieval-augmented-generation-rag-pinecone-18f3dfe758e#c6660d08-57aa-4bde-a27b-596eae82eee6) - > Why is RAG the preferred approach from a cost-efficacy perspective? [⤴️](https://omnivore.app/me/retrieval-augmented-generation-rag-pinecone-18f3dfe758e#31972949-6c96-4e8e-a956-ea01c33367af) - > OpenAI’s Sam Altman estimated it cost around $100 million to train the foundation model behind ChatGPT. [⤴️](https://omnivore.app/me/retrieval-augmented-generation-rag-pinecone-18f3dfe758e#3923cf05-74ed-48f0-a35e-a6328040438c) - > Another challenge is obtaining, sanitizing, and labeling the datasets required to produce a capable foundation model. [⤴️](https://omnivore.app/me/retrieval-augmented-generation-rag-pinecone-18f3dfe758e#510ff1a2-115e-4579-b309-1e8b218fd3b6)