Skill Tracer
Skills › Evals Skills › generate-synthetic-data

generate-synthetic-data

skill · 131 lines · Apache-2.0 · skills/generate-synthetic-data/SKILL.md

The facts

Its description

Create diverse synthetic test inputs for LLM pipeline evaluation using dimension-based tuple generation. Use when bootstrapping an eval dataset, when real user data is sparse, or when stress-testing specific failure hypotheses. Do NOT use when you already have 100+ representative real traces (use stratified sampling instead), or when the task is collecting production logs.

The description the agent reads to decide when to use it.

From its settingsline 3

When it starts

The agent picks this skill when the user wants to build up an evaluation dataset from scratch — bootstrapping test inputs for an LLM pipeline, working with little or no real user data, or probing specific failure hypotheses — and not when plenty of real traces already exist or the job is collecting production logs.

Things a person might say (the model's guesses)

  • “I want to start evaluating my support chatbot but I don't have any real user queries yet”
  • “We only have a handful of real traces — can you generate some synthetic test inputs for us?”
  • “I want to stress-test my pipeline against ambiguous and out-of-scope requests”

A model's summary of when it is used.

A model's reading

Stops for a person

2 lines stop to ask a person

Lines that stop and wait for a person before going on. Found by matching words, so treat them as pointers.

Found by matching wordsline 18 line 54

What leads to it

Other skills that hand off to this one, call it, require it or offer it instead, as a model read them.

A model's reading

Licence

Apache-2.0, from LICENSE

The terms its author shares it under, which let it be shown here.

From the repositorylicence text
Other files in this skill (1) Close

The text

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1---
2name: generate-synthetic-data
3description: >
4 Create diverse synthetic test inputs for LLM pipeline evaluation using
5 dimension-based tuple generation. Use when bootstrapping an eval dataset,
6 when real user data is sparse, or when stress-testing specific failure
7 hypotheses. Do NOT use when you already have 100+ representative real
8 traces (use stratified sampling instead), or when the task is collecting
9 production logs.
10---
12# Generate Synthetic Data
14Generate diverse, realistic test inputs that cover the failure space of an LLM pipeline.

Generate Synthetic Data

Generate diverse, realistic test inputs that cover the failure space of an LLM pipeline.

Raw lines 1 to 15
16## Prerequisites
18Before generating synthetic data, identify where the pipeline is likely to fail. Ask the user about known failure-prone areas, review existing user feedback, or form hypotheses from available traces. Dimensions (Step 1) must target anticipated failures, not arbitrary variation.

Prerequisites

Before generating synthetic data, identify where the pipeline is likely to fail. Ask the user about known failure-prone areas, review existing user feedback, or form hypotheses from available traces. Dimensions (Step 1) must target anticipated failures, not arbitrary variation.

Raw lines 16 to 19
Involves a person Ask the user :18
20## Core Process

Core Process

Raw lines 20 to 21
22### Step 1: Define Dimensions
24Dimensions are axes of variation specific to your application. Choose dimensions based on where you expect failures.
26```
27Dimension 1: [Name] — [What it captures]
28 Values: [value_a, value_b, value_c, ...]
30Dimension 2: [Name] — [What it captures]
31 Values: [value_a, value_b, value_c, ...]
33Dimension 3: [Name] — [What it captures]
34 Values: [value_a, value_b, value_c, ...]
35```
37Example for a real estate assistant:
39```
40Feature: what task the user wants
41 Values: [property search, scheduling, email drafting]
43Client Persona: who the user serves
44 Values: [first-time buyer, investor, luxury buyer]
46Scenario Type: query clarity
47 Values: [well-specified, ambiguous, out-of-scope]
48```
50Start with 3 dimensions. Add more only if initial traces reveal failure patterns along new axes.

Step 1: Define Dimensions

Dimensions are axes of variation specific to your application. Choose dimensions based on where you expect failures.

Dimension 1: [Name] — [What it captures]
  Values: [value_a, value_b, value_c, ...]

Dimension 2: [Name] — [What it captures]
  Values: [value_a, value_b, value_c, ...]

Dimension 3: [Name] — [What it captures]
  Values: [value_a, value_b, value_c, ...]

Example for a real estate assistant:

Feature: what task the user wants
  Values: [property search, scheduling, email drafting]

Client Persona: who the user serves
  Values: [first-time buyer, investor, luxury buyer]

Scenario Type: query clarity
  Values: [well-specified, ambiguous, out-of-scope]

Start with 3 dimensions. Add more only if initial traces reveal failure patterns along new axes.

Raw lines 22 to 51
52### Step 2: Draft 20 Tuples with the User
54A tuple is one combination of dimension values defining a specific test case. Present 20 draft tuples to the user and iterate until they confirm the tuples reflect realistic scenarios. The user's domain knowledge is essential here — they know which combinations actually occur and which are unrealistic.
56```
57(Feature: Property Search, Persona: Investor, Scenario: Ambiguous)
58(Feature: Scheduling, Persona: First-time Buyer, Scenario: Well-specified)
59(Feature: Email Drafting, Persona: Luxury Buyer, Scenario: Out-of-scope)
60```

Step 2: Draft 20 Tuples with the User

A tuple is one combination of dimension values defining a specific test case. Present 20 draft tuples to the user and iterate until they confirm the tuples reflect realistic scenarios. The user's domain knowledge is essential here — they know which combinations actually occur and which are unrealistic.

(Feature: Property Search, Persona: Investor, Scenario: Ambiguous)
(Feature: Scheduling, Persona: First-time Buyer, Scenario: Well-specified)
(Feature: Email Drafting, Persona: Luxury Buyer, Scenario: Out-of-scope)
Raw lines 52 to 61
Involves a person until they confirm :54
62### Step 3: Generate More Tuples with an LLM
64```
65Generate 10 random combinations of ({dim1}, {dim2}, {dim3})
66for a {your application description}.
68The dimensions are:
69{dim1}: {description}. Possible values: {values}
70{dim2}: {description}. Possible values: {values}
71{dim3}: {description}. Possible values: {values}
73Output each tuple in the format: ({dim1}, {dim2}, {dim3})
74Avoid duplicates. Vary values across dimensions.
75```

Step 3: Generate More Tuples with an LLM

Generate 10 random combinations of ({dim1}, {dim2}, {dim3})
for a {your application description}.

The dimensions are:
{dim1}: {description}. Possible values: {values}
{dim2}: {description}. Possible values: {values}
{dim3}: {description}. Possible values: {values}

Output each tuple in the format: ({dim1}, {dim2}, {dim3})
Avoid duplicates. Vary values across dimensions.
Raw lines 62 to 76
77### Step 4: Convert Each Tuple to a Natural Language Query
79Use a separate prompt for this step. Single-step generation (tuples + queries together) produces repetitive phrasing.
81```
82We are generating synthetic user queries for a {your application}.
83{Brief description of what it does.}
85Given:
86{dim1}: {value}
87{dim2}: {value}
88{dim3}: {value}
90Write a realistic query that a user might enter. The query should
91reflect the specified persona and scenario characteristics.
93Example: "{one of your hand-written examples}"
95Now generate a new query.
96```

Step 4: Convert Each Tuple to a Natural Language Query

Use a separate prompt for this step. Single-step generation (tuples + queries together) produces repetitive phrasing.

We are generating synthetic user queries for a {your application}.
{Brief description of what it does.}

Given:
{dim1}: {value}
{dim2}: {value}
{dim3}: {value}

Write a realistic query that a user might enter. The query should
reflect the specified persona and scenario characteristics.

Example: "{one of your hand-written examples}"

Now generate a new query.
Raw lines 77 to 97
98### Step 5: Filter for Quality
100Review generated queries. Discard and regenerate when:
101- Phrasing is awkward or unrealistic
102- Content doesn't match the tuple's intent
103- Queries are too similar to each other
105Optional: use an LLM to rate realism on a 1-5 scale, discard below 3.

Step 5: Filter for Quality

Review generated queries. Discard and regenerate when:

  • Phrasing is awkward or unrealistic
  • Content doesn't match the tuple's intent
  • Queries are too similar to each other

Optional: use an LLM to rate realism on a 1-5 scale, discard below 3.

Raw lines 98 to 106
107### Step 6: Run Queries Through the Pipeline
109Execute all queries through the full LLM pipeline. Capture complete traces: input, all intermediate steps, tool calls, retrieved docs, final output.
111**Target: ~100 high-quality, diverse traces.** This is a rough heuristic for reaching saturation (where new traces stop revealing new failure categories). The number depends on system complexity.

Step 6: Run Queries Through the Pipeline

Execute all queries through the full LLM pipeline. Capture complete traces: input, all intermediate steps, tool calls, retrieved docs, final output.

Target: ~100 high-quality, diverse traces. This is a rough heuristic for reaching saturation (where new traces stop revealing new failure categories). The number depends on system complexity.

Raw lines 107 to 112
113## Sampling Real User Data
115When you have real queries available, don't sample randomly. Use stratified sampling:
1171. **Identify high-variance dimensions** — read through queries and find ways they differ (length, topic, complexity, presence of constraints).
1182. **Assign labels** — for small sets, with the user; for large sets, use K-means clustering on query embeddings.
1193. **Sample from each group** — ensures coverage across query types, not just the most common ones.
121When both real and synthetic data are available, use synthetic data to fill gaps in underrepresented query types.

Sampling Real User Data

When you have real queries available, don't sample randomly. Use stratified sampling:

  1. Identify high-variance dimensions — read through queries and find ways they differ (length, topic, complexity, presence of constraints).
  2. Assign labels — for small sets, with the user; for large sets, use K-means clustering on query embeddings.
  3. Sample from each group — ensures coverage across query types, not just the most common ones.

When both real and synthetic data are available, use synthetic data to fill gaps in underrepresented query types.

Raw lines 113 to 122
123## Anti-Patterns
125- **Unstructured generation.** Prompting "give me test queries" without the dimension/tuple structure produces generic, repetitive, happy-path examples.
126- **Single-step generation.** Generating tuples and queries in one prompt produces less diverse results than the two-step separation.
127- **Arbitrary dimensions.** Dimensions that don't target failure-prone regions waste test budget.
128- **Skipping user review of tuples.** Without the user validating tuples first, you can't judge whether LLM-generated tuples are realistic.
129- **Synthetic data when no one can judge realism.** If no one can judge whether a synthetic trace is realistic, use real data instead.
130- **Synthetic data for complex domain-specific content** (legal filings, medical records) where LLMs miss structural nuance.
131- **Synthetic data for low-resource languages or dialects** where LLM-generated samples are unrealistic.

Anti-Patterns

  • Unstructured generation. Prompting "give me test queries" without the dimension/tuple structure produces generic, repetitive, happy-path examples.
  • Single-step generation. Generating tuples and queries in one prompt produces less diverse results than the two-step separation.
  • Arbitrary dimensions. Dimensions that don't target failure-prone regions waste test budget.
  • Skipping user review of tuples. Without the user validating tuples first, you can't judge whether LLM-generated tuples are realistic.
  • Synthetic data when no one can judge realism. If no one can judge whether a synthetic trace is realistic, use real data instead.
  • Synthetic data for complex domain-specific content (legal filings, medical records) where LLMs miss structural nuance.
  • Synthetic data for low-resource languages or dialects where LLM-generated samples are unrealistic.
Raw lines 123 to 131

From ai-evals-course/evals-skills at 80d5f7b, 2026-09-24. Skills read by DeepSeek V4.1 Flash on 2026-11-04. Summary and techniques by Claude Opus 5.5 on 2026-11-06.