Agent Frameworks

FINER-SQL: Boosting Small Language Models for Text-to-SQL

3B model rivals LLMs with 85% accuracy and 5.57s latency per sample.

Deep Dive

Researchers from multiple institutions have released FINER-SQL, a reinforcement learning framework designed to supercharge small language models (SLMs) for Text-to-SQL generation. The approach addresses the core weakness of SLMs—poor reasoning and instruction following—by replacing the conventional sparse binary reward signals (0/1 for SQL correctness) with dense, interpretable feedback. FINER-SQL introduces two novel reward functions: a memory reward that aligns the model's reasoning with verified execution traces for semantic stability, and an atomic reward that grants partial credit for structurally correct but incomplete SQL queries at the operation level. This transforms the learning signal from a binary pass/fail into continuous feedback, enabling stable, critic-free optimization using group relative policy optimization.

Benchmarked on the BIRD and Spider datasets, FINER-SQL with a 3B parameter model achieves execution accuracy of 67.73% and 85% respectively—matching the performance of much larger LLMs while dramatically reducing inference latency to just 5.57 seconds per sample. This makes high-performance Text-to-SQL viable for on-premise deployment where cost, latency, and data privacy are critical concerns. The code is publicly available, offering a practical path for organizations that need natural language to database query capabilities without sending sensitive data to third-party APIs.

Key Points
  • Replaces sparse binary rewards with dense memory and atomic rewards for stable SLM training.
  • 3B FINER-SQL model achieves 85% accuracy on Spider and 67.73% on BIRD benchmarks.
  • Inference latency reduced to 5.57s per sample, enabling cost-efficient on-premise deployment.

Why It Matters

Enables accurate, private, and affordable Text-to-SQL using small models instead of expensive LLMs.