First the Rules, Then the Summary: Computing Questionnaire Results in Code Before a Large Language Model Writes Clinical Summaries
Year: 2026
Type: preprint
Abstract: Objective: We evaluated whether computing categories and changes in code before a large language model (LLM) generates text prevents factual errors in summaries of questionnaire data, and identified where errors remained. Materials and Methods: For 25 participants in a suicidal crisis recovery study, a rules-based component calculated all severity categories and changes for 12 questionnaires. Gemma 4 31B, Gemini 3 Flash, and GPT-4.1 drafted summaries. These were compared with a generic-prompt baseline and a dismantling condition in which the model derived categories and changes itself. Structured statements were checked automatically and with LLM-assisted verification; narrative sentences were audited; and 5 clinicians rated Gemma summaries. Results: With the rules-based component, substantive structured-section errors (e.g., wrong category or direction) appeared in 0 of 25 Gemma summaries, 0 of 19 Gemini summaries, and 2 of 25 GPT-4.1 summaries, and nearly every statement cited its source (vs 37.5% uncited in the baseline). When the model derived values itself, 5 of 25 summaries had substantive errors, against 0 of 25 in a same-day control (exploratory P=.06). Narratives contradicted the data in 4 of 25 summaries. Clinician ratings averaged 4.80 to 5.47 out of 7, with low agreement; clinicians flagged 2 of the 3 contradictions the audit found. Discussion: The remaining risk is in the narrative paragraph, which synthesizes findings across assessments and is not read by the automated checker. Conclusion: For data with published scoring rules, substantive errors in the structured sections were rare when values were computed in code. The next step is to move narrative interpretation into code.
Source: PsyArXiv (OSF Preprints)
Language: English
Subfield: Health Informatics
Field: Medicine
Domain: Health Sciences
Open Access status: green
OpenAlex ID: W7242533092
Cites:
Cited by:
Related to:
