TLDR: SAFER is a novel two-stage framework designed to improve the trustworthiness of Large Language Models (LLMs) in risk-sensitive question answering. It addresses the challenges of hallucinations and unreliable outputs by first calibrating a sampling budget with an abstention mechanism, ensuring that if no admissible answer is found within a limit, the model abstains. The second stage then filters out unreliable candidates from the sampled set using a statistically calibrated uncertainty threshold. This approach provides rigorous statistical guarantees on the coverage of correct answers, making LLM predictions more reliable and efficient for open-ended tasks.
Large Language Models (LLMs) are becoming increasingly common in applications where accuracy and reliability are paramount, such as answering questions in critical real-world scenarios. However, these models often struggle with generating incorrect or ‘hallucinated’ content and can be overconfident in their unreliable outputs. This makes it challenging to trust them fully, especially when the stakes are high.
To tackle these issues, researchers Qingni Wang, Yue Fan, and Xin Eric Wang from UC Santa Cruz and UC Santa Barbara have introduced a new framework called SAFER. SAFER stands for abstention-aware SAmpling and conformalized FiltERing, and it’s designed to ensure the trustworthiness of LLM outputs by providing statistical guarantees on their accuracy.
Understanding SAFER’s Approach
Traditional methods for ensuring LLM reliability often assume that a correct answer can always be found through repeated sampling, even for open-ended questions where the possible answers are vast and undefined. SAFER challenges this assumption by recognizing that sometimes, an LLM simply might not be able to generate an admissible answer within a reasonable number of attempts. It addresses this through a clever two-stage process.
Stage I: Abstention-Aware Sampling
The first stage focuses on determining how many candidate answers an LLM should generate for a given question. This is called the ‘sampling budget.’ SAFER uses a calibration set (a separate set of questions and answers) to figure out the minimum number of samples needed to ensure that the correct answer is likely to be included in the generated set, all while keeping the risk of miscoverage (not including the correct answer) below a user-defined level. Crucially, SAFER incorporates an ‘abstention’ mechanism. If, even after generating the maximum allowed number of candidates, no admissible answer is found, the model will abstain from providing a prediction. This prevents the framework from producing unreliable answers when the risk level cannot be met, making it much more practical for real-world use.
Stage II: Conformalized Filtering
Once the sampling budget is determined and a set of candidate answers is generated, the second stage comes into play. Even with a statistically sound sampling budget, the candidate set might still contain irrelevant or unreliable answers due to the LLM’s inherent unpredictability or the way it generates responses. To refine this set, SAFER introduces a ‘conformalized filtering’ process. It evaluates the uncertainty of each sampled answer and then calibrates a statistical threshold. Answers with uncertainty scores above this threshold are filtered out, leaving a more reliable and concise set of predictions. This filtering process is also guided by another user-specified risk level, ensuring that while unreliable answers are removed, the chance of accidentally excluding a correct answer remains controlled.
Also Read:
- Dynamic Temperature Control Enhances LLM Reasoning in Reinforcement Learning
- Improving Language Model Exploration with Uncertainty-Aware Advantage Shaping
Key Advantages and Findings
SAFER offers several significant advantages:
- It provides user-specified guarantees for covering admissible answers in open-ended question answering.
- It introduces a practical abstention mechanism into the sampling process, making the calibration of the sampling budget more robust.
- It uses conformal risk control to filter out unreliable candidates, enhancing the efficiency of the prediction sets while maintaining statistical validity.
The researchers evaluated SAFER on three different open-ended QA datasets using five popular LLMs. Their experiments showed that SAFER consistently and rigorously controlled the miscoverage risks at both the sampling and filtering stages. It also proved to be robust across various ways of defining a ‘correct’ answer and efficient, requiring only a small amount of calibration data to achieve risk control on a larger test set.
In essence, SAFER represents a significant step forward in making LLMs more trustworthy for critical applications. By intelligently managing sampling and filtering with statistical guarantees, it helps ensure that when an LLM provides an answer, users can have greater confidence in its reliability. You can read the full research paper here: SAFER: Risk-Constrained Sample-Then-Filter in Large Language Models.


