← Back to Paper List

ODIN: A NL2SQL Recommender to Handle Schema Ambiguity

Kapil Vaidya, Abishek Sankararaman, Jialin Ding, Chuan Lei, Xiao Qin, Balakrishnan Narayanaswamy, Tim Kraska
Amazon Web Services
arXiv (2025)
P13N Recommendation QA Agent

📝 Paper Summary

User-profile based personalization Multi-turn w. user interactions
Odin resolves database schema ambiguity by generating diverse SQL options via iterative schema masking, filtering them with conformal prediction, and learning user preferences to personalize future queries.
Core Problem
Enterprise databases often contain ambiguous schemas (e.g., similarly named tables/columns), causing standard NL2SQL models to guess user intent incorrectly and produce wrong data.
Why it matters:
  • Ambiguity can lead to structurally different queries (e.g., joins vs. pre-aggregated lookups) with different runtime costs and results
  • Standard diversity techniques like high-temperature sampling produce only 'cosmetic' variations (syntax changes) rather than 'semantic' diversity (logic changes), failing to expose real alternatives to the user
  • Users have specific business logic preferences (e.g., using 'gross_sales' vs 'net_sales') that generic models fail to capture over time
Concrete Example: A user asks 'What is the revenue per customer?'. The database has an `orders` table (requiring aggregation) and a `customers` table (with a `total_revenue` column). A standard model might guess one arbitrarily. Odin generates both options, allowing the user to select the pre-aggregated column, which Odin then learns as a preference.
Key Novelty
Generate-Select-Personalize Paradigm for Ambiguity
  • **Forced Diversity via Masking:** Instead of random sampling, the Generator explicitly hides schema elements (columns/tables) used in previous queries to force the LLM to find alternative valid paths (e.g., hide `birthplace` to force use of `origin`)
  • **Conformal Selection:** Uses conformal prediction to filter the candidate set, providing statistical guarantees that the correct query is retained while minimizing the number of options shown to the user
Architecture
Architecture Figure Figure 1
Overview of Odin's workflow handling a user question about 'hometown of students'.
Evaluation Highlights
  • Improves the likelihood of generating the correct SQL query by 1.5–2x compared to baselines on the AmbiQT benchmark
  • Maintains a result set size that is 2–2.5x smaller than baselines while preserving accuracy
  • Successfully generates semantically diverse queries where traditional high-temperature sampling produces only superficial syntactic variations
Breakthrough Assessment
8/10
Addresses a critical, often-overlooked real-world enterprise problem (schema ambiguity) with a clever algorithmic solution (masking) rather than just bigger models. The integration of conformal prediction for quality control is robust.
×