LLM-Driven Historical Source Retrieval: Model Evaluation and Hallucination Control

    Learn how to evaluate large language models for historical source retrieval and build a reliable, unattended pipeline. This article covers four model capabilities, practical evaluation metrics, structured retrieval intents, source verification, and the engineering components needed to keep results accessible, accurate, and traceable.

    1. The Starting Point: An LLM Is a Pipeline Component, Not a Chat Interface

    When teams first introduce large language models into historical research or document workflows, they often expect “smarter question answering.” The actual requirement, however, is usually an unattended pipeline:

    Understand a natural-language request → generate search queries → call retrieval APIs → download candidate resources → save and synchronize files → convert formats → publish materials to a private reading page.

    Within this pipeline, the model handles only three tasks: intent interpretation, query generation, and result selection. Everything else is an engineering problem.

    Model quality should therefore be judged not by leaderboard scores, but by end-to-end usability: how many materials a request ultimately produces that can actually be opened, cited, and verified as matching the request.

    2. Four Capabilities That Determine Practical Performance

    2.1 Breadth of World Knowledge Sets the Recall Ceiling

    Historical research requests are often vague: “Find references to water management in a Song dynasty local gazetteer.”

    The model must expand that request into multiple queries covering alternative names for historical periods, changes in place names, variant characters, and common differences in catalog records. Broader background knowledge helps the model produce more accurate synonyms and contextual constraints, increasing the potential coverage of retrieval.

    In implementation, treat the model’s expansions as a set of candidate queries, not as a single definitive query.

    2.2 Hallucinations Set the Minimum Level of Trust

    Hallucinations in retrieval pipelines typically take three forms, in increasing order of risk:

    • Query hallucinations: Generating plausible but nonexistent book or chapter titles.
    • Result hallucinations: Describing content the model has not read as a “confirmed reference.”
    • Citation hallucinations: Producing a formally complete citation that points to a nonexistent source or the wrong location.

    Citation hallucinations are especially dangerous because they can slip through manual spot checks.

    The remedy is not simply to replace the model. It is to remove the model’s authority to issue conclusions directly. The model should output structured retrieval intents; factual statements must be generated only after the pipeline retrieves and checks the original text.

    2.3 Defensive Behavior Determines Completion Rate

    Some models stop progressing when they encounter uncertainty. They may repeatedly request confirmation, abandon a task midway, or incorrectly classify publicly accessible historical documents as restricted content.

    In an unattended pipeline, these behaviors amount to task failure. Three measures help address them:

    • Break the task into small steps with explicit authorization.
    • Define the data scope and usage boundaries clearly in the system prompt.
    • Automatically retry or fall back when a task stops—for example, by changing the query, switching data sources, or narrowing the time range.

    2.4 Flexible Tool Use Determines Success on Complex Tasks

    Multistep tasks require the model to adapt after failures. If a query returns no results, it should try different wording. If a download fails, it should try a mirror or another collection source.

    Stable tool calls and well-structured parameters improve the pipeline’s ability to recover.

    Evaluation should include deliberately failing scenarios to test whether the model changes its approach or blindly retries the same parameters.

    3. A Reusable Evaluation Method

    Do not select a model on intuition alone. Start with a small evaluation set of 100–200 cases:

    1. case_id, natural_language_request, expected_material_characteristics, contains_trap(nonexistent_title/restricted_content/ambiguous_place_name)

    Use four metrics:

    • End-to-end success rate: The proportion of cases in which the final materials meet the expected characteristics.
    • Citation accuracy: The proportion of sampled claims whose cited sources and locations match the original text.
    • Unproductive termination rate: The proportion of tasks left incomplete without an effective fallback action.
    • Average step count and elapsed time: Measures of pipeline cost.

    Run the same evaluation set three times for each candidate model and use the median results. This is more reliable than a single trial.

    4. Hallucination Control: Replace Free-Form Generation with Retrieval Intent

    The central principle is that the model does not have final authority. A recommended structured intermediate format is:

    1. {
    2. "query_expansions": ["search query 1", "search query 2"],
    3. "constraints": {"time_range": ["960", "1279"], "doc_type": "local gazetteer"},
    4. "accept_rules": ["The body text must contain passages about water management", "Full text must be obtainable"],
    5. "confidence": 0.0
    6. }

    The pipeline checks the source text against accept_rules. Only candidates that pass verification enter the download queue.

    Also apply a confidence threshold and a secondary verification step. Low-confidence items should enter a human review queue rather than being discarded automatically or accepted without scrutiny.

    For every stored material, retain a provenance chain:

    Original request → search queries → source → verification results

    This makes problems traceable.

    5. Engineering Architecture

    1. Request input
    2. → Intent interpretation (model) → Query set
    3. → Retrieval (parallel, multiple sources) → Candidate list
    4. → Rule-based filtering + confidence threshold
    5. → Download (retry/fallback) → Object storage staging
    6. → Format conversion (plain text/structured text) → Full-text index
    7. → Synchronization to reading page → Provenance records stored

    Key implementation considerations:

    • Decouple downloading and conversion with a message queue. Automatically requeue failed jobs so that one failure does not block the pipeline.
    • Store original files and converted outputs in separate buckets. Retain originals for later verification.
    • Detect text encoding and clean up page layout during conversion. Historical texts often contain vertical writing, variant characters, and sentence segmentation issues.
    • Instrument the entire pipeline. Use logging, monitoring, and alerts to track success rates, termination rates, and average step counts.
    • Rate-limit and cache model calls. Avoid consuming additional quota for identical requests.

    These requirements map to common cloud service categories: object storage, message queues, container platforms, logging, monitoring, and alerting. Providers such as Baidu AI Cloud offer services in these categories; choose services according to your compliance and cost constraints, and verify availability in your deployment region.

    6. Conclusion

    When a new model becomes available, the useful question is not “How powerful is it?” but “What end-to-end success rate and citation accuracy does it achieve in this pipeline?”

    Limit the model to intent interpretation and query generation. Control hallucinations through rules and source-text verification. Address unnecessary termination through task decomposition and automatic fallbacks. Use observability to guide iteration.

    This architecture does not depend on a single model. When models change, rerun the evaluation set while keeping the pipeline itself stable.