ExPT: Synthetic Pretraining for Few-Shot Experimental Design

Tung Nguyen, Sudhanshu Agrawal, Aditya Grover

Abstract

Experimental design is a fundamental problem in many science and engineering fields. In this problem, sample efficiency is crucial due to the time, money, and safety costs of real-world design evaluations. Existing approaches either rely on active data collection or access to large, labeled datasets of past experiments, making them impractical in many real-world scenarios. In this work, we address the more challenging yet realistic setting of few-shot experimental design, where only a few labeled data points of input designs and their corresponding values are available. We approach this problem as a conditional generation task, where a model conditions on a few labeled examples and the desired output to generate an optimal input design. To this end, we introduce Experiment Pretrained Transformers (ExPT), a foundation model for few-shot experimental design that employs a novel combination of synthetic pretraining with in-context learning. In ExPT, we only assume knowledge of a finite collection of unlabelled data points from the input domain and pretrain a transformer neural network to optimize diverse synthetic functions defined over this domain. Unsupervised pretraining allows ExPT to adapt to any design task at test time in an in-context fashion by conditioning on a few labeled data points from the target task and generating the candidate optima. We evaluate ExPT on few-shot experimental design in challenging domains and demonstrate its superior generality and performance compared to existing methods.

Introduction

In fields ranging from protein engineering to robotics, the central objective is often to identify a "design"—such as a DNA sequence or a robot's morphology—that maximizes a specific performance metric. This process, known as Experimental Design (ED), is frequently bottlenecked by the extreme costs associated with evaluating new designs. Whether it is the time required for biological assays or the safety risks of testing physical hardware, evaluations are expensive.

Traditional approaches typically fall into two categories: Online ED, which requires active, iterative data collection, and Offline ED, which necessitates massive historical datasets. However, many emerging scientific problems exist in a "data desert," where only a handful of previous experiments (often unsuccessful ones) are available. ExPT (Experiment Pretrained Transformers) addresses this few-shot experimental design challenge by treating optimization as a conditional generation task, leveraging synthetic pretraining to learn the underlying structure of design landscapes.

Methodology: The ExPT Framework

ExPT introduces a two-phase approach—pretraining and in-context adaptation—to solve optimization problems without requiring large-scale labeled real-world data.

1. Synthetic Pretraining

The core innovation of ExPT is its use of unlabeled data. While labeled experimental results are rare, unlabeled designs (e.g., a library of possible DNA sequences) are often abundant. ExPT uses these unlabeled points to generate millions of "synthetic" functions using Gaussian Processes (GPs) with randomized kernels. By training the model to find the optima of these diverse synthetic functions, the model learns the "language" of optimization landscapes before ever seeing a real experimental result.

2. Inverse Modeling and Architecture

Standard predictive models attempt to map a design ($x$) to a score ($y$). In contrast, ExPT employs inverse modeling: it learns to predict the optimal design ($x$) given a desired target score ($y^*$) and a small "context set" of previous experiments. This architecture consists of two main components:

  • Transformer Encoder: Processes the context points and the target value to capture the relationship between designs and outcomes.
  • Conditional VAE (CVAE) Decoder: Generates high-dimensional, complex design candidates based on the encoder’s latent representation.

3. In-Context Learning

Because ExPT is built on a Transformer architecture, it does not require fine-tuning for new tasks. At test time, the model performs in-context learning: it is "prompted" with a few real-world data points and immediately generates candidate optima. This allows for rapid adaptation to new objectives or domains.

Experimental Setup

The authors evaluated ExPT using Design-Bench, a standard benchmark for offline experimental design, focusing on both continuous and discrete tasks:

  • Robotics (D’Kitty & Ant): Optimizing robot morphology for movement.
  • Biology (TF Bind 8 & 10): Optimizing DNA sequences for binding affinity.

To simulate realistic constraints, the researchers tested the model in two specific few-shot regimes:

  1. Random: Only 1% of the original dataset, sampled randomly.
  2. Poorest: Only 1% of the dataset, containing only the lowest-performing designs. This simulates the common real-world scenario where researchers only have access to failed past experiments.

Key Insights and Results

Robustness to Low-Quality Data

One of ExPT’s most significant achievements is its performance in the "Poorest" data setting. While traditional methods struggle when provided only with low-scoring examples, ExPT can infer the direction of improvement. In these scenarios, ExPT outperformed the next-best baseline by 70% in mean performance.

Sample Efficiency and Generalization

ExPT demonstrated remarkable sample efficiency, reaching or exceeding the performance of models trained on full datasets while using only 0.01 to 0.2 of the available unlabeled data for pretraining. Furthermore, the model showed strong Out-of-Distribution (OOD) success; even when pretrained on RBF kernels, it generalized effectively to functions derived from Periodic or Cosine kernels.

Versatility

A single pretrained ExPT model can handle multiple objectives within a domain. For instance, in robotics, the same model can be prompted to optimize for speed or energy efficiency simply by changing the context points provided in the prompt.

Conclusion and Future Work

ExPT represents a step toward a "foundation model for science." By demonstrating that synthetic pretraining on unlabeled data is sufficient to learn complex optimization behaviors, the work opens new doors for data-scarce scientific discovery.

Future iterations of ExPT aim to move beyond domain-specific models (e.g., separate models for DNA and robotics) toward a universal optimizer capable of cross-domain generalization. Additionally, while the current model requires a target value ($y^*$), future research may focus on relaxing this requirement to make the model even more flexible in exploratory settings.

Summary updated

Abstract

Experimental design is a fundamental problem in many science and engineering fields. In this problem, sample efficiency is crucial due to the time, money, and safety costs of real-world design evaluations. Existing approaches either rely on active data collection or access to large, labeled datasets of past experiments, making them impractical in many real-world scenarios. In this work, we address the more challenging yet realistic setting of few-shot experimental design, where only a few labeled data points of input designs and their corresponding values are available. We approach this problem as a conditional generation task, where a model conditions on a few labeled examples and the desired output to generate an optimal input design. To this end, we introduce Experiment Pretrained Transformers (ExPT), a foundation model for few-shot experimental design that employs a novel combination of synthetic pretraining with in-context learning. In ExPT, we only assume knowledge of a finite collection of unlabelled data points from the input domain and pretrain a transformer neural network to optimize diverse synthetic functions defined over this domain. Unsupervised pretraining allows ExPT to adapt to any design task at test time in an in-context fashion by conditioning on a few labeled data points from the target task and generating the candidate optima. We evaluate ExPT on few-shot experimental design in challenging domains and demonstrate its superior generality and performance compared to existing methods. The source code is available at https://github.com/tung-nd/ExPT.git.
BibTeX
@inproceedings{nguyen2023expt,
  author = {Tung Nguyen and Sudhanshu Agrawal and Aditya Grover},
  title = {{ExPT: Synthetic Pretraining for Few-Shot Experimental Design}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=7qfkImn0dL},
}
Figure