Large Language Model Selection and Hallucination Mitigation: A Practical Guide to Factual Evaluation
Choosing a large language model based on "chat experience" alone is risky for engineering decisions. This guide explains the common causes and categories of hallucinations, outlines a repeatable evaluation framework covering factual consistency, constraint adherence, appropriate refusal, and multimodal detail verification, and shows how retrieval augmentation and structured output validation keep hallucinations under control. It also recommends a two-month dual-track trial to make model selection with data, plus hybrid routing for high-risk scenarios.
1. Why Model Selection Cannot Rely on “Chat Experience”
In real projects, teams often face a deceptively simple question: when several model services are available, which one should we choose? Many discussions stay at the level of subjective impressions, such as “the writing flows better,” “the answers sound more confident,” or “the interface feels smoother.” These differences are real, but they are not enough to support an engineering decision. What ultimately determines a project’s success is how a model performs across factual accuracy, controllability, evaluability, and cost constraints.
A core contradiction from the original discussion is representative: one model sounds “confident” on open-ended questions, producing well-structured and assertive narratives, yet it includes fabricated content; another model is more conservative, with slightly lower answer coverage, but makes fewer unsupported claims. For developers, this is not a question of “which model is smarter,” but of “whose mistakes are easier to detect and intercept.”
This article therefore abstracts the topic from a specific product comparison into a general technical question: how to build a factuality-oriented evaluation and hallucination mitigation system for large language models, and use it to guide selection.
2. Causes and Categories of Hallucinations
Hallucinations are not random failures; they are a byproduct of how generative models work. Fundamentally, a model performs probabilistic sequence prediction. It optimizes for a text distribution that “looks reasonable,” not for a set of facts that have been “verified as true.” When training data coverage is insufficient, a question goes beyond the knowledge boundary, or contextual constraints are weak, the model fills the gap with fluent language.
In engineering practice, hallucinations can be roughly divided into three categories:
- Factual hallucinations: entities, dates, numbers, and cited sources are constructed incorrectly. For example, a nonexistent event is described in rich detail.
- Instruction hallucinations: the model fails to follow constraints, for example introducing outside knowledge when asked to “answer only based on the given material.”
- Reasoning hallucinations: intermediate steps look plausible, but the conclusion is wrong. This is common in multi-hop reasoning and mathematical calculations.
Models differ across these three categories. Some tend to produce complete narratives on open-ended questions, which improves readability but amplifies the risk of factual hallucinations; others tend to express uncertainty and lower the strength of their assertions, which is more controllable in professional scenarios. During selection, weight the three categories according to the business’s tolerance for each, rather than pursuing “smarter” in a vague way.
3. A Verifiable Evaluation Framework
To replace “feelings,” evaluation must be repeatable and quantifiable. At a minimum, include the following four dimensions.
3.1 Factual Consistency
Prepare a set of questions with definite answers, covering dates, numbers, citations, and process specifications. Score only whether the answer matches authoritative material, not the writing quality. A sample structure:
{"id": "fact-017","question": "Is mounting a high-noise adapter allowed in high-noise scenarios for a given process?","reference_answer": "Not allowed","scoring": "exact_match"}
3.2 Constraint Adherence
Provide material and require the model to “answer only based on the material,” then measure the proportion of external content the model introduces. This metric effectively distinguishes “conservative” models from “confident” ones.
3.3 Refusal and Expression of Uncertainty
For open-ended questions without definite answers, observe whether the model clearly states uncertainty. Avoid one misconception here: a higher refusal rate is not always better; it should match the true answerability of the questions. Use a confusion matrix to count two types of errors: “refusing when it should answer” and “asserting when it should not.”
3.4 Multimodal and Local Detail Verification
The original discussion mentioned a typical case: a prompt asks whether a certain local region of an image, cropped out on its own, resembles a particular musical instrument, while the overall image is a different scene. This type of task tests the model’s understanding of the relationship between local and global elements. During evaluation, require the model to output local coordinates or a region description, then verify it manually or with rules, instead of only checking whether the final natural-language description “seems right.”
4. Retrieval Augmentation and Constrained Prompting: Bringing Hallucinations Under Engineering Control
Beyond evaluation, mitigation matters more. For scenarios with high factuality requirements, two main approaches are recommended.
The first is retrieval augmentation. Chunk authoritative documents, build an index, retrieve relevant pieces, inject them as context, and state clearly in the system prompt that the model should answer “not found” if the material does not cover the question. A sample prompt:
You may answer only based on the content in <context>.If <context> does not contain the answer, output: No supporting evidence found in the material.Do not add parameters, model numbers, or operating steps beyond the material.
The second is structured output and validation. Have the model produce conclusions with source markers, then use a program to verify whether the sources actually exist and correspond to the conclusions. Sample code:
def validate(answer, retrieved):cited = [c for c in answer.citations if c in retrieved]return len(cited) > 0 and answer.grounded
These two methods are independent of the model brand and are general engineering practices that can significantly reduce factual hallucinations.
5. Verification Examples for Specific Technical Scenarios
The video generation adapter question from the original discussion is valuable: how should a single checkpoint that merges two noise stages be loaded together with low-noise/high-noise adapters that were originally split into two paths. The correct answer to this kind of question is definite and unique, making it well suited as a factuality benchmark item.
The engineering workflow is: first retrieve the official documentation to confirm whether mounting a certain type of adapter is allowed; then have the model answer only based on the retrieved snippets; finally use rules to check whether key phrases in the answer match the documentation. If the model still gives an affirmative conclusion without supporting material, treat it as a high-risk output and intercept it. This workflow transfers to high-risk question answering in medicine, finance, and legal domains, with the core unchanged: answers must be traceable.
6. Selection Advice: Run a Two-Month Dual-Track Trial
For developers new to these tools, the safest approach is not to trust recommendations, but to run a dual-track trial of about two months: run the same batch of tasks on two configurations, recording factual consistency, constraint adherence, appropriateness of refusal, and response cost. Make the decision with data after the trial.
If the business is oriented toward professional knowledge question answering and is sensitive to the cost of errors, prioritize a configuration with more stable factuality and more conservative expression, supported by retrieval augmentation and human review; if the business is oriented toward creative writing and conversational experience, it can tolerate higher uncertainty, but validation is still needed on high-risk branches. Hybrid routing is also a common practice: low-risk requests go through an experience-first path, while high-risk requests go through a factuality-first path.
7. Conclusion
The core of model selection is not finding a “model that never makes mistakes,” but building a “system where mistakes can be detected.” No model has a 100% accuracy rate, and key conclusions must remain under human control. Only by quantifying evaluation dimensions, constraining knowledge sources, and validating outputs can you make sound trade-offs across general conversation, content creation, and professional question answering. If the enterprise side needs capabilities such as retrieval, logging, and monitoring alerts, general cloud service offerings from Baidu AI Cloud can be used for engineering implementation, while keeping the model layer replaceable to avoid being locked into a single solution.
