Run this model with HF Jobs

Run google/cellgemma-e4b on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/google/cellgemma-e4b. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/google/cellgemma-e4b on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/google/cellgemma-e4b. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/google/cellgemma-e4b. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

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.

Thanks @emailfrom ! Quick v2.1 update (+128 calibration runs, 900 total) narrowing down both mechanisms, with summary figures now in the repo:

  1. SMILES fragility extends to atom traversal order within valid lowercase aromatic RDKit SMILES (16 × 16 FDA oncology panel, A549 Tahoe):
    • Named (Name + RDKit) ↔ Blinded RDKit SMILES: 16/16 Top-1 (AUROC 1.000, cos +0.938)
    • Named ↔ Name-Only (no SMILES): 0/16 Top-1 (AUROC 0.556, cos +0.194)
    • Blinded RDKit ↔ Blinded Kekulé (PubChem / EmeraldBay default): 7/16 Top-1 (AUROC 0.761, cos +0.364)
    • Blinded RDKit ↔ Blinded Random-Atom-Order Aromatic (Chem.MolToRandomSmilesVect): 3/16 Top-1 (AUROC 0.562, cos +0.214)

CellGemma SMILES Fragility

  1. Stage-2 ExpressionDecoder sign inversion also occurs on normal natural-EOS runs and short outputs (not only 8,192-token caps):
    • Across the 601 / 772 runs that stopped cleanly before 8,192 tokens (using the official {0, 1} README reconstruct() code), 50.8% of +GENE tokens decode < 0 and 31.9% of -GENE tokens decode > 0 (24.1% of |residual| L1 mass inverted; 58.7% on short 256-token Norman outputs where N ≈ 64 sits well below bn0.running_mean[2:4] = (454.1, 428.7)).

Stage-2 ExpressionDecoder Sign Inversion and Norman Sign-Clamp Recovery

Both figures and all tables reproduce directly from the raw outputs (<1s, Python 3 stdlib): https://github.com/dsugurtuna/cellgemma-chemistry-bench

Thanks for the v2.1 update, and for taking the total to 900 runs. The atom-order result sharpens the SMILES point for us: named and blinded RDKit stay at 16/16 Top-1, while random atom order drops to 3/16, so traversal order alone moves the prediction. The clean-stop check matters too — sign inversion across the 601 runs that stopped before 8,192 tokens, with 50.8% of +GENE tokens decoding below zero, shows the decoder issue is not only a tail-cap effect. Figures that reproduce from the raw outputs in under a second make both claims easy to verify.

Sign up or log in to comment