[KongchangAI]
· 2 min read· 1,018 words

Training-Free Decoding Method SLA: Tackling Schema Ambiguity in Text-to-SQL

Training-Free Decoding Method SLA: Tackling Schema Ambiguity in Text-to-SQL

SLA adjusts token logits by semantic similarity to boost SQL diversity under schema ambiguity without training.

The article addresses schema ambiguity in Text-to-SQL, where one question may map to multiple reasonable schema elements and systems must present diverse interpretations in top-k candidates. Since LLMs favor high-probability paths and produce skewed outputs, researchers propose Semantic-aware Logit Adjustment (SLA), a training-free decoding method that penalizes or rewards candidate token logits based on semantic similarity between schema elements. SLA is efficient, model-agnostic, and easy to deploy, outperforming standard decoding in interpretation coverage at much lower inference cost.

In real-world Text-to-SQL systems, schema ambiguity is a common and thorny problem—the same natural language question may map to multiple plausible database schema elements. To support downstream disambiguation, SQL generation systems need to present diverse interpretations among their top-k predictions. However, large language models (LLMs) tend to favor a single interpretation, resulting in highly skewed outputs. To address this tension, researchers propose a training-free decoding method called Semantic-aware Logit Adjustment (SLA), which adjusts token logits based on semantic similarity between schema elements to promote diverse SQL generation.

rss source: Semantic-aware Decoding for Diverse Text-to-SQL under Schema Ambiguity

Schema Ambiguity: The Hidden Challenge of Text-to-SQL

In database query scenarios, user questions often admit multiple reasonable interpretations. For example, "show the product with the highest sales" may correspond to different table join strategies and aggregation logic. If a traditional Text-to-SQL system outputs only a single SQL query, it may miss the user's true intent. Therefore, generating a diverse set of candidate SQL queries is crucial for subsequent interactive disambiguation. However, current LLM-based methods have a clear shortcoming: models gravitate toward high-probability paths, resulting in insufficient diversity in top-k predictions and difficulty covering all reasonable schema interpretations.

Top-k Prediction and Interpretation Coverage: In ambiguous scenarios, systems typically return not just one SQL query but the k most probable candidates (top-k), which are then selected by the user or a downstream module. When evaluating such systems, "accuracy" alone is insufficient to capture their value, because if all k candidates are variants of the same interpretation, the user still cannot disambiguate. Interpretation coverage measures how many distinct reasonable interpretations (i.e., different schema mappings) the top-k candidate set covers, and is the core metric for diversity-oriented evaluation. It complements traditional Execution Accuracy: the latter focuses on whether a single SQL query executes correctly, while the former focuses on whether the candidate set "covers all the possible meanings." SLA's experiments use coverage as the primary metric, demonstrating that its goal is not to improve single-point precision but to broaden the interpretive breadth of the candidate set.

SLA: A Training-Free Decoding Innovation

The core idea of SLA is to dynamically adjust the token probability distribution during decoding, without additional training or complex prompt engineering. Specifically, the method computes semantic similarity between schema elements (such as table names and column names) and uses it to penalize or reward the logits of candidate tokens, thereby encouraging the model to explore semantically different schema paths. Compared with prior methods that rely on reasoning-intensive prompting or task-specific fine-tuning, SLA offers significant advantages: it is efficient, model-agnostic, and easy to deploy. This means developers can seamlessly integrate it into existing LLM inference pipelines without retraining models or designing complex prompts.

Logits and Logit Adjustment: At each decoding step of an LLM, the model computes an unnormalized score—a logit—for every token in the vocabulary; these are converted into a probability distribution via softmax and then used for sampling or argmax selection. Logit Adjustment is a class of techniques that directly apply biases or penalties to logits during decoding, commonly used to control generation attributes (such as debiasing, diversity, and constraint satisfaction), with the advantage of not requiring changes to model parameters. SLA converts "semantic similarity between schema elements" into penalty terms on candidate token logits: if the table name or column name corresponding to a token is semantically similar to already-selected schema elements, its logit is suppressed, guiding the model toward semantically different schema paths and achieving diverse SQL generation.

Schema Elements: These refer to the basic building blocks of a database schema, typically including table names, column names, primary and foreign keys, and constraints. In Text-to-SQL, natural language questions must be "anchored" to these elements (e.g., identifying which tables and columns a query involves), a process called Schema Linking. When the same question can correspond to multiple sets of schema elements, schema ambiguity arises. SLA operates at the token level precisely because schema elements such as table names and column names appear as tokens in the generated SQL; adjusting the logits of relevant tokens can indirectly influence schema selection.

Experimental Validation: Coverage Gains and Cost Advantages

Experimental results show that SLA consistently outperforms standard decoding methods in interpretation coverage and remains competitive with existing diversity-oriented methods at significantly lower inference cost. This validates SLA's practical value in real-world Text-to-SQL systems: it improves diversity without imposing a heavy computational burden. For production environments that need to handle schema ambiguity, SLA offers a lightweight solution.

Industry Implications and Future Directions

The introduction of SLA reflects a trend in Text-to-SQL research: shifting from a sole focus on generation accuracy to an emphasis on output diversity and interpretability. In scenarios such as database interaction, intelligent customer service, and data analytics, systems that can offer multiple reasonable interpretations are more likely to meet user needs. In the future, how to combine SLA with techniques such as retrieval augmentation and interactive disambiguation is worth further exploration. Meanwhile, SLA's training-free nature gives it strong generalization potential and makes it extensible to other structured generation tasks.

In summary, SLA provides an efficient and practical decoding strategy for the schema ambiguity problem in Text-to-SQL, with the potential to advance the deployment of diverse SQL generation in real-world applications.

One-line Summary

SLA adjusts token logits via semantic similarity to boost SQL diversity under Text-to-SQL schema ambiguity without training.

Paragraph Summary

The article focuses on schema ambiguity in Text-to-SQL: the same natural language question may correspond to multiple sets of reasonable schema elements such as tables and columns, and systems need to present diverse interpretations among top-k candidates to support downstream disambiguation. However, LLMs favor high-probability paths, producing highly skewed outputs. To address this, researchers propose Semantic-aware Logit Adjustment (SLA), a training-free decoding method that penalizes or rewards candidate token logits during decoding based on semantic similarity between schema elements, encouraging the model to explore semantically different schema paths. Compared with reasoning-intensive prompting and task-specific fine-tuning, SLA is efficient, model-agnostic, and easy to deploy. Experiments show it consistently outperforms standard decoding in interpretation coverage and remains competitive with existing diversity methods at significantly lower inference cost.

#Text-to-SQL#schema ambiguity#training-free decoding#logit adjustment#SQL diversity
Share:

Related articles