Search arXiv⌕ Search

arXiv · 2612.05991

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

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.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Faaz Khan Mohammad, Sanket Salvi. 2026-12-03. Testing a Safety-Critical Matching Component of an LLM-Based Simulated Patient: Blind Test Sets, Overfitted Cut-offs and a Cascade. https://searcharxiv.org/abs/2612.05991

Citations retain the original authors and DOI and include this site’s record URL. If this discovery service contributed to your research, you can also cite Search arXiv by Indiciae: BibTeX · RIS.

KEEP EXPLORING

Related papers

MockingBird: Context-aware Repository-level Code Translation with Isolated Validation

Despite advances in repository-level code translation, automated type resolution across differing type systems and translation validation (functional-equivalence checking) remain challenging. This paper proposes MockingBird, combining context-aware type resolution with mock-based isolated validation. MockingBird retrieves API documentation and contextual code information per source-language type, prompting an LLM to resolve precise cross-language type mappings, reducing the manual effort of existing approaches. Using this automatically constructed type map, MockingBird employs custom serialization/deserialization to generate equivalent target-language mock objects, validating each translation unit in isolation without test translation, eliminating test-overfitting risks and translation challenges. On 10 Java-to-Python tasks from the AlphaTrans benchmark, MockingBird improves functional equivalence from the state-of-the-art 25.14% to 52.8%, with no manual type-mapping correction needed. A 700-fragment study shows MockingBird achieves 0.1% false positives and 0.3% false negatives, substantially outperforming GraalVM (2.1% false positives, 14.0% false negatives) and MatchFixAgent (11.0% combined mislabel rate). The pipeline is also LLM-agnostic, maintaining these gains with both DeepSeekCoder-33B and the smaller Devstral-24B.

cs.SE↗

Teralizer: Semantics-Based Test Generalization from Conventional Unit Tests to Property-Based Tests

Background: Property-based testing checks properties across generated inputs, finding edge cases that unit tests commonly miss. Writing properties can be challenging for practitioners, thus limiting adoption. Objective: We propose a semantics-based approach that automatically generalizes unit tests into property-based regression tests and analyze its effectiveness and applicability barriers. Design: Single-path symbolic analysis yields a path condition and a symbolic output expression, without constraint solving. Generalized tests sample inputs satisfying the path condition and replace expected values with the symbolic output. Teralizer implements the approach for Java, from JUnit tests to jqwik properties, for pure methods over primitive and boxed scalars and restricted string operations. Methods and Results: Teralizer generalizes tests in 9 of JARVIS's 12 benchmark projects, whereas JARVIS generalizes 2 of 12. On EqBench and Apache Commons, generalization raises mutation scores of EvoSuite and mature developer suites by 0.8-3.9 and 0.05-0.07 percentage points, respectively. Across 584 RepoReapers projects, barrier analysis attributes exclusions to assertion recognition, tested-method identification, symbolic type support, and concrete return values that the analysis cannot relate to the inputs. Conclusions: Our results suggest Teralizer applies more broadly than the state of the art. Future work should improve test analysis and symbolic analysis support. Artifacts at: https://doi.org/10.5281/zenodo.17950380

cs.SE↗

Bridging Requirements and Architecture: Multi-Agent Orchestration with External Knowledge and Hierarchical Memory

Software architecture design is a critical yet inherently complex and knowledge-intensive phase that requires balancing competing QAs and adapting to evolving requirements. Traditionally, this process has been time-consuming, labor-intensive, and heavily reliant on architects, often resulting in limited exploration of alternative architectural decompositions and styles. While LLM-based agents have shown promising performance across various SE tasks, coordinating requirements analysis, multi-view modeling, and design documentation still requires explicit attention to consistency and decision rationale. To address these challenges, we propose MAAD, a knowledge-driven framework that orchestrates four specialized agents (Analyst, Modeler, Designer, and Evaluator) to autonomously transform requirements specifications into multi-view architectural models, documentation, and preliminary evaluation reports. MAAD incorporates RAG to inject recognized architectural standards and patterns into the workflow and leverages a hierarchical memory mechanism that captures design history for iterative refinement. We evaluated MAAD using quantitative architecture-level metrics across 10 case studies, a comparison of configurations with and without external knowledge, a comparison of four foundational LLMs, and interviews with six practitioners. Results show that MAAD produces more detailed architectural descriptions together with dedicated evaluation reports than the selected MetaGPT outputs, with differences in the reported structural indicators; the effects of knowledge infusion vary across metrics and cases. The replication package of MAAD is available at [31] to support reproducibility and future extensions.

cs.SE↗