← ALB News · curated headline

Testing a Safety-Critical Matching Component of an LLM-Based Simulated Patient: Blind Test Sets, Overfitted Cut-offs and a Cascade

arXiv Software Engineering · WORLD · Compilers · 12/4/2026, 12:00:00 AM

arXiv:2612.05991v1 Announce Type: new Abstract: Components that decide what an LLM application may say are ordinary software and need tests, but their correct behaviour is defined by meaning, so no specification lists their inputs. We report a case study of testing one such component: the matcher in Rapport, a spoken simulated psychiatric patient, which decides which of the patient's memories a student's question is about. If it misses a question about suicidal thoughts, plans or means, the code can let the patient deny something it should disclose. Of the 8 bugs logged during the simulator's evaluation, 4 were matching faults, including all 3 rated major; each was fixed by adding keywords and a regression test for one wording. We built the test oracle from the specification instead of the code: a blind test set of 512 doctor questions over four cases written from what each memory means by a writer that never saw the matching rules, split by checksum into tuning and test halves. On the test half, keyword tags found 35.1% of risk questions; the deployed hybrid of tags and a sentence encoder with 33 million parameters found 72.7% while wrongly matching 15.2% of non-risk questions. Five small encoders and BM25 gave overlapping threshold-free results (AUROC 0.86-0.91 for risk), so the encoder choice was not the bottleneck; the cut-off was. The 4-billion-parameter model that voices the patient, used zero-shot, found 94.8% of risk questions with 4.8% wrong matches, at a median of 416 ms per question; screening with the hybrid first kept 93.5% recall while sending 63% of questions to the model. On two further test sets written by other local models, the deployed rules found 58.9% and 47.5% of risk questions and the zero-shot model 87.7% and 91.5%: the first writer's test set flattered the component. The test sets, every method's output and a machine-checked trace of every reported number to the committed results are public.

Continue to arXiv Software Engineering →

Coverage timeline

  1. arXiv Software Engineering · WORLD
  2. arXiv Software Engineering · WORLD

All coverage (2)

Finished reading? Continue to the original source above — or join the discussion below.