Experimental Design for Configuration Comparison: Worked Example — Evaluation, Testing, and Optimization (Claude Certified Architect - Professional)
Experimental Design for Configuration Comparison — Worked Example In the Claude Certified Architect - Professional exam, domain 4 (17% weight)...
Experimental Design for Configuration Comparison — Worked Example
In the Claude Certified Architect - Professional exam, domain 4 (17% weight) emphasizes rigorous evaluation, testing, and optimization of AI solutions. A critical skill is designing experiments that compare two prompt or model configurations effectively within constraints of sample size, cost, and interpretability.
This worked example demonstrates a step-by-step approach to designing such an experiment to compare two prompt configurations deployed via the Claude API.
Scenario
An enterprise uses a Claude-powered conversational agent for customer support. They have developed a new prompt configuration (Prompt B) intended to improve response groundedness without sacrificing latency. The current production prompt is Prompt A.
The architect must design an experiment to compare Prompt A and Prompt B on groundedness and latency, ensuring results are interpretable and statistically meaningful within a limited budget of 200 total API calls.
Step 1: Define Evaluation Metrics and Success Criteria
Groundedness: Measured by human review on a 3-point scale (0=hallucinated, 1=partially grounded, 2=fully grounded).
Latency: Measured automatically via Claude API telemetry, average response time per prompt.
Success Criterion: Prompt B must show a statistically significant improvement in groundedness without increasing average latency by more than 10%.
Step 2: Determine Sample Size and Trial Allocation
Given 200 total API calls, the architect chooses to allocate equally between Prompt A and Prompt B to control variance:
100 calls for Prompt A
100 calls for Prompt B
Each call corresponds to one test case (customer query). To separate configuration effect from run-to-run variance, each test case is run once per prompt configuration.
Step 3: Select Test Cases
Test cases are sampled from recent production queries to reflect the deployed distribution. The architect ensures diversity in query types to cover typical customer intents.
Step 4: Design Human Review Process
Human annotators will review responses for groundedness using the 3-point scale.
To reduce LLM-as-judge bias, human review is the gold standard rather than relying solely on rubric-based or automated evaluation.
Annotators are blinded to prompt configuration to avoid bias.
Step 5: Collect Latency Telemetry
Latency data is collected automatically via the Claude API's response time logs for each call.
Step 6: Execute Experiment and Collect Data
The architect runs the 200 API calls, collects responses, and submits them for human review. Latency telemetry is aggregated.
Step 7: Analyze Results
Calculate average groundedness score per prompt.
Perform a paired statistical test (e.g., Wilcoxon signed-rank) to assess significance of groundedness difference.
Calculate average latency per prompt and compare percentage difference.
Step 8: Interpret Findings and Make Recommendations
If Prompt B shows a statistically significant improvement in groundedness and latency increase is within the 10% threshold, recommend rollout.
If latency increase exceeds threshold or groundedness improvement is not significant, consider re-tuning Prompt B or deferring deployment.
Summary
This experimental design balances interpretability, cost, and statistical rigor. By carefully defining metrics, allocating trials, and using human review to mitigate evaluation bias, the architect ensures a robust comparison of prompt configurations aligned with production constraints.
Such a methodical approach exemplifies the evaluation and testing expertise required for the Claude Certified Architect - Professional certification.