Semantic-aware Decoding for Diverse Text-to-SQL under Schema Ambiguity
Organizations: ATHENA Research Center, Greece · Utrecht University, Netherlands
Abstract
Real-world text-to-SQL systems often face schema ambiguity, where a question can map to multiple plausible schema elements. To support downstream disambiguation, SQL generation systems should include diverse interpretations among their top-k predictions. However, large language models (LLMs) typically favor a single interpretation, producing highly skewed outputs. We propose Semantic-aware Logit Adjustment (SLA), a training-free decoding method that promotes diverse SQL generation by adjusting token logits based on semantic similarity between schema elements. Unlike prior approaches that rely on reasoning-intensive prompting or task-specific fine-tuning, SLA is efficient, model-agnostic, and easy to deploy. Experiments show that SLA consistently improves interpretation coverage over standard decoding and remains competitive with existing diversity-oriented methods at substantially lower inference cost.
Figures & tables
| Column | Join | Table | Vague | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Model | Method | Either | Both | Either | Both | Either | Both | Either | Both |
| Llama-8B | Sampling | 59.17 | 11.84 | 76.89 | 23.45 | 66.22 | 17.15 | 64.99 | 8.81 |
| Beam | 57.29 | 10.56 | 77.59 | 16.55 | 65.49 | 17.15 | 57.91 | 8.86 | |
| Constrained | 61.48 | 17.89 | 75.52 | 31.38 | 70.43 | 24.77 | 58.97 | 8.97 | |
| SchemaBeam | 62.45 | 38.36 | 78.28 | 54.83 | 70.22 | 39.03 | 67.72 | 23.63 | |
| QwenCoder-14B | Sampling | 63.58 | 14.37 | 90.57 | 23.33 | 74.70 | 23.79 | 64.29 | 6.76 |
| Column | Join | Table | Vague | |||||||
| Category | Method | latency | Either | Both | Either | Both | Either | Both | Either | Both |
| Prompt-based | Prompt | 1.59 | 59.87 | 23.77 | 74.88 | 33.45 | 71.91 | 58.36 | 53.95 | 13.08 |
| Reasoning ensemble | 10.9 | 65.75 | 15.95 | 82.41 | 19.66 | 76.99 | 21.74 | 63.61 | 6.01 | |
| CLEAR | 6.36 | 62.85 | 32.39 | 86.55 | 38.62 | 70.15 | 36.34 | 51.2 | 11.11 | |
| ODIN | - | 67.44 | 43.69 | 87.85 | 58.33 | 73.96 | 59.99 | - | - | |
| Fine-tuning-based | DFPL | 2.54 | 64.40 | 38.84 | 75.61 | 6.10 | 71.92 | 36.66 | 60.12 | 19.64 |
| Column | Table | ||||
|---|---|---|---|---|---|
| Method | Emb. | Either | Both | Either | Both |
| SchemaBeam | Qwen | 62.13 | 38.11 | 70.36 | 38.11 |
| SchemaBeam | mpnet | 62.05 | 39.00 | 69.87 | 38.53 |
| SchemaBeam | MiniLM | 62.45 | 38.36 | 70.22 | 39.03 |
| w/ avg | 62.37 | 38.28 | 70.92 | 33.87 | |
| w/o deduplication | 61.89 | 36.18 | 68.67 | 35.64 | |
Text-to-SQL
Text-to-SQL translates natural-language questions into executable database queries, linking user intent to schemas, values, and SQL logic.
See all 195 papers