Skip to main content
Datasets are JSONL files containing test cases to validate prompt behavior. Each line has an input (required) and an optional expected_output. You keep them alongside your prompts and run them directly from the CLI.

Quick start

1. Create a dataset file (agentmark/datasets/sentiment.jsonl):
2. Link to your prompt (frontmatter):
3. Run experiments:

Dataset structure

Each line must be valid JSON:
  • input (required) - Props passed to your prompt
  • expected_output (optional) - Expected result for evaluation
With expected output (enables evaluations):
Without expected output (output-only mode):

What to test

Common cases:
Edge cases:
Failure modes:
Real-world data - Use production data with identifying details removed when possible.
LLM-assisted generation - Use LLMs to generate test cases, but have humans verify outputs before using them.

Expected-output types

Strings (classification):
Objects (structured data):
Flexible (patterns, not exact matches):
Your evaluation function validates flexible expectations.

Dataset size

Start small (10-20 cases):
  • 5-7 common scenarios
  • 3-5 edge cases
  • 2-3 failure modes
Scale based on needs:
  • Initial development: 50-100 cases (recommended by Confident AI)
  • Statistical significance: ~250 cases (for 95% confidence, 5% margin of error)
  • Production systems: 100-300 cases minimum
  • High-stakes applications: 300+ cases
Quality > quantity. Start with 50-100 high-quality cases, then grow based on statistical power analysis and real-world findings.

Best practices

  • One test case per line (valid JSONL)
  • Use descriptive inputs that clearly show what the test case validates
  • Version control datasets alongside prompts
  • Avoid duplicates - each case should validate something unique
  • Always anonymize data (never leak sensitive information)

Advanced: held-out test sets

Create separate datasets to avoid over-fitting:
Critical rules:
  • Never iterate on held-out data
  • Don’t peek at held-out results during development
  • If you look at held-out results and make changes, create a new held-out set
Example workflow:

Advanced: statistical significance

Sample size requirements (source):
  • Quick iteration: 10-20 cases (directional feedback only)
  • Initial development: 50-100 cases (industry standard)
  • Statistical rigor: ~250 cases (95% confidence, 5% margin of error)
  • Production deployment: 100-300 cases minimum
  • High-stakes systems: 300+ cases
Why size matters: with 10 cases, one failure = 10% change. With 100 cases, one failure = 1% change. Research shows datasets with N ≤ 300 often overestimate performance. Confidence intervals - Report uncertainty:
Report: “Pass rate: 85% [CI: 78%-92%]” Avoid: “Pass rate: 85%” Comparing prompts - Use paired comparisons on same dataset:
Power analysis - Determine how many samples you need before creating your dataset. It answers how many test cases reliably detect a meaningful improvement. The smaller the improvement you want to catch, the more cases you need: If you only have 50 test cases, you can only reliably detect large improvements (>15%); smaller improvements look like noise. Plan your dataset size around the smallest improvement that matters to your application before you start collecting cases.

Next steps

Evaluations

Write evaluation functions

Running experiments

Test your datasets

Testing overview

Learn testing concepts

Have questions?

Reach out any time: