Model architecture · CellGemma

How CellGemma works: residual prediction and decoding

CellGemma does not predict an entire perturbed cell profile from scratch. It learns a residual response around an empirical reference.

Why predict a residual?

An average calculated across several cells can already summarize a substantial part of a perturbation response. If a model has to relearn that shared response, it also spends capacity reconstructing information present in the observations. CellGemma therefore receives an empirical reference and learns the component that deviates from that average.

ypert ≈ max(0, xctrl + Δ̄) + δresxctrl: control cell · Δ̄: empirical response prior · δres: model-predicted residual response

This decomposition is a modeling strategy, not a guarantee that the mean is available or representative in every new context. The source and calculation of the prior are part of the protocol to document.

From a cell profile to a gene sequence

The starting profile is converted into an ordered “cell sentence” based on gene expression. The model receives this context, a perturbation descriptor and a biological prior. It then generates a signed sequence of differentially expressed genes: +GENE for a predicted increase and −GENE for a predicted decrease relative to the chosen reference.

The vocabulary adds 19,881 tokens dedicated to protein-coding genes. This avoids splitting gene symbols into generic text units and makes the sequence more compact. The report describes roughly two-fold compression compared with a subword representation of these symbols.

Describe the perturbation and biological context

The descriptor depends on the perturbation type. A small molecule can be represented by its SMILES string. For a genetic target or cytokine, the authors use functional relations from a biological network to provide informative context around the target.

In the described methods, the STRING network is used to retrieve up to 20 interaction partners, with a high-confidence threshold and a more permissive threshold for less-documented targets. These relations are converted into short structured statements for the prompt. They provide known context, but do not prove that every relation is active in the cell type being tested.

ExpressionDecoder: from gene ranks to values

The generated sequence selects and orders genes, but it is not yet a continuous expression profile. A dataset-specific expression decoder reconstructs expression levels and log-fold changes. The report describes a lightweight decoder with an asymmetric weighted loss that penalizes overestimation of effect magnitude more heavily.

The decoder must match the target representation and assay. Changing the assay, normalization or profile type can change how reconstructed values should be interpreted. Gene-ranking accuracy and effect-size accuracy should therefore be analyzed separately.

Model parameters and resources

CellGemma uses the Gemma 4 E4B architecture. The report describes 8 billion parameters in total and 4.5 billion effective parameters. The Hugging Face repository card lists the Apache 2.0 license for the resources it distributes. Consult the current repository and documentation for versions, dependencies, weights and terms of use.

Official Hugging Face model card ↗ · Official inference guide ↗.

Pipeline at a glance

  1. Choose a control cell and context compatible with the assay.
  2. Order the profile, describe the perturbation and retrieve the empirical prior.
  3. Ask the model to generate a signed sequence of residual responses.
  4. Apply the ExpressionDecoder associated with the dataset.
  5. Compare outputs with replicates and baselines, then test hypotheses experimentally.

Data, prior and decoder availability are part of the scientific pipeline. The model weights alone do not reproduce the full method.

Explore

CellGemma mind map

Open a branch, then select a page in the guide.

Drag to pan · zoom with buttons or two-finger pinch · use Tab and Enter on a keyboard

Branches open indexable pages about the paper, its methods and findings.