Nguyen Le PhongNguyen Le Phong

Reducing Hallucinations in LLMs

A practical guide to reducing LLM hallucinations with clearer tasks, bounded context, retrieval, citations, verification, refusals, evaluation sets, and product design that makes uncertainty visible.

The first hallucination that bothered me was not dramatic. It was a confident sentence in a draft summary, placed between two correct details. The tone was smooth, the structure was useful, and the wrong part looked ordinary enough to pass if nobody checked. That is what makes hallucinations uncomfortable in daily work. They often do not arrive wearing a warning sign.

An LLM hallucination is a generated answer that sounds plausible but is not grounded in the facts needed for the task. Sometimes the model invents a source. Sometimes it merges two similar ideas. Sometimes it fills a missing detail because the prompt quietly asked it to be helpful even when the evidence was thin. The issue is not that the model is trying to lie. The issue is that fluent text can appear before reliable grounding.

The first way to reduce hallucinations is to narrow the task. A vague request like explain this customer case invites the model to choose its own boundaries. A better request says what materials are allowed, what question must be answered, what uncertainty should be reported, and what format is expected. The model still may fail, but the surface area for unsupported invention becomes smaller.

Context quality matters more than context volume. Dumping a folder into a prompt can make the answer look better while hiding weak retrieval. The useful question is whether the model has the right evidence, not whether it has a lot of text. For internal knowledge tools, this means chunking documents carefully, preserving titles and dates, retrieving the most relevant passages, and showing the source material close to the generated answer.

RAG helps when the task depends on external or private knowledge. Instead of asking the model to remember a policy, product detail, or project decision, the system retrieves the relevant source and asks the model to answer from that source. But RAG is not magic. If retrieval brings the wrong document, stale content, or fragments without enough surrounding context, the answer can still be wrong with more confidence.

Citations help, but only if they are meaningful. A citation should point to the exact material that supports the claim, not simply decorate the paragraph. In a serious workflow, the product should make it easy for the reader to open the source and compare. The citation is not only for trust. It is a user interface for verification.

Another useful habit is to design for refusal and uncertainty. Many systems accidentally reward the model for answering everything. A safer prompt and product flow allow responses like the provided context does not contain that detail, this part is uncertain, or I can answer only the first question from the available source. These sentences may feel less impressive, but they are often more useful than a polished guess.

Verification should also move outside the prompt. For code, run tests. For calculations, use deterministic tools. For facts, compare against source documents. For structured output, validate the schema. For policy answers, check citations. The model can help create the verification plan, but it should not be the only judge of whether its own answer is true.

Evaluation sets are where teams start becoming serious. Collect examples that represent real failure modes: missing context, conflicting documents, stale policies, similar product names, tricky edge cases, and questions that should be refused. Then test prompt changes, retrieval changes, and model changes against those examples. Without an evaluation set, every improvement is just a feeling from the last few chats.

The user experience matters too. If an AI feature presents every answer as final, users learn the wrong habit. Better interfaces can show sources, confidence boundaries, last-updated dates, follow-up questions, and clear paths to inspect evidence. The goal is not to make users distrust everything. It is to help them trust at the right level.

Reducing hallucinations is less about finding one perfect prompt and more about building a system around the model. Clear task, good retrieval, source visibility, refusal behavior, deterministic checks, and continuous evaluation all work together. Each layer catches a different kind of mistake.

The quiet lesson is that AI reliability is a design problem, not only a model problem. We reduce hallucinations by refusing to treat fluent language as proof. If you have built or used an AI tool at work, I would be interested in which guardrail changed your behavior most: citations, tests, better retrieval, or a product flow that made uncertainty visible.

記事はいかがでしたか?