dify blog 09月19日 13:27
Dify.AI更新:增强RAG技术,提升问答效率
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

Dify.AI最新版本显著提升了其数据集模块中的检索增强生成(RAG)技术,核心在于优化向量搜索能力,以提高大型语言模型(LLMs)的问答准确性。此次更新引入了混合搜索,结合了向量搜索和全文本搜索的优势,并增加了Rerank模型,用于语义重排搜索结果,确保答案与用户查询高度匹配。此外,针对知识库问答的多路径检索功能,可同时考虑多个数据集,提取最相关的文本片段。这些优化使得Dify.AI在QA准确性和整体体验上均有提升,并在Ragas评估框架下,检索命中率提升20%,超越了OpenAI的Assistants API。

🚀 **混合搜索与Rerank模型提升检索精度**:Dify.AI的数据集模块现支持向量搜索、全文本搜索以及两者的混合搜索,并引入了可配置的Rerank模型,通过语义重排来精确匹配用户查询,显著提高了答案的相关性。

📚 **多路径检索优化知识库问答**:针对使用多个数据集构建的知识库,Dify.AI的多路径检索功能能够同时分析所有相关数据集,提取最精准的文本信息,确保信息提取的全面性和准确性。

📈 **RAG技术显著提升QA性能**:经过Dify.AI的增强,RAG技术在Ragas评估框架下,整体Ragas Score提升18.44%,其中Context Precision(上下文精确度)提升20%,Faithfulness(忠实度)提升35.71%,显示出在提升问答准确性和减少信息“幻觉”方面的强大能力。

💡 **Dify.AI的开放性与模型兼容性优势**:与OpenAI的Assistants API相比,Dify.AI支持更广泛的模型选择,包括开源模型,并能利用其先进RAG技术提供更准确的上下文问答。例如,在处理iPhone发布日期查询时,Dify.AI准确回答,而Assistants API则未能正确提取信息。Dify.AI还新增支持了具备200K token上下文窗口的Claude 2.1模型。

In the latest update of Dify.AI's dataset module, we've enhanced the Retrieval-Augmented Generation (RAG) technology, pivotal for vector search, to boost the question-answering proficiency of Large Language Models (LLMs). Key upgrades and optimizations include:

  1. Hybrid Search: We've broadened dataset upload capabilities with multiple search options: vector search, full-text search, and a novel hybrid search that melds the strengths of both methods.

  2. Rerank Model: This new model enables semantic re-ranking of search results from various technologies, pinpointing answers that most accurately align with user queries. This feature is user-configurable in the search settings.

  3. Multi-path Retrieval: Tailored for knowledge base Q&A using multiple datasets, this feature concurrently considers all relevant datasets. This ensures the extraction of the most pertinent text segments from each dataset.

Both hybrid search and multi-path retrieval now automatically incorporate a Rerank model configuration. This is accessible via the settings page under Model Provider, with the Cohere Rerank currently supported and additional Rerank models slated for future release.For more in-depth details on these features, please consult the Official Help Documentation.

These approaches have improved the accuracy of QA targeting and elevated the overall QA experience. In Dify.AI's latest version, we extensively tested the enhanced RAG. The results revealed a notable enhancement in system performance, including a 20% rise in retrieval hit rate, and a distinct edge over OpenAI's Assistants API.


Dify.AI's 20% Performance Improvement with RAG

In our recent tests, we utilized the Ragas evaluation framework, specifically designed to assess the RAG pipeline. This framework offers a suite of tools and metrics for evaluating RAG system aspects. We focused on three primary metrics:

  • Answer Relevancy: Measures how relevant an answer is to the posed question, evaluating the quality and applicability of answers produced by LLMs.

  • Context Precision: Assesses the relevance of the retrieved context to the question. This metric reflects the quality of the retrieval process, ensuring the extracted information is pertinent to the query. The test values span from 0 to 1, with higher values denoting superior precision.

  • Faithfulness: Evaluates the factual accuracy of the generated answer in relation to the provided context. This metric also encompasses detecting “hallucination” phenomena in answers. Values range from 0 to 1, with higher scores indicating greater consistency and fewer hallucinations.

Additionally, Ragas includes other metrics like Context Recall for an all-encompassing assessment of RAG's effectiveness. The Ragas Score, an aggregate of these metrics, serves as a comprehensive measure of QA system performance.

Our test outcomes are noteworthy: Ragas Score rose by 18.44%, Context Precision by 20%, and Faithfulness by 35.71%.

Note: Answer Relevancy is linked to LLM performance. Since the same LLM was employed in these tests, the scores were almost identical.


Dify.AI vs Assistants API: A Comparative Overview

Dify.AI distinguishes itself from OpenAI's Assistants API by supporting a wider array of models, notably including open-source models from Hugging Face and Replicate platforms. Unlike the Assistants API, which utilizes models like gpt-3.5-turbo-1106, Dify.AI leverages its advanced RAG technology for context-based accurate question answering.

For instance, when using the dataset "iphone.txt" that details the release dates and performance comparisons of various iPhone models, Dify.AI outperforms the Assistants API.

For the query, "when was iPhone 15 announced", the Assistants API was unable to extract the relevant information from the context, incorrectly inferring the absence of iPhone 15's release date in the dataset. In contrast, Dify.AI's RAG system accurately retrieved and provided the correct answer: "The iPhone 15 was announced on September 12, 2023."

A key highlight of Dify's RAG system is its open-source nature, inviting community contributions and fostering technology sharing. Developers are encouraged to star us on GitHub and join our collaborative efforts.

We're also excited to announce Dify.AI's support for the newly launched Claude 2.1 model. This model boasts a 200K token context, substantially minimizing hallucinations and inaccuracies in responses, which is crucial for developing more dependable AI applications. We invite you to experience these enhancements firsthand.


via @dify_ai

If you like Dify.AI, give us a Star ⭐️.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

Dify.AI RAG LLM 向量搜索 混合搜索 问答系统 AI Retrieval-Augmented Generation Vector Search Hybrid Search Question Answering Large Language Models
相关文章