草稿-细化-优化:面向自然语言到MongoDB查询生成的自演化学习
Draft-Refine-Optimize: Self-Evolved Learning for Natural Language to MongoDB Query Generation
AI总结:
本文提出EvoMQL框架,通过迭代的草稿-细化-优化流程,结合执行反馈实现自然语言到MongoDB查询生成的自演化学习,提升了执行准确率。
摘要:
自然语言到MongoDB查询语言(NL2MQL)对于普及现代以文档为中心的数据库至关重要。与Text-to-SQL不同,NL2MQL面临MQL过程性聚合管道、深度嵌套模式和模糊值定位的独特挑战。现有方法使用静态提示或单次细化,无法有效建模这些复杂上下文,也无法系统利用执行反馈进行持续改进。本文提出EvoMQL,一种自演化框架,通过迭代的草稿-细化-优化(DRO)循环,统一证据导向的上下文构建与执行驱动的学习。每个循环使用草稿查询触发查询感知检索,动态构建紧凑的证据上下文,解决模式模糊性和嵌套路径到具体值的定位问题。模型随后通过基于执行的奖励和课程调度进行在线策略优化,优化后的模型反馈到后续循环中实现逐步演化。整体而言,EvoMQL在EAI内部分布基准上达到76.6%的执行准确率,在TEND外部分布基准上达到83.1%,优于最强的开源基线。仅使用3B激活参数,这种闭环范式使NL2MQL系统在生产环境中实现可扩展的持续改进。
英文摘要:
Natural Language to MongoDB Query Language (NL2MQL) is essential for democratizing access to modern document-centric databases. Unlike Text-to-SQL, NL2MQL faces unique challenges from MQL's procedural aggregation pipelines, deeply nested schemas, and ambiguous value grounding. Existing approaches use static prompting or one-shot refinement, which inadequately model these complex contexts and fail to systematically leverage execution feedback for persistent improvement. We propose EvoMQL, a self-evolved framework that unifies evidence-grounded context construction with execution-driven learning through iterative Draft-Refine-Optimize (DRO) cycles. Each cycle uses draft queries to trigger query-aware retrieval, dynamically building compact evidence contexts that resolve schema ambiguities and ground nested paths to concrete values. The model then undergoes online policy optimization with execution-based rewards and curriculum scheduling, with refined models feeding back into subsequent cycles for progressive evolution. Overall, EvoMQL achieves state-of-the-art execution accuracy of 76.6% on the EAI in-distribution benchmark and 83.1% on the TEND out-of-distribution benchmark, outperforming the strongest open-source baselines by up to 9.5% and 5.2%, respectively. With only 3B activated parameters, this closed-loop paradigm enables scalable, continuous improvement of NL2MQL systems in production.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。