├── README.md ├── llm-rag.excalidraw ├── practice.md └── resource ├── Building RAG with LLMs and Prompts-LlamaIndex Prompt Engineering Tutorial (FlowGPT).pptx ├── Building, Evaluating, and Optimizing your RAG App for Production.pdf ├── ChatGLM + LangChain 实践培训.pdf ├── Evaluating and Optimizing your RAG App-LlamaIndex Talk (AI Conference).pptx ├── LlamaIndex Prompt Engineering Tutorial (FlowGPT).pptx ├── LlamaIndex Talk (AI User Conference).pptx ├── Prompting-RAGs-Fine-tuning.md ├── RAG_Slide_ENG.pdf ├── devvai-rag.md ├── docugamiwebinar-llmsinproduction-230920071519-179a639f.pdf ├── 中文问答系统技术及应用.pdf ├── 利用+LLM+改善研发过程里答疑体验-段潇涵.pdf └── 基于+RAG+构建生成式+AI+应用最佳实践与+避坑指南-李元博.pdf /README.md: -------------------------------------------------------------------------------- 1 |
2 |

Awesome LLM RAG Application

3 | 4 |
5 | 6 | Awesome LLM RAG Application is a curated list of application resources based on LLM with RAG pattern. 7 | (latest update: 2025-01-02) 8 | 9 | --- 10 | 11 | - [综述](#综述) 12 | - [论文](#论文) 13 | - [其他资料](#其他资料) 14 | - [介绍](#介绍) 15 | - [比较](#比较) 16 | - [开源工具](#开源工具) 17 | - [RAG框架](#rag框架) 18 | - [预处理](#预处理) 19 | - [路由](#路由) 20 | - [评测框架](#评测框架) 21 | - [Embedding](#embedding) 22 | - [爬虫](#爬虫) 23 | - [安全护栏](#安全护栏) 24 | - [Prompting](#prompting) 25 | - [SQL增强](#sql增强) 26 | - [LLM部署和serving](#llm部署和serving) 27 | - [可观测性](#可观测性) 28 | - [其他](#其他) 29 | - [AI搜索类项目](#ai搜索类项目) 30 | - [应用参考](#应用参考) 31 | - [企业级实践](#企业级实践) 32 | - [知识库建设](#知识库建设) 33 | - [论文](#论文-1) 34 | - [RAG构建策略](#rag构建策略) 35 | - [总览](#总览) 36 | - [预处理](#预处理-1) 37 | - [查询问句分类和微调](#查询问句分类和微调) 38 | - [检索](#检索) 39 | - [查询语句改写](#查询语句改写) 40 | - [检索策略](#检索策略) 41 | - [GraphRAG](#graphrag) 42 | - [检索后处理](#检索后处理) 43 | - [重排序](#重排序) 44 | - [Contextual(Prompt) Compression](#contextualprompt-compression) 45 | - [其他](#其他-1) 46 | - [评估](#评估) 47 | - [幻觉](#幻觉) 48 | - [课程](#课程) 49 | - [视频](#视频) 50 | - [图书](#图书) 51 | - [编码实践](#编码实践) 52 | - [其他](#其他-2) 53 | --- 54 | 55 | ## 综述 56 | ### 论文 57 | 58 | 论文顺序由近及远 59 | - 2024.12.23 RAG中的查询优化技术总结 60 | - [《A Survey of Query Optimization in Large Language Models》](https://arxiv.org/abs/2412.17558) 61 |
62 | 详情 63 | 64 | 65 | https://arxiv.org/abs/2412.17558 66 | - 对查询优化技术进行了梳理和分类,涵盖了扩展、消歧、分解和抽象四种主要方法。 67 | ![](https://cdn.jsdelivr.net/gh/lizhe2004/pic-repo@master/imgs/20250102143719.png) 68 | ![](https://cdn.jsdelivr.net/gh/lizhe2004/pic-repo@master/imgs/20250102144007.png) 69 | ![](https://cdn.jsdelivr.net/gh/lizhe2004/pic-repo@master/imgs/20250102144352.png) 70 |
71 | 72 | - 2024.10.23 RAG技术演进的回顾总结 73 | - [《A Comprehensive Survey of Retrieval-Augmented Generation (RAG: Evolution, Current Landscape and Future Directions》](https://arxiv.org/abs/2410.12837) 74 |
75 | 详情 76 | https://arxiv.org/abs/2410.12837 77 | 78 | 全面研究检索增强生成(RAG)技术,追溯其从基础概念到当前状态的演变过程 79 |
80 | 81 | - 2024.09.23 综述RAG数据利用方案 82 | - [《Retrieval Augmented Generation (RAG and Beyond: A Comprehensive Survey on How to Make your LLMs use External Data More Wisely)》](https://arxiv.org/abs/2409.14924) 83 |
84 | 详情 85 | https://arxiv.org/abs/2409.14924 86 | 探讨了如何通过外部数据增强大模型(LLMs)的能力。 87 |
88 | - 2024.08.15 综述GraphRAG方案 89 | - [《Graph Retrieval-Augmented Generation: A Survey》](https://arxiv.org/abs/2408.08921) 90 |
91 | 详情 92 | 93 | - https://arxiv.org/abs/2408.08921 94 | - 系统性地回顾了Graph Retrieval-Augmented Generation (GraphRAG) 的现状和发展方向。 95 |
96 | - 2024.07.18 综述RAG用于NLP自然语言处理 97 | - [《Retrieval-Augmented Generation for Natural Language Processing: A Survey》](https://arxiv.org/abs/2407.13193) 98 |
99 | 详情 100 | 101 | 102 |
- https://arxiv.org/abs/2407.13193 103 | - 2024.05.13 综述RAG的评估 104 | - [《Evaluation of Retrieval-Augmented Generation: A Survey》](https://arxiv.org/abs/2405.07437) 105 |
106 | 详情 107 | 108 | - https://arxiv.org/abs/2405.07437 109 | 110 |
111 | - 2024.05.10 综述RAG与LLM的结合范式 112 | - [《A Survey on RAG Meeting LLMs: Towards Retrieval-Augmented Large Language Models》](https://arxiv.org/abs/2405.06211) 113 |
114 | 详情 115 | - 地址:https://arxiv.org/abs/2405.06211 116 | 117 |
118 | - 2024.04.30 综述检索增强语言模型(RALMs) 119 | - [《RAG and RAU: A Survey on Retrieval-Augmented Language Model in Natural Language Processing》](https://arxiv.org/abs/2404.19543) 120 |
121 | 详情 122 | 123 | 全面综述检索增强语言模型(RALMs),包括检索增强生成(RAG)和检索增强理解(RAU),并探讨其在自然语言处理(NLP)中的应用和发展,不仅关注RAG,还涵盖了RAU,详细描述了检索器和语言模型的不同交互模式,并提供了RALMs的工作时间表和应用总结。 124 | - 地址:https://arxiv.org/abs/2404.19543 125 |
126 | 127 | - 2024.04.17 综述面向检索的核心技术 128 | - [《A Survey on Retrieval-Augmented Text Generation for Large Language Models》](https://arxiv.org/abs/2404.10981) 129 |
130 | 详情 131 | 132 | 地址:https://arxiv.org/abs/2404.10981 133 | 主要回顾当前RAG在各个阶段的核心技术。例如,对于检索,分成了基本检索策略:线性工作流程,适用于简单任务;迭代检索策略:多次检索,逐步优化结果;递归检索策略:处理层次化或分层信息,适用于复杂查询;条件检索策略:根据特定条件或规则进行检索;以及自适应检索策略:动态调整检索策略以优化结果。 134 | ![](https://cdn.jsdelivr.net/gh/lizhe2004/pic-repo@master/imgs/20250102152054.png) 135 | ![](https://cdn.jsdelivr.net/gh/lizhe2004/pic-repo@master/imgs/20250102151954.png) 136 |
137 | 138 | - 2024.02.29 面向AIGC生成做全面综述 139 | - [《Retrieval-Augmented Generation for AI-Generated Content: A Survey》](https://arxiv.org/abs/2402.19473) 140 |
141 | 详情 142 | 143 | 地址:https://arxiv.org/abs/2402.19473 144 | ![](https://cdn.jsdelivr.net/gh/lizhe2004/pic-repo@master/imgs/20250102151051.png) 145 | ![](https://cdn.jsdelivr.net/gh/lizhe2004/pic-repo@master/imgs/20250102151154.png) 146 | ![](https://cdn.jsdelivr.net/gh/lizhe2004/pic-repo@master/imgs/20250102151334.png) 147 | ![](https://cdn.jsdelivr.net/gh/lizhe2004/pic-repo@master/imgs/20250102151632.png) 148 |
149 | 150 | - 2023.11.18 首个全面RAG综述 151 | - [Retrieval-Augmented Generation for Large Language Models: A Survey](https://arxiv.org/abs/2312.10997) 152 |
153 | 详情 154 | 155 | 全面回顾了RAG的发展历程,提供了对RAG系统各个关键组件的深入理解,并介绍了最新的评估框架和基准。 156 | 157 | 地址:https://arxiv.org/abs/2312.10997 158 | 159 | [翻译:面向大语言模型的检索增强生成技术:调查](https://baoyu.io/translations/ai-paper/2312.10997-retrieval-augmented-generation-for-large-language-models-a-survey) 160 | 161 | [Github repo](https://github.com/Tongji-KGLLM/RAG-Survey/tree/main) 162 | 163 | ![](https://cdn.jsdelivr.net/gh/lizhe2004/pic-repo@master/imgs/20250102150341.png) 164 | ![](https://cdn.jsdelivr.net/gh/lizhe2004/pic-repo@master/imgs/20250102150551.png) 165 | 166 |
167 | 168 | - 2023.03.20 多模态RAG综述 169 | - [2023.03.20 《Retrieving Multimodal Information for Augmented Generation: A Survey》](https://arxiv.org/abs/2303.10868) 170 |
171 | 详情 172 | 173 | https://arxiv.org/abs/2303.10868 174 | 探讨了通过检索多模态知识来增强生成模型的方法,特别是如何利用图像、代码、结构化知识、音频和视频等多模态信息来提升大型语言模型(LLMs)的生成能力。 175 |
176 | 177 | - 2022.02.02近三年首个综述 178 | - [《A Survey on Retrieval-Augmented Text Generation》](https://arxiv.org/abs/2202.01110) 179 |
180 | 详情 181 | 182 | https://arxiv.org/abs/2202.01110 183 | 184 | 首先突出了检索增强生成的通用范式,然后根据不同的任务,包括对话响应生成、机器翻译和其他生成任务,回顾了值得关注的方案。 185 | 186 | ![](https://cdn.jsdelivr.net/gh/lizhe2004/pic-repo@master/imgs/20250102144855.png) 187 |
188 | 189 | ### 其他资料 190 | - [大语言模型的检索增强生成 (RAG) 方法](https://www.promptingguide.ai/zh/research/rag#rag%E7%AE%80%E4%BB%8B) 191 | - [Advaned RAG Techniques: an Illustrated Overview](https://pub.towardsai.net/advanced-rag-techniques-an-illustrated-overview-04d193d8fec6) 192 | - [中译版 高级 RAG 技术:图解概览](https://baoyu.io/translations/rag/advanced-rag-techniques-an-illustrated-overview) 193 | - [高级RAG应用构建指南和总结](https://blog.llamaindex.ai/a-cheat-sheet-and-some-recipes-for-building-advanced-rag-803a9d94c41b) 194 | - [Patterns for Building LLM-based Systems & Products](https://eugeneyan.com/writing/llm-patterns/) 195 | - [构建LLM系统和应用的模式](https://tczjw7bsp1.feishu.cn/docx/Z6vvdyAdXou7XmxuXt2cigZUnTb?from=from_copylink) 196 | - [RAG大全](https://aman.ai/primers/ai/RAG/) 197 | - [中译版](https://tczjw7bsp1.feishu.cn/docx/GfwOd3rASo6lI4xoFsycUiz8nhg) 198 | - [Open RAG Base](https://openrag.notion.site/Open-RAG-c41b2a4dcdea4527a7c1cd998e763595) 199 | - Open RAG Base 是一个基于公开资料收集整理汇总的RAG知识库。它基于Notion构建,是目前最全面RAG的资料汇总仓库。目的是为读者提提供前沿和全面的RAG知识,提供多维度的分析汇总,涵盖RAG的方方面,包括:学术论文、前沿阅读资料、RAG评估与基准、下游任务与数据集、工具与技术栈 200 | - [一个繁体的RAG资料集](https://ihower.tw/notes/AI-Engineer/RAG/Adaptive+RAG) 201 | - [关于RAG技术的综合合集RAG_Techniques](https://github.com/NirDiamant/RAG_Techniques) 202 | 203 | ## 介绍 204 | - [Microsoft-Retrieval Augmented Generation (RAG) in Azure AI Search](https://learn.microsoft.com/en-us/azure/search/retrieval-augmented-generation-overview) 205 | - [**微软**-Azure AI 搜索之检索增强生成(RAG)](https://tczjw7bsp1.feishu.cn/docx/JJ7ldrO4Zokjq7xZIJcc5IZjnFh?from=from_copylink) 206 | - [**azure** openai design patterns- RAG](https://github.com/microsoft/azure-openai-design-patterns/tree/main/patterns/03-retrieval-augmented-generation) 207 | - [IBM-What is retrieval-augmented generation-IBM](https://research.ibm.com/blog/retrieval-augmented-generation-RAG) 208 | - [**IBM**-什么是检索增强生成](https://tczjw7bsp1.feishu.cn/wiki/OMUVwsxlSiqjj4k4YkicUQbcnDg?from=from_copylink) 209 | - [**Amazon**-Retrieval Augmented Generation (RAG)](https://docs.aws.amazon.com/sagemaker/latest/dg/jumpstart-foundation-models-customize-rag.html) 210 | - [Nvidia-What Is Retrieval-Augmented Generation?](https://blogs.nvidia.com/blog/what-is-retrieval-augmented-generation/?ncid=so-twit-174237&=&linkId=100000226744098) 211 | - [**英伟达**-什么是检索增强生成](https://tczjw7bsp1.feishu.cn/docx/V6ysdAewzoflhmxJDwTcahZCnYI?from=from_copylink) 212 | - [Meta-Retrieval Augmented Generation: Streamlining the creation of intelligent natural language processing models](https://ai.meta.com/blog/retrieval-augmented-generation-streamlining-the-creation-of-intelligent-natural-language-processing-models/) 213 | - [**Meta**-检索增强生成:简化智能自然语言处理模型的创建](https://tczjw7bsp1.feishu.cn/wiki/TsL8wAsbtiLfDmk1wFJcQsiGnQb?from=from_copylink) 214 | - [**Cohere**-Introducing Chat with Retrieval-Augmented Generation (RAG)](https://txt.cohere.com/chat-with-rag/) 215 | - [**Pinecone**-Retrieval Augmented Generation](https://www.pinecone.io/learn/series/rag/) 216 | - [**Milvus**-Build AI Apps with Retrieval Augmented Generation (RAG)](https://zilliz.com/learn/Retrieval-Augmented-Generation?utm_source=twitter&utm_medium=social&utm_term=zilliz) 217 | - [Knowledge Retrieval Takes Center Stage](https://towardsdatascience.com/knowledge-retrieval-takes-center-stage-183be733c6e8) 218 | - [知识检索成为焦点](https://tczjw7bsp1.feishu.cn/docx/VELQdaizVoknrrxND3jcLkZZn8d?from=from_copylink) 219 | - [Disadvantages of RAG](https://medium.com/@kelvin.lu.au/disadvantages-of-rag-5024692f2c53) 220 | - [RAG的缺点](https://tczjw7bsp1.feishu.cn/docx/UZCCdKmLEo7VHQxWPdNcGzICnEd?from=from_copylink) 221 | 222 | ### 比较 223 | 224 | - [Retrieval-Augmented Generation (RAG) or Fine-tuning — Which Is the Best Tool to Boost Your LLM Application?](https://www.linkedin.com/pulse/retrieval-augmented-generation-rag-fine-tuning-which-best-victoria-s-) 225 | - [RAG还是微调,优化LLM应用的最佳工具是哪个?](https://tczjw7bsp1.feishu.cn/wiki/TEtHwkclWirBwqkWeddcY8HXnZf?chunked=false) 226 | - [提示工程、RAGs 与微调的对比](https://github.com/lizhe2004/Awesome-LLM-RAG-Application/blob/main/Prompting-RAGs-Fine-tuning.md) 227 | - [RAG vs Finetuning — Which Is the Best Tool to Boost Your LLM Application?](https://readmedium.com/https://towardsdatascience.com/rag-vs-finetuning-which-is-the-best-tool-to-boost-your-llm-application-94654b1eaba7) 228 | - [RAG 与微调 — 哪个是提升优化 LLM 应用的最佳工具?](https://tczjw7bsp1.feishu.cn/wiki/Cs9ywwzJSiFrg9kX2r1ch4Nxnth) 229 | - [A Survey on In-context Learning](https://arxiv.org/abs/2301.00234) 230 | 231 | ## 开源工具 232 | 233 | ### RAG框架 234 | 235 | - [LangChain](https://github.com/langchain-ai/langchain/) 236 | - [langchain4j](https://github.com/langchain4j/langchain4j) 237 | - [LlamaIndex](https://github.com/run-llama/llama_index/) 238 | - [GPT-RAG](https://github.com/Azure/GPT-RAG) 239 | - GPT-RAG提供了一个强大的架构,专为RAG模式的企业级部署量身定制。它确保了扎实的回应,并建立在零信任安全和负责任的人工智能基础上,确保可用性、可扩展性和可审计性。非常适合正在从探索和PoC阶段过渡到全面生产和MVP的组织。 240 | - [QAnything](https://github.com/netease-youdao/QAnything/tree/master) 241 | - 致力于支持任意格式文件或数据库的本地知识库问答系统,可断网安装使用。任何格式的本地文件都可以往里扔,即可获得准确、快速、靠谱的问答体验。目前已支持格式: PDF,Word(doc/docx),PPT,Markdown,Eml,TXT,图片(jpg,png等),网页链接 242 | - [Quivr](https://github.com/StanGirard/quivr) 243 | - 您的第二大脑,利用 GenerativeAI 的力量成为您的私人助理!但增强了人工智能功能。 244 | - [Quivr](https://www.quivr.app/chat) 245 | - [Dify](https://github.com/langgenius/dify) 246 | - 融合了 Backend as Service 和 LLMOps 的理念,涵盖了构建生成式 AI 原生应用所需的核心技术栈,包括一个内置 RAG 引擎。使用 Dify,你可以基于任何模型自部署类似 Assistants API 和 GPTs 的能力。 247 | - [Verba](https://github.com/weaviate/Verba) 248 | - 这是向量数据库weaviate开源的一款RAG应用,旨在为开箱即用的检索增强生成 (RAG) 提供端到端、简化且用户友好的界面。只需几个简单的步骤,即可在本地或通过 OpenAI、Cohere 和 HuggingFace 等 LLM 提供商轻松探索数据集并提取见解。 249 | - [danswer](https://github.com/danswer-ai/danswer) 250 | - 允许您针对内部文档提出自然语言问题,并获得由源材料中的引用和参考文献支持的可靠答案,以便您始终可以信任您得到的结果。您可以连接到许多常用工具,例如 Slack、GitHub、Confluence 等。 251 | - [RAGFlow](https://github.com/infiniflow/ragflow) 252 | - RAGFlow:基于OCR和文档解析的下一代 RAG 引擎。在文档解析上做了增强,2024年4月1日开源,在数据处理上支持文档结构、图片、表格的深度解析,支持可控分片,可对查询进行深入分析识别关键信息,在检索上提供多路找回/重排能力,界面提供友好的引用参考查看功能。 253 | - [Cognita](https://github.com/truefoundry/cognita) 254 | - Cognita 在底层使用了Langchain/Llamaindex,并对代码进行了结构化组织,其中每个 RAG 组件都是模块化的、API 驱动的、易于扩展的。Cognita 可在本地设置中轻松使用,同时还能为您提供无代码用户界面支持的生产就绪环境。Cognita 默认还支持增量索引。 255 | - [LazyLLM](https://github.com/LazyAGI/LazyLLM) 256 |
257 | 详情 258 | 259 | 一款低代码构建多Agent大模型应用的开发工具,协助开发者用极低的成本构建复杂的AI应用,并可以持续的迭代优化效果。使用LazyLLM搭建RAG应用非常便捷和灵活,可以任意字定义多路检索和召回策略。除此之外,LazyLLM的AI应用构建流程是原型搭建 -> 数据回流 -> 迭代优化,用户可以先基于LazyLLM快速搭建RAG应用的,再结合场景任务数据进行bad-case分析,然后对应用中的关键环节进行算法迭代和模型微调,进而逐步提升整个RAG应用的效果。 260 | 261 |
262 | 263 | - [GraphRAG](https://github.com/microsoft/GraphRAG) 264 |
265 | 详情 266 | 267 | - GraphRAG 是一种基于图的检索增强方法,由微软开发并开源。 它通过结合LLM和图机器学习的技术,从非结构化的文本中提取结构化的数据,构建知识图谱,以支持问答、摘要等多种应用场景。 268 | - [微软GraphRAG框架演进之路及带来的一些思考](https://mp.weixin.qq.com/s/3P7QZLaa4_d9fn9uHRA0JA) 269 | 270 |
271 | 272 | - [LightRAG](https://github.com/HKUDS/LightRAG) 273 |
274 | 详情 275 | 276 | - 微软Graph的简化版本,将社区、社区宅摘要这些环节做了去除,这种去除是好的,不会太重,对于知识更新也更快; 277 | 278 |
279 | - [kotaemon](https://github.com/Cinnamon/kotaemon) 280 |
281 | 详情 282 | 283 | 一个开源的、基于 RAG (Retrieval-Augmented Generation) 的文档问答工具,支持多用户登录、本地和云端 LLM 及 Embedding 模型、图表多模态文档解析和问答、混合检索带文档预览的高级引用功能、持复杂推理方法,如问题分解、基于 agent 的推理(如 ReAct、ReWOO)等。 284 | 285 |
286 | 287 | 288 | ### 预处理 289 | 290 | - [Unstructured](https://github.com/Unstructured-IO/unstructured) 291 |
292 | 详情 293 | 294 | 该库提供了用于摄取和预处理图像和文本文档(如 PDF、HTML、WORD 文档等)的开源组件。 unstructured的使用场景围绕着简化和优化LLM数据处理工作流程, unstructured模块化功能和连接器形成了一个有内聚性的系统,简化了数据摄取和预处理,使其能够适应不同的平台,并有效地将非结构化数据转换为结构化输出。 295 |
296 | 297 | - [Open Parse](https://github.com/Filimoa/open-parse) 298 | - 对文档进行分块是一项具有挑战性的任务,它支撑着任何 RAG 系统。高质量的结果对于人工智能应用的成功至关重要,但大多数开源库处理复杂文档的能力都受到限制。 299 | - Open Parse 旨在通过提供灵活、易于使用的库来填补这一空白,该库能够直观地识别文档布局并有效地对其进行分块。 300 | - [ExtractThinker](https://github.com/enoch3712/ExtractThinker) 301 | - 使用 LLMs 从文件和文档中提取数据的库。 extract_thinker 在文件和 LLMs 之间提供 ORM 风格的交互,从而实现灵活且强大的文档提取工作流程。 302 | - [OmniParser](https://github.com/AlibabaResearch/AdvancedLiterateMachinery/tree/main/OCR/OmniParser) 303 | - OmniParser 是一个统一的框架,无缝地结合了三个基本的 OCR 任务:文本识别、关键信息提取和表格识别。 304 | - [python-readability](https://github.com/buriy/python-readability) 305 | - 给定一个 HTML 文档,提取并清理主体文本和标题。 306 | - [nougat](https://github.com/facebookresearch/nougat) 307 | - Neural Optical Understanding for Academic Documents.这是学术文档 PDF 解析器,它能理解 LaTeX 数学和表格。但对中文支持不好,需要单独微调。 308 | - [Pix2Struct](https://github.com/google-research/pix2struct) 309 | - Pix2Struct 是一种预训练的图像到文本模型,专为纯视觉语言理解而设计。 310 | - [Indexify](https://github.com/tensorlakeai/indexify) 311 | - Indexify 是一个开源引擎,用于使用可重复使用的提取器进行嵌入、转换和特征提取,为非结构化数据(视频、音频、图像和文档)快速构建数据流水线。当;流水线生成嵌入或结构化数据时,Indexify 会自动更新向量数据库、结构化数据库 (Postgres)。 312 | - [MegaParse](https://github.com/QuivrHQ/MegaParse) 313 | - MegaParse 是一个强大且通用的解析器,可以轻松处理各种类型的文档,包括文本、PDF、PowerPoint 演示文稿、Word 文档等。它旨在在解析过程中尽可能减少信息丢失。 314 | - 解析内容包括: ✅ Tables ✅ TOC ✅ Headers ✅ Footers ✅ Images 315 | 316 | ### 路由 317 | - [semantic-router](https://github.com/aurelio-labs/semantic-router) 318 | 319 | ### 评测框架 320 | 321 | - [ragas](https://github.com/explodinggradients/ragas?tab=readme-ov-file) 322 | - Ragas是一个用于评估RAG应用的框架,包括忠诚度(Faithfulness)、答案相关度(Answer Relevance)、上下文精确度(Context Precision)、上下文相关度(Context Relevancy)、上下文召回(Context Recall) 323 | - [tonic_validate](https://github.com/TonicAI/tonic_validate) 324 | - 一个用于 RAG 开发和实验跟踪的平台,用于评估检索增强生成 (RAG) 应用程序响应质量的指标。 325 | - [deepeval](https://github.com/confident-ai/deepeval) 326 | - 一个简单易用的开源LLM评估框架,适用于LLM应用程序。它与 Pytest 类似,但专门用于单元测试 LLM 应用程序。 DeepEval 使用 LLMs 以及在您的计算机上本地运行的各种其他 NLP 模型,根据幻觉、答案相关性、RAGAS 等指标来评估性能。 327 | - [trulens](https://github.com/truera/trulens) 328 | - TruLens 提供了一套用于开发和监控神经网络的工具,包括大型语言模型。这包括使用 TruLens-Eval 评估基于 LLMs 和 LLM 的应用程序的工具以及使用 TruLens-Explain 进行深度学习可解释性的工具。 TruLens-Eval 和 TruLens-Explain 位于单独的软件包中,可以独立使用。 329 | - [uptrain](https://github.com/uptrain-ai/uptrain) 330 | - 用于评估和改进生成式人工智能应用的开源统一平台。提供了20多项预配置检查(涵盖语言、代码、嵌入用例)评分,对失败案例进行根本原因分析,并就如何解决这些问题提出见解。 331 | - 比如prompt注入、越狱检测、整通对话的用户满意度等 332 | - [langchain-evaluation](https://python.langchain.com/docs/guides/evaluation/) 333 | - [Llamaindex-evaluation](https://docs.llamaindex.ai/en/stable/optimizing/evaluation/evaluation.html) 334 | 335 | ### Embedding 336 | 337 | - [BCEmbedding](https://github.com/netease-youdao/BCEmbedding/tree/master) 338 | - **网易有道**开发的双语和跨语种语义表征算法模型库,其中包含 **Embedding**Model和 **Reranker**Model两类基础模型。EmbeddingModel专门用于生成语义向量,在语义搜索和问答中起着关键作用,而 RerankerModel擅长优化语义搜索结果和语义相关顺序精排。 339 | - [BGE-Embedding](https://github.com/FlagOpen/FlagEmbedding/tree/master/FlagEmbedding/baai_general_embedding) 340 | - 北京智源人工智能研究院开源的embeeding通用向量模型,使用retromae 对模型进行预训练,再用对比学习在大规模成对数据上训练模型。 341 | - [bge-reranker-large](https://github.com/FlagOpen/FlagEmbedding/tree/master/FlagEmbedding/reranker) 342 | - 北京智源人工智能研究院开源,交叉编码器将对查询和答案实时计算相关性分数,这比向量模型(即双编码器)更准确,但比向量模型更耗时。 因此,它可以用来对嵌入模型返回的前k个文档重新排序 343 | - [gte-base-zh](https://modelscope.cn/models/iic/nlp_gte_sentence-embedding_chinese-base/summary) 344 | - GTE text embedding GTE中文通用文本表示模型 通义实验室提供 345 | 346 | ### 爬虫 347 | - [Crawl4AI](https://github.com/unclecode/crawl4ai) 348 |
349 | 详情 350 | 351 | - Crawl4AI是一个开源的、用于为AI而生的智能、快速且灵活的网络爬虫工具。它针对大语言模型(LLM)、AI Agent和数据流水线提供了优秀的爬取性能,通过高速、精确和易部署的特点来赋能开发者。 352 | - 为LLM量身打造的Markdown生成功能。 353 | - 提供6倍于常规爬虫的超快速爬取能力。 354 | - 支持会话管理、代理和自定义钩子,实现灵活的浏览器控制。 355 | - 采用高级算法进行高效抽取,减少对昂贵模型的依赖。 356 | - 完全开源无API密钥,支持Docker和云端集成。 357 |
358 | - [firecrawl](https://github.com/mendableai/firecrawl) 359 |
360 | 详情 361 | 362 | Firecrawl 是一个强大的 API 服务,可以从任何网站抓取数据并转换为干净的 Markdown 或结构化数据。它具有高级的抓取、爬取和数据提取功能,可以帮助您的 AI 应用程序获取干净的数据。 363 | 364 | 主要功能点 365 | - 抓取: 抓取网页内容并以 LLM 就绪格式(Markdown、结构化数据、截图、HTML)返回 366 | - 爬取: 抓取网页上的所有 URL 并以 LLM 就绪格式返回内容 367 | - 映射: 输入一个网站,获取该网站的所有 URL - 速度极快 368 | 强大的功能: 支持 LLM 就绪格式、代理、反机器人机制、动态内容(JS 渲染)、输出解析、编排等 369 | - 可定制性: 排除标签、在身份验证墙后爬取、最大爬取深度等 370 |
371 | - [jina-reader](https://github.com/jina-ai/reader) 372 | - 它将任何 URL 转换为LLM 友好的输入, 373 | 374 | 375 | ### 安全护栏 376 | 377 | - [NeMo-Guardrails](https://github.com/NVIDIA/NeMo-Guardrails) 378 |
379 | 详情 380 | 381 | NeMo Guardrails 是一个开源工具包,用于为基于 LLM 的对话应用程序轻松添加可编程的保护轨。Guardrails(简称 "轨")是控制大型语言模型输出的特定方式,例如不谈论政治、以特定方式响应特定用户请求、遵循预定义对话路径、使用特定语言风格、提取结构化数据等。 382 |
383 | 384 | - [Guardrails](https://github.com/guardrails-ai/guardrails) 385 |
386 | 详情 387 | 388 | - Guardrails 是一个 Python 框架,通过执行两个关键功能来帮助构建可靠的人工智能应用程序: 389 | - Guardrails 在应用程序中运行输入/输出防护装置,以检测、量化和减轻特定类型风险的存在。要查看全套风险,请访问 [Guardrails Hub](https://hub.guardrailsai.com/)。 390 | - Guardrails 可帮助您从 LLMs 生成结构化数据。对输入和输出进行检测 391 |
392 | 393 | - [LLM-Guard](https://github.com/protectai/llm-guard) 394 |
395 | 详情 396 | 397 | - LLM Guard 是一款旨在增强大型语言模型 (LLMs) 安全性的综合工具。 398 | - 输入(Anonymize 匿名化、BanCode 禁止代码、BanCompetitors 禁止竞争对手、BanSubstrings 禁止子串、BanTopics 禁止话题、PromptInjection 提示词注射 399 | 、Toxicity 毒性等) 400 | - 输出(代码、anCompetitors 禁止竞争对手、Deanonymize 去匿名化、JSON、LanguageSame 语言相同、MaliciousURLs 恶意URL、NoRefusal 不可拒绝、FactualConsistency 事实一致性、URLReachability URL可达性等) 401 | - 各个检测功能是利用了huggingface上的各种开源模型 402 |
403 | 404 | - [Llama-Guard](https://github.com/meta-llama/PurpleLlama/tree/main/Llama-Guard) 405 |
406 | 详情 407 | 408 | - Llama Guard 是一个新的实验模型,可为 LLM 部署提供输入和输出防护栏。Llama Guard 是经过微调的 Llama-7B 模型。 409 |
410 | Guardrails in your application 411 |
412 |
413 | 414 | - [RefChecker](https://github.com/amazon-science/RefChecker) 415 | - RefChecker 提供了一个标准化的评估框架来识别大型语言模型输出中存在的微妙幻觉。 416 | - [vigil-llm](https://github.com/deadbits/vigil-llm/) 417 | - Vigil是一个Python库和REST API,可以根据一组扫描器评估大型语言模型提示和响应,以检测提示注入、越狱和其他潜在威胁。该存储库还提供了必要的检测特征(签名)和数据集,支持用户自行部署和使用。 418 | 该应用程序目前处于 alpha 状态,应被视为实验/用于研究目的。 419 | 420 | ### Prompting 421 | - [ DSPy](https://github.com/stanfordnlp/dspy) 422 | - DSPy 是一款功能强大的框架。它可以用来自动优化大型语言模型(LLM)的提示词和响应。还能让我们的 LLM 应用即使在 OpenAI/Gemini/Claude版本升级也能正常使用。无论你有多少数据,它都能帮助你优化模型,获得更高的准确度和性能。通过选择合适的优化器,并根据具体需求进行调优,你可以在各种任务中获得出色的结果。 423 | 424 | - [YiVal](https://github.com/YiVal/YiVal) 425 | - GenAI 应用程序的自动提示工程助手 YiVal 是一款最先进的工具,旨在简化 GenAI 应用程序提示和循环中任何配置的调整过程。有了 YiVal,手动调整已成为过去。这种以数据驱动和以评估为中心的方法可确保最佳提示、精确的 RAG 配置和微调的模型参数。使用 YiVal 使您的应用程序能够轻松实现增强的结果、减少延迟并最大限度地降低推理成本! 426 | 427 | ### SQL增强 428 | 429 | - [vanna](https://github.com/vanna-ai/vanna) 430 | - Vanna 是一个MIT许可的开源Python RAG(检索增强生成)框架,用于SQL生成和相关功能。 431 | - Vanna 的工作过程分为两个简单步骤 - 在您的数据上训练 RAG“模型”,然后提出问题,这些问题将返回 SQL 查询。训练的数据主要是一些 DDL schema、业务说明文档以及示例sql等,所谓训练主要是将这些数据embedding化,用于向量检索。 432 | - [Chat2DB](https://github.com/chat2db/Chat2DB) 433 | - 由前阿里巴巴成员创建并开源,一个智能和多功能的通用SQL客户端和报表工具,集成了ChatGPT功能,,14.3k 434 | 435 | - [SQLChat](https://github.com/sqlchat/sqlchat) 436 | - 一个可以将自然语言转换为SQL查询的工具,4.1k 437 | 438 | - [Dataherald](https://github.com/dataherald/dataherald) 439 | - 使用AI驱动的数据管理平台,帮助用户将自然语言查询转换为SQL。,3.2k 440 | 441 | - [WrenAI](https://github.com/Canner/WrenAI) 442 | - 一个高效的自然语言到SQL转换工具,支持多种数据库。,1.4k 443 | 444 | - [SuperSonic](https://github.com/tencentmusic/supersonic) 445 | - 由腾讯音乐开源,高性能的SQL生成工具,支持复杂查询的自动生成。1.6k 446 | 447 | 448 | ### LLM部署和serving 449 | 450 | - [vllm]([vllm](https://github.com/vllm-project/vllm)) 451 | - [OpenLLM](https://github.com/bentoml/OpenLLM) 452 | 453 | ### 可观测性 454 | 455 | - [llamaindex-可观测性](https://docs.llamaindex.ai/en/stable/module_guides/observability/observability.html) 456 | - [langfuse](https://github.com/langfuse/langfuse) 457 | - [phoenix](https://github.com/Arize-ai/phoenix) 458 | - [openllmetry](https://github.com/traceloop/openllmetry) 459 | - [lunary](https://lunary.ai/) 460 | 461 | ### 其他 462 | 463 | - [RAGxplorer](https://github.com/gabrielchua/RAGxplorer) 464 | - RAGxplorer 是一种交互式 Streamlit 工具,通过将文档块和的查询问句展示为embedding向量空间中可的视化内容来支持检索增强生成 (RAG) 应用程序的构建。 465 | - [Rule-Based-Retrieval](https://github.com/whyhow-ai/rule-based-retrieval) 466 | - rule-based-retrieval是一个 Python 包,使您能够创建和管理具有高级筛选功能的检索增强生成 (RAG) 应用程序。它与用于文本生成的 OpenAI 和用于高效矢量数据库管理的 Pinecone 无缝集成。 467 | - [instructor](https://github.com/jxnl/instructor) 468 | - 借助大模型从一段文本中提取为结构化数据的库 469 | - [RAGLAB](https://github.com/fate-ubw/raglab) 470 | - RAGLAB是一个模块化、面向研究的开源框架,用于检索增强型生成(Retrieval-Augmented Generation, RAG)算法。它提供了6种现有RAG算法的复制,以及一个全面的评估系统,包括10个基准数据集,使得RAG算法之间的公平比较和新算法、数据集和评估指标的高效开发成为可能。 471 | 472 | ### AI搜索类项目 473 | 474 | 1. https://github.com/leptonai/search_with_lepton 475 | 2. https://github.com/khoj-ai/khoj 476 | 3. https://github.com/YassKhazzan/openperplex_front 477 | 4. https://github.com/supermemoryai/opensearch-ai 478 | 5. https://github.com/InternLM/MindSearch 479 | 6. https://github.com/luyu0279/BrainyAI 480 | 7. https://github.com/memfreeme/memfree 481 | 8. https://github.com/shadowfax92/Fyin 482 | 9. https://github.com/Nutlope/turboseek 483 | 10. https://github.com/ItzCrazyKns/Perplexica 484 | 11. https://github.com/rashadphz/farfalle 485 | 12. https://github.com/yokingma/search_with_ai 486 | 13. https://github.com/nashsu/FreeAskInternet 487 | 14. https://github.com/jjleng/sensei 488 | 15. https://github.com/miurla/morphic 489 | 16. https://github.com/nilsherzig/LLocalSearch 490 | 17. https://github.com/OcularEngineering/ocular 491 | 18. https://github.com/QmiAI/Qmedia?tab=readme-ov-file 492 | 19. Zure-search-openai-demo:https://github.com/Azure-Samples/azure-search-openai-demo 493 | 21. Gerev:https://github.com/GerevAI/gerev 494 | 22. OpenPerPlex:https://github.com/YassKhazzan/openperplex_backend_os 495 | 23. llm-answer-engine:https://github.com/developersdigest/llm-answer-engine 496 | 24. search4all:https://github.com/fatwang2/search4all 497 | 25. scira: https://github.com/zaidmukaddam/scira 498 | -
499 | 详情 500 | 网页搜索:使用 Tavily 的 API 搜索网页。 501 | 特定 URL 搜索:从特定 URL 获取信息。 502 | 天气:使用 OpenWeather 的 API 获取任何位置的当前天气。 503 | 编程:使用 E2B 的 API 运行多种语言的代码片段。 504 | 地图:使用 Google Maps API、Mapbox API 和 TripAdvisor API 获取任何地点的位置。 505 | YouTube 搜索:搜索 YouTube 视频并获取时间戳和字幕。 506 | 学术搜索:搜索学术论文。 507 | X 帖子搜索:搜索 X.com 上的帖子。 508 | 航班跟踪:使用 AviationStack 的 API 跟踪航班。 509 | 热门电影和电视节目:获取热门电影和电视节目的信息。 510 | 电影或电视节目搜索:获取任何电影或电视节目的信息。 511 |
512 | 26. Gemini-Search:https://github.com/ammaarreshi/Gemini-Search 513 | - 一个基于 Google 的 Gemini 2.0 Flash 模型和 Google 搜索的 Perplexity 风格的搜索引擎。它提供 AI 驱动的问答功能,可以实时获取网络资源并提供引用。 514 | 515 | ## 应用参考 516 | 517 | - [Kimi Chat](https://kimi.moonshot.cn/) 518 | - 支持发送网页链接和上传文件进行回答 519 | - [GPTs](https://chat.openai.com/gpts/mine) 520 | - 支持上传文档进行类似RAG应用 521 | - [百川知识库](https://platform.baichuan-ai.com/knowledge) 522 | - 1.新建知识库后得到知识库 ID; 523 | - 2.上传文件,获取文件 ID; 524 | - 3.通过文件 ID 与知识库 ID 进行知识库文件关联,知识库中可以关联多个文档。 525 | - 4.调用对话接口时通过 knowledge_base 字段传入知识库 ID 列表,大模型使用检索到的知识信息回答问题。 526 | - [COZE](https://www.coze.com/) 527 | - 应用编辑平台,旨在开发下一代人工智能聊天机器人。无论您是否有编程经验,该平台都可以让您快速创建各种类型的聊天机器人并将其部署在不同的社交平台和消息应用程序上。 528 | - [Devv-ai](https://devv.ai/zh) 529 | - 最懂程序员的新一代 AI 搜索引擎,底层采用了RAG的大模型应用模式,LLM模型为其微调的模型。 530 | 531 | 532 | ## 企业级实践 533 | - [B站大模型×领域RAG:打造高效、智能化的用户服务体验 PPT](https://www.alipan.com/s/KQBhhZvaUVK) 534 | - [哈啰出行从Copilot到Agent模式的探索-贾立 PPT](https://www.alipan.com/s/U58jxu9vrKd) 535 | - [51Talk-AI+Agent+-+在业务增长中的落地实践 PPT](https://www.alipan.com/s/ztfCspjsvDG) 536 | - [万科物业科技 PPT](https://www.alipan.com/s/95dev73WiRM) 537 | - [京东商家助手 PPT](https://www.alipan.com/s/xCFX3Sf9zjn) 538 | - [58同城-灵犀大模型PPT ](https://www.alipan.com/s/TevoFZfweHH) 539 | - [阿⾥云AI搜索RAG⼤模型优化实践PPT](https://www.alipan.com/s/SWMYmRwtB7t) 540 | - [向量化与文档解析技术加速大模型RAG应用落地PPT](https://www.alipan.com/s/xio6aX4zeCF) 541 | - [RAG应用在得物开放平台的智能答疑的探索](https://mp.weixin.qq.com/s/6yhYLKfNrumSMs7ELvktjg) 542 | - [用户案例|Milvus向量引擎在携程酒店搜索中的应用场景和探索](https://zilliz.com.cn/blog/usercase-milvus-trip) 543 | - [OpenAI 如何优化 LLM 的效果](https://www.breezedeus.com/article/make-llm-greater) 544 | - [What We Learned from a Year of Building with LLMs 系列](#) 545 | - [(Part I)](https://www.oreilly.com/radar/what-we-learned-from-a-year-of-building-with-llms-part-i/) 546 | - [ (Part II)](https://www.oreilly.com/radar/what-we-learned-from-a-year-of-building-with-llms-part-ii/) 547 | - [(Part III): Strategy](https://www.oreilly.com/radar/what-we-learned-from-a-year-of-building-with-llms-part-iii-strategy/) 548 | - [构建企业级AI助手的经验教训](https://tczjw7bsp1.feishu.cn/docx/Hq4Hd7JXEoHdGZxomkecEDs3n6b?from=from_copylink) 549 | - [How to build an AI assistant for the enterprise](https://www.glean.com/blog/lessons-and-learnings-from-building-an-enterprise-ready-ai-assistant) 550 | ### 知识库建设 551 | - [Aily知识问答中的友好文档格式](https://bytedance.larkoffice.com/docx/WA7hdkjYHo9xiDxUiTqcxO7Dnod) 552 | - [蔚来知识平台的建设与应用](https://mp.weixin.qq.com/s/yUhIBCHWO-fM08qMeikoDQ) 553 | 554 | 555 | 556 | ## 论文 557 | 558 | - [RAG最佳实践《Searching for Best Practices in Retrieval-Augmented Generation》](https://arxiv.org/pdf/2407.01219) 559 |
560 | 图片 561 | 562 | ![](https://cdn.jsdelivr.net/gh/lizhe2004/pic-repo@master/imgs/20250102135350.png) 563 | 564 |
565 | 566 | - [Retrieval Augmented Generation: Streamlining the creation of intelligent natural language processing models](https://ai.meta.com/blog/retrieval-augmented-generation-streamlining-the-creation-of-intelligent-natural-language-processing-models/) 567 | - [Lost in the Middle: How Language Models Use Long Contexts](https://arxiv.org/abs/2307.03172) 568 | - [论文-设计检索增强生成系统时的七个故障点](https://arxiv.org/abs/2401.05856) 569 | - Seven Failure Points When Engineering a Retrieval Augmented Generation System 570 | - [Is ChatGPT Good at Search? Investigating Large Language Models as Re-Ranking Agents](https://arxiv.org/abs/2304.09542) 571 | - [RankGPT Reranker Demonstration (Van Gogh Wiki)](https://github.com/run-llama/llama_index/blob/main/docs/examples/node_postprocessor/rankGPT.ipynb) 572 | - [Bridging the Preference Gap between Retrievers and LLMs](https://arxiv.org/abs/2401.06954) 573 | - [Tuning Language Models by Proxy](https://arxiv.org/abs/2401.08565) 574 | - [Zero-Shot Listwise Document Reranking with a Large Language Model](https://arxiv.org/pdf/2305.02156.pdf) 575 | - 两种重新排序方法:逐点重新排名、列表重新排名。 576 | - 逐点重新排名是给定文档列表,我们将查询+每个文档单独提供给 LLM 并要求它产生相关性分数。 577 | - 列表重新排名是给定文档列表,我们同时向 LLM 提供查询 + 文档列表,并要求它按相关性对文档进行重新排序。 578 | - 建议对 RAG 检索到的文档按列表重新排序,列表重排优于逐点重排。 579 | - [Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflection](https://arxiv.org/abs/2310.11511) 580 | - [高级RAG之Self-RAG框架的原理和内部实现](https://blog.lidaxia.io/2024/05/10/self-rag-introduction/) 581 | - [Adaptive-RAG: Learning to Adapt Retrieval-Augmented Large Language Models through Question Complexity](https://arxiv.org/abs/2403.14403) 582 | - [高级RAG之Adaptive-RAG框架的原理和内部实现](https://blog.lidaxia.io/2024/05/16/adaptive-rag/) 583 | - [Corrective Retrieval Augmented Generation](https://arxiv.org/abs/2401.15884) 584 | - [高级RAG之Corrective-RAG框架的原理和内部实现 585 | ](https://blog.lidaxia.io/2024/05/14/crag/) 586 | 587 | 这里列出了一些重要的研究论文,它们揭示了 RAG 领域的关键洞察和最新进展。 588 | 589 | | **洞见** | **参考来源** | **发布日期** | 590 | | ------------- | ------------- | ------------- | 591 | | 提出一种名为纠正检索增强生成(CRAG, Corrective Retrieval Augmented Generation)的方法,旨在提升 RAG 系统生成内容的稳定性和准确性。其核心在于增加一个能够自我修正的组件至检索器中,并优化检索文档的使用,以促进更优质的内容生成。此外,引入了一种检索评估机制,用于评价针对特定查询检索到的文档的整体品质。通过网络搜索和知识的优化利用,能够有效提升文档自我修正和利用的效率。 | [纠正检索增强生成](https://arxiv.org/abs/2401.15884)| 2024年1月| 592 | | RAPTOR 模型通过递归方式嵌入、聚类并总结文本信息,自底向上构建出层次化的总结树。在使用时,该模型能够从这棵树中检索信息,实现对长文档在不同抽象层面上信息的综合利用。 | [RAPTOR:递归抽象处理用于树组织检索](https://arxiv.org/abs/2401.18059)| 2024年1月 | 593 | | 开发了一个通用框架,通过大语言模型(LLM)与检索器之间的多步骤互动,有效处理多标签分类难题。 | [在上下文中学习用于极端多标签分类](https://arxiv.org/abs/2401.12178) | 2024年1月 | 594 | | 研究表明,通过提取高资源语言中语义相似的提示,可以显著提升多语言预训练语言模型在多种任务上的零样本学习能力。 | [从分类到生成:洞察跨语言检索增强的 ICL](https://arxiv.org/abs/2311.06595) | 2023年11月| 595 | | 针对 RAGs 模型在处理噪声较多、不相关文档以及未知情境时的稳健性进行了改善,通过为检索文档生成序列化阅读笔记,深入评估其与提问的相关性,并整合信息以构建最终答案。 | [链式笔记:增强检索增强语言模型的鲁棒性](https://arxiv.org/abs/2311.09210)| 2023年11月 | 596 | | 通过去除可能不会对答案生成贡献关键信息的标记,优化了检索增强阅读模型的处理流程,实现了高达 62.2% 的运行时间缩减,同时保持性能仅降低了2%。 | [通过标记消除优化检索增强阅读器模型](https://arxiv.org/abs/2310.13682)| | 2023年10月 | 597 | | 通过对小型语言模型 (LM) 进行指令式微调,我们开发了一个独立的验证器,以验证知识增强语言模型 (knowledge-augmented LMs) 的输出及其知识准确性。这种方法特别有助于解决模型在面对特定查询时未能检索相关知识,或在生成文本中未能准确反映检索到的知识的情况。 | [知识增强语言模型验证](https://arxiv.org/abs/2310.12836) | 2023年10月 | 598 | | 我们设立了一个基准测试,以分析不同大型语言模型 (LLMs) 在检索增强生成 (RAG) 所需的四项核心能力——噪声容忍、排除不相关信息、信息融合和对反事实情境的适应性——的表现。 | [大型语言模型在检索增强生成中的基准测试](https://arxiv.org/abs/2309.01431) | 2023年10月 | 599 | | 介绍了一种自我反思的检索增强生成 (Self-RAG) 框架,旨在通过检索和自我反思来提升语言模型的质量和事实性。该框架利用语言模型动态检索信息,并通过反思标记来生成和评估检索到的内容及其自生成内容。 | [自我反思检索增强生成: 通过自我反思学习检索、生成及自我批判](https://arxiv.org/abs/2310.11511) | 2023年10月 | 600 | | 通过生成增强检索 (GAR) 和检索增强生成 (RAG) 的迭代改善,提高了零样本信息检索的能力。该过程中的改写-检索阶段有效提升了召回率,而重排阶段则显著提高了精度。 | [零样本信息检索中的GAR与RAG相结合的新范式](https://arxiv.org/abs/2310.20158) | 2023年10月 | 601 | | 通过使用基于 43B GPT 模型的预训练和从 1.2 万亿 Token 中检索信息,我们预训练了一个 48B 的检索模型。进一步通过指令式微调,该模型在多种零样本任务上相比经过指令式微调的 GPT 模型显示出显著的性能提升。 | [InstructRetro: 检索增强预训练后的指令式微调](https://arxiv.org/abs/2310.07713) | 2023年10月| 602 | | 通过两步精细调整,我们为大型语言模型增加了检索功能:一步是优化预训练的语言模型以更有效利用检索到的信息,另一步则是改进检索器以返回更符合语言模型偏好的相关结果。这种分阶段的微调方法,在要求知识利用和上下文感知的任务中,显著提升了性能。 | [检索增强的双重指令微调 (RA-DIT)](https://arxiv.org/abs/2310.01352) | 2023年10月 | 603 | | 介绍了一种提升 RAGs 在面对不相关内容时鲁棒性的方法。该方法通过在训练期间混合使用相关与不相关的上下文,自动产生数据以微调语言模型,从而有效利用检索到的文段。 | [让基于检索增强的语言模型对无关上下文更加鲁棒](https://arxiv.org/abs/2310.01558) |2023年10月| 604 | | 研究表明,采用简单检索增强技术的 4K 上下文窗口的大语言模型在生成过程中,其表现与通过位置插值对长上下文任务进行微调的 16K 上下文窗口的大语言模型相媲美。 | [当检索遇上长上下文的大语言模型](https://arxiv.org/abs/2310.03025)| 2023年10月| 605 | | 在上下文融合前将检索文档压缩为文本摘要,既降低了计算成本,也减轻了模型从长文档中识别关键信息的难度。 | [RECOMP: 用压缩和选择性增强提升检索增强语言模型](https://arxiv.org/abs/2310.04408)| 2023年10月| 606 | | 提出了一个迭代式的检索与生成协同工作框架,它结合了参数化和非参数化知识,通过检索与生成的互动来寻找正确的推理路径。这一框架特别适合需要多步推理的任务,能够显著提高大语言模型的推理能力。 | [检索与生成的协同作用加强了大语言模型的推理能力](https://arxiv.org/abs/2310.05149)| 2023年10月| 607 | | 提出“澄清树”框架,该框架通过少样本提示并借助外部知识,为含糊问题递归构建一个消歧树。然后利用这棵树产生详细的答案。 | [利用检索增强大语言模型回答含糊问题的“澄清树”方法](https://arxiv.org/abs/2310.14696) | 2023年10月 | 608 | | 介绍了一种使大语言模型能够参考其之前遇到的问题,并在面对新问题时动态调用外部资源的方法。 | [借助自我知识的大语言模型检索增强策略](https://arxiv.org/abs/2310.05002)| 2023年10月| 609 | | 提供了一组评估指标,用于从多个维度(如检索系统识别相关及集中上下文段落的能力、大语言模型忠实利用这些段落的能力,以及生成内容本身的质量)评价不同方面,而无需依赖人工注释的真实数据。| [RAGAS: 对检索增强生成进行自动化评估的指标体系](https://arxiv.org/abs/2309.15217) | 2023年9月 | 610 | | 提出了一种创新方法——生成后阅读(GenRead),它让大型语言模型先根据提问生成相关文档,再从这些文档中提取答案。 | [生成而非检索:大型语言模型作为强大的上下文生成器](https://arxiv.org/abs/2209.10063)| 2023年9月 | 611 | | 展示了在 RAG 系统中如何使用特定排名器(比如 DiversityRanker 和 LostInTheMiddleRanker)来挑选信息,从而更好地利用大型语言模型的上下文窗口。 | [提升 Haystack 中 RAG 系统的能力:DiversityRanker 和 LostInTheMiddleRanker 的引入](https://towardsdatascience.com/enhancing-rag-pipelines-in-haystack-45f14e2bc9f5) | 2023年8月 | 612 | | 描述了如何将大型语言模型与不同的知识库结合,以便于知识的检索和储存。通过编程思维的提示来生成知识库的搜索代码,此外,还能够根据用户的需要,将知识储存在个性化的知识库中。 | [KnowledGPT: 利用知识库检索和存储功能增强大型语言模型](https://arxiv.org/abs/2308.11761) | 2023年8月| 613 | | 提出一种模型,通过结合检索增强掩码语言建模和前缀语言建模,引入上下文融合学习,以此提高少样本学习的效果,使模型能够在不增加训练负担的情况下使用更多上下文示例。 | [RAVEN: 借助检索增强编解码器语言模型实现的上下文学习](https://arxiv.org/abs/2308.07922)| 2023年8月| 614 | | RaLLe 是一款开源工具,专门用于开发、评估和提升针对知识密集型任务的 RAG 系统的性能。 | [RaLLe: 针对检索增强大型语言模型的开发和评估框架](https://arxiv.org/abs/2308.10633) | 2023年8月| 615 | | 研究发现,当相关信息的位置发生变化时,大型语言模型的性能会明显受影响,这揭示了大型语言模型在处理长篇上下文信息时的局限性。 | [中途迷失:大型语言模型处理长篇上下文的方式](https://arxiv.org/abs/2307.03172) | 2023年7月 | 616 | | 通过迭代的方式,模型能够将检索和生成过程相互协同。模型的输出不仅展示了完成任务所需的内容,还为检索更多相关知识提供了丰富的上下文,从而在下一轮迭代中帮助产生更优的结果。 | [通过迭代检索-生成协同增强检索增强的大语言模型](https://arxiv.org/abs/2305.15294) | 2023年5月| 617 | | 介绍了一种新的视角,即在文本生成过程中,系统能够主动决定何时以及检索什么信息。接着,提出了一种名为FLARE的方法,通过预测下一句话来预见未来的内容,利用此内容作为关键词检索相关文档,并在发现不确定的表达时重新生成句子。 | [主动检索增强生成](https://arxiv.org/abs/2305.06983)| 2023年5月| 618 | | 提出了一个能够通用应用于各种大语言模型的检索插件,即使在模型未知或不能共同微调的情况下也能提升模型性能。 | [适应增强型检索器改善大语言模型的泛化作为通用插件](https://arxiv.org/abs/2305.17331)| 2023年5月| 619 | | 通过两种创新的预训练方法,提高了对结构化数据的密集检索效果。首先,通过对结构化数据和非结构化数据之间的关联进行预训练来提升模型的结构感知能力;其次,通过实现遮蔽实体预测来更好地捕捉结构语义。 | [结构感知的语言模型预训练改善结构化数据上的密集检索](https://arxiv.org/abs/2305.19912) | 2023年5月 | 620 | | 该框架能够动态地融合来自不同领域的多样化信息源,以提高大语言模型的事实准确性。通过一个自适应的查询生成器,根据不同知识源定制查询,确保信息的准确性逐步得到修正,避免错误信息的累积和传播。 | [知识链:通过动态知识适应异质来源来基础大语言模型](https://arxiv.org/abs/2305.13269) | 2023年5月 | 621 | | 此框架通过首先检索知识图谱中的相关子图,并通过调整检索到的子图的词嵌入来确保事实的一致性,然后利用对比学习确保生成的对话与知识图谱高度一致,为生成与上下文相关且基于知识的对话提供了新方法。 | [用于知识基础对话生成的知识图谱增强大语言模型](https://arxiv.org/abs/2305.18846)| 2023年5月| 622 | | 通过采用小型语言模型作为可训练重写器,以适应黑盒式大语言模型(LLM)的需求。重写器通过强化学习(RL)根据 LLM 的反馈进行训练,从而构建了一个名为“重写-检索-阅读”的新框架,专注于查询优化。| [为检索增强的大语言模型重写查询](https://arxiv.org/abs/2305.14283)| 2023年5月 | 623 | | 利用检索增强生成器迭代创建无限记忆池,并通过记忆选择器挑选出适合下一轮生成的记忆。此方法允许模型利用自身产出的记忆,称为“自我记忆”,以提升内容生成质量。| [自我提升:带有自我记忆的检索增强文本生成](https://arxiv.org/abs/2305.02437) | 2023年5月 | 624 | | 通过为大语言模型(LLM)装配知识引导模块,让它们在不改变内部参数的情况下,获取相关知识。这一策略显著提高了模型在需要丰富知识的领域任务(如事实知识增加7.9%,表格知识增加11.9%,医学知识增加3.0%,多模态知识增加8.1%)的表现。| [用参数知识引导增强大语言模型](https://arxiv.org/abs/2305.04757) | 2023年5月| 625 | | 为大语言模型(LLM)引入了一个通用的读写记忆单元,允许它们根据任务需要从文本中提取、存储并回忆知识。| [RET-LLM:朝向大语言模型的通用读写记忆](https://arxiv.org/abs/2305.14322) | 2023年5月| 626 | | 通过使用任务不可知检索器,构建了一个共享静态索引,有效选出候选证据。随后,设计了一个基于提示的重排机制,根据任务的特定相关性重新排序最相关的证据,为读者提供精准信息。| [针对非知识密集型任务的提示引导检索增强](https://arxiv.org/abs/2305.17653)| 2023年5月| 627 | | 提出了UPRISE(通用提示检索以改善零样本评估),通过调整一个轻量级且多功能的检索器,它能自动为给定零样本任务的输入检索出最合适的提示,以此来改善评估效果。| [UPRISE:改进零样本评估的通用提示检索](https://arxiv.org/abs/2303.08518) | 2023年3月 | 628 | | 结合了 SLMs 作为过滤器和 LLMs 作为重排器的优势,提出了一个适应性的“过滤-再重排”范式,有效提升了难样本的信息提取与重排效果。| [大语言模型不是一个理想的少样本信息提取器,但它在重排难样本方面表现出色!](https://arxiv.org/abs/2303.08559) | 2023年3月 | 629 | 零样本学习指导一款能够遵循指令的大语言模型,创建一个虚拟文档来抓住重要的联系模式。接着,一个名为Contriever的工具会将这份文档转化成嵌入向量,利用这个向量在大数据集的嵌入空间中找到相似文档的聚集地,通过向量的相似度来检索真实文档。 | [无需相关标签的精确零样本密集检索](https://arxiv.org/abs/2212.10496) | 2022年12月 | 630 | 提出了一个名为展示-搜索-预测(DSP)的新框架,通过这个框架可以编写高级程序,这些程序能够先展示流程,然后搜索相关信息,并基于这些信息做出预测。它能够将复杂问题分解成小的、更易于解决的步骤。 | [通过检索和语言模型组合,为复杂的自然语言处理任务提供解决方案](https://arxiv.org/abs/2212.14024) | 2022年12月 | 631 | 采用了一种新的多步骤问答策略,通过在思维链条的每一步中穿插检索信息,使用检索到的信息来丰富和改善思维链条。这种方法显著提升了解决知识密集型多步问题的效果。 | [结合思维链条推理和信息检索解决复杂多步骤问题](https://arxiv.org/abs/2212.10509) | 2022年12月 | 632 | 研究发现,增加检索环节可以有效减轻对已有训练信息的依赖,使得RAG变成一个有效捕捉信息长尾的策略。 | [大语言模型在学习长尾知识方面的挑战](https://arxiv.org/abs/2211.08411) | 2022年11月 | 633 | 通过抽样方式,从大语言模型的记忆中提取相关信息段落,进而生成最终答案。 | [通过回忆增强语言模型的能力](https://arxiv.org/abs/2210.01296) | 2022年10月 | 634 | 将大语言模型用作少量示例的查询生成器,根据这些生成的数据构建针对特定任务的检索系统。 | [Promptagator: 基于少量示例实现密集检索](https://arxiv.org/abs/2209.11755) | 2022年9月 | 635 | 介绍了Atlas,这是一个经过预训练的检索增强型语言模型,它能够通过极少数的示例学习掌握知识密集任务。 |[Atlas: 借助检索增强型语言模型进行少样本学习](https://arxiv.org/abs/2208.03299)| 2022年8月 | 636 | 通过从训练数据中进行智能检索,实现了在多个自然语言生成和理解任务上的性能提升。 | [重新认识训练数据的价值:通过训练数据检索的简单有效方法](https://arxiv.org/abs/2203.08773) | 2022年3月 | 637 | 通过在连续的数据存储条目之间建立指针关联,并将这些条目分组成不同的状态,我们近似模拟了数据存储搜索过程。这种方法创造了一个加权有限自动机,在推理时能够在不降低模型预测准确性(困惑度)的情况下,节约高达 83% 的查找最近邻居的计算量。 | [通过自动机增强检索的神经符号语言建模](https://arxiv.org/abs/2201.12431) | 2022 年 1 月 | 638 | 通过将自回归语言模型与从大规模文本库中检索的文档块相结合,基于这些文档与前文 Token 的局部相似性,我们实现了模型的显著改进。该策略利用了一个庞大的数据库(2 万亿 Token),大大增强了语言模型的能力。 | [通过从数万亿 Token 中检索来改善语言模型](https://arxiv.org/abs/2112.04426) | 2021 年 12 月 | 639 | 我们采用了一种创新的零样本任务处理方法,通过为检索增强生成模型引入严格的负样本和强化训练流程,提升了密集段落检索的效果,用于零样本槽填充任务。 | [用于零样本槽填充的鲁棒检索增强生成](https://arxiv.org/abs/2108.13934)| 2021 年 8 月 | 640 | 介绍了 RAG 模型,这是一种结合了预训练的 seq2seq 模型(作为参数记忆)和基于密集向量索引的 Wikipedia(作为非参数记忆)的模型。此模型通过预训练的神经网络检索器访问信息,比较了两种 RAG 设计:一种是在生成过程中始终依赖相同检索的段落,另一种则是每个 Token 都使用不同的段落。 | [用于知识密集型 NLP 任务的检索增强生成](https://arxiv.org/abs/2005.11401) | 2020 年 5 月 | 641 | 展示了一种仅通过密集表示实现信息检索的方法,该方法通过简单的双编码框架从少量问题和文本段落中学习嵌入。这种方法为开放域问答提供了一种高效的密集段落检索方案。 | [用于开放域问答的密集段落检索](https://arxiv.org/abs/2004.04906)| 2020 年 4 月 | 642 | 643 | ## RAG构建策略 644 | 645 |
646 | 架构图片参考 647 | 648 | ![](https://cdn.jsdelivr.net/gh/lizhe2004/pic-repo@master/imgs/20250102135138.png) 649 | 650 | ![](https://cdn.jsdelivr.net/gh/lizhe2004/pic-repo@master/imgs/20250102135250.png) 651 | 652 |
653 | ### 总览 654 | - [Weaviate Advanced RAG Techniques电子书](https://weaviate.io/ebooks/advanced-rag-techniques) 655 | - [中文解读](https://mp.weixin.qq.com/s/62EJx_JAkAiStmoL_p_yjQ) 656 | 657 | 658 | ### 预处理 659 | 660 | - [From Good to Great: How Pre-processing Documents Supercharges AI’s Output](https://readmedium.com/https://medium.com/mlearning-ai/from-good-to-great-how-pre-processing-documents-supercharges-ais-output-cf9ecf1bd18c) 661 | - [从好到优秀:如何预处理文件来加速人工智能的输出](https://tczjw7bsp1.feishu.cn/docx/HpFOdBVlIo2nE5xHN8GcPqaSnxg?from=from_copylink) 662 | - [Advanced RAG 02: Unveiling PDF Parsing](https://readmedium.com/https://Fpub.towardsai.net/advanced-rag-02-unveiling-pdf-parsing-b84ae866344e) 663 | - [Advanced RAG 07: Exploring RAG for Tables](https://readmedium.com/https://ai.plainenglish.io/advanced-rag-07-exploring-rag-for-tables-5c3fc0de7af6) 664 | - [5 Levels Of Text Splitting](https://github.com/FullStackRetrieval-com/RetrievalTutorials/blob/main/5_Levels_Of_Text_Splitting.ipynb) 665 | - [Semantic Chunker](https://github.com/run-llama/llama-hub/blob/main/llama_hub/llama_packs/node_parser/semantic_chunking/semantic_chunking.ipynb) 666 | - [Advanced RAG 05: Exploring Semantic Chunking](https://readmedium.com/https://Fpub.towardsai.net/advanced-rag-05-exploring-semantic-chunking-97c12af20a4d) 667 | - [Advanced RAG series: Indexing](https://div.beehiiv.com/p/advanced-rag-series-indexing) 668 | 669 | 670 | 671 | 672 | ### 查询问句分类和微调 673 | 674 | 675 | 676 | ### 检索 677 | 678 | #### 查询语句改写 679 | 680 | - [Advanced RAG 06: Exploring Query Rewriting](https://readmedium.com/https://medium.com/@florian_algo/advanced-rag-06-exploring-query-rewriting-23997297f2d1) 681 | - [Advanced RAG 11: Query Classification and Refinement](https://readmedium.com/https://ai.gopubby.com/dvanced-rag-11-query-classification-and-refinement-2aec79f4140b) 682 | - [Advanced RAG Series:Routing and Query Construction](https://div.beehiiv.com/p/routing-query-construction) 683 | - [Query Transformations](https://blog.langchain.dev/query-transformations/) 684 | - [基于LLM的RAG应用的问句转换的技巧(译)](https://tczjw7bsp1.feishu.cn/docx/UaOJdXdIzoUTBTxIuxscRAJLnfh?from=from_copylink) 685 | - [Query Construction](https://blog.langchain.dev/query-construction/) 686 | - [查询构造](https://tczjw7bsp1.feishu.cn/docx/Wo0Sdn23voh0Wqx245zcu1Kpnuf?from=from_copylink) 687 | - - [Advanced RAG Series - Query Translation](https://div.beehiiv.com/p/rag-say) 688 | 689 | #### 检索策略 690 | 691 | - [Foundations of Vector Retrieval](arxiv.org/abs/2401.09350) 692 | - 这本200多页的专题论文提供了向量检索文献中主要算法里程碑的总结,目的是作为新老研究者可以独立参考的资料。 693 | - [Improving Retrieval Performance in RAG Pipelines with Hybrid Search](https://towardsdatascience.com/improving-retrieval-performance-in-rag-pipelines-with-hybrid-search-c75203c2f2f5) 694 | - [在 RAG 流程中提高检索效果:融合传统关键词与现代向量搜索的混合式搜索技术](https://baoyu.io/translations/rag/improving-retrieval-performance-in-rag-pipelines-with-hybrid-search) 695 | - [Multi-Vector Retriever for RAG on tables, text, and images](https://blog.langchain.dev/semi-structured-multi-modal-rag/) 696 | - [针对表格、文本和图片的RAG多向量检索器](https://tczjw7bsp1.feishu.cn/docx/Q8T8dZC0qoV2KRxPh8ScqoHanHg?from=from_copylink) 697 | - [Relevance and ranking in vector search](https://learn.microsoft.com/en-us/azure/search/vector-search-ranking#hybrid-search) 698 | - [向量查询中的相关性和排序](https://tczjw7bsp1.feishu.cn/docx/VJIWd90fUohXLlxY243cQhKCnXf?from=from_copylink) 699 | - [Boosting RAG: Picking the Best Embedding & Reranker models](https://blog.llamaindex.ai/boosting-rag-picking-the-best-embedding-reranker-models-42d079022e83) 700 | - [提升优化 RAG:挑选最好的嵌入和重排模型](https://tczjw7bsp1.feishu.cn/docx/CtLCdwon9oDIF4x49mOchmjxnud?from=from_copylink) 701 | - [Azure Cognitive Search: Outperforming vector search with hybrid retrieval and ranking capabilities](https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/azure-cognitive-search-outperforming-vector-search-with-hybrid/ba-p/3929167) 702 | - [Azure认知搜索:通过混合检索和排序功能优于向量搜索](https://tczjw7bsp1.feishu.cn/docx/CDtGdwQJXo0mYVxaLpecXWuRnLc?from=from_copylink) 703 | - [Optimizing Retrieval Augmentation with Dynamic Top-K Tuning for Efficient Question Answering](https://medium.com/@sauravjoshi23/optimizing-retrieval-augmentation-with-dynamic-top-k-tuning-for-efficient-question-answering-11961503d4ae) 704 | - [动态 Top-K 调优优化检索增强功能实现高效的问答](https://tczjw7bsp1.feishu.cn/docx/HCzAdk2BmoBg3lxA7ZOcn3KlnJb?from=from_copylink) 705 | - [Building Production-Ready LLM Apps with LlamaIndex: Document Metadata for Higher Accuracy Retrieval](https://readmedium.com/https://betterprogramming.pub/building-production-ready-llm-apps-with-llamaindex-document-metadata-for-higher-accuracy-retrieval-a8ceca641fb5) 706 | - [使用 LlamaIndex 构建生产就绪型 LLM 应用程序:用于更高精度检索的文档元数据](https://tczjw7bsp1.feishu.cn/wiki/St29wfD5QiMcThk8ElncSe90nZe?from=from_copylink) 707 | - [dvanced RAG Series: Retrieval](https://div.beehiiv.com/p/advanced-rag-series-retrieval) 708 | 709 | ### GraphRAG 710 | - [微软GraphRAG框架演进之路及带来的一些思考](https://mp.weixin.qq.com/s/3P7QZLaa4_d9fn9uHRA0JA) 711 | - [LazyGraphRAG](https://www.microsoft.com/en-us/research/blog/lazygraphrag-setting-a-new-standard-for-quality-and-cost) 712 | ### 检索后处理 713 | 714 | #### 重排序 715 | 716 | - [Advanced RAG 04: Re-ranking](https://readmedium.com/https://pub.towardsai.net%2Fadvanced-rag-04-re-ranking-85f6ae8170b1) 717 | - [RankGPT Reranker Demonstration](https://github.com/run-llama/llama_index/blob/main/docs/examples/node_postprocessor/rankGPT.ipynb) 718 | 719 | #### Contextual(Prompt) Compression 720 | 721 | - [How to Cut RAG Costs by 80% Using Prompt Compression](https://readmedium.com/https://towardsdatascience.com/how-to-cut-rag-costs-by-80-using-prompt-compression-877a07c6bedb) 722 | - 第一种压缩方法是 AutoCompressors。它的工作原理是将长文本汇总为短向量表示,称为汇总向量。然后,这些压缩的摘要向量充当模型的软提示。 723 | - [LangChain Contextual Compression](https://python.langchain.com/docs/modules/data_connection/retrievers/contextual_compression/?ref=blog.langchain.dev) 724 | - [Advanced RAG 09: Prompt Compression](https://readmedium.com/https://ai.gopubby.com/advanced-rag-09-prompt-compression-95a589f7b554) 725 | 726 | #### 其他 727 | 728 | - [Bridging the rift in Retrieval Augmented Generation](https://readmedium.com/https://medium.com/@alcarazanthony1/bridging-the-rift-in-retrieval-augmented-generation-3e12f379f66c) 729 | - 不是直接微调检索器和语言模型等效果不佳的基础模块,而是引入了第三个参与者——位于现有组件之间的中间桥接模块。涉及技术包括**排序**、**压缩**、**上下文框架**、**条件推理脚手架**、**互动询问**等 (可参考后续论文) 730 | 731 | ### 评估 732 | 733 | - [Evaluating RAG Applications with RAGAs](https://towardsdatascience.com/evaluating-rag-applications-with-ragas-81d67b0ee31a) 734 | - [用 RAGAs(检索增强生成评估)评估 RAG(检索增强型生成)应用](https://baoyu.io/translations/rag/evaluating-rag-applications-with-ragas) 735 | - [Best Practices for LLM Evaluation of RAG Applications](https://www.databricks.com/blog/LLM-auto-eval-best-practices-RAG) 736 | - [RAG应用的LLM评估最佳实践(译)](https://tczjw7bsp1.feishu.cn/docx/TQJcdzfcfomL4QxqgkfchvbOnog?from=from_copylink) 737 | - [Advanced RAG 03: Using RAGAs + LlamaIndex for RAG evaluation ](https://readmedium.com/https://ai.plainenglish.io/advanced-rag-03-using-ragas-llamaindex-for-rag-evaluation-84756b82dca7) 738 | - [Exploring End-to-End Evaluation of RAG Pipelines](https://readmedium.com/https://betterprogramming.pub/exploring-end-to-end-evaluation-of-rag-pipelines-e4c03221429) 739 | - [探索 RAG 流水线的端到端评估](https://tczjw7bsp1.feishu.cn/wiki/XL8WwjYU9i1sltkawl1cYOounOg?from=from_copylink) 740 | - [Evaluating Multi-Modal Retrieval-Augmented Generation](https://blog.llamaindex.ai/evaluating-multi-modal-retrieval-augmented-generation-db3ca824d428) 741 | - [评估多模态检索增强生成](https://tczjw7bsp1.feishu.cn/docx/DrDQdj29DoDhahx9439cjb30nrd?from=from_copylink) 742 | - [RAG Evaluation](https://cobusgreyling.medium.com/rag-evaluation-9813a931b3d4) 743 | - [RAG评估](https://tczjw7bsp1.feishu.cn/wiki/WzPnwFMgbisICCk9BFrc9XYanme?from=from_copylink) 744 | - [Evaluation - LlamaIndex](https://docs.llamaindex.ai/en/stable/module_guides/evaluating/root.html) 745 | - [评估-LlamaIndex](https://tczjw7bsp1.feishu.cn/wiki/KiSow8rXviiHDWki4kycULRWnqg?from=from_copylink) 746 | - [Pinecone的RAG评测](https://www.pinecone.io/blog/rag-study/) 747 | - 不同数据规模下不同模型的RAG忠实度效果 748 | - 不同模型下使用RAG与不是用RAG(仅依靠内部知识)的忠实度效果 749 | - 不同模型下结合内部和外部知识后的RAG忠实度效果 750 | - 不同模型下的RAG的答案相关度效果 751 | - [zilliz:Optimizing RAG Applications: A Guide to Methodologies, Metrics, and Evaluation Tools for Enhanced Reliability](https://zilliz.com/blog/how-to-evaluate-retrieval-augmented-generation-rag-applications?utm_source=twitter&utm_medium=social&utm_term=zilliz) 752 | - [Advanced RAG Series: Generation and Evaluation](https://div.beehiiv.com/p/advanced-rag-series-generation-evaluation) 753 | 754 | 755 | ## 幻觉 756 | - [大模型评测幻觉检测+-+AICon PPT](https://www.alipan.com/s/rCUkfz21vR9) 757 | - [Let’s Talk About LLM Hallucinations](https://readmedium.com/https://levelup.gitconnected.com/lets-talk-about-llm-hallucinations-9c8dab3e7ac3) 758 | - [谈一谈LLM幻觉](https://tczjw7bsp1.feishu.cn/docx/G7KJdjENqoMYyhxw05rc8vrgn1c?from=from_copylink) 759 | - [大型语言模型中的幻觉前沿](https://readmedium.com/zh/the-frontiers-of-hallucination-in-large-language-models-b4e5d666737a) 760 | 761 | ## 课程 762 | - [短课程 Building and Evaluating Advanced RAG Applications](https://www.deeplearning.ai/short-courses/building-evaluating-advanced-rag/) 763 | - [Retrieval Augmented Generation for Production with LangChain & LlamaIndex](https://learn.activeloop.ai/courses/rag?utm_source=Twitter&utm_medium=social&utm_campaign=student-social-share) 764 | 765 | ## 视频 766 | - [A Survey of Techniques for Maximizing LLM Performance](https://www.youtube.com/watch?v=ahnGLM-RC1Y&ab_channel=OpenAI) 767 | - [How do domain-specific chatbots work? An overview of retrieval augmented generation (RAG)](https://www.youtube.com/watch?v=1ifymr7SiH8&ab_channel=CoryZue) 768 | - [文字版](https://scriv.ai/guides/retrieval-augmented-generation-overview/) 769 | - [nvidia:Augmenting LLMs Using Retrieval Augmented Generation](https://courses.nvidia.com/courses/course-v1:NVIDIA+S-FX-16+v1/course/) 770 | - [How to Choose a Vector Database](https://www.youtube.com/watch?v=Yo-AzVpWrRg&ab_channel=Pinecone) 771 | ## 图书 772 | - [大语言模型](https://llmbook-zh.github.io/) 773 | - ![](https://cdn.jsdelivr.net/gh/lizhe2004/pic-repo@master/imgs/20250107115756.png) 774 | - 大模型技术的中文参考资料,由中国人民大学师生联手打造,由赵鑫教授和文继荣教授领衔。书籍注重为大模型技术的入门读者提供讲解,力图展现一个整体的大模型技术框架和路线图。本书适用于具有深度学习基础的高年级本科生以及低年级研究生使用,可以作为一本入门级的技术书籍。 775 | - **下载地址**: [http://aibox.ruc.edu.cn/docs//2024-04/da308db79a5d4c5697da99e012d46c76.pdf](http://aibox.ruc.edu.cn/docs//2024-04/da308db79a5d4c5697da99e012d46c76.pdf) 776 | - [大模型基础](https://github.com/ZJU-LLMs/Foundations-of-LLMs/tree/main) 777 | - 浙江大学DAILY实验室毛玉仁研究员、高云君教授领衔撰写的《大模型基础》教材!本书包括传统语言模型、大语言模型架构、提示工程、高效参数、模型编辑、搜索增强增加生成等六章内容。为增加本书的易读性,每章分别以一种动物为背景,对具体技术进行举例说明,故此本书以六种动物作为封面。 778 | - 因为大模型的技术这几年发展太快了,本书的一个目标也是“月度更新”,自半年前发布后就在不断update,致力打造易读、严谨、有深度的大模型教材。 779 | - ![](https://cdn.jsdelivr.net/gh/lizhe2004/pic-repo@master/imgs/20250107134449.png) 780 | - [《大规模语言模型:从理论到实践》](https://intro-llm.github.io/) 781 | - 本书围绕大语言模型构建的四个主要阶段:预训练、有监督微调、奖励建模和强化学习,详细介绍各阶段使用的算法、数据、难点以及实践经验。 782 | - **下载地址:** [https://intro-llm.github.io/chapter/LLM-TAP.pdf](https://intro-llm.github.io/chapter/LLM-TAP.pdf) 783 | - ![](https://cdn.jsdelivr.net/gh/lizhe2004/pic-repo@master/imgs/20250117090904.png) 784 | ## 编码实践 785 | 786 | - [编码实践](./practice.md) 787 | 788 | ## 其他 789 | - [中文大模型相关汇总](https://github.com/WangRongsheng/Awesome-LLM-Resourses) 790 | - 包括数据、微调、推理、评估、体验、RAG、Agent、搜索、书籍和课程等方面的资源: 791 | - [Large Language Model (LLM) Disruption of Chatbots](https://cobusgreyling.medium.com/large-language-model-llm-disruption-of-chatbots-8115fffadc22) 792 | - [大型语言模型 (LLM)对聊天机器人的颠覆](https://tczjw7bsp1.feishu.cn/docx/GbxKdkpwrodWRnxW4ffcBU0Gnur?from=from_copylink) 793 | - [Gen AI: why does simple Retrieval Augmented Generation (RAG) not work for insurance?](https://www.zelros.com/2023/10/27/gen-ai-why-does-simple-retrieval-augmented-generation-rag-not-work-for-insurance/) 794 | - [生成式AI:为什么RAG在保险领域起不了作用?](https://tczjw7bsp1.feishu.cn/docx/KfbidIiZBoPfb3xrT0WcL70LnPd?from=from_copylink) 795 | - [End-to-End LLMOps Platform](https://medium.com/@bijit211987/end-to-end-llmops-platform-514044dc791d) 796 | 797 | [![Star History Chart](https://api.star-history.com/svg?repos=lizhe2004/Awesome-LLM-RAG-Application&type=Date)](https://star-history.com/#lizhe2004/Awesome-LLM-RAG-Application&Date) 798 | -------------------------------------------------------------------------------- /llm-rag.excalidraw: -------------------------------------------------------------------------------- 1 | { 2 | "type": "excalidraw", 3 | "version": 2, 4 | "source": "https://marketplace.visualstudio.com/items?itemName=pomdtr.excalidraw-editor", 5 | "elements": [ 6 | { 7 | "type": "text", 8 | "version": 86, 9 | "versionNonce": 1731830764, 10 | "isDeleted": false, 11 | "id": "Maj-5PsrPLTmnyAgCMq_T", 12 | "fillStyle": "solid", 13 | "strokeWidth": 1, 14 | "strokeStyle": "solid", 15 | "roughness": 2, 16 | "opacity": 100, 17 | "angle": 0, 18 | "x": 590.5237622942245, 19 | "y": 170.6904754638672, 20 | "strokeColor": "#e03131", 21 | "backgroundColor": "transparent", 22 | "width": 196, 23 | "height": 35, 24 | "seed": 79826400, 25 | "groupIds": [], 26 | "frameId": null, 27 | "roundness": null, 28 | "boundElements": [], 29 | "updated": 1705408785230, 30 | "link": null, 31 | "locked": false, 32 | "fontSize": 28, 33 | "fontFamily": 1, 34 | "text": "预训练的大模型", 35 | "textAlign": "left", 36 | "verticalAlign": "top", 37 | "containerId": null, 38 | "originalText": "预训练的大模型", 39 | "lineHeight": 1.25, 40 | "baseline": 27 41 | }, 42 | { 43 | "type": "rectangle", 44 | "version": 262, 45 | "versionNonce": 1615450988, 46 | "isDeleted": false, 47 | "id": "9WfJgxwDtyaOFrg238FHn", 48 | "fillStyle": "hachure", 49 | "strokeWidth": 1, 50 | "strokeStyle": "solid", 51 | "roughness": 2, 52 | "opacity": 100, 53 | "angle": 0, 54 | "x": 300.5001678466797, 55 | "y": 40.130981445312514, 56 | "strokeColor": "#343a40", 57 | "backgroundColor": "#1e1e1e", 58 | "width": 158.66662597656253, 59 | "height": 68.66662597656249, 60 | "seed": 2007465964, 61 | "groupIds": [], 62 | "frameId": null, 63 | "roundness": { 64 | "type": 3 65 | }, 66 | "boundElements": [ 67 | { 68 | "id": "raf7RXskMR-_6nDQvTew4", 69 | "type": "arrow" 70 | } 71 | ], 72 | "updated": 1705408747865, 73 | "link": null, 74 | "locked": false 75 | }, 76 | { 77 | "type": "rectangle", 78 | "version": 411, 79 | "versionNonce": 73236076, 80 | "isDeleted": false, 81 | "id": "SizCKkMoBuO6xbWujAV-D", 82 | "fillStyle": "solid", 83 | "strokeWidth": 2, 84 | "strokeStyle": "solid", 85 | "roughness": 2, 86 | "opacity": 100, 87 | "angle": 0, 88 | "x": 309.83348083496094, 89 | "y": 46.797698974609375, 90 | "strokeColor": "transparent", 91 | "backgroundColor": "#ffffff", 92 | "width": 138.66662597656253, 93 | "height": 53.33329772949219, 94 | "seed": 2034499028, 95 | "groupIds": [], 96 | "frameId": null, 97 | "roundness": { 98 | "type": 3 99 | }, 100 | "boundElements": [], 101 | "updated": 1705408746667, 102 | "link": null, 103 | "locked": false 104 | }, 105 | { 106 | "type": "text", 107 | "version": 157, 108 | "versionNonce": 583623788, 109 | "isDeleted": false, 110 | "id": "cm21iS7CWt1NHHFvAgqeN", 111 | "fillStyle": "solid", 112 | "strokeWidth": 2, 113 | "strokeStyle": "solid", 114 | "roughness": 2, 115 | "opacity": 100, 116 | "angle": 0, 117 | "x": 345.1667022705078, 118 | "y": 53.083343505859375, 119 | "strokeColor": "#1e1e1e", 120 | "backgroundColor": "#ffc9c9", 121 | "width": 72, 122 | "height": 45, 123 | "seed": 1086130260, 124 | "groupIds": [], 125 | "frameId": null, 126 | "roundness": null, 127 | "boundElements": [], 128 | "updated": 1705408508660, 129 | "link": null, 130 | "locked": false, 131 | "fontSize": 36, 132 | "fontFamily": 1, 133 | "text": "问题", 134 | "textAlign": "left", 135 | "verticalAlign": "top", 136 | "containerId": null, 137 | "originalText": "问题", 138 | "lineHeight": 1.25, 139 | "baseline": 35 140 | }, 141 | { 142 | "type": "rectangle", 143 | "version": 432, 144 | "versionNonce": 1153868396, 145 | "isDeleted": false, 146 | "id": "QzxRlXqhldKgx8mJKPPCh", 147 | "fillStyle": "hachure", 148 | "strokeWidth": 2, 149 | "strokeStyle": "solid", 150 | "roughness": 2, 151 | "opacity": 100, 152 | "angle": 0, 153 | "x": 235.97635105678017, 154 | "y": 140.6072060721261, 155 | "strokeColor": "#343a40", 156 | "backgroundColor": "#ffc9c9", 157 | "width": 295.4285147530691, 158 | "height": 143.3332737513951, 159 | "seed": 289141588, 160 | "groupIds": [], 161 | "frameId": null, 162 | "roundness": { 163 | "type": 3 164 | }, 165 | "boundElements": [ 166 | { 167 | "id": "raf7RXskMR-_6nDQvTew4", 168 | "type": "arrow" 169 | } 170 | ], 171 | "updated": 1705408759430, 172 | "link": null, 173 | "locked": false 174 | }, 175 | { 176 | "type": "rectangle", 177 | "version": 794, 178 | "versionNonce": 5125204, 179 | "isDeleted": false, 180 | "id": "nP9VWYhaABRz5hmytUl0y", 181 | "fillStyle": "solid", 182 | "strokeWidth": 2, 183 | "strokeStyle": "solid", 184 | "roughness": 2, 185 | "opacity": 100, 186 | "angle": 0, 187 | "x": 247.69059753417957, 188 | "y": 152.60725184849318, 189 | "strokeColor": "transparent", 190 | "backgroundColor": "#ffffff", 191 | "width": 270.09536307198675, 192 | "height": 117.14278084891194, 193 | "seed": 495610068, 194 | "groupIds": [], 195 | "frameId": null, 196 | "roundness": { 197 | "type": 3 198 | }, 199 | "boundElements": [ 200 | { 201 | "id": "CDgj_tP69tP6f5cRGRbvD", 202 | "type": "arrow" 203 | }, 204 | { 205 | "id": "raf7RXskMR-_6nDQvTew4", 206 | "type": "arrow" 207 | } 208 | ], 209 | "updated": 1705408771569, 210 | "link": null, 211 | "locked": false 212 | }, 213 | { 214 | "type": "text", 215 | "version": 426, 216 | "versionNonce": 1769465787, 217 | "isDeleted": false, 218 | "id": "1radQjayVpZT2WTQyOl5G", 219 | "fillStyle": "solid", 220 | "strokeWidth": 2, 221 | "strokeStyle": "solid", 222 | "roughness": 2, 223 | "opacity": 100, 224 | "angle": 0, 225 | "x": 295.6906324114118, 226 | "y": 226.3690425327846, 227 | "strokeColor": "#1e1e1e", 228 | "backgroundColor": "#ffc9c9", 229 | "width": 193.5390625, 230 | "height": 35, 231 | "seed": 1399729748, 232 | "groupIds": [], 233 | "frameId": null, 234 | "roundness": null, 235 | "boundElements": [], 236 | "updated": 1707020769508, 237 | "link": null, 238 | "locked": false, 239 | "fontSize": 28, 240 | "fontFamily": 1, 241 | "text": "(LLM 大模型)", 242 | "textAlign": "left", 243 | "verticalAlign": "top", 244 | "containerId": null, 245 | "originalText": "(LLM 大模型)", 246 | "lineHeight": 1.25, 247 | "baseline": 27 248 | }, 249 | { 250 | "type": "rectangle", 251 | "version": 377, 252 | "versionNonce": 1556387284, 253 | "isDeleted": false, 254 | "id": "5I5gWPLOKijE89dRUVYJY", 255 | "fillStyle": "hachure", 256 | "strokeWidth": 1, 257 | "strokeStyle": "solid", 258 | "roughness": 2, 259 | "opacity": 100, 260 | "angle": 0, 261 | "x": 318.64294215611045, 262 | "y": 318.0833326067243, 263 | "strokeColor": "#343a40", 264 | "backgroundColor": "#1e1e1e", 265 | "width": 158.66662597656253, 266 | "height": 68.66662597656249, 267 | "seed": 1140993004, 268 | "groupIds": [], 269 | "frameId": null, 270 | "roundness": { 271 | "type": 3 272 | }, 273 | "boundElements": [], 274 | "updated": 1705408777679, 275 | "link": null, 276 | "locked": false 277 | }, 278 | { 279 | "type": "rectangle", 280 | "version": 528, 281 | "versionNonce": 1692056404, 282 | "isDeleted": false, 283 | "id": "Ca4e_D02zm8-sXZ-yZjw3", 284 | "fillStyle": "solid", 285 | "strokeWidth": 2, 286 | "strokeStyle": "solid", 287 | "roughness": 2, 288 | "opacity": 100, 289 | "angle": 0, 290 | "x": 327.9762551443917, 291 | "y": 324.7500501360212, 292 | "strokeColor": "transparent", 293 | "backgroundColor": "#ffffff", 294 | "width": 138.66662597656253, 295 | "height": 53.33329772949219, 296 | "seed": 19779180, 297 | "groupIds": [], 298 | "frameId": null, 299 | "roundness": { 300 | "type": 3 301 | }, 302 | "boundElements": [ 303 | { 304 | "id": "CDgj_tP69tP6f5cRGRbvD", 305 | "type": "arrow" 306 | } 307 | ], 308 | "updated": 1705408777679, 309 | "link": null, 310 | "locked": false 311 | }, 312 | { 313 | "type": "text", 314 | "version": 279, 315 | "versionNonce": 1408955988, 316 | "isDeleted": false, 317 | "id": "_Oc_VSsSuMVLA2jqLSc3R", 318 | "fillStyle": "solid", 319 | "strokeWidth": 2, 320 | "strokeStyle": "solid", 321 | "roughness": 2, 322 | "opacity": 100, 323 | "angle": 0, 324 | "x": 363.3094765799386, 325 | "y": 330.08331734793524, 326 | "strokeColor": "#1e1e1e", 327 | "backgroundColor": "#ffc9c9", 328 | "width": 72, 329 | "height": 45, 330 | "seed": 230760684, 331 | "groupIds": [], 332 | "frameId": null, 333 | "roundness": null, 334 | "boundElements": [], 335 | "updated": 1705408777679, 336 | "link": null, 337 | "locked": false, 338 | "fontSize": 36, 339 | "fontFamily": 1, 340 | "text": "答案", 341 | "textAlign": "left", 342 | "verticalAlign": "top", 343 | "containerId": null, 344 | "originalText": "答案", 345 | "lineHeight": 1.25, 346 | "baseline": 35 347 | }, 348 | { 349 | "type": "arrow", 350 | "version": 290, 351 | "versionNonce": 712554677, 352 | "isDeleted": false, 353 | "id": "raf7RXskMR-_6nDQvTew4", 354 | "fillStyle": "solid", 355 | "strokeWidth": 2, 356 | "strokeStyle": "solid", 357 | "roughness": 2, 358 | "opacity": 100, 359 | "angle": 0, 360 | "x": 291.83335876464844, 361 | "y": 62.29578596566651, 362 | "strokeColor": "#1e1e1e", 363 | "backgroundColor": "#1e1e1e", 364 | "width": 80.19049072265625, 365 | "height": 106.62008873033983, 366 | "seed": 1153852628, 367 | "groupIds": [], 368 | "frameId": null, 369 | "roundness": { 370 | "type": 2 371 | }, 372 | "boundElements": [], 373 | "updated": 1707020748193, 374 | "link": null, 375 | "locked": false, 376 | "startBinding": { 377 | "elementId": "9WfJgxwDtyaOFrg238FHn", 378 | "focus": 0.811460291872423, 379 | "gap": 8.66680908203125 380 | }, 381 | "endBinding": { 382 | "elementId": "nP9VWYhaABRz5hmytUl0y", 383 | "focus": -0.8614736146114491, 384 | "gap": 16.047651018414996 385 | }, 386 | "lastCommittedPoint": null, 387 | "startArrowhead": null, 388 | "endArrowhead": "arrow", 389 | "points": [ 390 | [ 391 | 0, 392 | 0 393 | ], 394 | [ 395 | -80.19049072265625, 396 | 53.263742930120316 397 | ], 398 | [ 399 | -60.19041224888383, 400 | 106.62008873033983 401 | ] 402 | ] 403 | }, 404 | { 405 | "type": "arrow", 406 | "version": 456, 407 | "versionNonce": 593947477, 408 | "isDeleted": false, 409 | "id": "CDgj_tP69tP6f5cRGRbvD", 410 | "fillStyle": "solid", 411 | "strokeWidth": 2, 412 | "strokeStyle": "solid", 413 | "roughness": 2, 414 | "opacity": 100, 415 | "angle": 0, 416 | "x": 533.4525865827288, 417 | "y": 200.80193111503465, 418 | "strokeColor": "#1e1e1e", 419 | "backgroundColor": "#1e1e1e", 420 | "width": 124.28564453124989, 421 | "height": 162.36959792685084, 422 | "seed": 1093287892, 423 | "groupIds": [], 424 | "frameId": null, 425 | "roundness": { 426 | "type": 2 427 | }, 428 | "boundElements": [], 429 | "updated": 1707020748192, 430 | "link": null, 431 | "locked": false, 432 | "startBinding": { 433 | "elementId": "nP9VWYhaABRz5hmytUl0y", 434 | "focus": -0.7724945826664876, 435 | "gap": 15.6666259765625 436 | }, 437 | "endBinding": { 438 | "elementId": "Ca4e_D02zm8-sXZ-yZjw3", 439 | "focus": 0.9544614279184964, 440 | "gap": 12.333404541015625 441 | }, 442 | "lastCommittedPoint": null, 443 | "startArrowhead": null, 444 | "endArrowhead": "arrow", 445 | "points": [ 446 | [ 447 | 0, 448 | 0 449 | ], 450 | [ 451 | 69.80934361049094, 452 | 52.471887854691914 453 | ], 454 | [ 455 | -54.476300920758945, 456 | 162.36959792685084 457 | ] 458 | ] 459 | }, 460 | { 461 | "type": "text", 462 | "version": 159, 463 | "versionNonce": 46794677, 464 | "isDeleted": false, 465 | "id": "FuUjZ-ZLMEqSa30VxsHsu", 466 | "fillStyle": "solid", 467 | "strokeWidth": 2, 468 | "strokeStyle": "solid", 469 | "roughness": 2, 470 | "opacity": 100, 471 | "angle": 0, 472 | "x": 294.0238930838449, 473 | "y": 171.70239475795194, 474 | "strokeColor": "#1e1e1e", 475 | "backgroundColor": "#1e1e1e", 476 | "width": 207.15625, 477 | "height": 35, 478 | "seed": 1588996588, 479 | "groupIds": [], 480 | "frameId": null, 481 | "roundness": null, 482 | "boundElements": [], 483 | "updated": 1707020680952, 484 | "link": null, 485 | "locked": false, 486 | "fontSize": 28, 487 | "fontFamily": 1, 488 | "text": "Generator生成器", 489 | "textAlign": "left", 490 | "verticalAlign": "top", 491 | "containerId": null, 492 | "originalText": "Generator生成器", 493 | "lineHeight": 1.25, 494 | "baseline": 27 495 | } 496 | ], 497 | "appState": { 498 | "gridSize": null, 499 | "viewBackgroundColor": "#ffffff" 500 | }, 501 | "files": {} 502 | } -------------------------------------------------------------------------------- /practice.md: -------------------------------------------------------------------------------- 1 | ## 操作实践 2 | - [Mastering RAG: How To Architect An Enterprise RAG System](https://www.rungalileo.io/blog/mastering-rag-how-to-architect-an-enterprise-rag-system#multi-tenancy) 3 | - [构建企业级 RAG 系统的高级指南 [译]](https://baoyu.io/translations/rag/mastering-rag-how-to-architect-an-enterprise-rag-system) 4 | - [10 Lessons from Developing an AI Chatbot Using Retrieval-Augmented Generation](https://www.fiddler.ai/resources/10-lessons-from-developing-an-ai-chatbot-using-retrieval-augmented-generation) 5 | - [Building RAG from Scratch (Lower-Level)](https://docs.llamaindex.ai/en/stable/optimizing/building_rag_from_scratch.html) 6 | - [A Simple Guide To Retrieval Augmented Generation Language Models](https://www.smashingmagazine.com/2024/01/guide-retrieval-augmented-generation-language-models/?utm_campaign=meetedgar&utm_medium=social&utm_source=meetedgar.com) 7 | - [检索增强生成语言模型的简单指南](https://tczjw7bsp1.feishu.cn/docx/YOKCdqBwXoMSIAxU9w2cx3tCngg) 8 | - [A beginner’s guide to building a Retrieval Augmented Generation (RAG) application from scratch](https://medium.com/@wachambers/a-beginners-guide-to-building-a-retrieval-augmented-generation-rag-application-from-scratch-e52921953a5d) 9 | - [从头开始构建检索增强生成 (RAG) 应用程序的初学者指南](https://tczjw7bsp1.feishu.cn/docx/QobodfPJjoincexb7Yyc7jxLnUh) 10 | - [5 Common Challenges Implementing Retrieval Augmented Generation (RAG)](https://pureinsights.com/blog/2024/five-common-challenges-when-implementing-rag-retrieval-augmented-generation/) 11 | - [实施检索增强生成 (RAG) 的 5 个常见难题](https://tczjw7bsp1.feishu.cn/docx/KimodLgdDodECaxaApocJDG2n45) 12 | - [Retrieval-Augmented Generation (RAG): From Theory to LangChain Implementation](https://towardsdatascience.com/retrieval-augmented-generation-rag-from-theory-to-langchain-implementation-4e9bd5f6a4f2) 13 | - [中译版 检索增强生成(RAG):从理论到 LangChain 实践](https://baoyu.io/translations/rag/retrieval-augmented-generation-rag-from-theory-to-langchain-implementation) 14 | - [A Guide on 12 Tuning Strategies for Production-Ready RAG Applications](https://towardsdatascience.com/a-guide-on-12-tuning-strategies-for-production-ready-rag-applications-7ca646833439) 15 | - [12 种调整策略指南:为生产环境打造高效的 RAG 应用](https://baoyu.io/translations/rag/a-guide-on-12-tuning-strategies-for-production-ready-rag-applications) 16 | 17 | - [Building Performant RAG Applications for Production](https://docs.llamaindex.ai/en/stable/optimizing/production_rag.html) 18 | - [构建用于生产环境的高性能 RAG 应用程序](https://tczjw7bsp1.feishu.cn/wiki/VT5qwPOwQimGAqkzAVWc1PQmnfe?from=from_copylink) 19 | - [Practical Considerations in RAG Application Design](https://pub.towardsai.net/practical-considerations-in-rag-application-design-b5d5f0b2d19b) 20 | - [RAG 应用程序设计中的实用注意事项](https://tczjw7bsp1.feishu.cn/docx/QODydp3wSo3QohxZwZucIbL8nHc?from=from_copylink) 21 | - [Building RAG-based LLM Applications for Production](https://www.anyscale.com/blog/a-comprehensive-guide-for-building-rag-based-llm-applications-part-1#reranking-experiments) 22 | - [搭建基于RAG的用于生产环境的LLM应用](https://tczjw7bsp1.feishu.cn/docx/MJnPdkuTnoN5TYxqzHecNTUEnee?from=from_copylink) 23 | - [Why Your RAG is Not Reliable in a Production ](https://webcache.googleusercontent.com/search?q=cache:https://towardsdatascience.com/why-your-rag-is-not-reliable-in-a-production-environment-9e6a73b3eddb) 24 | - [为什么你的RAG应用在生产环境中不可靠](https://tczjw7bsp1.feishu.cn/docx/RjsCdsDbro6JxExAeWPcgap1nTc?from=from_copylink) 25 | - [Why do RAG pipelines fail? Advanced RAG Patterns — Part1](https://cloudatlas.me/why-do-rag-pipelines-fail-advanced-rag-patterns-part1-841faad8b3c2) 26 | - [为什么 RAG 流水线会失败?高级 RAG 模式 — 第 1 部分 ](https://tczjw7bsp1.feishu.cn/docx/KHkwdRrg9oAcd1xTNMDcsmBqnSp?from=from_copylink) 27 | - [How to improve RAG peformance — Advanced RAG Patterns — Part2](https://cloudatlas.me/how-to-improve-rag-peformance-advanced-rag-patterns-part2-0c84e2df66e6) 28 | - [如何提高 RAG 性能 — 高级 RAG 模式](https://tczjw7bsp1.feishu.cn/docx/H5pDd8g8Lo2wanxuUaGcCkEjnYg?from=from_copylink) 29 | - [Multi-Modal RAG](https://blog.llamaindex.ai/multi-modal-rag-621de7525fea) 30 | - [多模态RAG](https://tczjw7bsp1.feishu.cn/docx/OwXadpyWIopYc5xNvv9cErEZnLc?from=from_copylink) 31 | - [10 Ways to Improve the Performance of Retrieval Augmented Generation Systems](https://towardsdatascience.com/10-ways-to-improve-the-performance-of-retrieval-augmented-generation-systems-5fa2cee7cd5c) 32 | - [提高检索增强生成(RAG)系统性能的 10 种方法](https://tczjw7bsp1.feishu.cn/docx/ChhJdoSH8oLIHix6Nr6cZE12nqg) 33 | - [The Complete Guide to Retrieval Augmented Generation (RAG)](https://webcache.googleusercontent.com/search?q=cache:https://medium.com/@alcarazanthony1/the-complete-guide-to-retrieval-augmented-generation-rag-3ce54a57d8be) 34 | - [检索增强生成(RAG)完整指南](https://tczjw7bsp1.feishu.cn/wiki/WKawwO7lmir7BqkH39jcz4hdnAe) 35 | - [Crafting Knowledgeable AI with Retrieval Augmentation: A Guide to Best Practices](https://webcache.googleusercontent.com/search?q=cache:https://ai.plainenglish.io/crafting-knowledgeable-ai-with-retrieval-augmentation-a-guide-to-best-practices-33c84626be1e) 36 | - [使用检索增强打造知识渊博的 AI:最佳实践指南](https://tczjw7bsp1.feishu.cn/docx/TEXbdfcYToU4QFxSeJzcTDRTnMe?from=from_copylink) 37 | - [Optimizing RAG for LLMs Apps ](https://medium.com/@bijit211987/optimizing-rag-for-llms-apps-53f6056d8118) 38 | - [优化 RAG服务于为 LLM 应用](https://tczjw7bsp1.feishu.cn/docx/ES1PdAve3ocNb0x9pU3cNOtDngG) 39 | - [Fueling the RAG Engine : The Data Flywheel](https://webcache.googleusercontent.com/search?q=cache:https://medium.com/@alcarazanthony1/fueling-the-rag-engine-the-data-flywheel-fc958c6d68d8) 40 | - [为 RAG 引擎提供动力:数据飞轮](https://tczjw7bsp1.feishu.cn/docx/S4bodAeEuovzHDxQHMccqEUinnb?from=from_copylink) 41 | - [How Self-RAG Could Revolutionize Industrial LLMs](https://webcache.googleusercontent.com/search?q=cache:https://towardsdatascience.com/how-self-rag-could-revolutionize-industrial-llms-b33d9f810264) 42 | - [Self-RAG 如何彻底改变行业LLM ](https://tczjw7bsp1.feishu.cn/docx/KoZ6dCtG9oBG8KxtclgcSE4HnKu?from=from_copylink) 43 | - [Best practices for your ChatGPT ‘on your data’ solution](https://medium.com/@imicknl/how-to-improve-your-chatgpt-on-your-data-solution-d1e842d87404) 44 | - [您的 ChatGPT "数据 "解决方案的最佳实践 ](https://tczjw7bsp1.feishu.cn/wiki/ZkrXwLfKui9VeskV6b7crHHwncJ?from=from_copylink) 45 | - [How an LLM Chatbot Works: Exploring Chat with Retrieval-Augmented Generation (RAG)](https://tczjw7bsp1.feishu.cn/docx/FQGcda7PDo307Zx3BF0cdX2SnKe?from=from_copylink) 46 | -[Pinecone-Retrieval Augmented Generation (RAG): Reducing Hallucinations in GenAI Applications ](https://www.pinecone.io/learn/retrieval-augmented-generation/) 47 | - [检索增强生成(RAG):减少生成式AI应用的幻觉问题](https://tczjw7bsp1.feishu.cn/wiki/C7YcwmAp7iNa0TkTTUAcS6evn8e?from=from_copylink) 48 | - [RAG for Everyone: A Beginner’s Guide to Embedding & Similarity Search](https://blog.gopenai.com/rag-for-everyone-a-beginners-guide-to-embedding-similarity-search-and-vector-db-423946475c90) 49 | - [RAG适用于所有人:嵌入和相似性搜索初学者指南](https://tczjw7bsp1.feishu.cn/wiki/K4l1wWHMyiAqkskGBJwcs4W5n14?from=from_copylink) 50 | - [Retrieval Augmented Generation: Grounding AI Responses in Factual Data](https://medium.com/@minh.hoque/retrieval-augmented-generation-grounding-ai-responses-in-factual-data-b7855c059322) 51 | - [检索增强生成:将 AI 响应建立在事实数据的基础上 ](https://tczjw7bsp1.feishu.cn/wiki/OJkFwPDhgilHD4k9RrdcE0QCnTh?from=from_copylink) 52 | - [Leveraging LLMs on your domain-specific knowledge base](https://www.ml6.eu/blogpost/leveraging-llms-on-your-domain-specific-knowledge-base) 53 | - [在您的特定领域知识库上利用LLM](https://tczjw7bsp1.feishu.cn/wiki/SqfIwjdEGiHNEgk4o46ceuFJnOd?from=from_copylink) 54 | - [Build More Capable LLMs with Retrieval Augmented Generation](https://webcache.googleusercontent.com/search?q=cache:https://towardsdatascience.com/build-more-capable-llms-with-retrieval-augmented-generation-99d5f86e9779) 55 | -[通过检索增强生成构建功能更强大的 LLM](https://tczjw7bsp1.feishu.cn/wiki/SOL0wWptTihTUQk3Eogc4NpHnmc?from=from_copylink) 56 | - [LLM’s for Enterprises- Generative Q&A on Your Private Knowledge Base](https://webcache.googleusercontent.com/search?q=cache:https://medium.com/towards-generative-ai/llms-for-enterprises-architecture-for-generative-q-a-on-your-private-knowledge-base-a7c2e07690e8) 57 | - [LLM for Enterprise – 您的私人知识库上的生成问答](https://tczjw7bsp1.feishu.cn/wiki/RZIdwMpMti64PEkxzp1cdOewnze?from=from_copylink) 58 | - [Retrieval Augmented Generation (RAG) & LLM: Examples](https://vitalflux.com/retrieval-augmented-generation-rag-llm-examples/) 59 | - [检索增强生成(RAG)和LLM:示例](https://vitalflux.com/retrieval-augmented-generation-rag-llm-examples/) 60 | - [RAG Pipeline modeling](https://uxplanet.org/rag-pipeline-modeling-011e3e6cc803) 61 | - [RAG流水线模型](https://tczjw7bsp1.feishu.cn/docx/A5JFd3vcGokY94xcNogcfuNSnJb?from=from_copylink) 62 | - [Optimizing RAG for LLMs Apps](https://medium.com/@bijit211987/optimizing-rag-for-llms-apps-53f6056d8118) 63 | - [NVIDIA Advanced Document Question-Answering with LlamaIndex](https://github.com/NVIDIA/GenerativeAIExamples/blob/main/notebooks/04_llamaindex_hier_node_parser.ipynb) -------------------------------------------------------------------------------- /resource/Building RAG with LLMs and Prompts-LlamaIndex Prompt Engineering Tutorial (FlowGPT).pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizhe2004/Awesome-LLM-RAG-Application/50c222f1de90911ddcb986aa9b061c4435e30cf3/resource/Building RAG with LLMs and Prompts-LlamaIndex Prompt Engineering Tutorial (FlowGPT).pptx -------------------------------------------------------------------------------- /resource/Building, Evaluating, and Optimizing your RAG App for Production.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizhe2004/Awesome-LLM-RAG-Application/50c222f1de90911ddcb986aa9b061c4435e30cf3/resource/Building, Evaluating, and Optimizing your RAG App for Production.pdf -------------------------------------------------------------------------------- /resource/ChatGLM + LangChain 实践培训.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizhe2004/Awesome-LLM-RAG-Application/50c222f1de90911ddcb986aa9b061c4435e30cf3/resource/ChatGLM + LangChain 实践培训.pdf -------------------------------------------------------------------------------- /resource/Evaluating and Optimizing your RAG App-LlamaIndex Talk (AI Conference).pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizhe2004/Awesome-LLM-RAG-Application/50c222f1de90911ddcb986aa9b061c4435e30cf3/resource/Evaluating and Optimizing your RAG App-LlamaIndex Talk (AI Conference).pptx -------------------------------------------------------------------------------- /resource/LlamaIndex Prompt Engineering Tutorial (FlowGPT).pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizhe2004/Awesome-LLM-RAG-Application/50c222f1de90911ddcb986aa9b061c4435e30cf3/resource/LlamaIndex Prompt Engineering Tutorial (FlowGPT).pptx -------------------------------------------------------------------------------- /resource/LlamaIndex Talk (AI User Conference).pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizhe2004/Awesome-LLM-RAG-Application/50c222f1de90911ddcb986aa9b061c4435e30cf3/resource/LlamaIndex Talk (AI User Conference).pptx -------------------------------------------------------------------------------- /resource/Prompting-RAGs-Fine-tuning.md: -------------------------------------------------------------------------------- 1 | # Prompting vs RAGs vs Fine-tuning: 2 | 3 | An important decision that every AI Engineer must make when building an LLM-based application. 4 | 5 | To understand what guides the decision, let's first understand the meaning of these terms. 6 | 7 | ## 1️⃣ Prompting Engineering: 8 | 9 | The prompt is the text input that you provide, based on which the LLM generates a response. 10 | 11 | It's basically a refined input to guide the model's output. 12 | 13 | The output will be based on the existing knowledge the LLMs has. 14 | 15 | ## 2️⃣ RAGs (Retrieval-Augmented Generation): 16 | 17 | When you combine prompt engineering with database querying for context-rich answers, we call it RAG. 18 | 19 | The generated output will be based on the knowledge available in the database. 20 | 21 | ## 3️⃣ Finetuning 22 | 23 | Finetuning means adjusting parameters of the LLM using task-specific data, to specialise in a certain domain. 24 | 25 | For instance, a language model could be finetuned on medical texts to become more adept at answering healthcare-related questions. 26 | 27 | It's like giving additional training to an already skilled worker to make them an expert in a particular area. 28 | 29 | Back to the important question, how do we decide what approach should be taken! 30 | 31 | (refer the image below as you read ahead) 32 | ![](http://imgs.huahuaxia.net/picgo/20231227105350.png) 33 | 34 | ❗️There are two important guiding parameters, first one is Requirement of external knowledge, second is requirements of model adaptation. 35 | 36 | ❗️While the meaning of former is clear, model adaption means changing the behaviour of model, it's vocabulary, writing style etc. 37 | 38 | For example: a pretrained LLM might find it challenging to summarize the transcripts of company meetings, because they might be using some internal vocabulary in between. 39 | 40 | 🔹So finetuning is more about changing structure (behaviour) than knowledge, while it's other way round for RAGs. 41 | 42 | 🔸You use RAGs when you want to generate outputs grounded to a custom knowledge base while the vocabulary & writing style of the LLM remains same. 43 | 44 | 🔹If you don't need either of them, prompt engineering is the way to go. 45 | 46 | 🔸And if your application need both custom knowledge & change in the behaviour of model a hybrid (RAGs + Finetuning) is preferred. 47 | 48 | 49 | 提示工程、RAGs 与微调的对比: 50 | 51 | 这是每位搭建基于大语言模型(LLM)应用的 AI 工程师都面临的关键选择。 52 | 53 | 要理解这个决策的指导原则,我们首先得明白这些术语的含义。 54 | 55 | 1️⃣ 提示工程: 56 | 57 | 所谓提示,指的是你输入的文本,大语言模型就根据这个输入来生成回应。 58 | 59 | 这实际上是一种精确的输入方法,旨在引导模型产生相应的输出。 60 | 61 | 模型的输出将基于其已有的知识。 62 | 63 | 2️⃣ RAGs(检索增强生成): 64 | 65 | 当你将提示工程与数据库查询结合,以获得含丰富上下文的答案时,这就是所谓的 RAG。 66 | 67 | 生成的输出将基于数据库中现有的知识。 68 | 69 | 3️⃣ 微调: 70 | 71 | 微调是指使用特定任务的数据调整大语言模型的参数,使其在某一领域内专业化。 72 | 73 | 比如,一个语言模型可以在医学文献上进行微调,从而更擅长回答健康护理相关的问题。 74 | 75 | 这就好比对一位已经技艺娴熟的工人进行额外培训,让他们在特定领域成为专家。 76 | 77 | 那么,我们如何决定采取哪种方法呢? 78 | 79 | (阅读下文时请参考下面的图片) 80 | 81 | ❗️有两个关键的指导参数,一个是对外部知识的需求,另一个是模型适应性的需求。 82 | 83 | ❗️尽管前者的含义较为明确,模型适应性则意味着改变模型的行为、词汇、写作风格等。 84 | 85 | 例如,一个预训练的大语言模型可能在总结公司会议记录时遇到挑战,因为会议中可能穿插了一些特定的内部术语。 86 | 87 | 🔹因此,微调更多的是关于改变结构(行为)而非知识,而对于 RAGs 则正好相反。 88 | 89 | 🔸当你需要生成基于定制知识库的输出,同时保持大语言模型的词汇和写作风格不变时,你可以选择使用 RAGs。 90 | 91 | 🔹如果你不需要上述任一功能,那么提示工程就是你的选择。 92 | 93 | 🔸如果你的应用既需要定制知识又需要改变模型的行为,那么采用混合方案(RAGs + 微调)将是更佳选择。 94 | -------------------------------------------------------------------------------- /resource/RAG_Slide_ENG.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizhe2004/Awesome-LLM-RAG-Application/50c222f1de90911ddcb986aa9b061c4435e30cf3/resource/RAG_Slide_ENG.pdf -------------------------------------------------------------------------------- /resource/devvai-rag.md: -------------------------------------------------------------------------------- 1 | RAG 的全称是:Retrieval Augmented Generation(检索增强生成) 2 | 3 | 最初来源于 2020 年 Facebook 的一篇论文:Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks(是的,你没有看错,2020 年就有这项技术了)。 4 | ![](http://imgs.huahuaxia.net/picgo/20231227110337.png) 5 | 这篇论文要解决的一个问题非常简单:如何让语言模型使用外部知识(external knowledge)进行生成。 6 | 7 | 通常,pre-train 模型的知识存储在参数中,这就导致了模型不知道训练集之外的知识(例如搜索数据、行业的 knowledge)。 8 | 9 | 之前的做法是有新的知识就再重新在 pre-train 的模型上 finetune。 10 | 这样的方式会有几个问题: 11 | 12 | 1. 每次有新的知识后都需要进行 finetune 13 | 2. 训练模型的成本是很高的 14 | 15 | 于是这篇论文提出了 RAG 的方法,pre-train 的模型是能够理解新的知识的,那么我们直接把要让模型理解的新知识通过 prompt 的方式给它即可。 16 | 所以一个最小的 RAG 系统就是由 3 个部分组成的: 17 | 18 | 1. 语言模型 19 | 2. 模型所需要的外部知识集合(以 vector 的形式存储) 20 | 3. 当前场景下需要的外部知识 21 | ![](http://imgs.huahuaxia.net/picgo/20231227110421.png) 22 | langchain, llama-index 本质上就是做的这套 RAG 系统(当然还包括构建在 RAG 上的 agent)。 23 | 24 | 如果理解了本质,其实是没有必要再额外增加一层抽象的,根据自己的业务情况来搭建这套系统即可。 25 | 26 | 例如,我们为了保持高性能,采用了 Go + Rust 的架构,能够支持高并发的 RAG 请求。 27 | 28 | 把问题简化,不管是搭建什么样的 RAG,优化这套系统就是分别优化这 3 个模块。 29 | 1)语言模型 30 | 31 | 为什么 2020 年的这篇论文直到今年才火起来?一个主要的原因就是之前的基座模型能力不够。 32 | 33 | 如果底层模型很笨,那么即使给到了 丰富的外部知识,模型也不能基于这些知识进行推演。 34 | 35 | 从论文的一些 benchmark 上也可以看出效果有提升,但是并没有特别显著。 36 | ![](http://imgs.huahuaxia.net/picgo/20231227110500.png) 37 | 1.1)GPT-3 的出现第一次让 RAG 变得可用 38 | 39 | 第一波基于 RAG + GPT-3 的公司都获得了非常高的估值 & ARR(年经常性收入): 40 | 41 | - Copy AI 42 | - Jasper 43 | 44 | 这两个都是构建营销领域 RAG 的产品,曾经一度成为明星 AI 独角兽,当然现在祛魅之后估值也大幅度缩水。 45 | 1.2)2023 年以来,出现了大量的开源 & 闭源的基座模型,基本上都能够在上面构建 RAG 系统 46 | 47 | 最常见的方式就是: 48 | 49 | - GPT-3.5/4 + RAG(闭源方案) 50 | - Llama 2 / Mistral + RAG(开源方案) 51 | - 2)模型所需要的外部知识集合 52 | 53 | 现在应该大家都了解了 embedding 模型了,包括 embedding 数据的召回。 54 | 55 | embedding 本质上就是把数据转化为向量,然后通过余弦相似度来找到最匹配的两个或多个向量。 56 | 57 | knowledge -> chunks -> vector 58 | user query -> vector 59 | ![](http://imgs.huahuaxia.net/picgo/20231227110542.png) 60 | 2.1)这个模块分成两个部分: 61 | 62 | 1. embedding 模型 63 | 2. 存储 embedding vector 的数据库 64 | 65 | 前者基本上都使用 OpenAI 的 embedding 模型,后者可选方案非常多,包括 Pinecone,国内团队的 Zilliz,开源的 Chroma,在关系型数据库上构建的 pgvector 等。 66 | 2.2)这些做 embedding 数据库的公司也在这一波 AI Hype 中获得了非常高的融资额和估值。 67 | 68 | 但是从第一性原理思考,模块 2 个目的是为了存储外部的知识集合,并在需要的时候进行召回。 69 | 70 | 这一步并不一定需要 embedding 模型,传统的搜索匹配在某些场景下可能效果更好(Elasticsearch)。 71 | 2.3)http://devv.ai 采用的方式是 embedding + 传统的 relation db + Elasticsearch。 72 | 73 | 并在每个场景下都做了很多优化,一个思路是在 encoding knowledge 的时候做的工作越多,在 retrieve 的时候就能够更快 & 更准确(先做工 & 后做工的区别)。 74 | 75 | 2.4)我们使用 Rust 构建了整套 knowledge index 76 | 77 | 包括: 78 | - GitHub 代码数据 79 | - 开发文档数据 80 | - 搜索引擎数据 81 | 3)更好地召回当前场景下需要的外部知识 82 | 83 | 根据优先做工的法则,我们在 encoding 的时候对于原始的 knowledge 数据做了很多处理: 84 | 85 | - 对代码进行程序分析 86 | - 对开发文档进行逻辑级别的 chunk 分块 87 | - 对网页信息的提取 & page ranking 优化 88 | 3.1)做完了上面的工作之后保证了我们在 retrieve 的时候获取到的数据本身就是结构化的了,不需要做太多的处理,而且可以提升召回的准确率。 89 | 现在再来看 a16z 的这张图,就是在每个步骤上扩展出了对应的组件,核心本质并没有变。 90 | https://a16z.com/emerging-architectures-for-llm-applications/ 91 | ![](http://imgs.huahuaxia.net/picgo/20231227110644.png) 92 | 2022 年基于这套 RAG system 做的搜索引擎 Perplexity 每个月已经拥有了几千万的流量,LangChain 也获得了几亿美金的估值。 93 | 不管是通用的 RAG,还是专有的 RAG,这是一个做得马马虎虎很容易的领域,但是要做到 90 分很难。 94 | 95 | 每一步骤都没有最佳实践,例如 embedding chunk size,是否需要接搜索引擎,都需要根据实际的业务场景来多试。 96 | 97 | 相关的论文非常多,但是并不是每篇论文里面提到的方法都是有用的。 98 | 99 | 100 | 101 | # 第二部分 102 | 想要优化整个系统,就可以把问题分解为优化这个系统的每个部分。 103 | 104 | 但是优化一个基于 LLM 的系统的难点在于,这个系统本质上是一个黑盒,没有一套有效的评估手段。 105 | 106 | 如果连最基础的 benchmark 也没有,怎么提升对应的指标也就是空谈了。 107 | 所以我们要做的第一件事就是先建立对整个 RAG 系统的评估体系。 108 | 109 | 来自 Stanford 的这篇论文主要做的就是这个工作,评估生成式搜索引擎的可验证性。 110 | 111 | Evaluating Verifiability in Generative Search Engines 112 | 113 | https://arxiv.org/abs/2304.09848 114 | ![image](https://github.com/lizhe2004/Awesome-LLM-RAG-Application/assets/6104435/6d2ff3fc-d9c7-42de-9fda-ea78c22446a7) 115 | 这篇论文虽然是用来评测 Generative Search Engine(生成式搜索引擎),但是也完全可以把其中的方法应用到 RAG 上,本质上 Generative Search Engine 算是 RAG 的一个子集,还有针对于特定领域数据的 RAG 系统。 116 | 论文中提到了一个值得信赖的 Generative Search Engine 的先决条件就是:可验证性(verifiability)。 117 | 118 | 我们都知道 LLM 经常会一本正经的胡说八道(幻觉,hallucination),生成一些看似对,实则错的内容。 119 | 120 | 而 RAG 的一个优势就是给模型提供了参考资料,让模型降低幻觉的概率。 121 | 而这个幻觉降低了多少,就可以用 verifiability 这个指标来进行评估。 122 | 123 | 理想的 RAG 系统应该是: 124 | 125 | - 高引用召回率(high citation recall),即所有的生成内容都有引用(外部知识)充分支持 126 | - 高引用精度(high citation precision),即每个引用是否真的支持生成的内容 127 | 实际上这两个指标不可能做到 100%,根据论文中的实验结果,现有的 Generative Search Engine 生成的内容经常包含无据陈述和不准确的引文,这两个数据分别是 51.5% 和 74.5%。 128 | 129 | 简单来说,就是生成的内容和外部的知识不匹配。 130 | ![image](https://github.com/lizhe2004/Awesome-LLM-RAG-Application/assets/6104435/5dd04d98-64fc-4306-a24b-bc306a761bb8) 131 | 论文对 4 个主流的 Generative Search Engine 进行了评估: 132 | 133 | - Bing Chat 134 | - NeevaAI(已经被 Snowflake 收购) 135 | - Perplexity 136 | - YouChat 137 | 138 | 评测的问题来自不同的主题和领域。 139 | ![image](https://github.com/lizhe2004/Awesome-LLM-RAG-Application/assets/6104435/3207c46a-f39f-46cd-babb-83fb470ee057) 140 | 141 | 采用了 4 个指标来进行评估: 142 | 143 | 1. fluency,流畅性,生成的文本是否流畅连贯 144 | 2. perceived utility,实用性,生成的内容是否有用 145 | 3. citation recall,引文召回率,所生成的内容完全得到引文支持的比例 146 | 4. citation precision,引文精度,引文中支持生成内容的比例 147 | ![image](https://github.com/lizhe2004/Awesome-LLM-RAG-Application/assets/6104435/f6125b65-c594-4158-b0ec-5120f4de5102) 148 | 指标 1 和 2 通常是基本条件,如果连这个都不满足整个 RAG 系统就没什么意义了(话讲不清再准确也没有用)。 149 | 150 | 一个优秀的 RAG 系统应该在 citation recall 和 citation precision 上获得比较高的评分。 151 | 具体的评价框架是如何实现的? 152 | 153 | 这一部分用了一点初中数学的知识,详细的过程可以直接参考论文原文。 154 | 155 | 整个实验的评测方式是使用「人为」的评测方式。 156 | ![image](https://github.com/lizhe2004/Awesome-LLM-RAG-Application/assets/6104435/da70c16e-f95e-4beb-b00f-baad70db4cca) 157 | 1)评测流畅性和实用性 158 | 159 | 给评测者对应的评测指标,例如 xxx 算是流畅的,并用 five-point Likert 量表来进行计算,从 Strongly Disagree 到 Strongly Agree。 160 | 161 | 并且让评测者对「The response is a helpful and informative answer to the query」这个说法的同意程度进行打分。 162 | 2)评测引文召回(Citation Recall) 163 | 164 | 引文召回率是指:得到引文支持的生成内容 / 值得验证的生成内容 165 | 166 | 因此,计算召回率需要: 167 | 168 | 1. 识别生成内容中值得验证的部分 169 | 2. 评估每个值得验证的内容是否得到相关引文支持 170 | 什么是「值得验证」,可以简单理解为是生成内容中包含信息的部分,实践中,几乎所有的生成内容都可以看做是值得验证的内容,所以这个召回率可以近似等于: 171 | 172 | 召回率 = 引文支持的生成内容 / 总的生成内容 173 | 3)测量引文精度(Citation Precision) 174 | 175 | 引文精度是指生成的引文中支持其相关陈述的比例。如果生成的内容为每个生成的语句引用了互联网上所有的网页,那么引文召回率就会很高,但是引文精度会很低,因为很多文章都是无关紧要的,并不支持生成的内容。 176 | 比如说 Bing Chat 等之类的 AI 搜索引擎在使用中文进行询问的时候,会引用很多 CSDN、知乎、百度知道中的内容,在引文召回率上是很高的,甚至有时候每句生成的内容都有对应的引用,但是引文的精度却很低,大部分引文不能支持生成的内容,或者质量很差。 177 | http://devv.ai 就在引文精度上做了很多优化,尤其是针对于多语言的场景。在使用中文提问的前提下,精度是要显著优于 Perplexity、Bing Chat、Phind 等产品的。 178 | 具体的引用精度的计算方法这里就不赘述了,可以参考论文中的描述。 179 | 有了引文召回率和引文精度之后,我们就可以计算出 Citation F 这个最终指标了(调和平均数)。 180 | 181 | 要实现高 F,整个系统必须拥有高引文精度和高引文召回率。 182 | ![image](https://github.com/lizhe2004/Awesome-LLM-RAG-Application/assets/6104435/83aa8b10-843d-45d8-83a3-4776596f69b8) 183 | 关于 Harmonic Mean(调和平均数) 184 | https://devv.ai/en/search?threadId=d6xolrry09vk 185 | ![image](https://github.com/lizhe2004/Awesome-LLM-RAG-Application/assets/6104435/9abbb119-e029-47f5-b1e8-bb70133ee426) 186 | 上面就是整套的对 RAG 系统可验证性的评估方法。 187 | 188 | 有了这套评测系统,每次 RAG 优化了之后就可以重新跑一遍评测集,来确定相关指标的变化,这样就可以宏观上来判断整个 RAG 系统是在变好还是在变差了。 189 | 190 | 另外分享一下 http://devv.ai 在使用这套系统时的一些实践: 191 | 192 | 1)评测集 193 | 194 | 评测集的选定应该与 RAG 对应的场景所吻合,例如 http://devv.ai 所选择的评测均为和编程相关,并增加了很多多语言的评测集。 195 | 2)自动化评测框架 196 | 197 | 论文中所采用的还是 human evaluation 的方法,例如论文中使用了 34 个评测人员参与评测。 198 | 199 | 缺点是: 200 | 201 | 1. 耗费人力和时间 202 | 2. 样本量较少,存在一定的误差 203 | 所以针对工业级场景,我们在构建一套自动化的评测框架(Evaluation Framework)。 204 | 205 | 核心的思路是: 206 | 1. 基于 llama 2 训练一个评测模型(验证召回率和引文精度) 207 | 2. 构建大量的评测集,并且根据线上的数据自动抽样生成评测集 208 | 3. RAG 核心模块改动后,会有 CI 自动运行整个评测框架,并生成数据埋点和报表 209 | 采用这种方法,可以非常高效地进行测试和改进,例如对于 prompt 的改动,可以快速开一个 a/b 实验,然后不同的实验组跑一遍评测框架,得到最终的结果。 210 | 211 | 目前这套框架还在内部构建 & 实验中,未来可能会考虑开源对应的评测模型和框架代码。(感觉光这个评测框架就可以开一个新的 startup 了) 212 | -------------------------------------------------------------------------------- /resource/docugamiwebinar-llmsinproduction-230920071519-179a639f.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizhe2004/Awesome-LLM-RAG-Application/50c222f1de90911ddcb986aa9b061c4435e30cf3/resource/docugamiwebinar-llmsinproduction-230920071519-179a639f.pdf -------------------------------------------------------------------------------- /resource/中文问答系统技术及应用.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizhe2004/Awesome-LLM-RAG-Application/50c222f1de90911ddcb986aa9b061c4435e30cf3/resource/中文问答系统技术及应用.pdf -------------------------------------------------------------------------------- /resource/利用+LLM+改善研发过程里答疑体验-段潇涵.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizhe2004/Awesome-LLM-RAG-Application/50c222f1de90911ddcb986aa9b061c4435e30cf3/resource/利用+LLM+改善研发过程里答疑体验-段潇涵.pdf -------------------------------------------------------------------------------- /resource/基于+RAG+构建生成式+AI+应用最佳实践与+避坑指南-李元博.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizhe2004/Awesome-LLM-RAG-Application/50c222f1de90911ddcb986aa9b061c4435e30cf3/resource/基于+RAG+构建生成式+AI+应用最佳实践与+避坑指南-李元博.pdf --------------------------------------------------------------------------------