MolEdit: Knowledge Editing for Multimodal Molecule Language Models

Zhenyu Lei, Patrick Soga, Yaochen Zhu, Yinhan He, Yushun Dong, Jundong Li

TL;DR

MolEdit is the first framework designed to surgically edit knowledge within Multimodal Molecule Language Models (MoLMs) without the need for costly full retraining. By combining a multi-expert routing adapter with an expertise-aware gating switcher, it successfully corrects erroneous molecular facts while preventing unintended side effects on unrelated chemical data.

What Problem Does This Paper Address?

Molecule Language Models (MoLMs) have revolutionized chemistry and drug discovery by bridging structural data (like molecular graphs or SMILES strings) with textual descriptions of physicochemical properties and biomedical applications. However, because these models are trained on massive, web-mined datasets, they often memorize outdated or incorrect information—such as early-stage assay errors that mislabel toxic compounds as safe.

Fixing these errors is notoriously difficult. Traditional fine-tuning causes the model to forget unrelated facts. Furthermore, general-domain knowledge editing techniques fail here due to two molecule-specific challenges:

  1. Multifaceted Knowledge: A single compound possesses multiple distinct functional groups and properties, making it easy to over-edit or under-edit specific facets.
  2. Cross-Molecule Interdependence: Molecules share functional groups. Modifying the model's understanding of one molecule can inadvertently corrupt its knowledge of a structurally similar but completely unrelated molecule, violating the principle of locality.
Figure 1: An illustration of MoLM editing for two tasks: cor- recting inaccurate captions in molecule-to-caption generation and fixing mismatched or invalid molecules in caption-to- molecule generation.

Methods

The authors introduce MolEdit, a lightweight framework that patches selected layers in both the encoder and decoder of an MoLM. It relies on two main components:

  • Multi-Expert Knowledge Adapter (MEKA): Instead of using a single adapter, MEKA implements a Mixture-of-Experts (MoE) architecture. It breaks down a molecule or its text caption into distinct facets (e.g., functional groups or specific descriptive phrases) and routes them to specialized feed-forward network (FFN) experts. This allows for fine-grained, facet-level updates.
  • Expertise-Aware Editing Switcher (EAES): To protect unrelated knowledge, EAES acts as a strict gatekeeper. It maintains a memory bank of edited molecular expertise. During inference, it activates the editing adapters only if the input closely matches the stored edits across all expertise facets. If the match is insufficient, the switcher routes the input through the model's original, unaltered layers.
Figure 3: An overview of MolEdit to edit MoLMs for molecule/caption generation by modifying a chosen layer in either the encoder and decoder. It is composed of two components: (1) Multi-Expert Knowledge Adapter (MEKA) and (2) Expertise- Aware Editing Switcher (EAES). Specifically, MEKA utilizes expertise-wise MoE for encoder and token-wise MoE for decoder to route expertise to different editing experts (instantiated as FFN). EAES stores edited knowledge expertise (functional groups/descriptions) and activates MEKA only when all input expertise finds a similar match in its memory bank during inference, thereby preserving unrelated knowledge.

Datasets

To evaluate their approach, the authors created MEBench, the first comprehensive benchmark specifically designed for editing MoLMs. Built on top of the widely used ChEBI-20 dataset, MEBench evaluates model performance across two primary tasks: molecule-to-caption generation and caption-to-molecule design.

MEBench evaluates editing success along three critical dimensions:

  • Reliability: Does the model successfully output the newly corrected target?
  • Locality: Does the model leave structurally similar but untargeted molecules unchanged?
  • Generality: Is the edit robust to semantically equivalent rephrasings of the prompt?
Figure 2: A sample illustration of MEBench. It includes three evaluation dimensions for two tasks: Reliability (molecules requiring editing), Locality (similar but untar- geted molecules), and Generality (semantically equivalent but different captions).

Key Insights and Ideas

  • Synergistic Editing: The authors discovered that editing both the encoder and decoder layers yields significantly better results than editing either component in isolation. This suggests that molecular knowledge is distributively stored across both understanding and generation modules.
  • Asymmetric Sensitivity: Different chemical facets react differently to editing. For instance, modifying structural knowledge is significantly more challenging and prone to error than modifying origin or function descriptions. This strongly validates the authors' choice of a multi-expert architecture over a one-size-fits-all adapter.

Key Results

The authors evaluated MolEdit against strong baselines (including standard fine-tuning, MEND, and GRACE) across two popular MoLM backbones: MoMu and MolFM.

  • Molecule Generation: MolEdit outperformed the second-best baseline by up to 18.8% in Reliability, 10.2% in Locality, and 19.1% in Generality (measured via BLEU-4).
  • Caption Generation: MolEdit achieved superior performance here as well, exceeding the best baseline by up to 5.4% in Reliability and 12.0% in Locality (measured via BLEU-2).
  • Qualitative Success: Case studies revealed that while baseline methods like GRACE frequently injected invalid SMILES tokens or hallucinated irrelevant text, MolEdit consistently produced structurally valid and highly precise outputs.

Limitations and Future Work

While MolEdit marks a major step forward, the authors note a persistent performance gap in Generality. The model is still somewhat sensitive to how a query is phrased, meaning it occasionally fails to apply a corrected edit if the prompt structure changes significantly.

Future work will likely focus on closing this generality gap, scaling the framework to even larger scientific foundation models, and exploring how to handle complex, multi-hop chemical reasoning edits.

Summary updated

BibTeX
@inproceedings{lei2026moledit,
  author = {Zhenyu Lei and Patrick Soga and Yaochen Zhu and Yinhan He and Yushun Dong and Jundong Li},
  title = {{MolEdit: Knowledge Editing for Multimodal Molecule Language Models}},
  booktitle = {WSDM},
  year = {2026},
  doi = {10.1145/3773966.3777928},
}
Figure