Prompt engineering for accurate statistical reasoning with large language models in medical research

Sifiso Vilakati

View at source ↗PDF ↗Article27 citations

Abstract

Background: The integration of generative artificial intelligence (AI), particularly large language models (LLMs), into medical statistics offers transformative potential. However, it also introduces risks of erroneous responses, especially in tasks requiring statistical rigor. Objective: To evaluate the effectiveness of various prompt engineering strategies in guiding LLMs toward accurate and interpretable statistical reasoning in biomedical research. Methods: Four prompting strategies: zero-shot, explicit instruction, chain-of-thought, and hybrid were assessed using artificial datasets involving descriptive and inferential statistical tasks. Outputs from GPT-4.1 and Claude 3.7 Sonnet were evaluated using Microsoft Copilot as an LLM-as-a-judge, with human oversight. Results: Zero-shot prompting was sufficient for basic descriptive tasks but failed in inferential contexts due to lack of assumption checking. Hybrid prompting, which combines explicit instructions, reasoning scaffolds, and format constraints, consistently produced the most accurate and interpretable results. Evaluation scores across four criteria-assumption checking, test selection, output completeness, and interpretive quality confirmed the superiority of structured prompts. Conclusion: Prompt design is a critical determinant of output quality in AI-assisted statistical analysis. Hybrid prompting strategies should be adopted as best practice in medical research to ensure methodological rigor and reproducibility. Additional testing with newer models, including Claude 4 Sonnet, Claude 4 Opus, o3 mini, and o4 mini, confirmed the consistency of results, supporting the generalizability of findings across both Anthropic and OpenAI model families. This study highlights prompt engineering as a core competency in AI-assisted medical research and calls for the development of standardized prompt templates, evaluation rubrics, and further studies across diverse statistical domains to support robust and reproducible scientific inquiry.

Abstract of "Prompt engineering for accurate statistical reasoning with large language models in medical research" by Sifiso Vilakati, https://doi.org/10.3389/frai.2025.1658316, used under its Creative Commons Attribution license (CC-BY); markup removed, otherwise unmodified.

Record

Archive ID
doi:10.3389/frai.2025.1658316
Published
Oct 13, 2025
Venue
Frontiers in Artificial Intelligence
DOI
10.3389/frai.2025.1658316
PubMed
41159127
Categories
Artificial Intelligence in Healthcare and Education
License
cc-by
Provenance
openalex

Topics