# How to generate synthetic data Generate synthetic data by defining what each record represents, which relationships must hold and how you will check the output. Start from a prompt when you need new records, or start from existing data when you need to retain patterns from a source. [Read this guide on Ground](https://useground.dev/guides/generate-synthetic-data) ## Choose how to generate your data Decide what the data needs to do before choosing a generator. Test fixtures need stable cases, analytics data needs plausible distributions, and training data needs examples that teach the model a task. | Starting point | What to specify | How to validate | | --- | --- | --- | | A prompt or schema | Tables, keys, row counts, business rules and required cases | Load the export and check keys, totals and case counts | | Existing data | Fields and relationships to preserve, plus the gaps you want to fill | Check the new rows against source patterns. For training, evaluate on a real holdout. | | A task for a model | Inputs, reference outputs, examples of hard cases and the trainer’s format | Check the labels or answers and evaluate on a separate test set | - [Compare synthetic data generators](https://useground.dev/guides/synthetic-data-generator-options) - [Extend an existing dataset](https://useground.dev/guides/extend-existing-dataset) ## Write a prompt Ground can turn into a dataset Name the entities, how they join and the conditions the rows must satisfy. Review the generated tables and compare the output with your requirements before you export CSV, JSON Lines or Parquet. Ground’s bike-share example has 200,000 rides, 10,000 members and 60 stations. Open the tables to see how rides link to members and stations, or download them to check aggregate ride patterns. - [Inspect the Bike-share tables and export](https://useground.dev/examples/bike-share) - [Download and verify the Bike-share recipe](https://useground.dev/examples/bike-share/recipe.md) - [Check synthetic data with SQL](https://useground.dev/guides/synthetic-data-quality-sql-checks) > Generate a month of bike-share rides with tables for stations, members and rides. Each ride links to its starting station. Member rides link to existing members. Make weekend rides longer on average. ## Generate synthetic data for training For a tabular model, generate examples of the classes or scenarios you need more of. For an LLM, generate task inputs paired with reference answers, or pairs of preferred and rejected answers. Set aside your evaluation data before you generate new examples. - [Generate synthetic data for machine learning](https://useground.dev/guides/synthetic-data-for-machine-learning) - [Build synthetic LLM fine-tuning data](https://useground.dev/guides/llm-fine-tuning-datasets) - [Inspect Ground’s text-to-SQL training experiment](https://useground.dev/use-cases/fine-tuning/method) ## Common questions ### Can I generate synthetic data without real records? Yes. Describe the entities, schema and scenarios you need, then check the generated data against those requirements. Use reference data when matching a real population is part of the task. ### How do I reuse exactly the same data? Save the export by version and keep its checksum alongside your code. Use that same artifact for subsequent runs. ## Related guides - [What is synthetic data?](https://useground.dev/guides/what-is-synthetic-data): Synthetic data is made-up data with the structure and behavior of real data. Ground builds tabular datasets, often several related tables, from a plain-language request, or adds rows and columns to a table you upload. [Markdown](https://useground.dev/guides/what-is-synthetic-data/guide.md). - [How to generate synthetic test data](https://useground.dev/guides/synthetic-test-data): To generate synthetic test data without production records, describe your tables, how they join and what cases the application must handle. Ground builds the related tables you can inspect and export. Pin a checked export to use the same rows in local development and CI. [Markdown](https://useground.dev/guides/synthetic-test-data/guide.md). - [How to generate synthetic data for machine learning](https://useground.dev/guides/synthetic-data-for-machine-learning): To generate synthetic data for training a machine learning model, start with the task, label definition and cases you need more of. Reserve a real test set first, generate only for the training set, and compare models on the same untouched test data. [Markdown](https://useground.dev/guides/synthetic-data-for-machine-learning/guide.md). - [How to evaluate synthetic data quality](https://useground.dev/guides/evaluate-synthetic-data-quality): Evaluate synthetic data at four levels: each value is valid, each row is consistent, combinations are plausible, and the dataset has the right mix of common and rare cases. Then measure it on the task you need it for. [Markdown](https://useground.dev/guides/evaluate-synthetic-data-quality/guide.md). - [How to generate synthetic training data for LLM fine-tuning](https://useground.dev/guides/llm-fine-tuning-datasets): To generate synthetic training data for an LLM, define a task and generate varied inputs with verified reference answers. Use input–answer examples for supervised fine-tuning or chosen–rejected answers for preference training. Check the export against your trainer and evaluate the fine-tuned model on held-out tasks. [Markdown](https://useground.dev/guides/llm-fine-tuning-datasets/guide.md).