Evaluated on the Spider 1.0 dev set (1,034 questions) using an agentic benchmark pipeline. The agent autonomously explores database schemas via tool calls, writes pipe SQL, and iterates until correct — matching the training workflow.
Execution Accuracy
Metric
Value
Execution Accuracy
60.66% (626 / 1,032)
Prediction Rate
99.7% (1,031 / 1,034)
Total Questions
1,034
Gold Errors Excluded
2
Context: Spider 1.0 Dev Set SOTA
Model
Size
EX (Dev)
Method
MiniSeek
—
91.2%
Proprietary
DAIL-SQL + GPT-4 + SC
—
86.6%
In-context learning
DIN-SQL + GPT-4
—
85.3%
In-context learning
SFT CodeS-7B
7B
85.4%
Fine-tuned
SFT CodeS-3B
3B
83.3%
Fine-tuned
SFT CodeS-1B
1B
77.9%
Fine-tuned
Pipe SQL 1.5B (ours)
1.5B
60.7%
Fine-tuned, agentic tool-calling
Our model trails CodeS-1B by ~17 points. Key differences: (1) Pipe SQL generates a novel SQL dialect (pipe syntax) rather than standard SQL, adding a transpilation step; (2) the agentic tool-calling interface adds overhead vs. direct SQL generation; (3) our focus is on demonstrating the pipe SQL paradigm, not maximizing Spider accuracy. Sources: Spider leaderboard, CodeS (Li et al., 2024).
Detailed Breakdown
Status
Count
% of Total
Description
Match
626
60.5%
Predicted SQL produces identical results to gold SQL
Mismatch
209
20.2%
SQL executes but results differ from gold
Execution Error
170
16.4%
Transpiled SQL fails to execute against SQLite
Transpile Error
24
2.3%
Pipe SQL cannot be transpiled to standard SQL
No Prediction
3
0.3%
Agent did not produce a pipe SQL query
Gold Error
2
0.2%
Reference gold SQL fails (excluded from denominator)
Evaluation Methodology
The TypeScript agent runs each question through a multi-turn tool-calling loop (max 10 turns, 120s timeout)
The agent's final execute_pipe_sql call is extracted as the predicted pipe SQL
Predicted pipe SQL is transpiled to standard SQL using sqlglot.transpile()
Both predicted and gold SQL are executed against the Spider SQLite databases
Result sets are compared using order-insensitive set comparison with numeric tolerance
Note: This is an in-distribution evaluation — the model was trained on Spider training data, and the dev set uses the same 20 databases.
Tools
The model was trained to use 5 tools in a multi-turn conversation:
Tool
Description
list_tables
List all tables in a database
describe_table
Get column names, types, and constraints for a table
sample_data
Retrieve sample rows from a table
execute_pipe_sql
Execute a pipe SQL query against the database
validate_pipe_sql
Validate pipe SQL syntax without executing
Usage
Chat Template
The model uses a custom chat template with <tool_call> tags for tool invocations:
<|im_start|>assistant
Let me explore the database first.
<tool_call>
list_tables({"db_id": "concert_singer"})
</tool_call><|im_end|>
1# Run all 1,034 questions (takes ~2 hours on RTX 4080)2bash pipe_sql/evaluation/run_all.sh
34# Smoke test with 5 questions first5bash pipe_sql/evaluation/run_all.sh --limit 5
This script:
Starts the Python evaluation server (model inference + tool execution)
Waits for the server to be ready
Runs the TypeScript agent benchmark
Evaluates results and prints execution accuracy
Option B: Run Components Separately
Start the evaluation server:
bash
1# Default: loads model from pipe_sql/finetuning_output/merged/2python -m pipe_sql.evaluation.server.app
34# Custom model path:5MODEL_PATH=path/to/model python -m pipe_sql.evaluation.server.app
Wait for Server ready in the logs, then in a separate terminal:
Run the agent benchmark:
bash
1cd pipe_sql/evaluation/agent
2npx tsx src/main.ts --benchmark # All 1,034 questions3npx tsx src/main.ts --benchmark --limit 5# Smoke test
Run single question interactively:
bash
1cd pipe_sql/evaluation/agent
2npx tsx src/main.ts "How many singers do we have?" concert_singer
Server fails to load model: Ensure pipe_sql/finetuning_output/merged/ contains config.json, model.safetensors, and tokenizer.json. If using a different path, set MODEL_PATH.
CUDA out of memory: The 1.5B model needs ~3 GB VRAM in float16. Close other GPU processes or use CUDA_VISIBLE_DEVICES=0 to select a specific GPU.
Agent produces garbled tool calls: The 1.5B model sometimes generates garbled special tokens instead of proper <tool_call> tags. The inference server includes fallback parsing for bare function calls — this is handled automatically.
Spider databases not found: Run bash scripts/setup_data.sh to download Spider 1.0. The script downloads from Google Drive via gdown.
Limitations
Trained and evaluated only on Spider 1.0 (SQLite databases)
Context window limited to 2,048 tokens during training
The 1.5B model may generate garbled special tokens instead of proper <tool_call> tags — the inference server includes fallback parsing for bare function calls
Performance on out-of-distribution databases (different schemas/domains) has not been extensively tested
This is an in-distribution evaluation; real-world performance on unseen databases will likely be lower
License
This model is released under the Apache 2.0 License, consistent with the base Qwen2.5-Coder model license.