Why You Need Synthetic Data for Machine Learning

Bijit Ghosh
7 min readMar 3, 2024

--

Data is the lifeblood of AI. Without quality, representative training data, our machine learning models would be useless. But as the appetite for data grows with larger neural networks and more ambitious AI projects, we face a crisis — real-world data collection and labeling simply does not scale.

In this post, I’ll discuss the key challenges around real-world data and why synthetic data is becoming essential for the development of performant, robust, and ethical AI systems. I’ll also share some best practices for generating and using synthetic data to train large language models (LLMs).

The Data Scaling Problem

Let’s start by understanding why real-world data runs into scalability issues. Modern neural networks are data hungry beasts — a large language model like GPT-4 was trained on hundreds of trillions of text parameters. Image classification models need millions of labeled examples to reach human-level performance. As we progress to multimodal, multi-task models, the data requirements will continue ballooning.

Real-world data doesn’t grow on trees though. Collecting quality, representative data sets large enough to feed these models is incredibly costly:

  • Data collection is manual and slow — web scraping, surveys, sensor data, etc. requires extensive human effort and infrastructure. It can take thousands of hours to assemble datasets that AI models can blow through in minutes during the training process.
  • Data labeling requires extensive human review — images, text, audio — almost all data needs some form of manual labeling or annotation before it can be used for supervised training. For example, autonomous vehicles might require millions of images with precise pixel-level segmentations — an almost impossible manual effort.
  • Specialized data is particularly scarce — while general data sets like ImageNet exist, most business applications require niche, specialized data that is even harder to source and label at scale.
  • Privacy and legal constraints limit access — from PII to copyright issues, real-world data usually cannot be freely shared and reused between organizations due to privacy laws or proprietary constraints. This massively hampers opportunities for collaboration and innovation in AI.

It’s clear that existing approaches to sourcing training data are wholly inadequate for the era of large neural networks and ambitious, real-world AI applications. Running bigger models or tackling harder problems will require datasets that are multiple orders of magnitude larger than anything we can realistically collect using today’s manual processes.

Without a scalable solution to the data problem, progress in AI will start hitting a wall across many important applications areas. Fortunately, synthetic data and simulation offers a path forward.

The Promise and Progress of Synthetic Data

Synthetic data is machine-generated data that mimics the statistical properties of real-world data. Instead of manual data collection and labeling, the idea is to automatically generate simulated datasets programmatically.

Recent advances in generative modeling have made it possible to synthesize increasingly realistic simulated data across modalities like images, text, speech, video, and sensor data. There is an exponential growth in papers and projects demonstrating the expanding capabilities of these generative synthetic data techniques.

What makes synthetic data so promising for tackling the data scaling problem in AI?

  • It’s automated — synthetic data pipelines can automatically churn out arbitrarily large datasets without any additional human effort once configured. This makes data effectively infinite.
  • It’s customizable — every aspect of synthetic data can be programmatically controlled allowing easy tuning to match the statistics of the real-world distribution. Want more examples of rare corner cases? That’s a simple tweak of the data generator.
  • It’s shareable and reusable — artificial data has no privacy constraints and can be freely shared, reused, and remixed to enable collaboration. This also allows the creation of benchmark datasets that the whole community can coalesce around and push progress on.
  • It’s multipurpose — the same synthetic data generation pipeline can usually create training data tailored to different downstream problems without much change. This makes it easy to expand to new use cases.
  • It’s fast and cheap — most synthetic data techniques can run far faster than real-time while leveraging spare compute capacity like GPUs. There are essentially zero marginal costs to generating more data.

The effectiveness of synthetic data has been demonstrated across applications like medical imaging, autonomous driving, drug discovery, recommender systems, finance, robotics, and natural language processing. Nearly every industry struggling with data scarcity stands to benefit.

And with the currently exponential pace of progress in AI overall, innovations in generative models translate quickly into more capable and economical synthetic data. It’s a positive feedback cycle ultimately bounded only by the constraints of computing power.

Synthetic data is thus poised to take over as the primary source of training data for many AI systems in the coming years. But it’s not yet as simple as firing up a generator and getting perfect training sets. There are still best practices needed…

Best Practices for Using Synthetic Data with LLMs

