acceptodds
Under review as a conference paper at ICLR 2027

Learning the Graph Language of Molecules: Grammar Tokenization for Chemical LLMs

Abstract

Large language models (LLMs) have been explored for integrating molecular graphs, but joint autoregressive modeling of text and molecules remains challenging. A key barrier is the lack of principled molecular graph tokenizers (MGTs): string representations like SMILES rely on brittle syntax and canonicalization, limiting robustness, flexibility, and interpretability. We introduce AlphaGrammar, a neural-symbolic MGT that rewrites molecular graphs as linear derivations over a formal graph grammar with theoretical guarantees. Training optimizes the parameters of a potential function for grammar construction, and inference amortizes the cost of parsing during tokenization. We then introduce Gramole, a multimodal LLM built on AlphaGrammar, which interleaves text and molecules as rule sequences without the need for modality-specific adapters. Gramole offers % validity via type-constrained decoding, expressivity by sampling high-diversity molecular sets, transferability by improving FDA drugs' predicted properties on all six endpoints under an independent property predictor (vs. four for the strongest baseline), with edits that stay closer to the parent drug, controllability using natural language interfaces, and synthesizability by achieving drug and material retrosynthesis success rate of the best multimodal LLM baseline at matched Qwen3-8B backbone. AlphaGrammar autonomously acquires rules that recapitulate known functional groups, offering a layer of interpretability absent in prior MGTs. We benchmark Gramole across diverse tasks in the design-make-test-analysis (DMTA) cycle and probe AlphaGrammar's mechanism in quantitative and qualitative case studies.

Primary area:
learning on graphs and other geometries & topologies
Keywords:
graph grammar, molecular design, graph language model

Reviews

Among:
Shape:
1234this paper, Bottom 10%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 1.67 over 3 reviews, above 10% of the others.
Reviewer_p1bXOpenReview ↗
Rating
1
Confidence
4
Informativeness
1
Presentation
1
Soundness
1
Read review
Paper summary

This paper introduces AlphaGrammar, a learned molecular graph tokenizer, and Gramole, a language model that processes text and molecular grammar rules within a shared token sequence.

Critical strengths
  1. The sequential grammar should provide a useful interface between molecular graphs and autoregressive language models.
Critical weaknesses
  1. Writing / Motivation. Overall, this paper is very difficult to follow and requires lots of background knowledge—too many concepts without clear explanations or even without references. I spent more than half a day understanding it; however, I still have many unclear parts. 1.1. The authors think SMILES and SELFIES are "(i) syntactically brittle, (ii) chemically unintelligible, and (iii) disrespectful of permutation invariance because there can be up to exponential DFS traversals on the same graph topology". It's very unclear to me why. There are no refs, no evidence, no explanations to support these so strong claims. And I don't think these are common agreements of the community that do not need explanations. 1.2. The authors think "An ideal MGT should (i) compose a modular vocabulary that an LLM can easily enforce chemical validity, (ii) build an interpretable vocabulary of chemically meaningful rules and (iii) encode and decode arbitrary molecules losslessly into a canonical sequence of tokens, without heuristics that violate graph invariances (e.g. SMILES canonicalization)." Again, it's very unclear to me: what is the evidence to indicate that "an LLM can easily enforce chemical validity"?

  2. I'm totally lost in Section 3. 2.1. I don't understand the correlation between each step. Are they related or randomly listed here? 2.2. Why should RL be introduced after finalizing the optimization objectives? Is RL a post step after optimization? Also, what is the reward function of RL? "Appendix C gives the complete objective and reward definitions." But I don't find anything in Appendix C. 2.3. I don't see a clear correspondence between Section 3 and Figure 3.

  3. Experiments 3.1. Why is Figure 5 placed in Section 6? 3.2. Where are the "Full results in App. J."? 3.3. Please also clarify how the subsets in Tables 21–22 relate to the full evaluation population.

Minor:

  1. Why do we need the DMTA abbreviation in the Abstract? Is it an important abbreviation?
  2. Incorrect citation format. Please distinguish \cite vs. \citp in the ICLR template.
Questions for authors

As listed in Critical Weaknesses

Reviewer_9QqtOpenReview ↗
Rating
2
Confidence
2
Informativeness
1
Presentation
1
Soundness
1
Read review
Paper summary

