SafeLLM: Extraction as a Hallucination-Resistant Alternative to Rewriting in Safety-Critical Settings
This paper demonstrates that extraction-based retrieval strategies, particularly line-number selection and draft-first approaches, offer a more hallucination-resistant and reliable alternative to rewriting-based RAG for accessing safety-critical organizational documentation by balancing precision, recall, and model scale across varying guideline structures.
Original paper licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
In hospitals, doctors and nurses rely on vast libraries of written rules to make life-or-death decisions. These documents, known as clinical guidelines, contain the precise steps for treating everything from a sudden heart attack to a rare infection. They are the consensus of expert knowledge, written to ensure that every patient receives safe, consistent care. However, these libraries are growing larger and more complex, making it difficult for busy medical staff to find the exact right instruction in a moment of crisis. To help, researchers have turned to a type of artificial intelligence called a large language model. These are powerful computer programs trained on huge amounts of text that can read a document and answer questions about it. The idea is to let a doctor ask a simple question and have the computer instantly retrieve the correct rule. But there is a serious problem: these computers sometimes make things up. They might invent a drug dosage or skip a critical safety warning, a mistake known as a "hallucination." In a safety-critical setting like a hospital, a made-up fact is not just a minor error; it can be dangerous.
A team of researchers from University College London and several NHS trusts set out to solve this problem by changing how these computers are asked to work. Instead of asking the artificial intelligence to read a guideline and then write a new answer in its own words, they asked the computer to act more like a strict librarian. Their goal was to see if forcing the machine to simply copy and paste the exact sentences from the original document would prevent it from inventing false information. They tested this idea on three different types of medical documents: short, sharp protocols for emergency care, medium-length guidelines for cancer treatment, and very long, detailed national recommendations. They compared their new method against the standard way of using these computers, which involves the machine rewriting the information to sound natural.
The researchers found that the standard method, where the computer rewrites the answer, often leads to omissions or unnecessary details. When the machine tries to paraphrase, it sometimes leaves out a crucial step or adds a detail that isn't in the source text. To fix this, the team developed a strategy where the computer is not allowed to write anything new. Instead, it must identify the specific lines of text in the original document that contain the answer and return only those lines. In one version of this test, the computer was asked to simply list the line numbers where the answer could be found. The researchers then used those numbers to pull the exact text from the source. This approach, which they call "extraction," proved to be far more reliable than the rewriting method.
When the team tested this on short, emergency care guidelines, the line-number method was the clear winner. It successfully found the correct medical terms and instructions up to 95 percent of the time, a significant improvement over other methods. Crucially, it did this without adding any extra words or changing the meaning of the original text. For the longer, more complex national guidelines, a slightly different approach worked best. Here, the computer first drafted a rough answer based on its own knowledge, and then a second step checked that draft against the original document, keeping only the sentences that were actually supported by the text. This two-step process helped the computer handle the massive amount of information in the longer documents while still avoiding the invention of facts.
The study showed that the best way to use artificial intelligence in high-stakes environments is to limit what the computer is allowed to do. By constraining the machine to select and copy existing text rather than generating new sentences, the researchers created a system that is much less likely to make dangerous mistakes. They found that while the computer could still miss some information if the document was very long, it never added false information. This is a vital distinction in medicine, where missing a detail is a risk, but inventing a detail is a disaster. The results suggest that for safety-critical tasks, the most reliable tool is not the smartest writer, but the most careful copier. By trusting the original text and letting the computer act as a precise selector rather than a creative author, hospitals can use these powerful tools to access their guidelines quickly without sacrificing the accuracy that keeps patients safe.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.