arXiv:2609.02324cs.IR2026-09

动态调整生成预算与选择性修正,提升文本转查询的效率与准确性。

Adaptive Test-Time Inference for Text2Cypher with Trace Budgeting and Selective Refinement

论文配图:Adaptive Test-Time Inference for Text2Cypher with Trace Budgeting and Selective Refinement
图 1 · 摘自论文原文
  • 根据问题难度动态分配生成预算,避免固定开销
  • 节省30.7%生成预算,提速21-25%且保持质量
  • 仅对复杂问题修正,适合资源受限场景

大型语言模型实现了自然语言到结构化数据库的接口,但生成的查询仍可能包含语法错误、违反数据库模式或执行失败。测试时推理策略可提升生成可靠性而无需额外训练,但现有方法常采用固定推理预算和统一修正策略,导致不同复杂度问题产生不必要的计算。本文研究 Text2Cypher 的自适应测试时推理,提出两种策略:自适应轨迹预算,根据问题难度动态调整候选生成预算;选择性执行引导修正,仅在额外推理有望带来收益时才进行修正。在 Gemma-2-9B 与 Qwen-2.5-7B 上的实验表明,自适应轨迹预算使平均生成预算降低 30.7%,实际推理时间减少 21-25%,同时维持相近生成质量;选择性修正几乎保留了完整修正的执行成功率(仅下降 0.2-0.5%),避免了简单问题的无效修正。实验还表明,单一修正模型(Gemma-4)可有效优化不同模型族的输出,提示修正能力具备跨模型家族迁移性。

原文摘要 · Abstract (English)

Large language models have enabled natural language interfaces for structured databases, but generated queries may still contain syntactic errors, violate database schemas, or fail during execution. Test-time inference strategies improve generation reliability without additional training, but existing approaches often use fixed inference budgets and uniform refinement strategies, leading to unnecessary computation across questions with different complexity levels. In this work, we investigate adaptive test-time inference for Text2Cypher and introduce two strategies: adaptive trace budgeting, which dynamically adjusts the candidate generation budget based on question difficulty, and selective execution-guided refinement, which applies correction only when additional inference is expected to be beneficial. Experiments on Gemma-2-9B and Qwen-2.5-7B show that adaptive trace budgeting reduces the average generation budget by 30.7% and wall-clock inference time by 21-25% while maintaining comparable generation quality. Selective refinement preserves nearly all execution success gains of full refinement, reducing execution success by only 0.2-0.5% while avoiding unnecessary refinement for simpler questions. Experiments show that a single correction model (Gemma-4) effectively refines outputs from a different model family, suggesting refinement transfers across families.

文本转查询测试时推理自适应优化查询纠错

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。