Testing a Safety-Critical Matching Component of an LLM-Based Simulated Patient: Blind Test Sets, Overfitted Cut-offs and a Cascade
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…
- arXiv
- 2612.05991
- Authors
- Faaz Khan Mohammad, Sanket Salvi
- Categories
- cs.SE · cs.CL · cs.HC