Two silent inference pitfalls (PubChem/EmeraldBay Kekulé SMILES & 8,192-token Stage-2 tail flips) + 772-run benchmark

#9
by Apparro - opened

Sharing three reproducible inference findings across 772 bfloat16 runs at max_new_tokens = 8,192 that may be useful to document in the model card's Best Practices:

  1. PubChem / EmeraldBay Kekulé SMILES vs. RDKit Aromatic SMILES (p = 0.0078): Passing uppercase Kekulé SMILES (C1=CC=CC=C1 — the default in PubChem and tahoebio/EmeraldBay's drug_metadata.parquet) instead of RDKit canonical aromatic SMILES (c1ccccc1) silently rotates or collapses Stage-1 predictions for the exact same molecule across 8/8 tested aromatic drugs (mean within-format cosine = +0.726 vs. cross-format = +0.276; e.g., Panobinostat +0.297, NVP-BHG712 +0.239, Sotorasib +0.065, Menadione +0.006). Canonicalizing via Chem.MolToSmiles(Chem.MolFromSmiles(s), isomericSmiles=True, canonical=True) restores expected behavior (lifting matched A549 Hederagenin GSE186218 to #1 / 29 against decoys and tahoe_mean_delta_global).
  2. 8,192-Token Cap Without EOS & Stage-2 Tail Sign Flips (Norman 2019, n = 131 pairs): 15.1% (tahoe), 21.8% (norman), and 29.3% (emeraldbay 2-drug combos) reach 8,192 tokens without <eos>/<turn|>. At ~4,000 emitted genes, ExpressionDecoder extrapolates past its training rank range and assigns positive deltas up to +0.601 to downregulated -GENE tokens; enforcing a 1-line sign clamp (+GENE >= 0, -GENE <= 0) lifts Norman 2019 (k = 3, S = 12,441) all-gene Pearson Δ from +0.5016 to +0.5560 (+0.5811 when capped at <= 256 tokens).
  3. Drug-Pair Prompt Order (EmeraldBay, n = 20 clinical 2-drug regimens): At T = 0.7, reversing [Drug A, Drug B] to [Drug B, Drug A] drops residual cosine from +0.594 to +0.408 (p = 2.67e-5, e.g., Trifluridine + Tipiracil: +0.647 vs. +0.166), while post-hoc 0.5 * (AB + BA) averaging improves Norman wet-lab Pearson Δ (+0.5016 -> +0.5325).

All 772 raw outputs and a <1s zero-dependency Python 3 stdlib verifier (Apache-2.0): https://github.com/dsugurtuna/cellgemma-chemistry-bench

Thanks for the 772-run benchmark, and for isolating the format issue so cleanly. The Kekulé versus aromatic SMILES result is the one that stays with us: the same molecule, a within-format cosine of +0.726 against +0.276 cross-format, with canonicalizing restoring the expected behaviour. Silent input-format effects like that are exactly what field reports catch and model cards rarely do. The 8,192-token tail sign flips matter for the same reason, and the sign clamp lifting Norman 2019 Pearson Δ from +0.5016 to +0.5560 gives a concrete check others can rerun. We also noted the drug-pair order effect. Useful data, clearly reported.

Sign up or log in to comment