The authors propose ALPHAGRAMMAR, a molecular graph tokenizer (MGT) that scaffolds molecules into sentences of rules using a composable, reusable vocabulary. They also built GRAMOLE, a multimodal LLM over molecules and text that performs autoregressive modeling on a unified vocabulary of text and grammar-rule tokens.

They compare tokenizer properties (parsimony, usage, uniqueness, rule quality) against string and fragment baselines, test unconditional generation on MOSES and GuacaMol, optimize FDA-approved drugs for ADMET properties against mCLM, using both a private oracle and public predictors (ADMET-AI, ADMETlab 3.0). The authors also evaluate prompt-following, inverse design, and retrosynthesis planning on a MolQA benchmark against SmileyLlama, mCLM, Llamole, and ICL/SFT baselines. They train three separate Gramole checkpoints (one per benchmark), each matching the respective baseline’s backbone, and report ablations over reward components, advantage formulation, parsing budget, and canonical-parse caching.

Critical strengths
  • New molecular representation. The paper represents each molecule as a sequence of grammar rules, where each rule can leave at most one open slot. That makes every derivation a sequence, so each rule can be an ordinary LLM token.

  • Extensive ablations. The authors ablate each reward term, the advantage formulation, the parsing budget, and the canonical-parse choice.

Critical weaknesses
  • The central guarantees are weaker than claimed. The vocabulary is said to hold around 50M atomic rules, so no molecule is out of vocabulary, but embeddings exist only for rules seen in training, about 9.6k atomic rules on MolQA. A rule that is in the symbol set but never seen in training has an untrained embedding, so for the model, it is effectively out of vocabulary. The guarantee is about which symbols exist, not about learned representations. Also, rollouts yield the same derivation for only about 5–19% of molecules, as shown in Table 3. The deterministic token stream is obtained by caching one parse per molecule, which cannot help with molecules that were never cached. The multiplicity problem that the paper criticizes in SMILES is moved elsewhere rather than solved.

  • Difficult to verify the empirical results. Although the authors claim to use a single model, they actually use three separate models trained on three different backbones. SAFE is the closest fragment-based linear representation, but the comparisons with it are missing. For RQ4, the large margin over mCLM holds only on the authors’ own unreleased oracle. On two public predictors, it shrinks to roughly 4–6 points, and the “closer to parent” claim reverses between the two drug sets. For RQ6, the MolQA tokenizer is trained with the CRM reward, which favors splits along known coupling-reaction bonds. Retrosynthesis success is then measured on the same benchmark, which makes the 3.1× material RS gain partly circular. It also can't be verified because the CRM reward isn’t in the released code. The provided code includes only the ALPHAGRAMMAR tokenizer, which is largely built on previous grammar-learning repos. There is no code for Gramole LLM, vocabulary setup, or type-constrained decoding.

Questions for authors
  1. How many atomic rules needed at test time were never seen during training, and how are their embeddings initialized?
  2. How is a molecule tokenized at inference if it is not in the parse cache?
  3. Why is the parsimony reward kept in the default setting, when removing it raises material RS from 13.3 to 49.3 (Table 8)?
  4. Why does the Tanimoto-to-parent ordering flip between the 122-drug and DrugBank settings in Table 1, and which one should the “1.9× closer” claim rest on?
  5. Section E.1 has a heading but no text. Also, is the mCLM training corpus the 10K set (p.6) or the 1k set (App. G)?
  6. Can you add SAFE as a baseline in the RQ1 tokenizer comparison and in at least one generation task?
  7. Can you report RQ6 retrosynthesis success for a MolQA tokenizer trained without CRM (or any reaction-based reward)? Without this, the synthesis-planning gain cannot be separated from reward–metric alignment.

Sugestions

  • Train one model across all tasks to support the “unified DMTA” claim.
  • Add error bars or seed variance for Table 1 and for the baselines in RQ6.
  • Switch to parenthetical citations (\citep) throughout for readability.
10 comments
AuthorsOpenReview ↗

Dear Reviewer 9Qqt

Thank you for recognizing the novelty of our representation and the extensive ablations!

[W1] "The central guarantees are weaker than claimed. The vocabulary is said to hold around 50M atomic rules, so no molecule is out of vocabulary, but embeddings exist only for rules seen in training, about 9.6k atomic rules on MolQA. A rule that is in the symbol set but never seen in training has an untrained embedding, so for the model, it is effectively out of vocabulary. The guarantee is about which symbols exist, not about learned representations."

