How to Evaluate the Accuracy of LLM Knowledge Q&A

    This article outlines a practical framework for evaluating the accuracy of large language model (LLM) knowledge question answering. It explains why identical questions produce different answers across models, breaks the evaluation into four dimensions—retrieval augmentation and completeness, factual accuracy, concept disambiguation, and answer structure—and summarizes common model behavior patterns. It also shares engineering practices such as retrieval-first pipelines, concept validation, structured output templates, and a fact-verification layer to help developers build more reliable Q&A applications.

    1. Background: Why the Same Question Gets Different Answers

    In real-world LLM application development, a common phenomenon appears: when the same humanities knowledge question is given to several different models, the results vary significantly in completeness, accuracy, and structure. Take the question “Which emperors had ‘Wu’ as their core posthumous title” as an example. The answer quality differs across models: some miss key entries, some confuse posthumous titles with temple names, and others provide a well-structured, complete answer with explanations.

    These differences are not accidental. They reflect several things: the depth of a model’s Chinese semantic understanding, whether it has web retrieval and multi-source information integration capabilities, its ability to distinguish proper nouns and concepts, and whether its answers are organized with the user in mind. For developers, turning these differences into measurable metrics is the first step toward building a reliable knowledge Q&A system.

    2. Breaking Down the Evaluation Dimensions

    To objectively compare the knowledge Q&A capabilities of different models, it helps to build an evaluation matrix across the following four dimensions.

    2.1 Retrieval Augmentation and Information Completeness

    Whether a model is connected to search, and whether the retrieved information is used effectively, directly determines the completeness of the answer. Better-performing models first retrieve from multiple sources, then merge and deduplicate the candidate entries, and finally produce a relatively complete list. Weaker models answer purely from parametric memory and tend to miss entries. In engineering terms, this can be quantified with a “key entry recall rate”:

    1. def recall(generated_items, ground_truth):
    2. hit = set(generated_items) & set(ground_truth)
    3. return len(hit) / len(ground_truth)

    2.2 Factual Accuracy

    Accuracy requires the model not to fabricate or mismatch. Typical errors include adding non-existent entries to the list, or misattributing real entries. When evaluating, you should introduce a manually annotated ground-truth answer set, check it entry by entry, and compute precision and recall.

    2.3 Concept Disambiguation

    High-quality answers need to distinguish between similar concepts. Using posthumous titles and temple names as an example, these are two different naming systems: a posthumous title is an evaluative title assigned after death based on a person’s life, while a temple name is a title used in ancestral temple worship. Whether a model can clearly distinguish the two is a direct reflection of the depth of its semantic understanding. Confusing concepts lowers the credibility of the entire answer.

    2.4 Answer Structure and Human-Like Expression

    A user-facing answer should have a complete “introduction—elaboration—summary” structure: first explain the core concept, then list the content, and finally summarize the key points and note any easily confused aspects. A bare list, or directly exposing the internal reasoning process to the user, both harm the experience. A good answer “speaks to the user” rather than “talking to itself.”

    3. Common Behavior Patterns

    Combining the dimensions above, different models generally fall into a few patterns.

    • Think-and-summarize type: retrieves first, then reasons; can explain concepts, distinguish posthumous titles from temple names, and produce a complete structure, but may miss individual entries.
    • Complete-structure-but-low-coverage type: highly systematic and structured, with an accompanying table, but with substantial content missing, possibly related to Chinese corpus understanding or retrieval depth.
    • Retrieval-boosted type: fairly complete search results, sometimes including obscure entries that others miss, but lacking concept introduction and summary, and insufficiently human-like.
    • Concept-confusion type: cannot accurately distinguish posthumous titles from temple names, produces too short a list, and shows “self-talk” style self-correction, with output misaligned to user needs.

    It is worth emphasizing that even when the same underlying model is used, platforms with different wrappers and prompt engineering can show clear differences in actual experience. This shows that the retrieval strategy, prompt design, and result orchestration at the application layer are equally important.

    4. Engineering Practices for Developers

    If you are building a knowledge Q&A application, you can refer to the following practices to improve reliability.

    1. Retrieval first: for factual questions, force the retrieval-augmented generation pipeline, and perform deduplication and ranking after multi-source recall.
    2. Concept validation: inject a domain concept dictionary before generation, prompting the model to align on concepts before answering.
    3. Structured output: constrain the output with a fixed template that enforces a three-part “concept explanation—list—summary” structure.
    1. Please answer in the following structure:
    2. 1) Concept explanation: explain the meaning of the core terms;
    3. 2) Main list: list each item with a brief description;
    4. 3) Summary: recap the key points and flag easily confused concepts.
    1. Fact-verification layer: perform a secondary check on the generated results, compare the list against the ground-truth answer set, and trigger re-retrieval for low-confidence entries.
    2. User-facing filtering: strip out internal reasoning and self-correction content, and output only information that is valuable to the user.

    5. Conclusion

    The differences in model knowledge Q&A are, in essence, a combined reflection of four capabilities: retrieval, factual accuracy, concept disambiguation, and expression structure. For developers, rather than focusing on the “fame” of a single model, it is better to build a standardized evaluation set and an engineering improvement pipeline. Through retrieval augmentation, concept validation, structured output, and fact verification, you can significantly improve the reliability of a Q&A system. Baidu AI Cloud’s integration practices in related general capabilities (such as search, knowledge bases, and model services) also offer a referenceable engineering paradigm for building such applications.