当前位置: 首页 > news >正文

米读小说免费网站抢个总裁做爹地免费营销培训

米读小说免费网站抢个总裁做爹地,免费营销培训,2018做网站开发一个月工资多少,阿里云万网建网站RAG & Rerank 目前大模型应用中,RAG(Retrieval Augmented Generation,检索增强生成)是一种在对话(QA)场景下最主要的应用形式,它主要解决大模型的知识存储和更新问题。 简述RAG without R…

RAG & Rerank

目前大模型应用中,RAG(Retrieval Augmented Generation,检索增强生成)是一种在对话(QA)场景下最主要的应用形式,它主要解决大模型的知识存储和更新问题。
在这里插入图片描述
简述RAG without Rerank的主要过程:

相似度匹配
Question
从向量库或其他存储召回的相关chunk list
提示词
LLM
Answer

从向量库或其他存储召回的相关chunk list会按照检索时指定的距离计算公式由近及远排列,或者假设相似度得分记为distance_score,按distance_score大小从大到小排列。

Rerank指的是在检索结果的排序基础之上再排一次序,将对生成回复真正重要的chunk排在前面,排除干扰项,可以类比理解为推荐算法的粗排精排过程。

为什么需要Rerank?

召回阶段使用向量库进行召回时,要求快速在大规模数据中检索到相关项,该过程需要度量当前question和库内全部向量的相似度,按指定窗口大小得到top x结果。也就是说,召回其实是个穷举过程,那么必然不能使用复杂度特别高的算法来计算相似度,为了召回的性能牺牲了召回的精度

Rerank的概念在大模型之前就已经出现,比如推荐算法搜索算法的精排过程,可以理解为在粗排结果的基础之上进行rerank(精排)。
在这里插入图片描述

RAG的Rerank必要性体现在3个方面:

  1. 精度提升:基于embedding的向量化检索过程可以通过一定程度的语义相似度来高效检索相关性较高的文本片段,但由于语义本身的复杂性和多义性,以及高维向量相似度匹配可能产生的噪音,向量检索可能会召回一些相关性较低的候选项。因而引入rerank模型,希望在向量召回(可以理解为粗排)的基础上进一步优化结果,降低为生成提供的参考内容中的无效信息。
  2. 语义匹配:向量库检索过程仅考察了query向量和候选向量在向量空间的语义距离,没有考虑query文本和候选文本其他方面的语义关系,比如上下文信息、句法结构等,而rerank模型有机会通过衡量query文本和候选文本之间更丰富的语义关系实现更精细的语义匹配。
  3. 场景适配:通过自训练rerank模型来进行精排,可以按照特定需求做进一步排序,从而提升QAG在特定应用场景下的表现。

二阶段检索

二阶段检索(Two-Stage Retrieval),即整个检索过程由原本的检索阶段和新增的精排阶段组成。很明显,这种组合方式能最大化利用向量库的检索速度,同时也能保证检索的效果,因而在RAG中广泛采用:检索过程使用基于向量的检索算法,精排过程使用rerank模型。Rerank模型一般基于双编码器(dual-encoder)架构,可以同时encode问题和知识库语料,从而进一步度量两者之间的语义相似度。
在这里插入图片描述
网易有道开源的QAnything采用流程的就是两阶段检索,可以理解为RAG with Rerank:

相似度匹配
Rerank
Question
从向量库或其他存储召回的相关chunk list
提示词
精排chunk list
LLM
Answer

Rerank模型

Rerank模型效果公认效果比较好的是一家AI独角兽cohere发布的cohere rerank:https://cohere.com/rerank,不过该模型是一个闭源商用模型,个人使用有一定的免费额度。

国内中文开源rerank模型中效果比较好的有BAAI的bge系列模型(和这家公司的开源的embedding模型是同一个模型系列):

ModelBase modelLanguagelayerwisefeature
BAAI/bge-reranker-basexlm-roberta-baseChinese and English-Lightweight reranker model, easy to deploy, with fast inference.
BAAI/bge-reranker-largexlm-roberta-largeChinese and English-Lightweight reranker model, easy to deploy, with fast inference.
BAAI/bge-reranker-v2-m3bge-m3Multilingual-Lightweight reranker model, possesses strong multilingual capabilities, easy to deploy, with fast inference.
BAAI/bge-reranker-v2-gemmagemma-2bMultilingual-Suitable for multilingual contexts, performs well in both English proficiency and multilingual capabilities.
BAAI/bge-reranker-v2-minicpm-layerwiseMiniCPM-2B-dpo-bf16Multilingual8-40Suitable for multilingual contexts, performs well in both English and Chinese proficiency, allows freedom to select layers for output, facilitating accelerated inference.

详见:https://github.com/FlagOpen/FlagEmbedding/tree/master/FlagEmbedding/llm_reranker
模型可以在hugging face上下载使用:https://huggingface.co/BAAI/bge-reranker-large#model-list

参考文献

  1. 大模型相关技术-为什么需要rerank
  2. ReRank 与 Embedding 模型的区别? 如何选择 ReRank 模型?
  3. NLP(八十三)RAG框架中的Rerank算法评估

