跳转至

文章背景与核心概要

当前的各类大语言模型(LLM)分析智能体评估主要集中在 SQL 语法的准确性上。然而,现实生产环境中的故障往往源于完全不同的挑战:包含多种有效业务定义的复杂问题、数仓中无法回答的问题、因架构迁移而过时的列,以及虽然能成功执行却返回事实性错误业务指标的查询。

为了填补这一空白,本文引入了 WarehouseReliabilityBench,这是一个严苛的基准测试,包含分布在两个合成数仓中的 400 个固定任务。在该基准中,大约一半的正确响应需要澄清、弃权或拒绝,而不是直接返回查询。作者提出了 QueryProof,这是一个拥有 7B 参数的智能体,它利用语义层和物理目录规则来规范其行为,并辅以确定性的执行后检查。尽管其参数规模较小,但 QueryProof 在大幅降低成本的同时,显著优于直接提示的 32B 基线模型,这充分证明了在商业分析应用中,架构设计和规则门控远比纯粹的模型规模更为重要。


Business Truth, not SQL Accuracy: A Rule-Gated 7B Analytics Agent Outperforms a Direct-Prompted 32B Baseline

Business Truth, not SQL Accuracy: A Rule-Gated 7B Analytics Agent Outperforms a Direct-Prompted 32B Baseline


📌 Executive Summary

📌 Executive Summary

当前的 LLM 分析智能体评估主要关注 SQL 语法准确性。然而,实际生产环境中的失败往往源于截然不同的挑战: * 包含多个有效业务定义的问题。 * 数仓中无法回答的问题。 * 由于架构迁移而产生的过时列。 * 执行成功但返回事实错误业务指标的查询。

Current evaluations of Large Language Model (LLM) analytics agents focus heavily on SQL syntax accuracy. However, real-world production failures stem from entirely different challenges: * Questions with multiple valid business definitions. * Unanswerable warehouse questions. * Deprecated columns resulting from schema migrations. * Queries that execute successfully while returning factually incorrect business metrics.

为了解决这一空白,本文推出了 WarehouseReliabilityBench,这是一个严苛的基准测试,包含横跨两个合成数仓的 400 个冻结任务。在该基准测试中,大约一半的正确响应需要进行澄清、弃权或拒绝,而不是盲目输出直接查询。

To address this gap, this paper introduces WarehouseReliabilityBench, a rigorous benchmark comprising 400 frozen tasks across two synthetic warehouses. In this benchmark, roughly half of the correct responses require clarification, abstention, or refusal rather than a direct query.

作者提出了 QueryProof,这是一个 7B 参数的智能体,它利用语义层和物理目录规则来规范行为,并由确定性的执行后检查提供支持。尽管参数规模较小,但 QueryProof 以极低的成本显著超越了直接提示的 32B 基线模型,展示了在商业分析应用中,系统架构和规则门控相较于原始模型规模的巨大威力。

The author presents QueryProof, a 7B parameter agent utilizing semantic-layer and physical-catalog rules to govern behavior, backed by deterministic post-execution checks. Despite its smaller parameter size, QueryProof significantly outperforms a direct-prompted 32B baseline at a fraction of the cost, demonstrating the power of architecture and rule-gating over raw model scale in business analytics applications.


🔍 Key Findings & Performance Highlights

🔍 Key Findings & Performance Highlights

  • 卓越的准确性: 在包含 80 个任务的合成测试集上,QueryProof 的商业真相率(Business Truth Rate)比直接提示的 32B 基线模型高出 +0.237(95% 置信区间:[+0.112, +0.375])。
  • 成本效益: 与未加脚手架(unScaffolded)的 32B 基线相比,它以 每个正确答案低 71.0% 的成本 实现了这些性能提升。与成本匹配的少样本(few-shot)基线相比,准确性优势依然存在。
  • 降低虚假成功率: 返回答案中的虚假成功率从 0.754 急剧下降至 0.351
  • 零严重错误: 在可回答的任务中返回了 0 个错误数字(24 个任务中 0 个出错),不过有 13 个答案被派发给了需要明确澄清或弃权的问题。
  • 脚手架 vs. 规模: 性能的提升归功于确定性的规则门控层,而不是模型的参数规模或复杂的路由机制。
  • Superior Accuracy: On an 80-task synthetic test split, QueryProof outperforms a direct-prompted 32B baseline by +0.237 (95% CI: [+0.112, +0.375]) in Business Truth Rate.
  • Cost Efficiency: Achieves these performance gains at 71.0% lower cost per correct answer compared to the unScaffolded 32B baseline. Against a cost-matched few-shot baseline, the accuracy advantages persist.
  • Reduction in False Success: False success rates plummeted from 0.754 to 0.351 of returned answers.
  • Zero Critical Errors: 0 wrong numbers were returned on answerable tasks (0 out of 24), though 13 answers were dispatched to questions requiring explicit clarification or abstention.
  • Scaffolding vs. Scale: The performance gains are attributed to the deterministic rule-gating layer rather than model parameter scale or routing complexities.

📑 Metadata & Classifications

📑 Metadata & Classifications