面包屑图标 当前位置: 首页
AI资讯
热点详情

一个全面先进公平且模块化的开源RAG框架

AI热点日报
AI热点日报时间:2026-06-23
热点解读

RAGLAB是模块化开源RAG框架,复现6种先进算法,在10个基准测试上实现公平横向比较。其模块化架构支持检索器、生成器和指令的灵活替换,集成多种语料库和训练工具,有效解决算法缺乏统一比较和工具黑箱问题。

要说 RAG 发展路上卡在哪,其实就两个关键问题。

第一,各种新型 RAG 算法之间,始终缺少一种全面且公平的横向比较。你用你的配置,我跑我的benchmark,结果放在一起根本没法直接对话。第二,LlamaIndex 和 LangChain 这些开源工具虽然好用,但它们做了太高级的抽象封装。这玩意儿的副作用就是内部逻辑成了黑箱,透明度严重缺失。想在上面折腾新算法、开发新评估指标?那可就费劲了。

这正是 RAGLAB 要解决的事。它是一个模块化的开源库,一口气复现了 6 种先进算法,给研究 RAG 算法的人搭了一个全面的生态系统。基于 RAGLAB,已经有人在 10 个不同的基准测试上,对这 6 种算法做了公平的对比。有了这玩意儿,研究人员既能高效地横向比较不同算法的性能,也能顺手开发新算法

不同 RAG 库和框架的比较

这里需要先厘清一个概念。所谓的公平比较,说白了就是在评估过程中,把所有基本组件都对齐到同一个起跑线上——随机种子、生成器、检索器,甚至你给模型的指令(instruction)都得统一。而数据收集器,就是指有没有能力去收集或生成训练和测试数据,比如从现有的原始数据集里抽个样,或者直接拿 LLM 来构建标注数据。

回到 RAGLAB。它的模块化架构,让你能像搭积木一样,轻松替换和扩展算法的各个组成部分:检索器(retriever)生成器(generator)指令(instruction)

RAGLAB 框架的架构和组件

具体拆开来看,RAGLAB 的核心组件包括这么几块:

  • 检索器(Retriever):集成了 Contriever 和 ColBERT 这类基于 BERT 的模型,统一了查询接口,还搞了个客户端-服务器架构,配合检索缓存机制。简单说,就是查得快,还不容易打架。

  • 语料库(Corpus):直接提供了预处理好的 Wikipedia 语料库,包括 2018 年和 2023 年两个版本,对应的索引和嵌入都打包好了。开箱即用。

  • 生成器(Generator):集成了 Huggingface Transformers 和 VLLM,还支持量化和 LoRA(低秩适应)技术。这意味着你跑大模型的时候,显存没那么容易爆。

  • 指令实验室(Instruction Lab):包含系统指令、任务指令和算法指令。说白了,你怎么调教模型生成结果,全看这里怎么组合指令。

  • 训练器(Trainer):集成了 Accelerate 和 DeepSpeed 库,支持模型微调,包括 LoRA 和量化 LoRA。想自己训个定制版?挺方便。

  • 数据集和度量(Dataset and Metric):一口气收集了 10 个广泛使用的基准数据集,覆盖 5 种不同类型的任务,还提供了灵活的数据适配机制和多样的评估指标。

一个使用 RAGLAB 来复现 Self-RAG 算法的脚本

光说不练假把式。RAGLAB 的实际效果如何?他们做了一组全面的实验,用不同的基础模型当生成器,同时死死按住其他组件不变,就为了看不同 RAG 算法在公平条件下到底谁更强。

实验分析了 Naive RAG、RRR、ITER-RETGEN、Self-Ask、Active RAG、Self-RAG 这几种算法在多个基准上的表现。结论挺有意思:Self-RAG 算法在搭配特定生成器时,表现显著碾压其他算法。

不同算法的指令

以下是各算法在实际代码中的指令示例,供你参考:

Naive RAG
# read process insruction
"### Instruction:n {task_instrucion} n## Input:nn{query}nn Now, based on the following passages
and your knowledge, please answer the question more succinctly and professionally. ### Background
Knowledge:n {passages} nn### Response:n"

