MongoBench:LLM 能否预知 MongoDB 查询的匹配结果?
原标题:MongoBench: Do LLMs Know What a MongoDB Query Will Do?
AI 摘要
研究者提出 MongoBench 基准,用于评估 LLM 在运行 MongoDB find() 查询前预测其匹配结果的能力,共 300 道题,每题组合三到四个有文档记录的匹配陷阱,标准答案由真实 mongod 服务器生成。评测四个模型(三家厂商的前沿模型和一个开源权重推理模型),准确率在 70.1% 到 92.1% 之间,相差 22 个百分点;每个出题模型对自己出的题也有 10% 到 31% 预测错误。失败模式分析显示,错误更易由查询涉及的语义陷阱(范围比较、null)预测,而非文档数量等表层指标;研究还发现,把查询委托给引擎执行虽能可靠得到匹配集,但必须校验委托是否忠实,因为有一个模型在 28% 的题目上执行的过滤器未通过规范检查。
正文节选
MongoBench: Do LLMs Know What a MongoDB Query Will Do? Abstract LLM agents increasingly operate databases on their own: they generate queries and run them against live data. Two checks are commonly used to judge such an agent—whether it produces a valid query, and whether it reaches the right final answer—but neither tells us whether the agent knows what its query will actually do before it runs. We argue that this consequence prediction ability must be evaluated in its own right, and we build M