Large language models (LLMs) like GPT-4/LLaMA-2/Gemini 1.5 ingest essentially infinite streams of text during training. Collecting and labeling sufficient real-world training data is completely infeasible at this scale across diverse domains. Synthetic text data is thus crucial but still requires diligence to be effective.

Here are some core best practices for synthetic data when training huge natural language models:

Benchmark against real data

The fundamental challenge with synthetic data is establishing that it preserves the statistical essence of real data. Failing to accurately mimic intricacies like long range dependencies can severely degrade model performance once deployed on real-world tasks.

Thus we must extensively benchmark synthetic datasets by training models on them and cross validating against real-world held out data. If we can match or even exceed metrics hit by models trained exclusively on real data, we can validate quality. Refinement of the data generators can then focus on pushing performance on those benchmarks.

Blend with real data

Most language data pipelines still incorporate at least some portion of real examples. While ratios vary, 20–30% tends to be a useful ballpark based on current published benchmarks. The idea is that real examples provide an anchor that stabilizes training.

This blending can happen at multiple levels from having real examples explicitly mixed into the final datasets to using smaller real datasets to prime data generator parameters before large scale synthetic generation.

Stratify by metadata

Modern LLMs train on datasets with extensive metadata — authors, topics, dates, titles, urls, etc. This supplementary data encodes statistical relationships that can be crucial for many downstream applications.

Thus metadata stratification matters for quality synthetic text data. Distributions of metadata attributes should be benchmarked and matched where possible. Generating stand-alone passages devoid of context limits model capabilities.

At minimum metadata like time-frames for news articles and scientific papers tends to be an important stratifying variable to encode via synthetic generation pipelines.

Model iterative refinement

Data generators should be iteratively updated based on feedback both from benchmark performance and errors observed during model training. Generator architecture matters when trying to capture intricate long range properties.

If we find the language model repeatedly struggling with certain types of passage structure that humans handle cleanly, updating the generator to better expose those structures in the synthetic distribution will improve downstream model quality.

This ability to programmatically refine the data itself to guide model capabilities is unique to synthetic data and incredibly powerful. It creates a feedback cycle that can bootstrap towards otherwise unattainable levels of performance.

Expand diversity

A persistent concern with synthetic text data is lack of diversity leading to issues like bias amplification. Complex generative models aim to capture distributions but may miss long tail nuances.

Actively analyzing synthetic data pipelines by metrics of lexical, semantic, and syntactic diversity then iteratively tuning helps avoid these pitfalls. We can also procedurally promote diversity by directly conditioning generation off sensitive metadata to better reflect real-world heterogeneity.

These best practices collectively help ensure synthetic text data improves rather than impairs language model quality at scale while avoiding common traps like overfitting to statistical quirks of generators.

Unleashing Innovation via Synthetic Data

High quality synthetic data unlocks a world of potential for AI progress previously hindered by data scarcity. Virtually every modern deep neural network is hungry for more data — synthetic generation offers infinite resources to feed these beasts.

Beyond just enabling bigger and better models, readily available, customizable training data also accelerates research and applications by allowing far more rapid prototyping. Ideas can be tested and iterated on quickly rather than waiting months to collect and label real-world data.

And synthetic data enables open, collaborative datasets facilitating wider participation. Public benchmarks with freely usable training resources foster innovation and diversity much better than siloed real-world datasets locked inside organizations.

We stand at the brink of a synthetic data revolution — expect to see explosive progress across language, vision, robotics, healthcare and more over the coming decade powered by simulated data. The scalability bottleneck is dissolving and AI capabilities will dramatically expand as a result unleashing new possibilities.

With great synthesis comes great responsibility. While synthetic data offers enormous potential for AI progress, it does not eliminate considerations around ethics, privacy, accountability and more which I did not discuss here but warrant extensive analysis elsewhere. We must pursue progress responsibly.

Nonetheless, AI is reaching an inflection point on the foundations of data. We must invest heavily into synthetic capabilities to realize the next level of machine intelligence. Building these infinite data engines will power breakthroughs across industries in the years ahead. The time to start is now.

--

--

Bijit Ghosh

CTO | Senior Engineering Leader focused on Cloud Native | AI/ML | DevSecOps