Every LLM team has "the prompt that feels better" - but feelings aren't evidence. LLM experimentation turns intuition into a controlled comparison: same dataset, same metrics, different variant. Done right, it tells you whether a new prompt, model, or tool configuration is genuinely better, not just different.
What you're comparing
Experiments span more than prompts. The most common variants are:
- Prompts - a rewritten instruction, a different rubric, an added example.
- Models - a frontier upgrade, a cheaper model, a different provider.
- Tools & configuration - retrieval strategy, temperature, context window, agent toolset.
- Dataset splits - how you sample the test set changes what you learn.
Design a controlled experiment
A comparison is only meaningful if it controls the variables:
- Fix the dataset. Identical inputs for all variants - no hand-picking "good" examples.
- Run everything with the same judges and metrics. Change one thing at a time.
- Repeat for statistical signal. LLM responses are stochastic; run enough trials to separate signal from noise.
- Look beyond a single metric. Quality, cost, latency, and failure modes all matter.
# A fair LLM experiment keeps everything fixed but the variant
# 1. One dataset, shared across candidates
# 2. Same judges and metrics
# 3. Multiple trials per candidate (pass@k)
# 4. Compare quality, cost, and latency together
Choosing the right metrics
The metrics decide what the experiment can claim. If you only compare a quality score, a cheaper model can look like a regression even when it's the same on the metrics users care about. Capture a small, meaningful set - a quality or correctness score, alongside latency and cost - and report all three. A variant that wins on quality but doubles latency is a trade-off, not a win.
From offline experiment to production A/B
Offline evals are the filter; production A/B is the verdict. After an offline run picks a winner, ship it to a slice of real traffic and compare live signals - completion rate, cost per request, error rate, and user outcomes. The offline experiment de-risks the roll-out, and the A/B test confirms it under real conditions.
Test one variable at a time, and let the data pick the winner.
Next steps
Set up a versioned evaluation dataset and run every candidate against it with a shared metric set. Combine LLM experimentation with prompt optimization and AI evals to turn prompt tuning from guesswork into evidence.