First the Rules, Then the Summary: Computing Questionnaire Results in Code Before a Large Language Model Writes Clinical Summaries
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.
- Link
- https://doi.org/10.31234/osf.io/79pum_v2
- Found by
- Crossref
- Authors
- Yosef Sokol, Nechama Schwartz, Jaclyn C. Kearns, Amar D. Mandavia, Sarah Andrusier, Jacob K. Brackett, Marianne Goodman
- Organizations
- VA Boston Healthcare System, Touro University, James J. Peters VA Medical Center
- Categories
- evaluation
- Published
- 2026-12-03
- Last seen by the radar
- 2026-12-04
- Citations
- 0
- Radar score
- 34.39 / 100 (how it is scored)
- Why it scored so
- Also found via Crossref; Matched: evaluat; Primary record: Crossref
- Related links
- https://doi.org/10.31234/osf.io/79pum