LongRAG: Enhancing Retrieval-Augmented Generation with Long-context LLMs

本文是LLM系列文章,针对《LongRAG: Enhancing Retrieval-Augmented Generation with Long-context LLMs》的翻译。

LongRAG:用长上下文LLM增强检索增强生成

摘要

在传统的RAG框架中,基本检索单元通常很短。像DPR这样的常见检索器通常处理100个单词的维基百科段落。这样的设计迫使检索器在大型语料库上搜索以找到“针”单元。相比之下,读者只需要从检索到的简短单元中提取答案。这种不平衡的“重”检索器和“轻”读取器设计可能导致次优性能。为了缓解这种不平衡,我们提出了一个新的框架LongRAG,由“长检索器”和“长阅读器”组成。LongRAG将整个维基百科处理成4Ktoken单元,比以前长了30倍。通过增加单元大小,我们将总单元从2200万个显著减少到600万个。这显著降低了检索者的负担,从而获得了显著的检索分数:答案recall@1=在NQ上占71%(之前为52%)并回答recall@2在HotpotQA(完整的wiki)上=72%(之前为47%)。然后,我们将前k个检索单元(≈30Ktoken)馈送到现有的长上下文LLM,以执行零样本答案提取。在不需要任何训练的情况下,LongRAG在NQ上实现了62.7%的EM,在HotpotQA(完整的wiki)上实现了64.3%的EM,这与(完全训练的)SoTA模型不相上下。我们的研究为将RAG与长期LLM相结合的未来路线图提供了见解。

1 引言

2 相关工作

3 LongRAG

4 实验

5 结论

在本文中,我们提出了一个新的框架LongRAG,以缓解检索器负担之间的不平衡。LongRAG框架由一个“长检索器”和一个

LongRAG:利用长上下文大语言模型提升检索生成效果 LongRAG 框架创新性地解决了传统检索增强生成(RAG)框架中检索器负担过重的问题,通过引入“长检索单元”、“长检索器”和“长阅读器”,将完整的维基百科文章处理成 4K Token 的单元,将语料库大小缩减了 97% 以上,从而显著提升了检索效率和整体性能。LongRAG 的优势主要体现在:在 NQ 和 HotpotQA 数据集上,LongRAG 无需复杂排序机制即可分别实现 71% 的 Recall@1 和 72% 的 Recall@2,远超传统的短文本检索方法。 阅读详情

相关推荐

LongRAG: A Dual-Perspective Retrieval-Augmented Generation Paradigm for Long-Context Question 论文

摘要: 长上下文问答(Long-Context Question answer, LCQA)是一项具有挑战性的任务,其目的是对长上下文文档进行推理,从而得到问题的准确答案。现有的用于LCQA的长上下文大型语言模型(llm)经常与“迷失在中间”的问题作斗争。检索增强生成(RAG)通过提供外部事实证据缓解了这一问题。然而,它的分块策略破坏了全局的长上下文信息,并且由于大量的噪声,它在长上下文中的低质量检索阻碍了llm识别有效的事实细节。为此,我们提出了LongRAG,一个通用的、双视角的、健壮的基于llm的LC

weixin_51657614的博客 753

LLM应用架构之检索增强(RAG,retrieval-augmented generation)的缘起与架构介绍

原创 ullyAI工程化收录于合集#领域技术13个#LLM应用架构3个动手点关注本文是LLM应用架构系列的第一篇,将介绍LLM应用开发里最常见的一种架构模式RAG( Retrieval Augmented Generation),它被广泛应用于知识问答,智能助手等常见LLM应用场景中。在后续文章中还将介绍该模式落地实际过程中的一些常见问题及改进思路,欢迎关注“AI工程化”,持续为大家更新。

具身机器人和通用AI 6722

Win10家庭版中文用户名改英文全攻略:从注册表到环境变量一步不落

本文详细介绍了Windows 10家庭版中文用户名改为英文的完整流程,包括注册表编辑、环境变量调整等关键步骤。通过激活管理员账户、重命名用户文件夹、修改注册表键值等操作,彻底解决因中文路径导致的软件兼容性问题,并提供常见错误解决方案和系统维护建议。

weixin_29227425的博客 427

Win11大版本更新失败:系统保留分区空间不足的终极解决方案

本文针对Windows 11大版本更新时遇到的“系统保留分区空间不足”错误,提供了详细的诊断与解决方案。核心问题在于EFI系统分区(ESP)空间过小,导致更新失败。文章重点介绍了使用傲梅分区助手等第三方工具安全扩展EFI分区的完整步骤,并提供了手动清理、使用安装介质修复等替代方案,帮助用户彻底解决更新障碍,顺利完成Win11升级。

weixin_29280219的博客 950

CVAT本地部署保姆级教程:用Docker Compose在Ubuntu上5分钟搞定你的私有数据标注平台

本文提供CVAT本地部署的保姆级教程,详细讲解如何在Ubuntu系统上使用Docker Compose快速搭建私有数据标注平台。从环境准备、Docker配置到CVAT部署全流程,涵盖硬件要求、性能优化及安全加固等关键步骤,帮助开发团队5分钟内完成高效、安全的标注环境搭建。

weixin_42619742的博客 383

基于Arduino与光电传感器的心率监测系统:从原理到实现的完整指南

光电式心率监测是一种基于光电容积脉搏波描记法(PPG)的非侵入式生命体征测量技术。其核心原理是利用特定波长光线照射皮肤组织,通过检测因血液容积周期性变化导致的反射光强微弱波动,来获取心率信息。这项技术的关键价值在于实现了低成本、便携化的连续生理参数监测,广泛应用于健康管理、运动科学及嵌入式系统教学领域。在工程实践中,信号处理算法(如移动平均滤波与动态阈值峰值检测)对提升测量精度至关重要。本文以Arduino平台为例,详细解析了如何集成MAX30102或Pulse Sensor Amped等光电传感器,结合T

weixin_33461476的博客 245

如何使用apifox打包测试用例生成测试套件自动化执行

使用apifox打包测试用例生成测试套件自动化执行

weixin_55613512的博客 2886

STM32F103多通道PWM输出避坑指南:TIM1_CH1异常输出的解决方案

本文深入解析STM32F103多通道PWM输出中的TIM1_CH1异常问题,提供从时钟配置到GPIO复用的系统化解决方案。通过黄金法则配置流程和高级调试技巧,帮助开发者快速定位并解决PWM输出不稳定、占空比异常等问题,同时拓展多定时器协同和互补PWM等高级应用场景。

weixin_29194817的博客 117

《派出你的AI同事:WorkBuddy案例实战》062:投研资讯摘要与预警

投研资讯摘要与预警:新闻、公告、行情交给 AI 同事提炼与预警,投研从“刷资讯”变成“读摘要”。

LuckyHanMo的博客 182

Far planner 部署真实小车 & 树莓派部署lego_loam

今天开一贴Far planner的部署,也算是lego loam的部署吧 因为state_estimation用的是lego loam小车底盘: 轮趣的mini差速底盘外加多一层钢板,中间层用来放velodyne的电池(小的电池还没到,大的电池塞不进去目前)和velodyne信号盒子。前面还可以加一个相机。底层用来放小车的电池和马达等设备了,底层不用动。最上面一层用来安装velodyne16线雷达,需要额外钻孔(如果买轮趣的话可以找老板钻个孔?我也不确定,我自己钻的)。 雷达固定螺丝用的是 1/4-20*3

博客 4303

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

上一篇: Aligning Large Language Models for Controllable Recommendations
下一篇: Meta Large Language Model Compiler: Foundation Models of Compiler Optimization
UnknownBody
博客等级 码龄16年 5600粉丝 4724原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

UnknownBody

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值