Model Reprogramming: Resource-Efficient Cross-Domain Machine Learning

Pin-Yu Chen

Introduction

Deep learning has traditionally been a data-hungry and computationally expensive endeavor. While foundation models like GPT-4 or ImageNet-trained ResNets offer immense power, their application is often limited to two paradigms: training from scratch—which is prohibitive for most due to cost and data scarcity—or fine-tuning, which still demands significant compute and a pre-trained model within a similar domain.

Model reprogramming emerges as a "no-finetuning" alternative that repurposes massive, frozen pre-trained models for entirely different domains. This approach is particularly transformative for resource-constrained fields, such as medical imaging or biochemistry, where high-quality domain-specific models are rare.

Comparison of model training paradigms by data scale and trainable parameters.

As shown in the figure above, model reprogramming occupies a unique niche: it requires significantly fewer trainable parameters than traditional transfer learning or task-specific training, making it highly efficient for low-data regimes.

Methodology

The core of model reprogramming lies in keeping a high-capacity source model (the "backbone") completely frozen. Instead of updating internal weights, researchers add two lightweight, trainable "wrapper" modules:

  1. Input Transformation Layer: This layer maps target-domain data into the source domain’s format. For instance, in vision tasks, a small target image might be padded with a trainable border of pixels that "tricks" the model into recognizing familiar features. In discrete domains like text or molecular sequences, dictionary learning maps target tokens to source embeddings.
  2. Output Mapping Layer: This translates the source model's predictions into target labels. This can range from a simple many-to-one mapping (e.g., mapping multiple ImageNet classes to a single medical diagnosis) to a small trainable linear head.
The architecture of model reprogramming, showing the flow from input transformation to a frozen backbone and output mapping across diverse domains.

By optimizing only these peripheral layers, the backbone remains a "black box," drastically reducing the computational overhead.

Experimental Scope and Results

The versatility of this approach has been demonstrated across a wide array of source and target pairs. Source models including ImageNet-1K (Vision), BERT (Language), and Speech models (Attention-RNN) have been successfully "reprogrammed" for tasks as diverse as:

  • Time-Series Classification: The Voice2Series (V2S) framework repurposed speech models for univariate time-series data, outperforming or tying state-of-the-art baselines on 19 out of 30 datasets.
  • Bio-medical Imaging: Black-box Adversarial Reprogramming (BAR) achieved new state-of-the-art accuracy in autism spectrum disorder classification using frozen ImageNet models.
  • Low-Data Regimes: In few-shot learning scenarios, reprogramming often outperforms fine-tuning because it leverages robust pre-learned features without the risk of "catastrophic forgetting."

Theoretical Insights: Representation Alignment

The success of cross-modal reprogramming—such as using a vision model for text sentiment analysis—is explained through Representation Alignment. The trainable input layer learns to shift the target data's distribution in the latent space to align with the source data's distribution. If the source model is a robust feature extractor, it can distinguish between these aligned target features as effectively as it did for its original training task.

Limitations and Future Outlook

Despite its promise, model reprogramming faces certain constraints. Currently, the target data dimensionality and class count generally need to be smaller than or equal to those of the source model. Reprogramming a simple model for a more complex task remains an open challenge.

Future research directions include "joint" reprogramming—tuning a tiny subset of the backbone alongside the wrappers—and exploring how reprogramming can enhance model fairness, privacy, and robustness without the need for full retraining.

Summary updated

BibTeX
@inproceedings{chen2024model,
  author = {Pin-Yu Chen},
  title = {{Model Reprogramming: Resource-Efficient Cross-Domain Machine Learning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i20.30267},
}
Figure