Your insight is very sharp! But these are two different claims, and we'd like to disentangle them with you. Theorem 1 closes the vocabulary: a finite, enumerable rule set covers every reasonable molecule, so there is no molecule for which the tokenizer has no symbol. It is a guarantee about symbols, as you said. Whether a particular rule's embedding has received gradient is a representation learning problem. We see this as a strength, not a weakness, because closing the vocabulary is what makes the representation-level question bounded and answerable at all.

The alternative of an open vocabulary carries no guarantees at all. With an open vocabulary the number of graph tokens unseen in training is unbounded, and each one can differ in topology from anything seen during training to an unbounded degree. An adapter has to embed them anyway, with no guarantee about what it returns. That cost is visible in the method we compare against: mCLM's block vocabulary is filtered to the 1,0001{,}000 most frequent blocks (Edwards et al., 2025). Its training set is restricted to only a small fraction of ChEMBL drugs that their tokenizer fully covers. On that filtered set, 120 of the 122 drugs in their benchmark test set contain at least one block outside the vocabulary. Our design closes the vocabulary and drops the adapter so that rule tokens are learned natively as tokens. The alternative is to keep an adapter and ask it to embed out-of-distribution tokens with no guarantee at all.

Combining our type-chaining system with the closed vocabulary is what makes "effectively out of vocabulary" lose its teeth. On the mCLM corpus, 3.9% of the distinct rules the validation split exercises have untrained embeddings because they appear in no training example (our Q1 response below contains more details). Those "effectively out of vocabulary" rules can still be emitted and consumed normally. What makes them usable is not a trained embedding, but the inference type-chaining system we developed that arises from the grammar's symbolic properties. Decoding is masked to rules that type-chain with the derivation so far, so an untrained rule can still be predicted if the mask leaves it as the only legal continuation. These rows don't start from noise: each is initialized from the mean of the trained embedding table rather than at random. We would rather let the benchmark results and our "extensive ablations" (more below) carry the rest of our argument.

We want to make the symbolic and representation claim separation clear. We are tightening one sentence in Section 2, where we write that a closed vocabulary removes the exposure to graph tokens unseen in training. What closure removes is out-of-vocabulary tokens, and the sentence now says that. The sentence after it already stated the representation-level fact, that a rule's embedding is learned as the rule is used, so the materialized table grows with the rules actually encountered.

AuthorsOpenReview ↗

Dear Reviewer 9Qqt (cont.)

[W2] "Also, rollouts yield the same derivation for only about 5-19% of molecules, as shown in Table 3. The deterministic token stream is obtained by caching one parse per molecule, which cannot help with molecules that were never cached. The multiplicity problem that the paper criticizes in SMILES is moved elsewhere rather than solved."

Table 3's 5-19% is rollout agreement during training, where the contraction policy samples. Low agreement there is exploration, which is what a policy-gradient method encourages. It is not the inference path.

With a trained AlphaGrammar checkpoint, a molecule's encoding is fixed. The tokenizer we ship runs the trained contraction policy once per molecule, and the derivation it returns becomes that molecule's canonical token sequence for Gramole. A molecule presented twice is therefore encoded the same way twice. None of this is about generation: when Gramole generates, it emits rule tokens directly and no parse is involved at all.

The paper also checks that the claim does not depend on which canonical parse we cache. App. E's canonical-parse ablation swaps the cached derivation for a greedy argmax contraction and the downstream differences are negligible, which is the point of it: what matters is that a canonical parse is fixed per molecule, not which one. So where our ablations name a deterministic mode, both settings are deterministic at deployment. What varies is the rule for choosing the canonical parse, and the problem is mitigated as long as that rule is consistent.

Parse multiplicity is a first-class metric for us, and benchmarking every MGT on it is the subject of RQ1. Table 17 reports E∣P(m)∣@100\mathbb{E}|P(m)|@100, the expected number of distinct parses a tokenizer admits per molecule. AlphaGrammar admits 253, against 2.28×1042.28\times10^{4} for character SMILES, 2.43×1042.43\times10^{4} for character SELFIES, 2.42×1042.42\times10^{4} for SELFIES BPE, 8.37×1038.37\times10^{3} for SMILES BPE, 1.82×1041.82\times10^{4} for BRICS and 4.53×1034.53\times10^{3} for GroupSELFIES, so AlphaGrammar achieves roughly one to two orders of magnitude lower multiplicity than the string representations. No tokenizer over graphs eliminates multiplicity entirely. The claim we make, and the one RQ1 measures, is that we squash the exponent furthest.

