Skip to content
AI.info

Research

Entropy-Guided Dynamic Tokens for Graph-LLM Alignment in Molecular Understanding

Overview Research area: Multimodal machine learning at the intersection of molecular graph representation learning and large language models (graph–LLM alignment). Technical level: Advanced (assumes f

arXiv
2602.02742
Published
2026-02-02
Authors
Zihao Jing, Qiuhao Zeng, Ruiyi Fang, Yan Sun, Boyu Wang, Pingzhao Hu

AI summary

Overview

  • Research area: Multimodal machine learning at the intersection of molecular graph representation learning and large language models (graph–LLM alignment).
  • Technical level: Advanced (assumes familiarity with Transformers, attention, Q-Former-style connectors, contrastive pretraining, and molecular graph encoders).
  • Scope: The paper introduces EDT-Former, an Entropy-guided Dynamic Token Transformer that aligns frozen molecular graph encoders with frozen LLM backbones using variable-length, substructure-aware query tokens, and evaluates it on molecular reasoning and property prediction benchmarks.

What This Paper Is About

Current graph–LLM bridges for molecules typically adapt the Q-Former connector from vision, using a fixed number of static query tokens plus costly fine-tuning of the LLM backbone. This fixed-length compression loses stereochemistry and substructural context — for example, the same 8-query-token Q-Former bridge to a Llama-3.1-8B backbone handles a 16-atom molecule well but gives incomplete substructure coverage for a 50-atom molecule. The paper's goal is a connector-only alignment method that lets a frozen graph encoder talk to a frozen LLM (excluding the embedding layer) while preserving local and global molecular structure.

Key Contributions

  1. EDT-Former, described as the first connector-only method that aligns chemical graphs with frozen LLMs via dynamic, substructure-aware query tokens.
  2. Entropy-Guided Patching, which uses a lightweight Next-Atom Predictor (NAP, a small Transformer) to segment a molecule at local maxima of next-atom surprisal, producing a number of dynamic tokens that scales with molecular complexity.
  3. Dynamic Query Transformer, which combines learned modality anchor tokens with the dynamic tokens in a shared query bank and refines them via self-attention, cross-attention to node embeddings, and a shared feed-forward network before projecting into the LLM embedding space.
  4. State-of-the-art results on MoleculeQA, molecule-oriented Mol-Instructions, and property prediction benchmarks (TDC, MoleculeNet), plus ablations on patching strategy, connector design, modality fusion, backbone choice, and compute cost.

Main Findings

  • Fixed-length fusion is structurally lossy: The motivation figure compares molecules with atom counts N = 16 and N = 50 fed through the same fixed 8-query-token Q-Former bridge to Llama-3.1-8B; large molecules show incomplete substructure coverage and chemically unfaithful predictions.
  • Frozen backbones are far cheaper to train: The paper's Table 1 reports that joint LLM-plus-connector tuning requires 8.1B trainable parameters, 4.9e10 FLOPs/token, and 0.93 time/step, versus 84M trainable parameters, 1.7e10 FLOPs/token, and 0.23 time/step with a frozen LLM — a 96x difference in trainable parameters.
  • Property prediction (zero-shot, 13 prompt settings averaged): EDT-Former (8.3B) scores 82.34 PAMPA, 72.48 BBBP, 49.12 BACE, 56.55 CLINTOX, 50.27 DILI, 73.46 HERG, 82.15 HIA, 46.56 HIV, 55.20 AMES, and 54.64 PGP, best on all ten tasks with >20% relative gains over the strongest baseline and average accuracy above 70% on BBBP, HIA, and PAMPA.
  • MoleculeQA: EDT-Former with SFT scores 74.55 Structure, 72.39 Source, 50.71 Property, 48.58 Application (61.56 average, 68.34 total), the best across all four tasks. Its 10-shot variant (66.46, 60.98, 40.35, 36.40; 51.05 average, 58.78 total) outperforms GPT-5 (62.78, 53.22, 36.42, 46.91; 49.83 average, 56.12 total).
  • Mol-Instructions: EDT-Former-8.3B records BLEU-2 0.424, BLEU-4 0.402, ROUGE-1 0.726, ROUGE-2 0.652, ROUGE-L 0.717, METEOR 0.631 and property MAE 0.0062 on description generation and property prediction. On retrosynthesis it reaches Exact 0.387, BLEU 0.930, RDK FTS 0.721, MACC FTS 0.836, Morgan FTS 0.670, Validity 1.000; on forward reaction prediction Exact 0.471, BLEU 0.964, RDK FTS 0.776, MACC FTS 0.871, Morgan FTS 0.712, Validity 1.000; on reagent prediction Exact 0.145, BLEU 0.650, RDK FTS 0.464, MACC FTS 0.531, Morgan FTS 0.431, Validity 1.000.
  • Component ablations (MoleculeQA): Removing multimodal fusion causes the largest degradation (26% average); disabling the Dynamic Query Transformer or Entropy-Guided Patching yields average drops of 10.7% and 11.5% respectively.
  • Patching strategy ablation (BBBP / PAMPA, accuracy and F1): Entropy-Guided Patching gives 75.06 / 75.06 and 84.52 / 91.61 with 0% average drop; BRICS 73.59 / 84.74 and 71.90 / 83.09 with 3.96% drop; random patches 68.90 / 80.13 and 66.67 / 79.32 with 8.81% drop; no patching 39.67 / 49.58 and 78.62 / 87.90 with 21.60% drop.
  • Backbone sensitivity (MoleculeQA): Attaching the connector improves Mistral-8B from 28.00 to 55.63 (+98.71%), Qwen3-8B from 27.18 to 54.79 (+101.58%), Llama2-7B from 38.37 to 65.89 (+71.72%), and Llama3.1-8B from 49.31 to 68.34 (+38.59%).
  • Efficiency (Llama3.1-8B): Frozen-backbone training uses 37 GB memory and 0.26 s per step versus 77 GB and 0.93 s per step for LoRA, roughly 3.5x faster per step and about half the memory; full backbone training exceeds 200 GB and is reported as infeasible in this setting.
  • Modality ablation (MoleculeQA): Text/Graph/3D scores 74.55 / 72.39 / 50.71 / 48.58 (61.56 average, 68.34 total, 0% drop); Text/Graph 70.84 / 68.72 / 49.22 / 46.51 (58.82 average, 65.11 total, 4.73% drop); Text/3D 66.50 / 64.77 / 42.17 / 42.02 (53.87 average, 60.48 total, 11.50% drop); Text Only 66.46 / 60.98 / 40.35 / 36.40 (51.05 average, 58.77 total, 14.00% drop).
  • Attention behavior: In the last-layer attention map for a molecule with N = 63 atoms, fixed anchors attend diffusely across unrelated patches, while dynamic tokens attend sharply to contiguous node ranges corresponding to chemically meaningful subgraphs.

Methodology in Plain English

The approach has three moving parts.

First, a small next-atom predictor is pretrained on large canonical SMILES corpora. At inference, it assigns a probability to each ground-truth next atom, and the negative log of that probability defines a per-position surprisal value. Positions where surprisal reaches a local maximum are treated as natural cut points (filtered by non-maximum suppression with a minimum separation and a prominence threshold). Cutting after each retained peak produces variable-length segments, and because SMILES follows a depth-first traversal of the molecular graph, these segments correspond to plausible substructures. The segment count adapts automatically to molecule size and complexity, which is the key departure from fixed-length Q-Former bridges.

Second, node embeddings from a frozen graph encoder are mapped onto those segments via a SMILES-position-to-graph-node mapping and average-pooled into one dynamic query token per segment. These dynamic tokens are concatenated with k learnable modality anchors to form a query bank of size (k + M) tokens. A lightweight transformer with L layers refines the bank: self-attention lets anchors and dynamic tokens exchange context, cross-attention retrieves evidence from the node embeddings, and a shared feed-forward network processes all tokens. A projection maps the result into the LLM embedding space.

Third, training is two-stage on the Mol-LLaMA-Instruct dataset. In pretraining, only the Dynamic Query Transformer is optimized alongside frozen graph encoders, using a cross-modal contrastive loss, an anchor–modality matching loss, and a masked substructure reconstruction loss. In alignment tuning, the LLM is attached but stays frozen, and only the bridge parameters (anchors, attention and feed-forward layers, and the projection) are updated.

Why This Matters

  • Research impact: The paper argues that fixed-length modality anchors inherited from vision are a structural bottleneck for heterogeneous, length-variable graph inputs, and offers entropy-based, data-driven segmentation as a general alternative. It also shows that strong molecular understanding can be obtained without updating LLM backbone weights, which reframes the cost-accuracy trade-off for multimodal fusion.
  • Real-world applications (as raised by the paper's framing): molecular property prediction for drug candidates; molecular description generation and property inference from structure; retrosynthesis planning; forward reaction prediction and reagent prediction.
  • Industry relevance: The reported memory and per-step timings (37 GB and 0.26 s per step versus 77 GB and 0.93 s per step for LoRA, and over 200 GB for full tuning) matter for deployments where backbone fine-tuning is impractical. The authors state that code and processed data are released, with a repository described as open source under the MIT license and a Dockerfile for reproducible environments, and that models will be released with terms of use prohibiting harmful or unlawful applications.

Future Directions

  • The paper states that current constraints and future directions are discussed in Appendices F.1 and F.2; those details are not included in the provided content, so the specific limitations and planned extensions are not reported here.
  • The authors argue that entropy-driven segmentation "likely generalizes beyond molecules," suggesting extension of the patching idea to other graph or sequence domains.
  • Because the method leaves the LLM frozen, open questions remain about how the connector behaves as backbones scale further; the paper's own analysis covers backbones including Mistral-8B, Qwen3-8B, Llama2-7B, and Llama3.1-8B, with reported gains that shrink as the backbone strengthens (+101.58% for Qwen3-8B versus +38.59% for Llama3.1-8B).
  • The provided content lists extended ablations on query token length, model size, hyperparameters, graph encoder choice, token budgets, LLM embedding-layer training, training corpus, inference-time removal of dynamic tokens and anchors, and hallucination analysis, indicating further characterization of the design space that is not detailed in the truncated text.

Target Audience

Researchers and practitioners working on multimodal LLMs, molecular machine learning, and graph–language alignment; engineers building chemistry or drug-discovery assistants who need efficient, low-cost adaptation of frozen LLM backbones; and graduate students interested in connector design, tokenization strategies, or evaluation on MoleculeQA, Mol-Instructions, TDC, and MoleculeNet benchmarks.

Authors’ abstract

Molecular understanding is central to advancing areas such as scientific discovery, yet Large Language Models (LLMs) struggle to understand molecular graphs effectively. Existing graph-LLM bridges often adapt the Q-Former-style connector with fixed-length static tokens, which is originally designed for vision tasks. These designs overlook stereochemistry and substructural context and typically require costly LLM-backbone fine-tuning, limiting efficiency and generalization. We introduce EDT-Former, an Entropy-guided Dynamic Token Transformer that generates tokens aligned with informative molecular patches, thereby preserving both local and global structural features for molecular graph understanding. Beyond prior approaches, EDT-Former enables alignment between frozen graph encoders and LLMs without tuning the LLM backbone (excluding the embedding layer), resulting in computationally efficient finetuning, and achieves stateof-the-art results on MoleculeQA, Molecule-oriented Mol-Instructions, and property prediction benchmarks (TDC, MoleculeNet), underscoring its effectiveness for scalable and generalizable multimodal molecular understanding

Read the original paper