Reprogramming Language Models for Molecular Representation Learning

Ria Vinod, Pin-Yu Chen, Payel Das

Abstract

Pre-trained language models (LMs) have demonstrated remarkable success in natural language processing, but their application to molecular biology is often limited by data scarcity. This paper introduces Representation Reprogramming via Dictionary Learning (R2DL), a method that repurposes frozen LMs for chemical tasks. By using sparse dictionary learning to map amino acid sequences into the LM's vocabulary, R2DL achieves performance comparable to or exceeding domain-specific models on antimicrobial peptide (AMP) and toxicity prediction tasks.

Introduction

Deep learning has revolutionized the natural sciences, yet it faces a significant "data hunger" problem. While billions of sentences are available for training large-scale language models, curated and labeled datasets for molecular biology—such as those identifying toxic peptides—are often limited in size. Standard transfer learning typically involves fine-tuning, which is computationally expensive and can fail when the source domain (e.g., English text) and target domain (e.g., amino acid sequences) differ substantially.

This research explores Adversarial Reprogramming (AR), where a pre-trained model remains frozen while a "wrapper" learns to transform input data. The primary challenge is the dimensionality mismatch between the massive vocabulary of natural languages and the 20-character "alphabet" of amino acids.

Methodology: The R2DL Framework

The authors propose Representation Reprogramming via Dictionary Learning (R2DL). The core innovation is treating the input space of a pre-trained language model as a dictionary.

  1. Sparse Mapping: Using the k-SVD algorithm, the method finds a linear transformation that represents molecular tokens (amino acids) as sparse combinations of tokens from the language model’s vocabulary.
  2. Frozen Backbone: The system utilizes a pre-trained sentiment classifier (e.g., BERT trained on IMDB movie reviews) without modifying its internal weights.
  3. Adversarial Program: A small set of trainable parameters ($ heta$) learns to perturb the molecular input so the frozen model can classify it according to the target task.
  4. Label Mapping: The model's original outputs (e.g., "Positive/Negative" sentiment) are mapped to target labels (e.g., "Toxic/Non-toxic").

Experimental Results

The R2DL method was evaluated on two primary benchmarks: AMP Prediction (Antimicrobial Peptides) and Toxicity Prediction.

AMP Prediction

On the AMP classification task, R2DL demonstrated strong performance as the training sample size increased, eventually outperforming traditional architectures.

Performance comparison on AMP prediction across varying training sample sizes.

As shown in the results, R2DL achieved a peak test accuracy of 90.01%, surpassing a Bi-LSTM model trained from scratch (88.0%) on the same dataset.

Toxicity Prediction

For toxicity prediction, the method similarly showed a clear correlation between training data volume and accuracy.

Performance comparison on Toxicity prediction across varying training sample sizes.

R2DL reached an accuracy of 89.34%, coming close to the domain-specific Bi-LSTM benchmark of 93.7%. The data suggests a performance "floor" around 5,000 samples, below which the mapping becomes significantly harder to learn accurately.

Discussion and Key Insights

  • Universal Sequence Structure: The ability to reprogram a movie-review classifier for protein sequences suggests that large-scale language models capture fundamental structural patterns that are domain-agnostic.
  • Sparsity as a Bridge: Dictionary learning is crucial for bridging the domain gap. Sparse representations allow the model to extract the most relevant features from a dense NLP vocabulary to represent simpler molecular sequences.
  • Efficiency: By keeping the backbone model frozen, R2DL is far more parameter-efficient than traditional fine-tuning, which would require updating over 110 million parameters in a BERT-base model.
  • Model Capacity: More expressive models like BERT provide a superior base for reprogramming compared to simpler architectures like Bi-LSTMs, likely due to their higher representational capacity.

Limitations and Future Work

While promising, R2DL faces challenges. The k-SVD solver is computationally intensive, requiring approximate versions for efficiency. Additionally, the current focus is on linear peptide sequences; future work should explore more complex structures like SMILES strings or molecular graphs. Finally, the method still requires a moderate amount of data (at least 5,000 samples) to effectively bridge the domain gap.

This summary is based on the paper "Reprogramming Language Models for Molecular Representation Learning" presented at NeurIPS 2020.

Summary updated

BibTeX
@misc{vinod2020reprogramming,
  author = {Ria Vinod and Pin-Yu Chen and Payel Das},
  title = {{Reprogramming Language Models for Molecular Representation Learning}},
  year = {2020},
  eprint = {2012.03460},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2012.03460},
}
Figure