AptMQL-Bench:通过基于访问模式的模式设计与数据保真迁移,将 Text-to-SQL 扩展至 Text-to-MQL
英文标题:AptMQL-Bench: From Text-to-SQL to Text-to-MQL via Access-Pattern Schema Design and Data-Preserving Migration
研究团队提出 AptMQL-Bench,这是一个通过基于访问模式的文档模式设计和数据保真迁移构建的 Text-to-MQL 基准。论文指出,现有从 Text-to-SQL 基准机械转换而来的方法在实验中无法迁移 BIRD 的 21 个数据库中的 6 个,且在其他数据库中最多会静默丢失 25.9% 的行数据。AptMQL-Bench 包含 21 个面向文档的数据库、3,186 条自然语言请求及对应的 MQL 查询,数据库从 SQLite 迁移时未发生数据丢失,并可高效扩展。最强模型 Claude Opus 4.5 在无外部知识证据时准确率仅为 57.38%,使用外部知识证据后为 70.34%,表明真实场景下的 Text-to-MQL 生成仍具挑战性。
672 B
612 B
380 B
9.1 KB
32.7 KB
22.8 KB
24.2 KB
34.7 KB
中文
[提交于 2026 年 10 月 2 日]
标题:AptMQL-Bench:通过基于访问模式的模式设计与数据保真迁移,将 Text-to-SQL 扩展至 Text-to-MQL
查看 Hy Nguyen 及另外 2 位作者撰写的论文《AptMQL-Bench:通过基于访问模式的模式设计与数据保真迁移,将 Text-to-SQL 扩展至 Text-to-MQL》的 PDF
摘要:MongoDB 等文档数据库是现代应用的核心基础设施。面向这类数据库的自然语言接口——Text-to-MQL——可让非专业用户无需掌握查询语言,也能查询复杂的半结构化数据。这一任务的进展依赖于高质量基准,而最实用的获取方式,是将现有 Text-to-SQL 基准转换至文档数据库场景。遗憾的是,现有工作依赖启发式规则进行机械转换:文档模式映射关系数据库的外键图,每条查询也映射其源 SQL。实验结果显示,这些方法完全无法迁移 BIRD 的 21 个数据库中的 6 个;对于其他数据库,则会静默丢失最多 25.9% 的行数据,并且随着数据规模扩大,其模式对应的标准答案查询运行速度会慢一个数量级以上。为此,我们提出了一条转换流水线:由编码 Agent 驱动,并结合人在回路验证;该流水线根据预期访问模式设计每个文档模式,并将查询重写为 MongoDB 原生形式。我们将其应用于 BIRD,构建了一个基于访问模式的 Text-to-MQL 基准(AptMQL-Bench)。该基准包含 21 个面向文档的数据库、3,186 条自然语言请求及其对应的 MQL 查询;其中的数据库从 SQLite 迁移而来,未发生数据丢失,并且能够高效扩展。最强模型 Claude Opus 4.5 在不使用外部知识证据时仅达到 57.38% 的准确率,使用外部知识证据时达到 70.34%。这表明,真实场景下的 Text-to-MQL 生成仍然具有挑战性。
提交历史
来自:Ngoc Gia Hy Nguyen [
]
[v1]
2026 年 10 月 2 日,周五 03:54:06 UTC(1,442 KB)
English / 原文
[Submitted on 2 Oct 2026]
Title:AptMQL-Bench: From Text-to-SQL to Text-to-MQL via Access-Pattern Schema Design and Data-Preserving Migration
View a PDF of the paper titled AptMQL-Bench: From Text-to-SQL to Text-to-MQL via Access-Pattern Schema Design and Data-Preserving Migration, by Hy Nguyen and 2 other authors
Abstract:Document databases such as MongoDB are core infrastructure for modern applications, and natural-language interfaces to them---text-to-MQL---would let non-experts query complex, semi-structured data without mastering the query language. Progress on this task depends on high-quality benchmarks, which are most practically obtained by converting an existing text-to-SQL benchmark to the document setting. Unfortunately, existing efforts rely on heuristics for mechanical conversion: the document schema mirrors the relational foreign-key graph, and each query mirrors its source SQL. As a result in our experiments, these approaches fail to migrate 6 of 21 BIRD databases outright, silently drop up to 25.9% of rows on others, and yield schemas whose ground-truth queries run over an order of magnitude slower as the data scales. We instead propose a conversion pipeline, driven by coding agents with human-in-the-loop verification, that designs each document schema from expected access patterns and rewrites queries to be MongoDB-native. Applying it to BIRD, we build an access-pattern-based text-to-MQL benchmark (AptMQL-Bench). It includes 21 document-oriented databases, 3,186 natural-language requests, and their associated MQL queries---whose databases are migrated from SQLite without data loss and scale efficiently. The strongest model, Claude Opus 4.5, achieves only 57.38% accuracy without external knowledge evidence and 70.34% with it. This indicates that realistic text-to-MQL generation remains challenging.
Submission history
From: Ngoc Gia Hy Nguyen [
]
[v1]
Fri, 2 Oct 2026 03:54:06 UTC (1,442 KB)