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

Inconsistent Query Results Based on Output Fields Selection in Milvus Dashboard

题意:在Milvus仪表盘中基于输出字段选择的不一致查询结果

问题背景:

I'm experiencing an issue with the Milvus dashboard where the search results change based on the selected output fields.

I'm working on a RAG project using text data converted into embeddings, stored in a Milvus collection with around 8000 elements. Last week, my retrieval results matched my expectations ("good" results), however, this week, the results have degraded ("bad" results).

I found that when I exclude the embeddings_vector field from the output fields in the Milvus dashboard, I get the "good" results; Including the embeddings_vector field in the output changes the results to "bad".

I've attached two screenshots showing the difference in the results based on the selected output fields.

Any ideas on what's causing this or how to fix it?

Environment:

Python 3.11 pymilvus 2.3.2 llama_index 0.8.64

Thanks in advance!

from llama_index.vector_stores import MilvusVectorStore
from llama_index import ServiceContext, VectorStoreIndex# Some other lines..# Setup for MilvusVectorStore and query execution
vector_store = MilvusVectorStore(uri=MILVUS_URI,token=MILVUS_API_KEY,collection_name=collection_name,embedding_field='embeddings_vector',doc_id_field='chunk_id',similarity_metric='IP',text_key='chunk_text')embed_model = get_embeddings()
service_context = ServiceContext.from_defaults(embed_model=embed_model, llm=llm)
index = VectorStoreIndex.from_vector_store(vector_store=vector_store, service_context=service_context)
query_engine = index.as_query_engine(similarity_top_k=5, streaming=True)rag_result = query_engine.query(prompt)

Here is the "good" result: "good" result And here is the "bad" result: "bad" result

问题解决:

I would like to suggest you to follow below considerations.

  • Ensure that your Milvus collection is correctly indexed. Indexing plays a crucial role in how search results are retrieved and ordered. If the index configuration has changed or is not optimized, it might affect the retrieval quality.
  • In your screenshots, the consistency level is set to "Bounded". Try experimenting with different consistency levels (e.g., "Strong" or "Eventually") to see if it impacts the results. Consistency settings can influence the real-time availability of the indexed data.
  • Review the query parameters, especially the similarity_metric. Since you're using IP (Inner Product) as the similarity metric, ensure that your embedding vectors are normalized correctly. Inner Product search works best with normalized vectors.
  • Verify that the embedding vectors are of consistent quality and scale. If there were changes in the embedding model or preprocessing steps, it could lead to variations in the search results.
  • The inclusion of the embeddings_vector field in the output might affect the way Milvus scores and ranks the results. It's possible that returning the raw embeddings affects the internal ranking logic. Ensure that including this field does not inadvertently alter the search behavior.
  • Check the Milvus server logs and performance metrics to identify any anomalies or changes in the search behavior. This might provide insights into why the results differ when the embeddings_vector field is included.
  • Ensure that there are no version mismatches between the client (pymilvus) and the Milvus server. Sometimes, discrepancies between versions can cause unexpected behavior.
  • As a last resort, try modifying your code to exclude the embeddings_vector field programmatically during retrieval and compare the results. This can help isolate whether the issue is indeed caused by including the embeddings in the output.
  • Please try out this code if it helps.

http://www.lryc.cn/news/404398.html

相关文章:

  • 视觉巡线小车——STM32+OpenMV
  • 升级TrinityCore 服务器硬件
  • NVidia 的 gpu 开源 Linux Kernel Module Driver 编译 安装 使用
  • win7显卡驱动更新后msvcp140.dll丢失的解决方法
  • (11)Python引领金融前沿:投资组合优化实战案例
  • git删除本地远程分支
  • 前端-04-VScode敲击键盘有键入音效,怎么关闭
  • JMeter数据库连接操作及断言
  • Maven settings.xml 私服上传和拉取配置
  • 【STM32】MPU内存保护单元
  • 用Python爬虫能实现什么?
  • 【QT】label中添加QImage图片并旋转(水平翻转、垂直翻转、顺时针旋转、逆时针旋转)
  • CSP-J模拟赛day1
  • Docker构建LNMP环境并运行Wordpress平台
  • 《峡谷小狐仙-多模态角色扮演游戏助手》复现流程
  • Qt 使用Installer Framework制作安装包
  • Typora 1.5.8 版本安装下载教程 (轻量级 Markdown 编辑器),图文步骤详解,免费领取(软件可激活使用)
  • linux代填密码切换用户
  • 防火墙的经典体系结构及其具体结构
  • 【BUG】已解决:note: This is an issue with the package mentioned above,not pip.
  • 【ARM】SMMU系统虚拟化整理
  • PYQT按键长按机制
  • SAPUI5基础知识15 - 理解控件的本质
  • 十七、【机器学习】【非监督学习】- K-均值 (K-Means)
  • 算法力扣刷题记录 五十六【501.二叉搜索树中的众数】
  • 分布式搜索引擎ES-Elasticsearch进阶
  • 低代码与传统编程:快速高质量构建系统的比较与方法
  • WebRTC音视频-环境搭建
  • Memcached开发(八):使用PHP进行操作
  • [Spring Boot]Protobuf解析MQTT消息体