Mol-CADiff: Causality-Aware Autoregressive Diffusion for Molecule Generation

Md. Atik Ahamed, Qiang Ye, Qiang Shawn ChengarXiv 2025 · DOI

TL;DR

This paper introduces Mol-CADiff, a novel diffusion-based framework for generating molecules from textual descriptions. By incorporating a causal attention mechanism, Mol-CADiff explicitly models the relationship between text and molecular structures, leading to more controlled and accurate molecule generation compared to existing methods.

What Problem Does This Paper Address?

Designing molecules with specific properties is crucial for fields like drug discovery and materials science. While deep learning has accelerated this process, existing models struggle to generate molecules based on detailed textual descriptions. This is partly because they don't effectively capture the complex, causal relationships between natural language prompts and the intricate, discrete structures of molecules. Current approaches often rely on simpler architectures that fail to model these dependencies adequately, limiting precise control over the generated molecular properties.

Methods

Mol-CADiff builds upon diffusion models, a powerful generative paradigm, by integrating an autoregressive approach with a novel causal attention mechanism. Here's a breakdown of their key techniques:

  • Diffusion Models: The core generative engine is a diffusion model, which progressively adds noise to data and then learns to reverse this process to generate new samples.
  • Autoregressive Causal Attention: This is the paper's main innovation. Instead of standard attention, they use a "causal attention mask" that ensures tokens attend only to preceding tokens. This enforces a structured, sequential generation process, mimicking how language is generated. This mechanism explicitly models the causal relationship between textual prompts and molecular graph structures.
  • Latent Space Transformation: To improve efficiency, molecules and text are first encoded into a compact latent space. This involves contrastive learning to align text and graph representations and an autoencoder-style training for structured graph reconstruction.
  • Partial Graph Latent Representation: During the autoregressive steps, they found that using only a partial clean latent representation of the molecular graph (rather than the full one) offered a good balance between performance and computational efficiency.
  • Classifier-Free Guidance: This technique is used to enhance the conditioning of the generation process on the textual input.

Datasets

The authors evaluated Mol-CADiff on four standard molecular datasets:

  • PubChem: A large dataset of chemical compounds.
  • ChEBI-20: A dataset focused on chemical entities of biological interest.
  • PCDes: A dataset for molecular property prediction.
  • MoMu: A dataset for multimodal molecular generation.

They also mention using a dataset of molecule-text pairs for contrastive learning.

Key Insights and Ideas

  • Causality is Key for Control: The paper strongly suggests that explicitly modeling the causal relationship between text and molecular structure is crucial for achieving fine-grained control in molecule generation.
  • Autoregression Enhances Structure: Integrating an autoregressive component, guided by causal attention, allows the model to build molecules step-by-step, ensuring structural coherence and validity.
  • Partial Latents Offer Efficiency: Using a partial clean latent representation during autoregressive steps is a clever way to reduce computational load without significantly sacrificing performance.
  • Diffusion Models are Versatile: The work demonstrates the continued power and adaptability of diffusion models for complex generative tasks beyond images, extending their utility to the structured domain of molecules.

Key Results

Mol-CADiff demonstrated strong performance across various metrics:

  • Conditional Generation: It outperformed state-of-the-art (SOTA) methods like MolT5, ChemT5, Mol-Instruction, and 3M-Diffusion by a significant margin in overall performance, novelty, and diversity, while maintaining high similarity to the input text. For example, on the ChEBI-20 dataset, Mol-CADiff achieved 100% validity and a high overall score of 81.24, significantly outperforming 3M-Diffusion's 69.12.
  • Unconditional Generation: It also showed competitive results on unconditional generation benchmarks, excelling in uniqueness, novelty, KL divergence, and Fréchet ChemNet Distance.
  • Qualitative Results: Visualizations showed that generated molecules closely matched ground truth structures and accurately reflected desired properties (e.g., insolubility, drug-likeness) as specified in textual prompts. Case studies highlighted Mol-CADiff's ability to generate molecules with specific logP values or belonging to particular chemical classes.

Limitations and Future Work

  • Efficiency and Scalability: While Mol-CADiff shows improved quality, the authors acknowledge that future work could focus on enhancing its efficiency and scalability for even larger-scale applications.
  • AR Step Decay Impact: The ablation study on AR step decay (gamma parameter) showed that while moderate decay (around 0.5) yielded the best novelty and diversity, extreme values could lead to fragmentation or oversimplification. This suggests that careful tuning of AR step parameters is important.
  • Attention Block Depth: The study on attention blocks indicated that while deeper architectures (up to 8 blocks) improved similarity, excessive depth could reduce diversity and novelty. This points to a trade-off between structural accuracy and exploration.
  • Sampling Timesteps: The optimal number of sampling timesteps (ST) for conditional generation was found to be around 50, balancing similarity, novelty, and diversity while maintaining computational efficiency.

The paper suggests that future work could explore improving efficiency and scalability for large-scale applications.

Summary updated

BibTeX
@misc{ahamed2025mol,
  author = {Md. Atik Ahamed and Qiang Ye and Qiang Shawn Cheng},
  title = {{Mol-CADiff: Causality-Aware Autoregressive Diffusion for Molecule Generation}},
  year = {2025},
  eprint = {2503.05499},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.05499},
}
Figure