RRR
# rewrite process instruction
"Provide a better search query for Wikipedia to answer the given question, end the query with '**'. nn
Question: Ezzard Charles was a world champion in which sport? nn Query: Ezzard Charles
champion** nn Question: What is the correct name of laughing gas? nn Query: laughing gas
name** nn Question: {query} nn Query: " # read process insruction
"### Instruction:n {task_instrucion} n## Input:nn{query}nn Now, based on the following passages
and your knowledge, please answer the question more succinctly and professionally. ### Background
Knowledge:n {passages} nn### Response:n"

ITER-RETGEN
# read process insruction
"### Instruction:n {task_instrucion} n## Input:nn{query}nn Now, based on the following passages
and your knowledge, please answer the question more succinctly and professionally. ### Background
Knowledge:n {passages} nn### Response:n"

Self ASK
# follow up question instruction
"Question: When does monsoon season end in the state the area code 575 is located? Are follow up
questions needed here: Yes. Follow up: Which state is the area code 575 located in? Intermediate
answer: The area code 575 is located in New Mexico. Follow up: When does monsoon season end in
New Mexico? Intermediate answer: Monsoon season in New Mexico typically ends in mid-September. So the final answer is: mid-September. n{query} Are follow up questions needed here:" # read process insruction
"### Instruction:n {task_instrucion} n## Input:nn{query}nn Now, based on the following passages
and your knowledge, please answer the question more succinctly and professionally. ### Background
Knowledge:n {passages} nn### Response:n"

Active RAG
# read process insruction
"### Instruction:n {task_instrucion} n## Input:nn{query}nn Now, based on the following passages
and your knowledge, please answer the question more succinctly and professionally. ### Background
Knowledge:n {passages} nn### Response:n"

Self-RAG
# read process instruction
"### Instruction:n{task_instruction}nn## Input:nn{query}nn### Response:n"

RAGLAB 系统用户评估问卷

想深入了解的,直接看论文和代码:

热点追踪提示词
你是一名 AI 行业编辑,请围绕下面这条热点输出一份资讯解读:
热点:一个全面先进公平且模块化的开源RAG框架要求:
1. 先用一句话解释这条热点在讲什么
2. 再总结它为什么重要
3. 说明会影响哪些 AI 产品或内容方向
4. 最后给出 3 个适合资讯站使用的标题
来源:https://www.53ai.com/news/OpenSourceLLM/2024090824610.html
ai 人工智能

游乐网为非赢利性网站,所展示的游戏/软件/文章内容均来自于互联网或第三方用户上传分享,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系youleyoucom@outlook.com。

相关热点
AI热点2026-07-11 20:22
Quickie AI 智能快捷方式,快速完成任务

QuickieAI是一款轻量级Chrome插件,核心逻辑是快速准确。在写作、社交媒体运营、营销活动场景中,一键完成内容研究与文案生成,支持侧边栏即时响应。可辅助写作、生成多平台文案及营销话术,擅长冷启动,最终质量需人工微调。

AI热点2026-07-11 20:22
快手开源模型可图Kolors 支持图像内生成文字

快手开源图像生成模型可图Kolors,采用GLM文本编码器支持中英文双语理解,可处理256token长文本。基于数十亿文本图像对训练,专门优化中国文化元素,能稳定生成中文文字,英文文字偶有缺漏。

AI热点2026-07-11 20:22
Hebbia AI智能搜索引擎 金融法律政府制药行业知识工作助手

Hebbia是一款专为金融、法律、政府和制药等行业设计的AI搜索引擎,其Matrix产品通过拆解复杂文档实现自动化信息提取与分析,已获3000万美元融资。它适用于研究人员、商业人士及学生,提供全面、精准的检索与洞察。

AI热点2026-07-11 20:21
Penf1 AI驱动的博客写作工具

Penf1是一款AI驱动的博客创作工具,专注于简化从构思到发布的全流程。它支持即时内容生成、创意破题和SEO优化,帮助创作者快速获得高质量初稿,从而将精力集中于打磨观点和注入个人风格。

延伸阅读