A Practical Guide to LLM Hallucinations and Factuality Selection

    Choosing a large language model is less about which one is "best" and more about which one has the lowest error cost on your task distribution. This guide explains why hallucinations are a structural byproduct of generative modeling, why they get worse on open-ended questions, and how to break factuality into measurable layers such as closed-fact accuracy, long-tail fabrication rate, instruction compliance, and multimodal reasoning. It also covers building knowledge-boundary probes as regression tests, separating writing fluency from factual reliability, handling local-versus-global conflicts in image understanding, running a concrete selection workflow, and adding prompt and system guardrails like context-only constraints, structured output, and retrieval augmentation. The conclusion favors conservative, uncertainty-aware models for fact-sensitive domains and model-agnostic architecture to avoid lock-in.

    1. The Real Question: Not “Which Model Is Strongest” but “Which Model Fits Your Task Distribution”

    Many developers start model selection by asking which model is the best. That question has no answer. The meaningful version is: on my task distribution, which model has the lowest error cost?

    The dilemma in the original discussion—one model feels smoother for writing, another is more conservative about facts—is fundamentally a tradeoff between two error classes: efficiency loss from under-answering, refusing, or being overly cautious, and trust loss from confidently fabricated content.

    For general-purpose LLMs, hallucination usually means content that contradicts objective facts while remaining highly coherent in form. It is not an occasional bug but a structural byproduct of the current generative modeling paradigm: the optimization target is the probability distribution over the next token, not whether a proposition is true. Any claim of “zero hallucination” therefore goes against industry consensus; engineering can only push the hallucination rate into a range the business can accept.

    2. Why Hallucinations Are Worse on Open-Ended Questions

    A key observation: on open-ended questions with no definitive answer, some models become conspicuously confident and are more likely to mislead. Three mechanisms explain this.

    First, data sparsity. Closed facts—a constant, the default value of an API—appear repeatedly in the corpus, giving the model a strong prior. Long-tail entities, niche events, and internal system details are nearly absent, so the model fills the gap from a language prior and produces a plausible-looking answer.

    Second, the helpfulness bias from alignment training. Models tuned on human preferences are encouraged to be direct, complete, and certain in tone. This improves most experiences, but when knowledge is missing it is amplified into fabrication plus high-confidence phrasing.

    Third, the amplification effect of decoding. Lower sampling temperature and longer generations increase surface fluency, and also raise the survival rate of invented details.

    Engineering conclusion: for fact-sensitive tasks, treat the expression of uncertainty as an evaluable capability, not something a prompt line like “please do not make things up” can fix.

    3. Breaking Factuality Into Measurable Metrics

    Selection cannot rely on gut feel. Split factuality into four layers and build a test set for each:

    • Closed-fact accuracy: questions with a single answer that can be judged automatically, such as configuration defaults, protocol field meanings, and algorithm complexity.
    • Long-tail entity recall and fabrication rate: for niche people, internal systems, and obscure libraries, measure the ratio of correct / refusal / fabrication. A rising refusal rate is not necessarily bad; a falling fabrication rate is the real gain.
    • Instruction following and constraint satisfaction: given “answer only from the material below; if the material does not cover it, say it is not covered,” check whether the model stays in bounds.
    • Multimodal and spatial relation understanding: given an image whose local features conflict with the overall semantics, check whether the model can locate and describe the local part correctly.

    A schematic evaluation skeleton (pseudocode, product-agnostic):

    1. cases = load_cases("factuality_v1.jsonl") # each entry has prompt / reference answer / judging method
    2. for model in candidates:
    3. for c in cases:
    4. out = call_model(model, c.prompt, temperature=0.0)
    5. record(model, c.id, judge(out, c.golden)) # exact / rubric / llm_judge
    6. report(metrics=["accuracy", "fabrication_rate", "refusal_rate", "constraint_pass"])

    The key point is layered judging: exact match for closed questions, a rubric for open ones, and a separate fabrication-rate column, which predicts production incident rates better than accuracy alone.

    4. Abstracting the Original Case: Why a “Knowledge Boundary” Test Stays Useful

    The original text used a regression test about whether to mount the high-noise branch when loading dual-noise-version fine-tuned weights in a video generation model; a year later it still failed. The value of such a case is not the question itself but that it is an ideal knowledge-boundary probe:

    1. The answer is unique and verifiable, so judging is unambiguous.
    2. It is long-tail knowledge with very low corpus coverage.
    3. It has a highly tempting wrong answer (intuitively, “mount one branch each” seems most reasonable).
    4. It can be verified in one step against the official documentation.

    Fix these probes into a regression set and run them whenever you swap models or upgrade versions, and you get a stable hallucination trend curve. Each team should maintain 20–50 such probes covering the high-frequency long-tail areas of its own business.

    5. Writing and Chat Experience: Fluency Is Not Accuracy

    One class of models feels better in chat and writing, while another has an edge in knowledge learning. Separate two things:

    • Style and readability: structure, natural tone, long-form consistency. This affects reading cost.
    • Factual density and verifiability: whether citations are real, numbers are self-consistent, and terminology is precise. This affects decision risk.

    High fluency raises subjective satisfaction and lowers human vigilance—the most overlooked risk in selection. For marketing copy and brainstorming, prioritize style. For technical documentation, healthcare, and financial compliance, put verifiability first and enforce human review plus material constraints.

    6. Multimodal Scenarios: When Local and Global Conflict

    An image understanding test where the local part looks like a violin but the whole is a pirate ship besieged by mermaids led one side to fail at localization and offer a hard-to-follow rationalization. This exposes a typical weakness when aligning a vision encoder with a language model: global semantics override local detail, and the model tends to answer along the most likely scene description instead of returning to pixel evidence.

    The fixes are engineering, not model-swap mysticism:

    • Split the question explicitly: describe the whole first, then each quadrant locally, then answer the localization question.
    • Require coordinates or region references to turn vague description into verifiable output.
    • Cross-validate key conclusions by re-asking the same fact from a different angle.

    7. A Practical Selection Workflow

    1. Define the task distribution and error cost; quantify the consequence of a single fabrication.
    2. Build a 100–300 item business evaluation set with closed questions, long-tail probes, constraint-following items, and multimodal items.
    3. Unify decoding parameters (such as temperature 0) and prompt templates to keep results comparable.
    4. Run double-blind human scoring and track four numbers: accuracy, fabrication rate, refusal rate, and constraint pass rate.
    5. Roll out to a small traffic slice and collect the user-correction rate online as a real-world metric.
    6. Set up a monthly regression and rerun the probe set whenever the model version changes.

    8. Guardrails in Prompts and System Design

    Whatever model you pick, these measures cut incident rates significantly:

    • Material-first constraint: state clearly “answer only from the provided context; declare it missing if absent.”
    • Structured output: constrain fields with a JSON mode so programs can validate.
    • Confidence self-assessment: require the model to cite the source of each conclusion and mark unsourced ones as speculation.
    • Retrieval augmentation: put authoritative documents into the retrieval path so long-tail knowledge enters the context.
    • Human fallback on critical paths: content involving health, legal, or financial matters must be reviewed.

    9. Conclusion

    For less experienced users, the safest approach is not to trust recommendations but to run a two-month A/B test: the same prompts, the same probes, the same scoring sheet. If a directional recommendation is required, prefer the more conservative option that is more willing to state uncertainty for fact-sensitive fields such as medicine and technical documentation, paired with retrieval augmentation and human review; for creative writing and chat experience, choose the more natural style. Architecturally, keep models replaceable—wrap calls behind a unified gateway and decouple prompts, evaluation sets, and the concrete implementation—so you avoid being locked into a single option. To store evaluation data and logs, general cloud product categories such as object storage, log services, and monitoring and alerting can handle data retention and quality dashboards.