Running Reproducible Prompt Experiments
This lesson explains how versioning every element of a generative AI experiment, with Bedrock Prompt Management and Bedrock evaluations, makes good results reproducible and comparisons fair.
Learning outcomes
After completing this lesson, you will be able to:
- Identify what defines a generative AI experiment.
- Version prompts with Prompt Management.
- Run comparable evaluations with the same configuration.
What defines a generative AI experiment
The result of a generative AI experiment depends on more than the prompt text. It depends on the prompt template and its variables, the model ID and version, the inference parameters such as temperature, top P and maximum tokens, the system prompt, any retrieval configuration such as the knowledge base, number of results, filters and reranker, the guardrail version and the evaluation dataset.
Changing any of these can change the outcome, so all of them must be recorded with each result. Sampling randomness also means that repeated runs vary unless the temperature is low, so comparisons should use several runs or deterministic settings.
Record the experiment
Versioning with Prompt Management
Amazon Bedrock Prompt Management stores a prompt with its template, variables, model and inference configuration. Editing happens in a draft; creating a version takes an immutable snapshot with its own ARN. Experiments and applications reference a specific version, and prompt variants can be compared side by side. MLflow tracing and experiments can also record prompt versions, parameters and scores alongside traditional ML runs.
Running comparable evaluations
Run every candidate through the same Bedrock evaluation job configuration: the same dataset version in S3, the same judge model and metrics. Record which prompt version and model each job evaluated, keep evaluation jobs' results for comparison and rerun the baseline when the dataset changes. The following table lists the elements to fix and how.
| Element | How to version or fix it |
|---|---|
| Prompt template and parameters | Prompt Management version ARN |
| Model | Explicit model ID or inference profile, not an alias that changes |
| Evaluation dataset | Versioned S3 object |
| Judge and metrics | Same evaluation job configuration |
| Retrieval settings and guardrail | Recorded configuration and guardrail version |
| Results | Evaluation job outputs, MLflow runs |
The following diagram compares two engineers' playground impressions of a prompt change with a controlled evaluation of the same change.

Is it really better?
A disputed improvement
Two engineers disagree about whether a new prompt improved answer quality. One tested in the playground with temperature 0.9 on ten questions; the other used a different model version.
- Save both prompts as versions 7 and 8 in Prompt Management with temperature 0.2 and the same model ID.
- Run two evaluation jobs on the same 400-question dataset version with the same judge metrics.
- Version 8 scores 0.86 correctness against 0.81 for version 7, with lower variance across reruns.
The application is switched to version 8 by changing one ARN, and version 7 remains available for rollback. Playground impressions were not comparable because the model and sampling differed.
Can a Bedrock Prompt Management version be edited?
Show answer
No. Versions are immutable and have their own ARN.
Exam Tips
Remember for the exam
- Version prompts, with model and parameters, in Bedrock Prompt Management.
- Prompt versions are immutable and have their own ARN.
- Compare candidates with the same evaluation dataset, judge and metrics.
- Pin explicit model IDs for experiments.
- Use low temperature to reduce run-to-run variance in comparisons.