This documentation is available to agents as Markdown at https://docs.synthesized.io/tdk/latest/user_guide/030_core_concepts/how_generation_works.md. For the complete documentation index, see llms.txt.

How Generation Works

Generation creates new rows instead of copying them. The engine learns what each column of the input looks like, then samples new values that follow it, at any size you need. The output keeps the schema and the relationships between tables.

What the engine learns

In a table in GENERATION mode, each column gets a generator, and most generators fit their parameters to the input when you don’t give them:

Generator What it learns or uses

continuous_generator, quantile_generator

The distribution of a numeric column: mean, spread, range or bins

date_generator

The distribution of a date column

categorical_generator

The categories in a column and how often each appears

person_generator, address_generator, finance_generator

No input values: they produce realistic names, addresses and financial values. With use_text_column_heuristics: true at the top level of the configuration, the engine picks them for text columns from the column and table names.

formatted_string_generator, int_sequence_generator, uuid_generator

A pattern or a sequence, for codes and IDs

You can give any generator its parameters instead, for example the categories and weights of a status column, or a range for amounts. That’s how you add values the input doesn’t have, such as edge cases for tests. See Generation Transformers.

If no rule gives a column a generator, the safety mode decides: STRICT stops the run; RELAXED uses a null_generator or a categorical_generator.

The output size

Setting Output

target_ratio

A multiple of the input table’s size. Unlike masking, it can be above 1: 2.0 makes the table twice as big.

target_row_number

An exact number of rows. Generation only. It overrides target_ratio.

Set them in default_config for every table, or per table, for example to generate a large orders table for a performance test while the lookup tables stay small.

Keys and relationships

Keys are generated so that the output holds together:

  • Primary keys get unique values.

  • Foreign keys get the primary key of an existing parent row. The engine adds a foreign_key_generator for them; you don’t set it up.

  • How many children each parent gets follows a Poisson distribution by default, set from the numbers of parent and child rows. The foreign key generator also has an ORIGINAL distribution, which approximates the input’s ratio of children to parents and takes more computation, and ROUND_ROBIN, which spreads children evenly. See Foreign key distribution.

As with every mode, tables are generated parents first. See What a run does.

Privacy

Generated values are sampled, not copied, with two exceptions. A categorical_generator with categories learned from the input outputs real values from the input: that’s what you want for a status or a country code, and what you don’t want for a name or an account number. And with safety_mode: RELAXED, a column that holds one value in every row gets a constant generator with that value. Check which columns get these, especially with RELAXED.

Generation or masking?

Masking Generation

Rows

The input’s rows, with values replaced

New rows

Size

The same, or smaller

Any size

Values

Real where you keep them, masked elsewhere

Sampled from what the engine learned, or from parameters you give

Best for

Copies of production for development and testing, where real record combinations matter

Performance and load tests, new features without production data, and data with no link to real records