A new arXiv paper presents BAP-SQL, a method for agentic text-to-SQL systems that treats observation gathering as a budget-control problem. In these systems, the agent’s database queries determine what evidence it sees next, and broad queries can waste context before useful rows appear.

BAP-SQL estimates query risk, rewrites SQL when useful, and delegates hard limits to an independent runtime shield. The aim is to decide what information to observe before context and database work are spent.

Across 4B, specialized 4B, and 7B model backbones, the authors report better tight-budget success. In the main BIRD-derived setting, BAP-SQL gained 3.4 and 3.6 percentage points over matched supervised fine-tuning while using 4.5% and 5.0% fewer tokens.

The benefit faded as models and budgets grew, and it did not reduce database work. That makes the method most relevant where context is scarce and careful observation planning matters.