The way we compute E∣P(m)∣@100\mathbb{E}|P(m)|@100 is also asymmetric between AlphaGrammar and the baselines. For AlphaGrammar the parse set is counted exactly, with a polynomial-time Bolinas parse-tree enumerator. For the string tokenizers no exact count is available at all. Their parse sets grow factorially in ring count, so the published figures rest on drawing randomized parses and inverting a coupon-collector species-richness estimator (App. K). That estimator is consistent but biased at finite sample, and because the randomizers are non-uniform over distinct parses it underestimates the true count. The comparison above is therefore conservative against us: their multiplicity is at least what is printed, and ours is exact. This difference in accounting methodology itself is the point.

The cache is an engineering optimization, not the mechanism as you stated. A molecule that is not in the cache is encoded on the spot by the same trained contraction policy that filled it, deterministically, so determinism does not depend on a prior cache entry. It depends on the policy being fixed at inference. Just like how a corpus is tokenized by BPE in advance and stored as an HF cache, the cache buys us speed, and Q2 states the procedure.

[W3] "Difficult to verify the empirical results. Although the authors claim to use a single model, they actually use three separate models trained on three different backbones."

We state in Section 5 Benchmarks. we train separate models, one per benchmark with matched data/architecture/evaluation. We think you're referring to the final sentence of RQ6, where we refer to an "all in one unified autoregressive model". What we're referring to is the Gramole model for MolQA, where the benchmark itself requires interleaving text and molecular structures, which are handled seamlessly because we treat rule tokens and text tokens as equal first-class tokens. We apologize if the wording read as a claim that we use a single model across benchmarks.

The all-in-one framing that does hold up beyond the unified vocabulary relates to the repeatable recipe of extending a pretrained LM by our tokenizer learning algorithm, closed vocabulary construction, parsing encoder and type-chaining decoder. This shared recipe is instantiated three separate times, because each benchmark's credible baselines live on a different backbone and we matched each one to keep the comparison fair and avoid confounds in the claims we make. A single cross-benchmark model is the right final deliverable of our project. We add it as a limitation on p. 10 but is the next big item on our agenda towards a production release.

AuthorsOpenReview ↗

Dear Reviewer 9Qqt (cont.)

[W4] "SAFE is the closest fragment-based linear representation, but the comparisons with it are missing."

Agreed, and we apologize for omitting it. SAFE is now cited and discussed in Related Works. We have run the comparison you ask. We trained SAFE (T7) with the identical SFT recipe on the same backbone, so the cell varies only the molecular representation. We also ran pSELFIES (T6) alongside it, since SELFIES is the other linear representation our Related Works argues against. The results are, with validity given per half and our two retrosynthesis cells as the revised three-run rows:

MetricSFT pSELFIES (T6)SFT SAFE (T7)Gramole (CRM, ours)
Validity, drug0.99980.99001.000
Validity, material0.75070.81871.000
Similarity0.18230.18240.123
BLEU-40.2060.3320.220
Avg. BA (drug)0.55690.56770.516
Avg. MAE (material)0.71630.69000.639
Drug RS %4.33.948.1 ± 11.8
Material RS %2.93.378.7 ± 4.8

SAFE is the closest comparison and it behaves the way its design predicts. SAFE fragments are standalone molecular structures, like our rules, which is why it is the only baseline that can contest us on rule quality (see Q6). But the fragmentation is a fixed heuristic decomposition rather than a learned vocabulary, and the fragment stream carries no type information, so nothing in the representation prevents an inadmissible attachment: validity has to be checked after decoding, not enforced during it. That is visible as 0.9900 drug and 0.8187 material validity against our 1.0001.000 on both.

That is what the type-constrained decoder is for. Our tokens are symbolic objects with types, and at each step the logits processor admits only the rules that type-chain with the derivation so far and from which a complete derivation is still reachable inside the remaining token budget. Any illegal continuation therefore has zero probability rather than being detected afterwards, which is the difference from a representation like SAFE whose validity has to be checked after decoding. Our type system lets us additionally layer the polymer-arity constraint (details in App. F.2), which is where SAFE's material validity of 0.8187 against our 1.0001.000 comes from.

