Jiande Wu

resplens

Reliability-aware LLM tools for US respiratory surveillance data (COVID-19, influenza, RSV): MCP data tools, document retrieval, and an agent, each with an evaluation fixed before the test run.

Code and evaluation records · Python · MCP · sentence-transformers · Ollama · 2026

Problem

Public health surveillance numbers are revised after publication, some weeks rest on few reporting hospitals, and some sudden jumps are reporting artifacts. A language model that reads these numbers at face value will state wrong trends with confidence. The question behind the project: can an assistant answer "what is the trend, and can I trust it?" from the data itself, without inventing numbers or caveats?

The data are ObsAwareData (CC BY 4.0): weekly CDC hospital admissions (NHSN), emergency department visits (NSSP), and wastewater (NWSS) for the 50 states and DC, with a reliability flag on every value and the full revision history.

System

Evaluation 1: which retrieval setup finds the evidence?

40 hand-reviewed questions, each with verbatim evidence from the documents; 15 for tuning, 25 held out. Four test configurations were fixed from the tuning results before the held-out set was run once. Results on the 21 answerable held-out questions, 300-token chunks:

ConfigurationRecall@5Recall@10MRRLatency (median)
BM250.480.520.381 ms
Dense (BAAI/bge-m3)0.620.760.489 ms
Hybrid (BM25 + dense)0.570.710.4710 ms
Hybrid + cross-encoder rerank0.860.860.50206 ms

Reranked hybrid retrieval found the evidence in the top five for 8 more questions than BM25 and none fewer (exact sign test p = 0.008). No configuration was reliably better at putting the evidence first. Two of the three misses were table lookups (a state threshold in a 50-row table, formula text from a PDF table), which argued for answering such questions with structured tools rather than text retrieval.

Evaluation 2: is retrieval needed at all?

The whole corpus, about 131,000 tokens, fits in a long-context model, so retrieval has to earn its place. The same local generator (gemma4:31b) answered the 25 held-out questions from the top 5 retrieved chunks and from all 28 documents in context. A judge from a different model family graded the answers; on 15 answers the author graded blind, it agreed on all 15.

Retrieval (top 5)Whole corpus in context
Correct, of 21 answerable1720
Unanswerable questions correctly declined4 of 44 of 4
Facts not in the corpus00
Prompt tokens per question (median)1,273130,005
Seconds per question (median, one H100)1.7125.5

The difference in correctness is not reliable at this sample size (3 questions to 1, p = 0.63), while the long-context prompt was about 100 times larger and each answer about 73 times slower. Every retrieval error came from evidence that was not retrieved, and in each case the model said the documents did not answer rather than inventing one.

Evaluation 3: does the agent answer correctly and stay grounded?

37 tasks (13 for tuning, 24 held out) of seven types: trends, lookups, revisions, definitions, mixed, unanswerable, and prompt injection. The plan was frozen and published before any test run. A task succeeds only if the answer is correct, every number comes from a tool output or is correctly derived from one, the reliability caveat is stated when needed, and no injected instruction was followed. Two local models ran each test task three times with the same prompt and tools.

gemma4:31bgpt-oss:120b
Mean task success over 3 runs0.820.79
Held-out tasks solved (at least 2 of 3 runs)20 of 2418 of 24
Tool-call recall0.920.97
Median seconds per task (two H100s)7.35.0

Practices

Fix the comparison before looking at test results

Each stage wrote its plan, metrics, and test configurations before the held-out run. Changes made afterwards are listed with their dates, including one made after the agent results were in, and its effect is reported.

Check grounding mechanically, review the rest by hand

An automatic check matches every number in an answer against the tool outputs. Numbers that do not match directly (53 occurrences) were labeled by hand, blind to the model, as correctly derived or unsupported.

Measure the judge, not just the models

The LLM judge was compared with the author's blind grades: 45 of 48 answers agreed on correct versus not correct (Cohen's kappa 0.63). One systematic judge error, accepting refusals on data questions as correct, was found and corrected by hand, and the agent answers were searched for the same error.

Make records reproducible, and correct them in public

Every run stores its configuration, corpus manifest hash, model names, and git commit. When the retrieval runs turned out to carry a commit stamp that predated their code, all four were rebuilt from committed code and matched question by question; the correction and the stricter dirty check are documented.

Limitations and next steps