Retrieval & Search / NAACL Workshop 2024

When a Medical Database Cannot Answer, Teach the Model to Stop

PLUQ learns from questions it predicts the database cannot answer. It combines that training with filters for uncertain or unproductive SQL queries.

LG AI Research & KAIST at EHRSQL 2024: Self-Training Large Language Models with Pseudo-Labeled Unanswerable Questions for a Reliable Text-to-SQL System on EHRs

Yongrae Jo, Seongyun Lee, Minju Seo, Sung Ju Hwang, Moontae Lee

Overview

A question can sound natural in a hospital and still be impossible to answer from the records at hand. A system that translates the question into SQL may produce a result that looks plausible because the query runs. The EHRSQL shared task treats knowing when to abstain as part of the work. The authors teach a model to recognize likely unanswerable questions, then apply two checks before accepting its queries.

Key Findings

A database assistant faces two kinds of failure. It can write a query that returns the wrong record, or it can confidently query for information the database never stored. The shared task penalizes both, which makes the decision to withhold a query part of what the team has to learn.

The system combines pseudo-labeling with uncertainty and execution checks before returning a query.
The system combines pseudo-labeling with uncertainty and execution checks before returning a query.

Train on examples of what the database cannot say

PLUQ first fine-tunes GPT-3.5-Turbo-0125 through the OpenAI fine-tuning API on 5,124 labeled questions. It then applies the seed to unlabeled inputs from the shared-task development or test set. It adds questions predicted to be unanswerable back to the training data with that predicted label and fine-tunes again. The model sees a textual version of the MIMIC-IV demo schema. One filter scores each query by its highest token entropy, a signal of uncertainty in the generated SQL. The development ablation filters out the highest-entropy 7%, with the cutoff set using the expected proportion of unanswerable questions. The other checks whether a query executes and yields a usable result under the paper's rules. Self-training and filtering, Section 3

An incorrect answer costs more than a skipped question

Development-set configurationRS(0)RS(10)
No filtering80.82−69.94
Execution filter93.9885.38
Execution and entropy filters90.3788.65

RS(10) penalizes an incorrect response by 10 while giving zero for abstaining on an answerable question. A correct response or a correct abstention earns one point. Adding the entropy filter raises the score under the larger penalty while lowering RS(0). On the official test leaderboard, PLUQ scores 81.32 on RS(10), ahead of PromptMind at 74.89. Scoring rule, Figure 2 · Test results, Table 1 · Filtering ablation, Table 4

Learn from examples the system expects it cannot answer

The team starts with labeled questions and looks for likely unanswerable items in an unlabeled split. Adding those examples lets the model see more occasions when its output should be null. The selection still depends on the seed model. A confidently mistaken seed can teach the next model the same error, so the later filtering experiments are important evidence.

A penalty can change the best threshold

The shared task awards a point for a correct answer and applies a cost to incorrect replies. A more expensive error makes abstention more attractive near the threshold. Entropy and execution address different risks. An uncertain token can indicate an unreliable query, while an execution test checks whether the SQL runs. A valid query can still express the wrong request, so the evaluation has to compare results as well as execution.

Questions & Answers

The opening answers are simulated author responses based on the paper.

Q: What does pseudo-labeling add?

A: The seed model identifies likely unanswerable questions in unlabeled inputs. We reuse those predictions to increase representation of that category in the second training stage.

Q: Why check execution and uncertainty?

A: Execution can catch a query that fails at the database. Uncertainty can flag a query that runs but may still be wrong. The filters address different failure modes.

Q: Why might a query that runs still be wrong?

A: Execution checks whether the database can run the SQL. It cannot establish that the SQL expresses the user’s intent. Zero rows can be correct when the matching records do not exist, whereas a missing schema field can make the question unanswerable. Because the shared-task setup uses unlabeled evaluation questions for pseudo-labeling, a new-schema split would test transfer under different conditions.

Future Ideas

Give each refusal a reason a database maintainer can verify

Build a test on synthetic records with a fixed schema. Include questions with missing fields, ambiguous terms, and legitimate empty answers. Compare a single abstention threshold with a system that returns a reason code after validating the schema and executing SQL in a read-only sandbox. On a new schema withheld from training, measure wrong-answer rate, correct empty answers, and reason accuracy at matched coverage.

Hold back an entire schema and prelabel reason categories for abstaining or returning a valid empty answer.

Sources

Original abstract

Text-to-SQL models are pivotal for making Electronic Health Records (EHRs) accessible to healthcare professionals without SQL knowledge. With the advancements in large language models, these systems have become more adept at translating complex questions into SQL queries. Nonetheless, the critical need for reliability in healthcare necessitates these models to accurately identify unanswerable questions or uncertain predictions, preventing misinformation. To address this problem, we present a self-training strategy using pseudo-labeled unanswerable questions to enhance the reliability of text-to-SQL models for EHRs. This approach includes a two-stage training process followed by a filtering method based on the token entropy and query execution. Our methodology’s effectiveness is validated by our top performance in the EHRSQL 2024 shared task, showcasing the potential to improve healthcare decision-making through more reliable text-to-SQL systems.