MolCap-Arena: A Comprehensive Captioning Benchmark on Language-Enhanced Molecular Property Prediction

April 23, 2025 ยท View on GitHub

Associated repository for "MolCap-Arena: A Comprehensive Captioning Benchmark on Language-Enhanced Molecular Property Prediction".

Table of Contents

Submission

(link coming soon)

If you would like to submit a caption file for easy distribution for others to use when building a leaderboard, please submit here. It should follow the format of existing files and contain captions for molecules in all datasets.

Installation

There are two conda environments: 'MolCapArena' for evaluation, and 'Captioner' for captioning.

conda env create -f environment.yml

conda env create -f environment_captioner.yml

conda activate MolCapArena
pip install -e .

Running the benchmark

Download the 'battles.zip' file from Downloads.

unzip battles.zip
conda activate MolCapArena
python leaderboard_scripts/create_metrics_h2h.py
python leaderboard_scripts/create_winrate_plot_h2h.py

Evaluating a new model

Create a new file in captions called 'YOUR_NAME.csv'. It should contain a header line with at least two fields: 'SMILES' and 'captions'. All canonicalized SMILES from 'all_smiles.csv' should appear.

Download the 'battles.zip', 'captions.zip', 'embeddings.zip', 'splits.zip' files from Downloads.

unzip battles.zip
unzip captions.zip
unzip embeddings.zip
unzip splits.zip

Set important variables:

declare -a datasets=('BBBP' 'BACE' 'ClinTox' 'FreeSolv' 'ESOL' 'Lipo')
export DATASETS="${datasets[@]}"
export caption_name='YOUR_NAME'
export WANDB_MODE=disabled
conda activate MolCapArena

Run the four stages of the evaluation procedure: 1) model training, 2) embedding extraction, 3) multimodal SVM training, and 4) head-to-head captioner vs captioner battles.

echo "Training caption embedding models"
for dataset in "${datasets[@]}"; do
    for run in {0..4}; do
        echo "$dataset:$run"
        python leaderboard_scripts/run_train.py --specific_caption="$caption_name" --dataset="$dataset" --max_epochs=20 --validate_every_n=0 --fold_idx=$run
    done
done


echo "Extracting captions"
for dataset in "${datasets[@]}"; do
    for run in {0..4}; do
        echo "$dataset:$run"
        python leaderboard_scripts/run_embeddings.py --specific_caption="$caption_name" --dataset=$dataset --fold_idx=$run --fold_idx=$run
    done
done

echo "Training single-caption predictors"
for dataset in "${datasets[@]}"; do
    for run in {0..4}; do
        echo "$dataset:$run"
        python leaderboard_scripts/head.py --dataset=$dataset --method=SVM --fold_idx=$run
    done
done

echo "Running head-to-head battles"
for dataset in "${datasets[@]}"; do
    for run in {0..4}; do
        echo "$dataset:$run"
        python leaderboard_scripts/head2head.py --dataset=$dataset --method=SVM --fold_idx=$run
    done
done

Finally, evaluate the leaderboard:

python leaderboard_scripts/create_metrics_h2h.py

Creating a new captioner

Create a new captioner file by first copying an existing file as an example. Modify 'get_all_captions.py' to include YOUR_NAME as an option.

conda activate Captioner

cp captioners/Llama3_8B_captioner.py captioners/YOUR_NAME_captioner.py

echo "Modify 'YOUR_NAME_captioner.py' and add an if statement to 'get_all_captions.py' to include it as an option."

python get_all_captions.py --model=YOUR_NAME --debug

python get_all_captions.py --model=YOUR_NAME

Adding a new dataset

Currently, adding a new dataset is not fully supported. The rough steps are as follows:

  1. Download and unzip 'splits.zip' files from Downloads.
  2. Generate a csv file for the dataset in 'splits/'. Modify 'create_splits.py' to include your dataset, then run it.
  3. Modify 'build_smiles_list.py' to include the new dataset. Run 'build_smiles_list.py' then 'create_BRICS.py'.
  4. Run captioners to generate new caption files. 4.1. (Optional) Modify 'get_all_captions.py' to avoid re-captioning old molecules.
  5. Run leaderboard_scripts as detailed above. Note that scripts require modification to accomodate new datasets.

Downloads

Alternatively, files can be downloaded through Box:

Citation

If you found our work useful, please cite:

@article{edwards2024molcaparena,
  title={MolCap-Arena: A Comprehensive Captioning Benchmark on Language-Enhanced Molecular Property Prediction},
  author={Edwards, Carl and Lu, Ziqing and Hajiramezanali, Ehsan and
Biancalani, Tommaso and Ji, Heng and Scalia, Gabriele},
  journal={arXiv preprint arXiv:2411.00737},
  url={https://arxiv.org/abs/2411.00737}
  year={2024}
}

Leaderboard

Here is the leaderboard conveniently generated by GPT-4o (so results might be hallucinated). Please see leaderboard_table.csv for real results.

ModelRating95% CIROC-AUCBCE LossAvg. ErrorAverage PrecisionPearson RSpearman RR2MSEMAE
BioT5_plus1061+3/-287.3590.3350.47174.9070.6540.6600.4081.0570.744
BioT51059+3/-287.3710.3340.47274.6310.6540.6580.4091.0570.744
LlaSMol1040+2/-386.5220.3400.47373.2710.6550.6610.4091.0540.746
GPT-4o-Generic1032+2/-285.6850.3410.47272.3880.6570.6620.4121.0490.742
TextChemT51032+4/-287.0740.3410.47575.2950.6520.6570.4071.0570.746
Gemma2-9B-Frags-Drug1031+3/-485.5430.3430.47572.4350.6530.6570.4071.0620.747
Gemma2-9B-Frags-Chem1030+3/-485.6190.3420.47572.3120.6520.6570.4061.0610.747
Llama3.1-70B-Chem1021+2/-285.4310.3440.47572.5290.6530.6560.4081.0560.746
Llama3.1-70B-Generic1021+1/-385.6180.3440.47472.3730.6530.6570.4081.0540.744
MolT51021+1/-486.4060.3400.47575.2510.6520.6550.4061.0640.748
Gemma2-9B-Frags-Generic1020+3/-385.5500.3420.47672.4550.6510.6570.4061.0640.749
Llama3.1-70B-Drug1020+1/-285.5940.3430.47172.4300.6550.6600.4121.0420.740
Llama3.1-405B-Generic1020+3/-185.4690.3420.47172.0480.6580.6630.4161.0380.738
Llama3-70B-Drug1017+2/-385.3920.3430.47272.1790.6560.6600.4131.0470.741
MistralNeMo-12B-Frags-Generic1017+2/-185.3760.3450.47372.0220.6530.6580.4081.0510.742
Llama3.1-70B-Bio1016+2/-285.2380.3470.47372.0740.6560.6610.4111.0470.741
Gemma2-27B-Generic1015+3/-385.2540.3430.47172.1520.6540.6610.4121.0430.739
Llama3-70B-Chem1014+2/-485.3550.3440.47372.1810.6550.6590.4091.0530.742
Gemma2-27B-Chem1013+1/-385.2230.3450.47472.0570.6530.6590.4091.0510.743
MistralNeMo-12B-Frags-Chem1012+2/-385.7460.3430.47272.3200.6560.6600.4111.0460.741
GPT-4o-Frags-Generic1012+3/-285.5100.3430.47572.2100.6540.6580.4081.0540.745
Llama3-8B-Task1009+1/-285.4140.3440.47772.1820.6520.6560.4061.0630.748
MistralNeMo-12B-Frags-Drug1008+3/-285.7310.3440.47372.4360.6540.6590.4101.0460.742
Llama3-70B-Generic1008+3/-285.1080.3450.47571.9200.6530.6560.4061.0610.746
Gemma2-9B-Frags-Bio1006+3/-385.2840.3460.47772.0200.6510.6570.4051.0650.750
Llama3.1-70B-Quant1006+3/-385.3120.3440.47472.1630.6530.6600.4081.0520.743
Llama3.1-405B-Frags-Generic1005+2/-285.4820.3440.47672.6820.6530.6570.4051.0650.749
Gemma2-9B-Chem1004+1/-285.4550.3430.47472.1120.6530.6570.4091.0570.745
Llama3-70B-Bio1003+1/-285.4790.3440.47672.2530.6510.6560.4031.0660.748
Llama3-70B-Frags-Generic1003+3/-385.7800.3420.47872.6930.6500.6550.4031.0720.751
Llama3.1-8B-Drug1003+4/-285.0880.3450.47572.0040.6540.6570.4101.0520.745
Llama3.1-70B-Frags-Generic1001+3/-285.5800.3420.47772.2380.6500.6560.4031.0710.750
Llama3.1-70B-Frags-Chem1001+3/-285.5120.3430.47772.3060.6510.6570.4041.0700.749
Gemma2-27B-Frags-Drug1001+2/-485.6440.3420.47772.3330.6490.6530.4021.0690.752
MistralNeMo-12B-Bio1000+1/-285.3010.3440.47672.1440.6500.6550.4031.0660.748
Llama3-8B-Drug999+3/-285.3750.3440.47472.1480.6540.6580.4081.0570.745
MistralNeMo-12B-Generic999+1/-185.4210.3430.47772.1130.6500.6540.4031.0690.750
Gemma2-27B-Bio998+2/-185.3470.3430.47672.1760.6520.6570.4051.0610.747
Gemma2-9B-Bio997+3/-285.3920.3440.47572.1390.6510.6560.4061.0570.746
Gemma2-9B-Frags-Quant997+5/-285.3050.3460.47572.0350.6520.6560.4061.0600.746
Gemma2-27B-Quant997+3/-485.3480.3460.47672.1200.6510.6560.4051.0610.746
MistralNeMo-12B-Frags-Bio996+2/-385.3640.3450.47572.0820.6520.6580.4061.0600.746
ChemDFM996+4/-386.0520.3440.47772.6140.6480.6530.4011.0730.751
MistralNeMo-12B-Chem996+1/-585.4180.3460.47572.2010.6510.6550.4061.0630.746
3D-MoLM996+2/-386.0320.3410.47573.1610.6510.6550.4061.0620.748
ChemLLM996+3/-385.8100.3420.47572.8490.6500.6540.4051.0630.747
Llama3-8B-Frags-Bio996+2/-185.3380.3440.47772.1020.6520.6570.4051.0710.750
Llama3-8B-Quant995+3/-485.3970.3440.47672.1540.6500.6540.4051.0640.747
Llama3-8B-Frags-Chem995+3/-285.3360.3440.47672.0860.6540.6590.4061.0650.749
Llama3.1-8B-Generic995+2/-385.3310.3430.47672.2310.6520.6570.4061.0620.748
MistralNeMo-12B-Frags-Quant994+3/-285.1940.3440.47672.1430.6510.6550.4031.0650.749
Llama3-70B-Frags-Drug994+3/-285.5900.3420.47872.2700.6500.6550.4021.0730.751
Gemma2-27B-Drug994+3/-385.3320.3440.47372.0670.6530.6590.4091.0450.741
Llama3-70B-Quant993+2/-285.2410.3440.47472.1090.6540.6570.4081.0550.745
Llama3-8B-Frags-Drug993+2/-285.3520.3430.47772.1440.6520.6560.4061.0640.748
Gemma2-9B-Generic993+4/-385.4120.3440.47672.0850.6500.6540.4041.0670.748
Llama3.1-8B-Chem992+3/-285.4250.3440.47572.2140.6520.6580.4061.0590.746
MolInstructions_molecule992+4/-485.7470.3420.47772.5940.6500.6540.4021.0700.750
Llama3.1-70B-Frags-Bio991+4/-285.3790.3430.47772.1710.6490.6530.4011.0750.751
Llama3-8B-Generic991+4/-585.3490.3440.47672.2270.6500.6560.4051.0620.747
Llama3-70B-Frags-Chem990+2/-485.2950.3450.47872.2780.6510.6560.4031.0700.750
Llama3-70B-Frags-Quant990+2/-385.3550.3440.47572.1390.6540.6580.4061.0650.748
Llama3-8B-Frags-Quant990+2/-385.3750.3440.47672.1710.6550.6600.4071.0640.748
Llama3.1-8B-Quant990+2/-585.5110.3430.47672.3390.6500.6550.4031.0670.748
Llama3-8B-Frags-Generic989+2/-385.2710.3470.47772.0350.6520.6580.4041.0690.749
Llama3.1-70B-Frags-Drug988+4/-185.3320.3440.47772.1320.6500.6540.4031.0730.750
Llama3-8B-Chem988+3/-385.3590.3440.47572.0830.6510.6560.4051.0590.746
Llama3-70B-Frags-Bio986+3/-685.3890.3430.47772.1680.6500.6530.4021.0740.751
Llama3-8B-Bio986+3/-285.4560.3430.47472.2650.6500.6560.4051.0640.746
Gemma2-9B-Quant984+2/-285.3290.3440.47672.1100.6500.6540.4041.0630.749
Gemma2-9B-Drug984+3/-385.2660.3440.47772.2620.6490.6540.4031.0680.750
Gemma2-27B-Frags-Chem983+1/-385.3190.3450.47872.1360.6470.6510.4001.0780.753
Llama3.1-70B-Frags-Quant983+5/-285.1850.3440.47772.0880.6520.6570.4051.0690.749
Llama3.1-8B-Frags-Bio982+2/-285.3220.3430.47972.1170.6470.6510.3991.0790.753
Llama3.1-8B-Bio982+1/-385.4310.3440.47672.1550.6490.6540.4031.0640.748
MistralNeMo-12B-Quant981+3/-285.4040.3430.47872.0920.6490.6540.4031.0680.751
Llama3.1-8B-Frags-Quant980+3/-385.3110.3450.47972.0910.6480.6520.4011.0740.752
MolT5_LPM24980+1/-485.3850.3430.47772.1400.6490.6530.4021.0710.750
Llama3.1-8B-Frags-Chem978+1/-285.3400.3440.47872.1320.6470.6520.4001.0780.752
BlankCaption978+3/-285.3360.3440.47872.1270.6470.6510.3991.0790.753
Gemma2-27B-Frags-Quant978+3/-185.4230.3420.47872.1690.6470.6510.3991.0770.752
Llama3.1-8B-Frags-Generic977+5/-485.3260.3460.47872.1010.6480.6530.4011.0740.751
MistralNeMo-12B-Drug975+5/-285.3230.3450.47772.0970.6500.6540.4021.0700.750
Gemma2-27B-Frags-Bio973+2/-285.4310.3430.47872.2740.6470.6510.3991.0790.753
Gemma2-27B-Frags-Generic973+1/-385.3620.3420.47872.0320.6470.6520.3991.0780.753
Llama3.1-8B-Frags-Drug970+2/-185.3530.3450.47972.1220.6470.6510.3991.0790.753
GNNNaNNaN85.3360.3450.47972.1110.6470.6520.3971.0800.753