There is a second SAFE comparison, on the other benchmark, and your Q6 reports it in full. We ran SAFE-over-BRICS as a free-decoding fragment vocabulary on the mCLM drug-editing task. Its binding limitation is coverage: only 13 of the 122 drugs are expressible under its own trained vocabulary, and 92 of the 109 exclusions are chemically novel substructures rather than numbering variants, so the ceiling is close to fundamental for a fixed fragment vocabulary rather than an artifact of how fragments are named. That is exactly the gap Theorem 1 closes for us, and it is why the claim we make is a vocabulary that is complete over reasonable molecules rather than merely closed. Q6 carries the rest: the RQ1 tokenizer row with its table, the rule-quality comparison, why extending that vocabulary does not rescue the coverage, and what the SAFE model's generated candidates look like.

The natural follow-up is SELFIES, which does enforce validity when a string is decoded, so it is worth saying exactly where that enforcement sits. The guarantee holds and our numbers confirm it: pSELFIES reaches 0.9998 drug validity, the highest of any baseline, and 0.7507 on material. The gap between those two is where the mechanism shows. SELFIES enforces validity inside its own string-to-molecule decoder, and it does so by reinterpreting a symbol its derivation grammar cannot apply: a [=C] after an atom with no valence left is read as a single bond, and a ring-closure index that cannot be honoured is redirected. Every well-formed string therefore decodes to some valid molecule, though not always the one it denoted. Two things follow. The guarantee is carried by the representation, so it binds only once the model has emitted a complete string inside the SELFIES alphabet, and it constrains nothing about the emission itself -- whereas our admissibility test is evaluated inside the generation loop on every step, so an inadmissible continuation never carries probability mass. And what it guarantees is a valid molecule, not the polymer arity the material check asks for, which is the 0.7507 against our 1.0001.000.

One caveat we will state in the caption. Design BLEU-4 is not comparable across representations: the scorer tokenizes on punctuation, so the molecule span occupies 59.4% of pSELFIES's design text against 19.4% for a SMILES baseline and 12.0% for SAFE. The retrosynthesis columns are the informative ones.

Reviewer_bqqMOpenReview ↗
Rating
2
Confidence
2
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper proposes ALPHAGRAMMAR, a neural-symbolic molecular tokenizer that rewrites a molecule as a linear sequence of hyperedge replacement grammar rules by learning, via GRPO, which junction-tree subtree to contract at each step. The authors claim that a finite enumerable set of atomic rules covers all molecules satisfying their reasonableness constants, and use this closed vocabulary to build GRAMOLE, an LLM that interleaves text and rule tokens in a single stream without modality-specific adapters. They evaluate across seven research questions and four benchmarks, with the strongest results reported in FDA drug ADMET optimization and MolQA retrosynthesis planning.

Critical strengths

Learnable tokenizer design. Framing molecular tokenization as grammar learning rather than heuristic fragmentation is a natural and well-motivated choice. Unlike BRICS or mCLM, contraction decisions are learned, so the same local topology can be contracted differently depending on surrounding context (App. Q). The resulting rules are standalone molecular structures, which makes rule quality measurable at all, whereas string tokenizers are N/A on this axis (Table 14). This gives the vocabulary something to be optimized against, which fixed fragmentation schemes cannot offer.

Convincing empirical results. GRAMOLE substantially outperforms Llamole on both drug and material retrosynthesis success rate at matched backbones, and the gains survive removing the planner’s CRM-matching templates (Table 20) as well as binning by heavy-atom count and by Tanimoto-to-target (Tables 21 and 22). Interpretability also emerges without explicit functional-group rewards, since the base setting trained only on rule usage and success rewards still ranks functional-group-matching rules well above the null (Table 24). Since grammar rules are symbolic patterns that can carry hard constraints, synthesis-related tasks seem like a natural fit for this representation, and the results here support that.

Critical weaknesses

Insufficient isolation of contributions. The learned tokenizer is ablated only against an atomic greedy lower bound, with no comparison to a heuristic contraction policy, so the benefit of GRPO training over simply using larger fragments remains unclear. No SELFIES-based model appears in any downstream table, despite SELFIES sharing the validity guarantee that motivates the work. The +Encoder ablation roughly doubles BLEU-4 and raises ROUGE-L by more than half at every temperature, which is hard to reconcile with Sec. 7 summarizing it as a modest bump in textual coherence. Since learning the tokenizer and removing adapters are two of the three stated contributions, I cannot tell from the current experiments how much either one is actually responsible for the reported gains.

