Pin-Tuning: Parameter-Efficient In-Context Tuning for Few-Shot Molecular Property Prediction

Qiang Liu, Shaozhen Liu, Xin Sun, Shu Wu, Liang Wang

Abstract: Few-Shot Molecular Property Prediction (FSMPP) is critical for drug discovery where labeled data is scarce. Traditional fine-tuning often leads to catastrophic forgetting or overfitting. This paper introduces Pin-Tuning (Parameter-efficient In-context Tuning), a framework that adapts pre-trained molecular encoders using lightweight adapters and Bayesian weight consolidation. By incorporating task-specific context directly into the encoder, Pin-Tuning achieves state-of-the-art performance with 60% fewer trainable parameters.

The Problem: The Fine-Tuning Paradox

Predicting molecular properties like toxicity or solubility is a cornerstone of drug discovery. However, new chemical tasks often suffer from a lack of labeled data, necessitating Few-Shot Molecular Property Prediction (FSMPP).

Standard approaches typically leverage a pre-trained molecular encoder but struggle with the "fine-tuning paradox": updating all parameters on a small support set leads to overfitting or "forgetting" general chemical knowledge, while keeping the encoder frozen limits its ability to adapt to task-specific nuances. Moreover, most existing encoders are "context-blind," processing molecules identically regardless of whether the target property is toxicity or solubility.

Figure 3: The fine-tuning paradox illustrated across different models and datasets, where freezing the encoder often outperforms full fine-tuning.

Methodology: The Pin-Tuning Framework

Pin-Tuning addresses these challenges through three core innovations designed to balance stability and plasticity:

  1. MP-Adapter: Instead of updating the heavy message-passing layers of a Graph Neural Network (GNN), Pin-Tuning inserts small, trainable "bottleneck" layers. These adapters down-project features, apply a non-linearity, and up-project them, keeping the primary pre-trained weights frozen.
  2. Emb-BWC (Embedding-layer Bayesian Weight Consolidation): While embedding layers (atoms and bonds) are fine-tuned, a Bayesian-derived penalty acts as a "leash" to ensure updates remain close to the original pre-trained values, preventing catastrophic forgetting.
  3. Contextual Perceptiveness: The framework constructs a Context Graph for each few-shot task. This context is fed into the MP-Adapters, allowing the encoder to dynamically shift its focus based on the specific property being predicted.
Figure 5: Comparison of molecular property prediction frameworks, highlighting the transition from context-blind vanilla models to the proposed context-aware Pin-Tuning method.

Experimental Evaluation

The researchers evaluated Pin-Tuning on five standard benchmarks from the MoleculeNet library: Tox21, ToxCast, SIDER, MUV, and PCBA. They tested the model in both 10-shot and 5-shot scenarios to assess its robustness in low-data regimes.

Key Results and Insights

  • Superior Performance: Pin-Tuning consistently outperformed state-of-the-art baselines across all five datasets. Notably, on the SIDER dataset, it achieved a 10.73% relative improvement over the previous best model (GS-Meta).
  • Efficiency: On the Tox21 dataset, Pin-Tuning achieved its best results using only 1.10M trainable parameters, compared to the 2.66M required by traditional full fine-tuning methods—a reduction of roughly 60%.
  • Dynamic Encoding: Unlike methods that only optimize the classifier, Pin-Tuning makes the encoder dynamic. Visualization via t-SNE confirmed that Pin-Tuning produces more distinct clusters of positive and negative molecules, significantly simplifying the classification task.

Limitations and Future Work

While highly effective, Pin-Tuning exhibits higher standard deviations in its results compared to some baselines, likely due to the inherent uncertainty in the "context information" derived from tiny samples. Future work will focus on uncertainty calibration to quantify the model's confidence in the provided context and stabilize performance across different random seeds.

Summary updated

BibTeX
@inproceedings{liu2024pin,
  author = {Qiang Liu and Shaozhen Liu and Xin Sun and Shu Wu and Liang Wang},
  title = {{Pin-Tuning: Parameter-Efficient In-Context Tuning for Few-Shot Molecular Property Prediction}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=1bTzaeeqxS},
}
Figure