HarnessSQL trains SQL agents for long-horizon database interaction
HarnessSQL is an open-source framework from researchers at HKUST, Microsoft and other institutions that trains SQL agents with full-trajectory supervised fine-tuning and execution-reward reinforcement learning in database sandboxes. The team reports that HarnessSQL-8B reached 45.2% execution accuracy on Spider 2.0-SQLite, while the 14B version reached 54.8%. These figures come from the authors’ evaluations and have not been independently replicated in the supplied reports.
The release provides an open implementation of a training approach that aligns SQL agents with interactive database environments rather than training them only to emit a final query.
新智元 2026-11-02 17:05 北京
新智元报道
在企业级真实业务与复杂数据分析中,让大模型「一眼看穿数据库并写出完美SQL」,往往只是一个不切实际的幻想。
传统的Text-to-SQL大多将其简化为单轮文本生成:给定问题和静态Schema,让模型一步生成最终SQL。但现实数据库动辄包含上百张表、数千字段与百万级数据,资深分析师绝不会「单轮盲猜」,而是在CLI或IDE 中执行 `SHOW TABLES`、探查表结构(DDL)、跑试探性查询(Probe Query),并根据报错反复修正逻辑后才提交代码。
在Spider2.0、BIRD-Interact和LiveSQLBench等长程交互基准上,传统静态微调模型纷纷暴露致命短板:训练时只学会「直接写终点答案」,部署到交互环境(Harness)后却缺乏探索试错、状态追踪与错误恢复能力,极易陷入死循环或因报错崩溃——即「训练与部署脱节」(Train–Deploy Mismatch)。
#HarnessSQL#Hong Kong University of Science and Technology#Microsoft#DeepSeek-Harness#Qwen3-14B#OmniSQL#Arctic-Text2SQL#MARS-SQL