Gap between stated claims and what is shown. Theorem 1 is stated for reasonable molecules under V and C, but the enumeration is carried out only up to E=6 for tractability, which by the paper’s own Remark 3 does not reach the bound implied by those constants. The parsimony reward is defined as grammar conciseness but operationalized as whether the Bolinas parser returns within a wall-clock timeout, and App. E.4 shows that removing it improves most downstream metrics while it remains in the default configuration. On controllability, Sec. 6 claims GRAMOLE matches or exceeds all non-Llamole baselines, but SFT and ICL Qwen3-8B reach higher Avg. BA in Table 19 than any GRAMOLE configuration in Table 23, and Table 17 shows parity with SmileyLlama rather than an advantage. These are individually fixable, but together they make it harder to take the paper’s claims at face value.

Questions for authors

Clarifications

  • Remark 3 gives E ≤ V(C+1), which with the V=6 and C=7 used in App. I.1 is well above the E=6 at which the enumeration is carried out. What fraction of MolQA requires rules with more than six external nodes, and does Corollary 1 hold for molecules in that range?
  • What happens when the trained policy emits a rule outside the materialized vocabulary? Theorem 1 establishes that an in-vocabulary tokenization exists, but I could not find the procedure that falls back to it, nor how it interacts with the K=20 length cap.
  • Sec. 6 reports 1.3% and 9.3% better property adherence than the best non-Llamole result. Which baselines does this compare against? SFT and ICL Qwen3-8B reach higher Avg. BA in Table 19 than any configuration in Table 23.
  • Sec. 7 describes the +Encoder setting as giving a modest bump in textual coherence, but Table 23 shows BLEU-4 roughly doubling at all four temperatures. Could you reconcile these? Relatedly, is the adapter-free claim separable from the tokenizer change in the mCLM comparison?
  • Eq. (1) has no importance ratio, clipping, or KL term, so it reads as REINFORCE with group-normalized advantages rather than GRPO as in Shao et al. (2024). Is this intended?
  • App. E.4 shows that removing the parsimony reward improves most downstream metrics, and also states that doing so removes the dependence on the Bolinas parser. The latter seems inconsistent with App. D.2, where compositionality is defined over the parser’s derivation set. Could you clarify both points, and why parsimony is retained in the default configuration?
  • Would a comparison against a heuristic contraction policy, or a SELFIES-based downstream baseline, be feasible? Both would help separate the contribution of the learned tokenizer from that of using larger fragments.
  • Reporting ALPHAGRAMMAR’s own training cost alongside the GRAMOLE SFT costs in App. G would help readers judge the overhead of the parser calls.

Suggestions for future work

  • Ablating the architectural choices discussed in App. H, in particular the frozen GNN and the O1 versus O3 feature projection, would substantiate design decisions that currently rest on argument alone. A definition of the projection itself would also help.
  • The unified vocabulary is motivated as enabling interleaved text and molecules, but the text side is evaluated only through BLEU-4 and ROUGE-L on MolQA. Understanding tasks such as captioning would be a natural extension if generation is not the intended scope.
11 comments
AuthorsOpenReview ↗

Dear Reviewer bqqM

Thank you for understanding the motivation of our learnable tokenizer design and recognizing our convincing results!

[W1] "Insufficient isolation of contributions. The learned tokenizer is ablated only against an atomic greedy lower bound, with no comparison to a heuristic contraction policy, so the benefit of GRPO training over simply using larger fragments remains unclear."

Agreed, and we've added two comparisons to isolate the contributions. T4 frequency-greedy contracts whichever cluster is most frequent in the corpus; T5 size-matched contracts to a fixed fragment-size distribution matched to our learned grammar, so it holds fragment size constant and removes only the learning. T3 remains the atomic lower bound. All four settings share one training recipe, one backbone, one decode configuration and one matched training run, so the contraction policy is the only thing that varies:

runvaliditydrug RS %material RS %Avg. BAAvg. MAE
Ours (CRM, default)1.00046.774.70.5000.647
T3 atomic (lower bound)0.98917.338.70.5230.634
T4 frequency-greedy1.00043.954.70.5220.654
T5 size-matched1.00016.029.30.5100.667