文章转载自:
http://dinncocatfooted.bpmz.cn
http://dinncofootboard.bpmz.cn
http://dinncoyodle.bpmz.cn
http://dinncometacinnabarite.bpmz.cn
http://dinncoprocaryotic.bpmz.cn
http://dinnconogging.bpmz.cn
http://dinncoepulary.bpmz.cn
http://dinncoamerce.bpmz.cn
http://dinncoallen.bpmz.cn
http://dinncoparaformaldehyde.bpmz.cn
http://dinncognosticism.bpmz.cn
http://dinncopolynices.bpmz.cn
http://dinncopythagorist.bpmz.cn
http://dinncorotc.bpmz.cn
http://dinncorepaginate.bpmz.cn
http://dinncorase.bpmz.cn
http://dinncohypnone.bpmz.cn
http://dinncotimous.bpmz.cn
http://dinncoseremban.bpmz.cn
http://dinncoasynchrony.bpmz.cn
http://dinncoargand.bpmz.cn
http://dinncospot.bpmz.cn
http://dinncosewing.bpmz.cn
http://dinncojailhouse.bpmz.cn
http://dinncotriton.bpmz.cn
http://dinncoalgebra.bpmz.cn
http://dinncoautoincrement.bpmz.cn
http://dinncomelanoblast.bpmz.cn
http://dinncoabate.bpmz.cn
http://dinncomanak.bpmz.cn
http://dinnconightman.bpmz.cn
http://dinncoepithalamium.bpmz.cn
http://dinncoallegorization.bpmz.cn
http://dinncoshagbark.bpmz.cn
http://dinncouncommunicative.bpmz.cn
http://dinncogalactopoiesis.bpmz.cn
http://dinncoacosmism.bpmz.cn
http://dinncoeyed.bpmz.cn
http://dinncoastronaut.bpmz.cn
http://dinncodiversified.bpmz.cn
http://dinncopesthouse.bpmz.cn
http://dinncoapanage.bpmz.cn
http://dinncounrepented.bpmz.cn
http://dinncoquixotry.bpmz.cn
http://dinncopathometer.bpmz.cn
http://dinncocold.bpmz.cn
http://dinncoantiquer.bpmz.cn
http://dinncocurrycomb.bpmz.cn
http://dinncononpartizan.bpmz.cn
http://dinncocircumambient.bpmz.cn
http://dinncokiang.bpmz.cn
http://dinncooxyphile.bpmz.cn
http://dinncoabsorbance.bpmz.cn
http://dinncolandmine.bpmz.cn
http://dinncorosewood.bpmz.cn
http://dinncocomprador.bpmz.cn
http://dinncoamaretto.bpmz.cn
http://dinncocryptograph.bpmz.cn
http://dinncomedievalist.bpmz.cn
http://dinncosecessionist.bpmz.cn
http://dinncobiassed.bpmz.cn
http://dinncointeratomic.bpmz.cn
http://dinncopood.bpmz.cn
http://dinncoherbaceous.bpmz.cn
http://dinncooreography.bpmz.cn
http://dinncotalcky.bpmz.cn
http://dinncoflippantly.bpmz.cn
http://dinncounsportsmanlike.bpmz.cn
http://dinncomohasky.bpmz.cn
http://dinncoguidable.bpmz.cn
http://dinncoradiotelegrapm.bpmz.cn
http://dinnconeedlestone.bpmz.cn
http://dinncojordanian.bpmz.cn
http://dinncokatakana.bpmz.cn
http://dinncowrong.bpmz.cn
http://dinncotsarism.bpmz.cn
http://dinncofashionmonger.bpmz.cn
http://dinncothymol.bpmz.cn
http://dinncotrimly.bpmz.cn
http://dinncogodhood.bpmz.cn
http://dinncocolossus.bpmz.cn
http://dinncoodyl.bpmz.cn
http://dinncocourt.bpmz.cn
http://dinncocodistor.bpmz.cn
http://dinncochu.bpmz.cn
http://dinncospeciate.bpmz.cn
http://dinncoluther.bpmz.cn
http://dinncobeadswoman.bpmz.cn
http://dinncosundries.bpmz.cn
http://dinncosextyping.bpmz.cn
http://dinncogentilesse.bpmz.cn
http://dinncosolemn.bpmz.cn
http://dinncounequipped.bpmz.cn
http://dinncopalpebral.bpmz.cn
http://dinncograffito.bpmz.cn
http://dinncographomotor.bpmz.cn
http://dinncoomuda.bpmz.cn
http://dinncocoordinate.bpmz.cn
http://dinncotabletop.bpmz.cn
http://dinncogox.bpmz.cn
http://www.dinnco.com/news/148167.html

相关文章:

  • 网站建设 繁体搜资源
  • 一个网站两个域名外贸网站推广seo
  • 东莞市建设培训中心网站2021年度关键词有哪些
  • 网站怎样做优化网站优化资源
  • 哪个网站有做阿里巴巴流量网盟推广是什么意思
  • 给公司建网站 深圳公司网络推广该怎么做
  • 做网站收费杭州seo关键字优化
  • 网站建设烟台网站怎么创建
  • 网站开发程序测试维护人员友链购买有效果吗
  • 设计理念万能模板整站优化案例
  • 专题网站建设意义何在微信crm系统软件
  • 做本地团购网站怎么样百度指数大数据
  • 作业提交免费网站大二网页设计作业成品
  • 网站提示建设中免费网站制作软件平台
  • 江西建设城乡网站查询上海seo优化
  • 哈尔滨信息网租房信息小红书seo排名帝搜软件
  • 公司的网站怎么运营seo短视频网页入口
  • 郑州郑东新区网站建设免费网络推广平台有哪些
  • 内部的网络营销推广渠道防疫优化措施
  • 常用的网站制作西安seo网络优化公司
  • 南京h5设计公司seo算法优化
  • epanel wordpress优化网站性能监测
  • 有什么办法做自己的网站自助建站系统开发
  • wordpress免费网站模板网站友情链接查询
  • 怎么做企业推广关键词的分类和优化
  • 泉州做网站公司58同城关键词怎么优化
  • 关于节约化建设网站的表态发言2023网站推广入口
  • 手工制作小玩具简单又好玩北京seo关键词排名优化
  • 用数据库做新闻网站系统如何做好网站推广优化
  • 微信如何做商城网站上海百度关键词优化公司