Pharma AI evaluation · · 8 min read
How to evaluate AI sample size calculation tools
Acumen Editorial · Updated November 29, 2026
Why does sample size matter so much for AI to get right?
Sample size is where a trial's cost, timeline and ethics meet. Too few patients and the study cannot answer its question. Too many and patients are exposed without need, and budgets swell. ICH E9, the international guideline on statistical principles for clinical trials, says the protocol should give the sample size calculation along with "the estimates of any quantities used in the calculations." It adds that the basis of those estimates should also be given.
That is a high bar for an AI tool. A correct number is not enough. The tool has to pick the right test, use defensible assumptions, account for withdrawals and explain itself in a way a regulator and a data monitoring committee will accept.
How accurate are AI tools at sample size calculation today?
The evidence splits cleanly between general chatbots and purpose-built agents.
| Study | Approach | What it tested | Result |
|---|---|---|---|
| N-Power AI (bioRxiv, 2025) | Three LLM agents calling R functions | 6 scenarios: t-tests, ANOVA, chi-square, Cox model; ground truth from R 4.2.2 | Matched ground truth in every scenario and replication; seven general LLMs prompted directly all deviated, and none returned correct power |
| PowerGPT randomized evaluation (arXiv, Sep 2025) | LLM plus statistical engines | Test selection and sample size tasks, statisticians and non-statisticians | Sample size accuracy 94.1% vs 55.4% without the tool; average time 4.0 vs 9.3 minutes |
Two lessons follow. First, a general model asked to "calculate the sample size" is guessing at arithmetic it cannot do reliably. The N-Power AI authors report that even when GPT-4o wrote and ran its own code, it still returned incorrect values in some scenarios. Second, wrapping a model around validated statistical functions changes the picture. The model's job becomes reading the design and choosing the method, and the software does the math.
Both studies tested a narrow set of designs. Neither proves a tool handles adaptive designs, non-inferiority margins, cluster randomization or multiplicity. That is where your own evaluation has to go.
What should you test, step by step?
Break the task into parts and score each one. A wrong answer at step one makes every later step wrong.
- Design reading. Can the tool turn a synopsis into the right primary endpoint, comparison and hypothesis? Score against the biostatistician's reading.
- Test selection. Does it pick the right method for the endpoint: continuous, binary, time-to-event, count or ordinal?
- Parameter extraction. Does it pull effect size, variance, alpha, power, allocation ratio and sidedness correctly from the text, and flag missing values instead of inventing them?
- Calculation. Does the number match validated software within a set tolerance?
- Adjustments. Does it inflate for dropout, adjust for interim analyses and handle multiple primary endpoints or arms?
- Justification. Does the write-up state the assumptions and their sources, the way ICH E9 expects?
- Sensitivity. Does it show how the number changes if the effect size or event rate is off?
Our guide to evaluating AI for clinical protocol design covers how this section fits the wider protocol.
How do you build a reference set for sample size AI?
Start with designs your team actually runs. Then add the cases that break tools.
- Core designs. Two-arm superiority with continuous and binary endpoints. These should be near-perfect.
- Time-to-event. Log-rank and Cox designs where the tool must reason about events, not patients, plus accrual and follow-up time.
- Non-inferiority and equivalence. Margins, one-sided alpha and the direction of the hypothesis are common failure points.
- Multiplicity. Multiple arms, co-primary endpoints and hierarchical testing.
- Adaptive and group sequential. Interim looks with alpha spending, sample size re-estimation.
- Cluster and crossover. Intraclass correlation and period effects.
- Trick cases. Synopses with a missing variance, inconsistent alpha or an endpoint that does not match the stated test. The right answer is to ask, not to fill the gap.
Each case needs a reference answer written and checked by a senior biostatistician, computed in validated software, with the acceptable tolerance and the expected justification text. A second biostatistician should review it blind. Keep the set private and refresh it each year. If cases leak into vendor training data, scores stop meaning anything. Our piece on evaluating AI for statistical programming uses the same double-programming logic for analysis code.
What acceptance criteria should a sponsor set?
Agree on these before a pilot starts:
- Exact or within-tolerance match to validated software on all core designs
- Correct test selection on every case, reported by endpoint type
- Zero invented parameters: missing inputs are flagged, not assumed
- Correct handling of dropout, interim analyses and multiplicity where present
- Justification text a biostatistician would sign without major edits
- Reproducible output: the same input gives the same answer across runs
- An audit trail of the function, version and inputs used for each calculation
- Clear scope: the vendor states which designs the tool does not support
If the tool is an agent that drafts protocol sections end to end, test it as part of the full workflow too. Our guide to evaluating AI agents in clinical trials covers multi-step agents.
Where should a human stay in the loop?
Always at sign-off. AI can speed up the first draft, run sensitivity scenarios and catch inconsistencies between the synopsis and the statistical section. It should not choose the effect size. That assumption comes from prior trials, natural history data and clinical judgment about what difference matters to patients. A biostatistician owns it, and the protocol has to say where it came from.
The practical split is simple. Let the tool draft, calculate and stress-test. Let the biostatistician choose assumptions, review the method and sign. Log every AI-assisted calculation with the tool version, inputs and output, so the trial master file shows how the number was reached. If the tool is later updated, rerun your reference set before using the new version on a live protocol.
How Acumen helps
We build sample size evaluation sets with credential-verified biostatisticians who have designed and defended trials. They write synopses across endpoint types and design families, compute reference answers in validated software, seed missing and conflicting parameters, and grade tool outputs blind with a second reviewer adjudicating. Every item carries reviewer credentials and agreement data, ready for quality and validation files. See our medical affairs and regulatory data service, or our approach to validating models with expert data.
For related reading, see our guides to GxP AI validation, synthetic control arms and AI in clinical data management.
FAQ
Can ChatGPT calculate sample size?
Not reliably on its own. In the N-Power AI study, seven general LLMs prompted directly all deviated from R ground truth across six standard trial scenarios, and none returned correct power estimates. Tools that connect a language model to validated statistical functions performed far better. Always check any AI result in validated software.
How accurate is AI sample size calculation?
It depends on the tool. A randomized evaluation of PowerGPT reported 94.1% sample size accuracy with the tool versus 55.4% without it, and average completion time fell from 9.3 to 4.0 minutes. Those results cover a narrow set of designs, so test complex designs such as adaptive or non-inferiority trials yourself.
What should an AI power analysis tool get right?
It should read the design correctly, choose the right test for the endpoint, extract alpha, power, effect size and variance without inventing values, match validated software, adjust for dropout, interim looks and multiplicity, and write a justification that states each assumption and its source. Score each step separately.
Does ICH E9 allow AI-generated sample size calculations?
ICH E9 does not address AI. It says the protocol should give the calculation with the estimates of quantities used and the basis for those estimates. Any tool can help draft that, but the sponsor's biostatistician remains accountable for the assumptions, the method and the final number.
Who should build the reference set for sample size AI evaluation?
Senior biostatisticians with trial design experience, ideally across the therapeutic areas and design families you run. One writes each case and computes the answer in validated software. A second reviews it blind. Disagreements are adjudicated and recorded, so the reference set itself can be defended in an audit.
Which trial designs break AI sample size tools most often?
Time-to-event designs that require reasoning about events and accrual, non-inferiority trials with margins and one-sided alpha, multiple arms or co-primary endpoints, group sequential and adaptive designs, and cluster randomized trials. Also test synopses with missing or conflicting inputs, where the correct response is to flag the gap rather than guess.