Large language models (LLMs) are increasingly popular in professional domains, while meet a fundamental cognitive tension when dealing with heterogeneous scientific data: LLMs are designed for discrete natural language symbolic sequences, whereas scientific entities represented by molecules are inherently topological and geometric. Forcing these structures into linear text inevitably results in information loss and semantic noise interferes with the LLM's cognitive reasoning.
We propose SciCore-Mol, a novel paradigm to augment the LLM with pluggable external cognitive modules, including a GVP encoder, a diffusion generator, and a numerical-sensitive Transformer (Reaction Transformer). This architecture preserves the general capabilities while providing specialized molecular perception for LLMs. With a two-stage alignment mechanism, external modules are invoked via special tokens and fused at the hidden-state level, enabling the LLM to deeply understand molecular information without sacrificing its core reasoning process.
Joint SFT training with all modules connected. The LLM learns to invoke external modules via special <mol> tokens.
# Configure training in configs/qwen3_sft_epoch2_1.yaml
# Uses DeepSpeed ZeRO-3 for multi-GPU training
torchrun --nproc_per_node=4 \
cotrain_llm_diffusion/train_step1_llm.py \
--config configs/qwen3_sft_epoch2_1.yaml
Key config fields (in configs/qwen3_sft_epoch2_*.yaml):
paths.llm_name_or_path: Base LLM checkpoint
paths.gnn_state_dict_path: Pretrained GVP weights
paths.deepspeed_config: DeepSpeed config (ZeRO-2 or ZeRO-3)
training.freeze_strategy: Control which modules are frozen/trainable
import os
os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com"
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("openbmb/SciCore-Mol", revision="8283148519b42d0ad1b551ca0382e7480fbf0be4")
model = AutoModelForCausalLM.from_pretrained("openbmb/SciCore-Mol", revision="8283148519b42d0ad1b551ca0382e7480fbf0be4", device_map="auto")