《姜勇-RAG關鍵技術及未來趨勢發展.pdf》由會員分享,可在線閱讀,更多相關《姜勇-RAG關鍵技術及未來趨勢發展.pdf(44頁珍藏版)》請在三個皮匠報告上搜索。
1、姜勇 Dify首席架構師負責 Dify.AI 最佳實踐探索及架構設計。一個 90%的 E 人,卻喜歡前沿技術折騰,并認為 Code 是最純粹的事情。在軟件工程、服務高可用和數據處理領域有較為豐富的經驗,曾獨立搭建類 Notion 的筆記型知識庫后端服務,超百萬用戶量;對 RAG 領域有著深刻的理解與實踐,曾多次在向量數據庫大會、A2M大會、人工智能峰會中進行過相關領域的知識分享。演講主題:RAG關鍵技術及未來趨勢發展RAG 關鍵技術及未來趨勢發展姜勇Dify.AI 架構師建設 RAG 目前的困境RAG 發展史E En nt te er rp pr ri is se e R RA AG GRAG
2、 的展望RAG 難點from:https:/arxiv.org/html/2401.05856v1R RA AG G 難難點點FP1 Missing ContentFP2 Missed the Top Ranked DocumentsFP3 Not in Context-Consolidation strategy Limitations FP4 Not Extracted FP5 Wrong FormatFP6 Incorrect SpecificityFP7 IncompleteRAG 發展史第第一一階階段段:B Ba as si ic c R RA AG GRetrieveAnswerb
3、ased on vector searchBasic RAGRAG 發展史based on vector search第二階段:Advanced RAGHybrid RetrieveAnswerResult ProcessA Ad dv va an nc ce ed d R RA AG GAdvanced RAGQuery typeKeywordNDCG3VectorNDCG3HybridNDCG3Hybrid+Semantic RankerNDCG3Concept seeking queries39.045.846.359.6Fact seeking queries37.849.049.16
4、3.4Exact snippet search51.141.551.060.8Web search-like queries41.846.350.058.9Keyword queries79.211.761.066.9Low query term overlap23.036.135.949.1Queries with misspellings28.839.140.654.6Long queries42.741.648.159.4Medium queries38.144.746.759.9Short queries53.138.853.063.9Advanced RAGAdvanced RAG“
5、G Ga ar rb ba ag ge e I In n G Ga ar rb ba ag ge e O Ou ut t.”Advanced RAG類類型型示示例例問題與語料不相關詢問產品配置庫關于貨物運輸的問題問題模糊“這篇文章的作者是誰?不是關于事實召回“總結一下這篇文章的主要內容”包含多個子問題今年的歐洲杯在哪里舉辦,什么時候開始?需要多跳邏輯“Who won the 2023 super bowl and where was their head coach from?”包含非語義組成(結構化)“What are movies about aliens in 1980”-should
6、filter by year=1980問題包含比較“江蘇省房貸利率政策從2022年至2023年有哪些調整?”Advanced RAGbased on vector searchHybird RetrieveAnswerResult ProcessQuery TransformAdvanced RAGAdvanced RAG類類型型解解決決方方案案問題與語料不相關檢索前增加問題分類或檢查步驟,如查詢路由(Query routing)問題模糊基于歷史的問題重寫(Rewrite)不是關于事實召回(總結)索引過程中實現摘要(Summary Index)長文本窗口模型(Long Context Mode
7、l)包含多個子問題子問題拆分(sub-question)后并行查詢需要多跳邏輯問題規劃(Question Planing)包含非語義組成(結構化)元數據過濾器(Metadata Filter)問題包含比較問題規劃(Question Planing)Advanced RAGMultimodal with long context RAG第三階段:Multimodal with long context RAGM Mo od de el lM Ma ax x T To ok ke en ngpt-4o128Kclaude-3200KGemini 1.5 Pro1Mqwen-long10Mdeeps
8、eek-chat32KERNIE Speed128Kglm-4128Kdoubao-lite-128k128Kmoonshot-v1-128k128K機機會會:分塊算法更靈活,可以達到文檔級別文檔之間的分析和比較更容易總結更容易更容易的記憶管理,減少壓縮技巧的使用減少幻覺為大模型支持無限 Context前的過濾手段,減少成本P Pa ar re en nt t c ch hu un nk k f fo or r l lo on ng g-c co on nt te ex xt t ,c ch hi il ld d c ch hu un nk k f fo or r r re et tr ri
9、iv va al lParent-Child RetrievalParent-Child RetrievalParent-Child RetrievalMultimodal RetrievalProvide different vector spaceMultimodal RetrievalConsolidate all modes into one main modeMultimodal RetrievalEmbed all content into the same vector spaceE En nt te er rp pr ri is se e R RA AG Gb ba as se
10、 ed d o on n v ve ec ct to or r s se ea ar rc ch hR RA AG GS Se em ma an nt ti ic c C Ca ac ch he eM Mo od de er ra at ti io on nA Au ut th he en nt ti ic ca at ti io on nO Ob bs se er rv va at ti io on nE Ev va al lu ua at ti io on nL Lo oa ad d B Ba al la an nc ci in ng gObservationE Ev va al lu u
11、a at ti io on nLoad BalancingSemantic CacheModerationAuthenticationRAG 的展望RAG 系統的本質是基于自然語言的開開放放域域問答系統,難點也在于“開開放放域域”。要想獲得符合預期的召回效果,需要對應用情景進行概概括括和和收收斂斂,尋找合適的檢索模式或組合。在動手設計一個 RAG 系統之前,最好先考慮好你的用戶是哪些人,以及他們最可能問出什么樣的問題。引入混合檢索(Hybrid Search)和重排序(Rerank)改進 RAG 系統召回效果Demo沒有最好的,只有最適合場景的策略No one is better than the other but just when one fits more in certain type of questions.聯系方式Dify.AI 官方公眾號如果你喜歡 Dify,歡迎:在 GitHub 上貢獻代碼,與我們一同共建更好的 Dify;通過線上線下活動、社交媒體向你的朋友們分享 Dify,以及你的使用經驗;在 GitHub 上給我們點亮https:/ 官方小助手謝謝聆聽