What Are Experiments?
Experiments allow you to:- Compare multiple prompts or versions against the same inputs
- Test different models (GPT-4 vs Claude vs Gemini)
- Measure performance with automated evaluators
- Validate improvements before production deployment
- Build datasets from production traffic or manual inputs
Side-by-Side Comparison
Automated Scoring
Production Testing
Dataset Building
Creating an Experiment
From the UI
Navigate to Experiments
Choose creation method
- From scratch: Manual input rows
- From prompt: Use an existing prompt as the baseline
- From dataset: Use a saved dataset
Configure inputs
Add hypotheses
- Different prompt versions
- Different models
- Different parameters (temperature, max_tokens)
Run the experiment
From a Prompt
Start an experiment directly from a prompt:Open your prompt
Click Experiment
Select inputs
- Production request history
- Manual input creation
- Existing datasets
Add variations
Experiment Structure
An experiment consists of:Inputs (Rows)
Each row represents a test case with variables:Hypotheses (Columns)
Each column represents a variation to test:Results
The experiment grid shows outputs for each input × hypothesis combination, along with:- Response text
- Token usage
- Latency
- Cost
- Evaluator scores
Running Experiments
Execute All Tests
Run the experiment to generate outputs for all combinations:View Results
Results appear in a table format with:- Input variables
- Output for each hypothesis
- Token counts and costs
- Latency measurements
- Evaluator scores
Compare Side-by-Side
The experiment table lets you:- Scroll horizontally to compare outputs
- Sort by evaluator scores
- Filter by input variables
- Highlight differences between versions
Evaluators
Evaluators automatically score experiment outputs based on criteria you define.Adding Evaluators
Open experiment settings
Create or select evaluator
- LLM-as-Judge: Use GPT-4 or Claude to score responses
- Regex: Pattern matching for specific content
- Custom: API-based evaluator with your own logic
Configure scoring
Run evaluators
Evaluator Types
LLM-as-Judge
Use another LLM to score responses:Pattern Matching
Score based on content patterns:Custom Evaluator
Call your own API for scoring:Viewing Scores
Evaluator scores appear as columns in the experiment table:Datasets
Datasets are reusable collections of test inputs.Creating Datasets
From production traffic
From experiments
Manual creation
CSV import
Using Datasets
Reuse datasets across multiple experiments:Experiment Workflows
A/B Testing Workflow
Create baseline
Add variation
Run on production inputs
Score with evaluators
Analyze results
- Version 2.0: Avg score 4.3, $0.02/request
- Version 1.0: Avg score 3.8, $0.03/request
Deploy winner
Model Comparison
Create hypotheses for each model
- GPT-4o
- Claude 3.5 Sonnet
- Gemini 1.5 Pro
Use same prompt across all
Run experiment
Compare cost vs quality
- GPT-4o: Score 4.2, $0.02
- Claude: Score 4.5, $0.025
- Gemini: Score 3.9, $0.015
Parameter Tuning
Create hypotheses with different parameters
- Temperature: 0.3, 0.7, 0.9
- Max tokens: 500, 1000, 2000
Run experiments
Find optimal settings
Experiment API
Create Experiment
List Experiments
Get Experiment Details
Delete Experiment
Best Practices
Analyzing Results
Statistical Significance
Consider:- Sample size: Test with at least 20-50 inputs for meaningful results
- Variance: Look at score distribution, not just averages
- Edge cases: Ensure new versions handle corner cases well
Cost Analysis
Compare total cost per hypothesis:Latency Impact
Monitor response times:- P50 latency
- P95 latency
- Max latency
