4.1. Principal Findings
The present study evaluated the execution fidelity of four commercially available LLM-linked chatbot platforms (ChatGPT, Claude, Copilot, and Gemini) when used as code-execution environments for seeded simple-randomization workflows, using a seeded Excel/VBA macro and R Console as deterministic, non-LLM control comparators. Across 1200 primary benchmark runs encompassing 48,000 individual participant allocations, all six platforms demonstrated perfect performance on every prespecified primary and secondary outcome. Exact seed-based reproducibility, allocation integrity, format compliance, and operational completion were each 100% in both sample-size scenarios (n = 30 and n = 50) and across all four investigators. These findings held across text-based perturbation scenarios involving modified group structures, 2:1 and 3:1 allocation ratios, and altered seed values and were replicated in voice-initiated exploratory runs. No inter-platform or inter-scenario variability was observed, formal comparative statistical analysis was not informative, and results were reported descriptively as prespecified.
The dual-experiment design of this study produces a knowledge contribution that extends beyond a simple code-execution check. Prior to this investigation, no empirical evidence existed to guide researchers on whether code-based or natural-language prompting should be used when a chatbot platform is considered for generating randomization sequences. The present findings establish that this choice is not a matter of preference or convenience, but a determinant of whether the reproducibility requirement of ICH E9 can be met at all. That operational boundary, documented here across four platforms and four investigators, is the study’s primary contribution, and it could not have been established without the direct empirical contrast between the two prompting paradigms.
It should be made explicit that the methodological contribution of this study is not the demonstration that fixed-seed pseudorandom code is deterministic, which follows directly from the pseudorandom number generator. Rather, it is the empirical verification that consumer-facing LLM-linked interfaces preserved that determinism without execution corruption across repeated runs, investigators, and sessions and the parallel demonstration that this property disappeared under NL-only prompting. The study is therefore positioned as a technical benchmarking and verification study rather than as a new randomization algorithm: it defines an operational reliability boundary for chatbot-mediated sequence generation, in which reproducibility is preserved when the chatbot serves as a code-execution wrapper for a fixed-seed algorithm, but not when sequence generation is delegated to unconstrained natural-language prompting.
4.2. Deterministic Code Execution as the Operative Mechanism
The central interpretive finding is that the reproducibility observed here is best understood as a property of deterministic code execution rather than as a general property of LLM outputs. Foundation models and LLMs are characteristically sensitive to prompt design, access configuration, and session handling, dependencies that the GAMER Statement explicitly requires authors to report through tool specifications, prompting techniques, verification procedures, and documentation of access modes [
14]. REFINE additionally addresses the technical dependencies specific to these systems, including model pretraining and inference-time adaptation strategies, generation parameters such as temperature and top-p sampling, output stochasticity and reproducibility constraints, and governance and auditability mechanisms [
16]. Both frameworks were developed precisely because LLM outputs cannot be assumed to be stable across repeated runs under standard inference conditions, and the REFINE checklist makes reproducibility assessment a mandatory reporting domain for any FM or LLM study in medical research [
16].
In the present study, however, the allocation sequence was determined by a Python script that used an explicit, fixed seed and was submitted directly to each platform. Under these conditions, the chatbot interface primarily served as a vehicle for code submission, execution, and output rendering. The deterministic element was therefore the seeded algorithm rather than the model’s generative inference process, a distinction that has direct implications for how chatbot-based allocation workflows should be classified, reported, and replicated in trial documentation. The Excel/VBA and R Console comparator supports the same conclusion: it implements seeded deterministic logic in a conventional software environment, and its equivalent reproducibility across repeated runs confirms that seeded execution, rather than model inference, accounts for the consistency observed in both tools. While restricted randomization methods such as stratified designs introduce additional structural constraints, their implementation in code-execution environments is governed by the same deterministic principles evaluated here. The present study’s permuted block benchmark confirms that this deterministic property extends beyond simple randomization: execution fidelity was preserved across 640 runs under a block-constrained shuffle, with 100% reproducibility under fixed-seed code execution across all four platforms, directly replicating the Experiment 1 pattern under a more structured, block-constrained algorithm. Whether this holds for stratified randomization or covariate-adaptive procedures such as minimization remains an important direction for future investigation. Accordingly, future evaluations of chatbot-assisted allocation workflows should clearly distinguish between model-level reproducibility, which is subject to stochastic inference and generation parameters, and code-level reproducibility, which is governed by algorithmic determinism under fixed seed conditions [
4,
16]. Shyr et al. (2025) [
13] operationalized this distinction formally, demonstrating that semantic and internal repeatability, measuring consistency in output meaning and token-level probability distributions, respectively, varied across models, prompts, and datasets and crucially did not correlate with diagnostic accuracy. This empirical dissociation between correctness and consistency directly supports the methodological position taken here: that a chatbot producing a correct allocation list on a given run does not, by itself, establish that the platform will do so reliably and reproducibly under varied operational conditions.
This interpretation is reinforced by the pilot phase that preceded formal benchmarking. When the task was requested through natural-language-only prompting without explicit Python execution and without fixed-seed specification, outputs were not reproducible across repeated sessions. In other words, reproducibility did not persist outside the deterministic code + seed pathway. This contrast supports the central methodological conclusion of the present study: the observed stability reflects seeded code execution preserved within chatbot interfaces rather than unconstrained chatbot randomization.
A potential objection to the present findings is that deterministic output from seeded Python code is mathematically guaranteed by the pseudorandom number generator and therefore provides no information beyond what could be obtained by running the same script locally. This characterization, however, does not account for the architectural complexity of LLM-linked chatbot platforms, which are not transparent Python interpreters. These platforms route user input through natural-language parsing layers, content-moderation pipelines, session-state management systems, and model inference processes before passing any identified code to an execution environment. Each of these layers could, in principle, alter, truncate, reformat, or substitute the submitted code prior to execution. The fact that none of these layers introduced execution corruption across 1200 runs on four platforms, four investigators, and two sample-size scenarios is a property of these specific systems under the tested conditions and not a foregone conclusion simply because a fixed seed was specified. The distinction is consequential for trial documentation: an investigator citing a chatbot-generated randomization sequence must be able to assert, not merely assume, that the platform preserved the integrity of the execution. The present study provides that assertion for four of the most widely used consumer-facing platforms at the time of testing.
This platform-reliability framing is also consistent with emerging regulatory expectations: the FDA’s draft guidance on AI-enabled device software explicitly recommends evaluating repeatability and reproducibility as components of performance validation, recognizing that variability in AI outputs, even under identical conditions, is a distinct concern from accuracy [
7,
13].
4.3. The Contrast Between Code-Execution and NL-Only Conditions as the Central Finding
The most important finding of this manuscript is not the 100% reproducibility observed in Experiment 1, nor the 0% reproducibility observed in Experiment 2, but the absolute contrast between them. Under fixed-seed Python code execution, all four platforms functioned as deterministic code-execution environments, a finding attributable to the seeded algorithm rather than to the model’s generative behavior, as explicitly framed throughout this manuscript. Under natural-language-only prompting, without code submission or seed specification, the same four platforms produced entirely non-reproducible allocation sequences across 320 independent runs, with zero exact matches detected. This contrast was perfectly consistent across all four platforms and all four investigators.
This finding directly operationalizes the distinction between code-level reproducibility and model-level stochasticity that has been called for in the methodological literature. Shyr et al. (2025) [
13] demonstrated formally that LLM outputs are variable even under identical input conditions and that this variability lacks standardized metrics for characterization. Experiment 2 provides direct empirical evidence of this stochasticity in the specific context of clinical trial randomization: without a fixed seed and explicit code submission, chatbot platforms cannot serve as reproducible allocation tools under the conditions tested here. Under the conditions evaluated in the present study, unconstrained NL-only chatbot prompting was therefore not appropriate for trial randomization.
The finding that allocation integrity remained 100% under NL-only prompting is equally important for correct interpretation. The platforms reliably produced complete, balanced, correctly formatted randomization tables in every run. The failure mode under NL-only prompting is therefore not structural invalidity, but non-reproducibility: any given list may be technically correct, yet it cannot be reconstructed, independently checked, or verified against a pre-registered sequence. A randomization list that cannot be independently reproduced from documented inputs violates the ICH E9 requirement that randomization procedures be reproducible when needed [
4] and the CONSORT 2025 requirement for transparent, verifiable sequence generation [
9,
10,
11]. Structural correctness without reproducibility is insufficient for legitimate trial use.
The practical implication is specific and narrow: investigators working in low-resource settings, such as postgraduate dental or medical research programs, trial sites in low- and middle-income countries, or early-phase exploratory studies, who wish to use a chatbot platform for sequence generation have, prior to this study, had no empirical basis for choosing between code-based and NL-only approaches. The present findings provide that basis. The recommendation is not that chatbots should be used for clinical trial randomization, but rather that if they are used, and available evidence suggests this is already occurring informally, the code-based pathway with a fixed seed is the only approach that satisfies the reproducibility requirement of ICH E9. The NL-only pathway, regardless of how structurally valid its outputs may appear, does not.
Taken together, the findings from Experiment 1 and Experiment 2 define a clear operational boundary: fixed-seed code execution provides a reproducible and manually traceable pathway for allocation generation, whereas NL-only prompting yields non-reproducible outputs and is therefore unsuitable for trial contexts requiring a documented and verifiable randomization sequence.
4.4. Allocation Integrity, Trial Validity, and Traceability
The finding of 100% allocation integrity, each identifier appearing exactly once, with no duplicates, missing, or extraneous entries, is methodologically important because valid randomization begins with a correct allocation sequence. Randomized controlled trials are regarded as the reference standard for causal effectiveness research because randomization reduces bias and, particularly in sufficiently large studies, balances both observed and unobserved participant characteristics between groups, thereby strengthening causal interpretation of between-group differences [
17]. The contemporary trial-methods literature emphasizes that true random allocation, together with allocation concealment and, where feasible, blinding, safeguards internal validity and protects against systematic error [
18]. Against that background, duplication, omission, or contamination of identifiers would represent a substantive failure of the allocation mechanism rather than a minor formatting defect. No such failures occurred in any benchmark or exploratory run, supporting the conclusion that, within the use case tested here, chatbot-mediated code execution implemented simple randomization faithfully at the level of the final allocation list.
That interpretation should nevertheless be bound to simple randomization itself. Braga et al. (2025) [
18] note that simple randomization is easy to implement and methodologically valid, but in smaller studies, it may still produce chance imbalances that, although they do not invalidate the statistical test, may affect the credibility of the treatment effect. Block and stratified randomization are used to address specific design problems, particularly when sample size is small or prognostic balance is a priority [
1,
3,
18]. The present findings, therefore, establish the correctness of the implementation in the tested use case, not the superiority of simple randomization over restricted or covariate-adaptive methods.
A second major contribution of this study is the demonstration that reproducibility and traceability can be preserved in a chatbot-mediated workflow when the allocation logic, seed value, and complete raw outputs are systematically archived. The ICH E9 guideline on statistical principles for clinical trials requires that randomization schedules be reproducible when needed and that details sufficient to reconstruct the schedule be securely filed rather than disclosed in documentation accessible to investigators during recruitment [
4]. CONSORT 2025 strengthens expectations for transparent trial reporting by requiring explicit identification of who generated the allocation sequence, the method used, the type of randomization, the allocation concealment mechanism, and whether enrolling personnel had access to the sequence; it further adds items on protocol access, data sharing, and code sharing [
9,
10,
11]. GAMER requires reporting of tool specifications, prompts, unedited outputs, verification procedures, data privacy safeguards, and the influence of AI tool use on study conclusions [
14]. REFINE adds dedicated items on model access; prompt engineering; generation parameters; output stochasticity and reproducibility constraints; version variation; sharing of code, data, and model artefacts; and governance, auditability, and oversight [
16]. Within this combined framework, preservation of the verbatim prompt or code condition, fixed seed, and full unedited output for every run enabled exact post hoc verification and reconstruction of the generated schedule. This study, therefore, demonstrates operational input–output traceability of the tested workflow, not a validated electronic audit trail or regulatory-grade record system.
It must be explicitly stated, however, that the operational input–output traceability demonstrated in this study refers strictly to manual traceability of the prompt/code, seed, and unedited output. It does not constitute, nor replace, the electronic audit trails required for regulatory compliance by agencies such as the FDA or MHRA (e.g., 21 CFR Part 11). Furthermore, any fully reproducible seeded workflow is inherently predictable if the seed and script are exposed. The revelation of the prompt or seed compromises allocation concealment entirely; therefore, the seed, code, and final list must remain strictly under the control of an independent party not involved in participant recruitment.
A related practical consideration concerns allocation concealment. While the present study establishes that chatbot interfaces preserved correct and reproducible outputs when executing the pre-specified fixed-seed code under the tested conditions, the conversational nature of these interfaces introduces a risk of inadvertent exposure. Chat histories may remain accessible within the platform, and the allocation sequence may be visible to individuals who should not have access to it during participant enrollment. To mitigate this risk, investigators using chatbot-generated allocation lists should adopt post-generation safeguards, such as exporting the output to a password-protected file, deleting or archiving the chat session immediately after list retrieval, and restricting access to the allocation schedule to a designated unblinded statistician or independent party, consistent with established allocation concealment principles [
6].
The exploratory voice runs nevertheless exposed a workflow-specific vulnerability. All platforms generated correct outputs after voice-delivered instructions, but the underlying code was not displayed automatically and required an additional text prompt within the same session. This does not negate traceability of the workflow record because the code remains retrievable and verifiable against the output upon request; however, it introduces an avoidable procedural dependency. In the context of contemporary reporting standards that emphasize transparent documentation, reproducibility, and traceability, code retrieval and archival should therefore be treated as mandatory components of any future voice-mediated allocation workflow [
9,
10,
11,
14,
16].
The supplementary permuted block benchmark extends the central finding of this study to a restricted randomization algorithm that is one step more structured than simple randomization. It should be interpreted as a restricted technical validation scenario rather than as a representative model of contemporary clinical trial randomization: it examined only a fixed block size, two arms, equal allocation, and no stratification. Although permuted block designs are widely used in registered clinical trials because they enforce allocation balance at fixed intervals and mitigate temporal recruitment bias [
1,
3], the present benchmark establishes only that the observed contrast persists under one restricted method that is more structured than simple randomization; it does not demonstrate performance across the broader set of randomization procedures used in contemporary trials, such as variable block sizes, stratification, multicenter workflows, unequal allocation ratios, or minimization. Within these bounds, the permuted block results demonstrate that the same binary pattern, 100% reproducibility under Python/fixed-seed execution, 0% reproducibility under NL-only prompting, holds without exception across all four platforms, all four investigators, and 640 runs under an algorithm that introduces structural complexity absent from simple randomization.
This replication carries two distinct implications. First, it establishes that the deterministic property of fixed-seed code execution is algorithm-agnostic within the code-execution pathway: the chatbot interface preserves execution fidelity regardless of whether the allocation logic is a complete random permutation or a block-constrained shuffle. The operative mechanism remains the seeded pseudorandom number generator, not the structural complexity of the allocation rule, and the platforms evaluated here did not introduce corruption under either design. Second, the NL-only failure mode is equally algorithm-agnostic: NL-only prompting cannot produce reproducible permuted block sequences any more than it can produce reproducible simple-randomization sequences because the absence of a fixed seed means that no allocation algorithm, however correctly implemented, can yield a verifiable, pre-registerable sequence. The structural correctness of every NL-only output (100% allocation integrity across 320 runs) confirms that the platforms understood and correctly implemented the permuted block instruction; the failure is exclusively one of reproducibility, not of algorithmic comprehension.
Taken together, the primary benchmark (Experiments 1 and 2) and the permuted block supplementary benchmark establish a consistent empirical pattern across two fundamentally different allocation algorithms, six platforms, and over 1900 total runs: within chatbot code-execution environments, seeded determinism is preserved; outside that deterministic scaffold, reproducibility disappears entirely. The practical recommendation that follows is correspondingly algorithm-independent: if LLM-linked chatbot platforms are to be used in any allocation context, whether simple or block-based, the fixed-seed explicit-code-execution pathway is the only prompting strategy that satisfies the ICH E9 reproducibility requirement and enables the traceability record demanded by CONSORT 2025 [
9], GAMER [
14], and REFINE [
16].
4.5. Operational Flexibility and Practical Relevance
The exploratory perturbation analyses showed that the workflow extended without failure to modified allocation structures, including, for example, three-arm and four-arm designs and 2:1 and 3:1 allocation ratios. This is practically relevant because a sequence-generation workflow limited to two-arm, 1:1 allocation would have only narrow utility. Within the bounds of simple randomization, the present results suggest that the same seeded code-execution paradigm can be adapted via straightforward parameter modifications without compromising allocation integrity or reproducibility.
This flexibility may have practical value in lower-infrastructure environments, although it should not be interpreted as a substitute for validated randomization systems. At the same time, accessibility should not be conflated with methodological sufficiency. Even a technically correct allocation list requires appropriate implementation, secure concealment from those enrolling participants, and rigorous protocol governance to support valid inference. Empirical evidence demonstrates that trials with inadequate or unclear allocation concealment yield treatment effect estimates inflated by up to 40% compared with adequately concealed trials, establishing concealment as equally critical to the validity of the RCT as the randomization sequence itself [
6]. Valid trial conduct, therefore, depends not only on generating a correct allocation list but on how that list is subsequently implemented, concealed, archived, and governed [
6,
17,
18].
To make the positioning of chatbot-mediated workflows explicit relative to the tools used in clinical practice,
Table 3 summarizes at a feature level how fixed-seed chatbot code execution compares with the non-LLM deterministic controls evaluated here and with dedicated randomization tools that were not tested: a sequence-generation and assessment package (randomizeR) and validated randomization services or trial-management systems (e.g., REDCap and Sealed Envelope). The comparison is qualitative and based on documented capabilities rather than on a head-to-head experiment, consistent with the scope of this study, and is intended only to delineate where chatbot-mediated execution is and is not a substitute. The table shows that the chatbot fixed-seed pathway achieved deterministic reproducibility and basic input–output traceability under the tested fixed-seed conditions, while differing categorically from dedicated tools in allocation concealment, role-based access control, validated electronic records, and integration with trial conduct—precisely the functions that distinguish a randomization utility from a regulated trial-management system. This directly addresses the concern that the present comparator set (Excel/VBA and R Console) does not encompass dedicated randomization software, by clarifying that those non-LLM tools were included as deterministic execution controls rather than as proposed substitutes for validated systems.
4.6. Reporting Implications
From a reporting perspective, this study lies at the intersection of randomized-trial methodology and generative AI evaluation, and no single guideline fully addresses both domains. CONSORT 2025 is the appropriate framework for transparent reporting of the trial-methods components, particularly sequence generation, allocation concealment, implementation roles, protocol access, and data and code sharing [
9,
10,
11]. GAMER contributes a universal framework for reporting the use of generative AI tools across medical research, covering tool specifications, prompting techniques, verification procedures, data privacy, and influence on conclusions [
14]. REFINE adds the technical detail required for FM and LLM studies, particularly model specification, prompt design, stochasticity control, output reproducibility constraints, version variation, and implementation governance [
16].
A specific implication of the present study is that future evaluations of chatbot-assisted randomization should report reproducibility at two distinct levels: model-level reproducibility, which is subject to stochastic inference and generation parameters, and code-level reproducibility, which is governed by algorithmic determinism under fixed seed conditions. The FDA draft guidance on AI-enabled device software formalizes this requirement from a regulatory standpoint, recommending precision studies that evaluate repeatability (agreement under identical conditions) and reproducibility (agreement under different, prespecified conditions) as part of performance validation documentation [
7]. Shyr et al. (2025) [
13] provide a statistical framework for operationalizing exactly these metrics in LLM contexts, using pairwise cosine similarity of semantic embeddings for semantic consistency and average token-level entropy for internal stability, offering a methodological template that future chatbot-assisted allocation studies could adapt.
This distinction follows directly from the logic of both REFINE and GAMER, which treat model identity, prompting, access conditions, output handling, and reproducibility constraints as separate reporting domains rather than as a single undifferentiated performance domain [
14,
16]. In the present study, the key reproducibility claim concerns the latter: deterministic code-level reproducibility under fixed-seed execution. Reporting this distinction precisely is essential for accurate interpretation by trial investigators, methodologists, and regulators who may seek to evaluate or adopt chatbot-mediated allocation workflows in practice.
4.7. Limitations
Some limitations should be considered when interpreting these findings. The present study evaluated simple randomization by complete random permutation as its primary algorithm; the supplementary permuted block benchmark extended this to a restricted design that is one step more structured than simple randomization but still limited in scope. The permuted block benchmark was intentionally simplified, with a fixed block size, two arms, equal allocation, and no stratification, and should not be interpreted as broadly representative of contemporary trial randomization practice. Within these bounds, it confirmed algorithm-agnostic determinism under fixed-seed code execution. However, variable block sizes, stratified randomization, multicenter randomization, unequal allocation ratios, and covariate-adaptive procedures such as minimization were not evaluated and remain outside the scope of this study; whether chatbot-mediated code execution performs reliably under these designs is a priority for future investigation.
First, all testing was conducted through the publicly available graphical user interfaces (GUIs) of the chatbot platforms rather than through application programming interfaces (APIs). GUI-based access is subject to interface changes, platform updates, and potential session instabilities that may affect long-term reproducibility in ways not captured during the testing period.
Second, the comparator set, while including a deterministic Excel/VBA macro and R Console verification, did not encompass dedicated randomization software packages (e.g., REDCap, randomizeR in R, or Sealed Envelope) or regulatory-grade trial management systems. It should also be noted that even Excel-based randomization is increasingly discouraged in professional trial settings in favor of dedicated statistical software, such as SAS and the R statistical computing environment, or validated web-based systems [
3]. The study was designed to evaluate operational equivalence in accessible, low-infrastructure settings rather than to benchmark against the full landscape of established randomization tools. To make this boundary explicit in the absence of a head-to-head experiment,
Table 3 provides a qualitative, feature-level comparison of chatbot-mediated fixed-seed execution against these dedicated tools; a direct empirical comparison with at least one dedicated randomization tool or trial-management system remains a necessary step before any practical clinical-trial use could be considered.
Third, because all platforms achieved 100% success across all outcomes in Experiment 1 and the permuted block benchmark, the study could not characterize failure modes, error rates, or the boundaries of reliable performance under fixed-seed code execution; ceiling effects preclude estimation of true failure probabilities. Future studies could use deliberately corrupted prompts or intentionally unstable code versions to characterize failure modes and establish error rates more precisely.
Fourth, the reproducibility demonstrated here relies entirely on strict adherence to the locked, standardized prompt as provided. In real-world applications, there is a practical risk of prompt drift or execution-path drift, whereby minor variations in a user’s natural-language instructions may lead the platform to alter the underlying script or invoke different software libraries. Researchers adopting this workflow must therefore use the provided prompt template exactly as specified; any deviation from it, or reliance on free-text prompting, could compromise deterministic execution and invalidate the reproducibility guarantee established here.
Fifth, although Experiment 2 prospectively benchmarked NL-only prompting, it evaluated only one locked prompt, one allocation scenario, and consumer-facing GUI access. These findings establish non-reproducibility under the tested NL-only condition but do not exhaust every possible prompt formulation, interface configuration, or future platform implementation. The scope of the NL-only failure mode should therefore be interpreted as specific to the conditions tested rather than as a universal characterization of NL-prompted randomization. Relatedly, reproducibility was operationalized as exact sequence-level identity against a reference run. The NL-only outputs that did not reproduce the reference sequence were not further characterized using more granular sequence-level metrics, such as within- and cross-platform sequence similarity, duplicate-pattern frequency, positional allocation entropy, or run-to-run edit distance. Such analyses could quantify the degree of divergence among independently generated NL-only sequences and help identify whether latent structure, such as recurring ordering patterns or reduced entropy, is present. However, these analyses were outside the prespecified binary outcome framework of the present study and would not alter the central finding that exact reproducibility was absent under NL-only prompting.
Finally, the rapidly evolving nature of LLM platforms means that model updates, changes to code-execution environments, or modifications to platform policies may alter performance characteristics over time. The findings reported here reflect platform behavior at the time of testing and underscore the need for periodic revalidation before any chatbot-mediated allocation workflow is adopted or continued in a research setting.