google-research / google-research/tabfm

Support for synthetic data generation

Open
#82 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.6k
Forks
270
Avg merge
1d 7h
Merged PRs (30d)
1

Description

TabFM does zero-shot classification and regression, but there is no way to generate synthetic rows the way TabPFN v2 does (Hollmann et al., Nature 2025). That capability falls out of an in-context classifier almost for free, so I built it on top of TabFMClassifier. This issue is the background for the PR I'm opening alongside it.

The idea is the usual chain-rule factorization. Columns are visited in a seeded random or user-given order and each column is sampled for all rows at once from a TabFMClassifier that treats the current column as the target and the already sampled columns as features. Everything happens at inference time through the existing sklearn API. No model, architecture or weight changes, and only the classification checkpoint is needed.

Numerical columns use hierarchical quantile refinement so the max_classes limit of 10 does not cap resolution. The column is split into n_bins ** n_levels equal-mass bins (100 by default) and the bin index is sampled digit by digit in base n_bins, with sampled digits appended to the conditioning features. Each level trains on all reference rows, so resolution grows exponentially while cost only grows linearly. Within a bin the value is drawn uniformly, same as TabPFN's bar distribution between borders.

I validated against the released v1.0.0 weights. On a small dataset with known structure the age-income correlation comes out at 0.833 vs 0.817 in the real data, group offsets survive, and per-column KS tests give p between 0.78 and 0.98. On iris the correlation matrix is recovered with 12/12 sign agreement and per-species petal lengths match within about 1%. Sampling temperature shrinks the conditional spread monotonically as intended.

The change is purely additive. One new module with an sklearn-style fit/sample API, tests for both backends using tiny random models (no weight downloads), BUILD registration, an example script and a README section. Categorical columns beyond max_classes fall back to top-k with an empirically re-sampled tail. Things not covered yet are extrapolation beyond the observed min/max, causal column ordering and missingness simulation.

The PR has the full implementation, tests for both backends, the example and the docs. Feedback on scope or the approach is very welcome.

Contributor guide

Open the contributing guide

Research direction

Start with the new synthetic-data module and its sklearn-style fit/sample entry points, then review the tests for both backends using tiny random models. Check the BUILD registration, example script, and README section for the expected integration surface. Done means the additive implementation, backend tests, example, and documentation are complete; the issue notes that a PR already contains this work.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, scikit-learn
Domain
data, machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.