The learned policy leads both heuristics on both retrosynthesis columns. The informative comparison is T5: it is handed our grammar's fragment-size distribution and still reaches 16.0 and 29.3 against our 46.7 and 74.7, so matching fragment size does not reproduce the result. The learned policy's contribution is therefore in which fragments it contracts, not in how large the resulting fragments are. T4, the stronger heuristic, closes much of the drug gap (43.9) but not the material gap (54.7), which is where reaction-aware contraction matters most.

T3 edges us on Avg. BA (0.523 against 0.500) and Avg. MAE (0.634 against 0.647). Both are property-prediction columns scored on the designed molecule, not measures of the tokenizer, and the margins are small -- 0.023 and 0.013. The columns that speak to tokenizer quality are the two retrosynthesis columns, where the learned policy leads every heuristic by a wide margin.

AuthorsOpenReview ↗

Dear Reviewer bqqM (cont.)

[W2] "No SELFIES-based model appears in any downstream table, despite SELFIES sharing the validity guarantee that motivates the work."

We ran the comparison and it is now in the downstream table. We trained pSELFIES (T6) and SAFE (T7) with the identical SFT recipe on the same backbone, so each cell varies only the molecular representation. Columns are the ones Table 24 reports, with validity given separately for drug and material:

columnSFT pSELFIES (T6)SFT SAFE (T7)Gramole (CRM, ours)
Validity, drug0.99980.99001.000
Validity, material0.75070.81871.000
Similarity0.18230.18240.123
BLEU-40.2060.3320.220
Avg. BA (drug)0.55690.56770.516
Avg. MAE (material)0.71630.69000.639
Drug RS %4.33.948.1 ± 11.8
Material RS %2.93.378.7 ± 4.8

What pSELFIES is, and why it rather than ordinary SELFIES. SELFIES (Krenn et al., 2020) has no symbol for a wildcard attachment point, and the MolQA material task is defined over polymer repeat units that contain wildcards (every material item does). Stock SELFIES therefore cannot encode a single material item: its encoder rejects such a molecule outright rather than approximating it. pSELFIES is the pseudo-polymer SELFIES of Savit et al. (2025), the open-source workaround to this known problem, which we adopt: each attachment point is replaced by an astatine terminus, chosen because it does not occur in the corpus; the result is encoded by the unmodified SELFIES library, and the terminus is restored afterwards. We used it because a stock-SELFIES model would have scored zero on the entire material half by construction, which would have defeated the purpose. On the drug half, which carries no wildcards, the encoding is identical to stock SELFIES.

On the shared validity guarantee. The guarantee holds on the drug half and our numbers confirm it: pSELFIES reaches 0.9998 drug validity, the highest of any baseline. On the material half it reaches 0.7507 against our 1.0001.000, and the distance between those two figures is the informative part, because the shortfall is not a failure of the SELFIES guarantee; it is a requirement the guarantee does not reach. SELFIES guarantees that a well-formed string decodes to some valid molecule. It does not guarantee the polymer arity the material check asks for, and it recovers validity by reinterpreting a symbol its derivation grammar cannot apply, so the molecule decoded is not always the one the string denoted. SELFIES places the guarantee in the representation, so it applies only once the model has emitted a complete string inside the SELFIES alphabet. The two pSELFIES drug responses that fail are the two ways that can go wrong: one never closes its molecule span, ending mid-repetition, and the other interjects a stray natural-language token into the middle of an otherwise well-formed SELFIES string, which the decoder then rejects. Neither is a failure of the SELFIES grammar, and neither is reachable for us, because we place the guarantee in the decoder. At each step, the logits processor admits only the rules that type-chain with the derivation so far and from which a complete derivation is still reachable inside the remaining budget, so an out-of-alphabet token carries no probability mass and a derivation that could not be finished is never entered. That is also what lets us layer a constraint SELFIES cannot express. The material check requires at least two wildcard attachment points, and we enforce that count during decoding. It is why our validity is 1.0001.000 on both halves.

The representation is nonetheless doing most of the work here: on the same backbone, the same training recipe and the same decoding budget, with only the molecular representation changed, the invalid share of drug responses falls from about 2% for the SMILES model to about 1% for SAFE and under 0.1% for pSELFIES. What is left after that is the difference between constraining the representation and constraining the decoder.

