🧠 Why This Matters

Creating high-quality QA datasets is often a bottleneck. With synthetic QA generation, you can:
  • Convert any text source into structured QA pairs.
  • Quickly scale your dataset with minimal manual effort.
  • Prepare reliable data for fine-tuning or evaluating small and large language models (SLMs/LLMs).

Example use case - Structured Output from Receipts In this guide we will see how to synthetically generate QA pairs from a set of receipts. We’ll use 20 invoice receipts from this dataset. Each file will generate 1 Synthetic QA pair, producing a structured JSON output that extracts key fields (date, total amount, business name, etc.). This type of dataset is crucial for fine-tuning models that need to reliably extract structured data from semi-structured sources (like receipts, tickets, or invoices).

βš™οΈ Step-by-Step: Using QA Generation in Prem Studio

1

Create a New Dataset

GIF of navigating to synthetic dataFrom the left sidebar, go to Datasets β†’ + Create dataset β†’ Synthetic Data.
2

Upload Your Input Files

GIF of uploading input filesDrag and drop your text files (PDF, DOCX, TXT, HTML). πŸ“Œ In this example, we use 20 invoice receipts.
3

Configure Advanced Settings (Optional but Recommended)

Advanced SettingsThis step lets you steer the QA generation toward your expected output. It includes:
  • Rules & Constraints β†’ enforce requirements.
  • QA Examples (up to 3) β†’ provide few-shot examples to guide generation.
  • Question/Answer Guidance β†’ define QA formats.
  • Creativity Level β†’ adjust diversity of generated QAs.
For our receipts example:Rules & Constraints:
- Always include the full extracted text in the question.
- Clearly instruct extraction into the given JSON schema.
- Only output the JSON object (no extra text).
- Fill fields only if explicitly present in the text.
- If a field is missing, leave it empty but keep the key.
- Strictly follow the schema.
- Never infer, guess, or fabricate information.
Question Format
{EXTRACTED_TEXT}
Task: Extract all the information available in the text and present it in the JSON format below.
Do not infer or invent details β€” only include what is explicitly stated.
JSON Schema:
{
    "DateTime": "YYYY-MM-DD HH:MM:SS",
    "Total Amount": "number",
    "Currency": "string",
    "Business Name": "string",
    "Business Location": "string"
}
Answer Format
{
    "DateTime": "<transaction_datetime_if_present>",
    "Total Amount": "<total_amount_if_present>",
    "Currency": "<currency_code_if_present>",
    "Business Name": "<business_name_if_present>",
    "Business Location": "<city_state_country_if_present>"
}
Creativity: set to 0
4

4. Review & Generate

Before starting, you’ll see a recap of your setup:
  • Data sources (your input files).
  • Generation settings (QA per file, creativity level, etc.).
  • Estimated cost. Click Create dataset to start the process.
Recap Synthetic Data Generation Task
5

Review Your Synthetic Dataset

Once generated, preview your QAs directly in Prem Studio. From the UI, you can also edit or delete datapoints to refine the dataset before using it.Recap Synthetic Data Generation Task

πŸ“¦ What’s Next?

You can now:

πŸ’‘ Pro Tips

  • Always define advanced settings if you expect strict outputs.
  • Start small (10–20 docs) to validate your setup, then scale up.
  • Use domain-specific schemas (invoices, medical records, support tickets, etc.).
  • Keep creativity low when extracting structured data.