How would you A/B test two LLM prompts in production?
Role: Data Scientist
Category: Analytics & Experimentation
Difficulty: medium
Interview Round: Other
You have two candidate prompts for an LLM feature that is already live, such as a customer support assistant. How would you A/B test the two prompts in production?
```hint Choose the unit
Think about what a returning user experiences if every request is assigned independently, and what that does to the independence of your measurements.
```
```hint Question the quality signal
Thumbs-up buttons and automatic judges both have biases. Consider who leaves feedback, and what an automatic judge can see when it scores a response.
```
### Clarifying Questions to Ask
- What counts as success for this feature: a resolved task, a user rating, a conversion, or something further downstream?
- Are users logged in and returning, or is traffic mostly anonymous one-off requests?
- How much traffic does the feature get per day, and how small an improvement is worth detecting?
- Do the two prompts differ in length or tool use in ways that change cost or latency?
- Are there safety or policy rules that one of the prompts could break?
### What a Strong Answer Covers
- The primary metric and guardrails, chosen before launch, and how LLM output quality will be measured
- The randomization unit and a deterministic way to assign it
- Keeping everything except the prompt fixed
- Sample size, test duration and the rule for deciding which prompt ships
- Pitfalls specific to LLM features, such as stochastic outputs, biased judges and sparse feedback
### Follow-up Questions
- Users are randomized, but your metric is measured per conversation. How do you compute the standard error?
- How would you test five prompt variants at once without inflating false positives?
- How would you check that an LLM-as-judge score tracks what users care about?
- When would a multi-armed bandit be a better choice than a fixed 50/50 split here?
Overview: Asks how to run a production A/B test comparing two prompts for a live LLM feature. Tests experiment design skills: choosing metrics and guardrails, picking a randomization unit, measuring noisy LLM output quality, sizing the test, and avoiding common analysis errors.