SafeMol improves safety in molecular AI models across inputs

SafeMol: Dual-Modality Safety Alignment for Molecular Multimodal Models

Machine Learning

Summary

Molecular AI models that read and generate chemical information can sometimes be tricked into handling dangerous molecules in unsafe ways. The authors found these AI systems have loopholes when using different types of input like text or molecular graphs. They created a large test set called SafeMolBench to measure how well these models avoid unsafe actions without refusing safe tasks too often. Then, they developed SafeMol, a method that trains models to be safer by aligning how they understand different inputs and by spotting harmful intentions. Their tests show SafeMol makes it much harder to trick the models while still letting them do useful chemical tasks.

What this means in practice

Authors

Xinmiao Wang, Ruijie Wang, Menghui Wang, Jiawei Chen, Haoyue Deng, Ran Zhang, Xingxuan Zhang, Xiao Wang

Abstract

Molecular multimodal models support diverse understanding and generation tasks but may introduce safety vulnerabilities when handling hazardous molecules. In this work, We reveal substantial jailbreak vulnerabilities under both text-only and graph-conditioned settings. Our analysis further shows that safety robustness must hold across input modalities while balancing safety, over-refusal, and utility. To address these challenges, we construct SafeMolBench, a molecular multimodal safety-alignment benchmark with 3702 samples covering 618 unique hazardous molecules and safe molecular tasks, organized into hazardous-harmful, hazardous-allowed, and utility-replay subsets to support unified training and evaluation of safety, over-refusal, and utility. Based on SafeMolBench, we propose SafeMol, a parameter-efficient safety alignment framework that jointly optimizes lightweight modules across text-only and graph-conditioned inputs, uses MMD for distribution-level representation alignment to reduce modality-induced discrepancies, and explicitly models molecular hazardousness and harmful operational intent. Experiments on SafeMolBench show that SafeMol reduces attack success by several tens of percentage points while largely maintaining low over-refusal and preserving molecular-task utility.