One caveat we will state in the caption: design BLEU-4 is not comparable across representations. The scorer tokenizes on punctuation, so the molecule span occupies 59.4% of pSELFIES's design text against 19.4% for a SMILES baseline and 12.0% for SAFE. The retrosynthesis columns are the informative ones.

AuthorsOpenReview ↗

Dear Reviewer bqqM (cont.)

[W3] "The +Encoder ablation roughly doubles BLEU-4 and raises ROUGE-L by more than half at every temperature, which is hard to reconcile with Sec. 7 summarizing it as a modest bump in textual coherence."

You read the table correctly and the summary was wrong, but the gap is an artifact of the erroneous Qwen3-8B (Base) row in Table 29 rather than an encoder effect. The Base row in your comparison came from a training run we have since identified as defective and retrained.

The defect is visible in the generated outputs and the Qwen3-8B (Base) row sticks out. Qwen3 is a reasoning model, and we found the checkpoint failed to converge and thus many responses failed to terminate its reasoning block: 64.3% of its drug responses open a <think> block and never close it, so they produced no answer text, hence the anomalous BLEU-4/ROGUE-L numbers. No other checkpoint used in that table behaves this way. After the retrain the unclosed rate is 7.0%.

Re-evaluated, the row moves, and the columns you are comparing move most:

columnprints nowre-evaluated
BLEU-40.1190.205
ROUGE-L0.2580.368
Material RS13.356.0
Drug RS26.128.8
Avg. MAE0.6580.648
Validity0.9990.999
Similarity0.1170.115

Against the corrected Base row, +Encoder's BLEU-4 of 0.220 is a small move from 0.205, and ROUGE-L likewise. So "modest" is the right description of the encoder's text effect after all; what was wrong was the baseline it was being measured against. We are correcting the Base row and keeping the Sec. 7 characterization. We apologize for the confusion.

Only the Base family is affected. The CRM numbers and every baseline row are unchanged, so the main-paper comparisons that do not involve the Base row stand as printed.

[W4] "Since learning the tokenizer and removing adapters are two of the three stated contributions, I cannot tell from the current experiments how much either one is actually responsible for the reported gains."

The two are separable, and we now have all four combinations. The design is a 2x2 grid: the learned tokenizer is either on or off, and the graph adapters are either on or off. Each cell isolates one of the two contributions by holding the other fixed.

With the adapters off throughout, learned tokenizer on vs off gives the heuristic-contraction ablations. All runs share one recipe, one decode configuration and a single matched training run.

runvaliditydrug RS %material RS %Avg. BAAvg. MAE
Ours (CRM, default)1.00046.774.70.5000.647
T3 atomic (lower bound)0.98917.338.70.5230.634
T4 frequency-greedy1.00043.954.70.5220.654
T5 size-matched1.00016.029.30.5100.667

So with the adapters held off, the learned tokenizer is worth roughly +30 points of drug RS over the atomic bound and +20 points of material RS over the stronger heuristic.

With the tokenizer held fixed, toggling only the adapters on and off is the +Encoder ablation. Once the Base row is corrected (W3), restoring the graph encoder moves the text metrics slightly and does not improve retrosynthesis -- its drug RS is 19.6 against the corrected Base row's 28.8 -- which is the basis for our claim that the adapters are not driving the result.

With our learned tokenizer, toggling the adapter on and off for the mCLM benchmark. T9 restores mCLM's per-block GNN adapter on top of our rule tokens, holding the backbone, the corpus, the checkpoint step and the decode configuration fixed, so the adapter is the only thing that differs from our adapter-free model. We report it on the mCLM drug-optimization task rather than on MolQA because mCLM is the baseline whose modality-specific component our design removes.

mean predicted-property improvementours, adapter-freeT9, adapter restored
N=84N{=}84, public predictor+57.83%+57.83\%+60.59%+60.59\%
N=122N{=}122, mCLM's oracle+43.32%+43.32\%+41.24%+41.24\%

The two settings produce different winners, and the overall comparison is too close to call. On the public N=84N{=}84 setup the adapter is ahead by 2.8 points; on the N=122N{=}122 setup it is behind by 2.1. There is no reliable effect from the adapter in either direction: it helps on one benchmark and costs on the other. This supports what we say about adapters in the paper, that they are not required. That is the contribution we can defend and it is a real one, because an adapter that is not necessary is not worth its training and inference cost.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.