CellGemma-E4B: 4.5B Effective Parameter Single-Cell Perturbation Model Guide

CellGemma-E4B (google/cellgemma-e4b, Apache 2.0) is Google DeepMind’s lightweight open foundation model built on Gemma 4 E4B for predicting single-cell transcriptional responses to small-molecule drugs, cytokines, and CRISPR perturbations. With 8B total parameters (4.5B effective via Per-Layer Embeddings) and 20K dedicated human gene tokens, it runs on a single workstation GPU and outperforms population mean-shift baselines across all 32 evaluation splits.
CellGemma-E4B: 4.5B Effective Parameter Single-Cell Perturbation Model Guide: CellGemma-E4B (google/cellgemma-e4b, Apache 2.0) is Google DeepMind’s lightweight open foundation model built on Gemma 4 E4B for predicting single-cell transcriptional responses to small-molecule drugs, cytokines, and CRISPR perturbations. With 8B total parameters (4.5B effective via Per-Layer Embeddings) and 20K dedicated human gene tokens, it runs on a single workstation GPU and outperforms population mean-shift baselines across all 32 evaluation splits. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- 4.5B Effective Workstation Footprint: Built on Gemma 4 E4B (8B total with PLE lookup tables, 42 layers, 512 sliding window, 16K context), running privately on one GPU.
- 20K Whole-Gene Token Vocabulary: Expands the Gemma 4 tokenizer to 282K tokens so every human protein-coding gene encodes as a single atomic token.
- Mean-Shift Residual Prediction: Focuses capacity on true treatment-specific +GENE/-GENE shifts rather than wasting tokens on unchanged housekeeping genes.
- Lab-Verified Oncology Discovery: Screened 20K genes and 15K drugs virtually to identify compounds that upregulate GPNMB and sensitize resistant tumor cells to CAR T therapy.
import { createAgent } from '@smoke-monkey/harness';// Orchestrate CellGemma-E4B virtual drug & CRISPR perturbation screens locallyconst bioAgent = createAgent({agentId: 'cellgemma-perturbation-screener',provider: 'openai-compatible',model: 'google/cellgemma-e4b',baseUrl: 'http://127.0.0.1:8000/v1',workspacePath: process.cwd(),permissions: {read_file: 'allow',write_file: 'allow',run_command: 'ask',},mcpServers: {filesystem: {command: 'npx',args: ['-y', '@modelcontextprotocol/server-filesystem', process.cwd()],},},});async function runVirtualScreen() {const result = await bioAgent.run('Execute ./scripts/run_cellgemma_screen.py against the Tahoe and Norman decoders, rank top compounds upregulating GPNMB residual expression, and write summary CSV to ./results/gpnmb_candidates.csv.');console.log('Virtual perturbation screen complete:', result.summary);}runVirtualScreen().catch(console.error);
Watch: Related Video Guides
CellGemma: Simulating how cells respond to drugs
AlphaGenome 2: Teaching AI to read the entire human genome
CellGemma-E4B Architecture: Per-Layer Embeddings & 20K Whole-Gene Tokens
CellGemma-E4B (google/cellgemma-e4b, released Dec 1, 2026 under Apache 2.0) adapts Gemma 4 E4B (gemma-4-E4B-it) for non-conversational single-cell transcriptomics. Pre-trained on 564 million+ cell states from scBaseCount, HCA, and CellxGene and fine-tuned across 10 perturbation datasets, it avoids subword fragmentation of gene names by adding 20,000 whole human protein-coding gene symbols directly into a 282K tokenizer vocabulary.
| Specification / Benchmark Split | Value / Metric | Details / Baseline Comparison |
|---|---|---|
| Base Architecture | Gemma 4 E4B (Dense) | 8B total params with PLE; `4.5B` effective active params |
| Attention & Context | 42 Layers, 512 Sliding Window | 16K context length, unified global K/V, Proportional RoPE (p-RoPE) |
| Tahoe (Unseen Pert./Cell) | 0.76 ± 0.01 Pearson Δ | Beats Mean-Shift baseline (0.56 ± 0.02) |
| Tahoe (Unseen Mechanism) | 0.56 ± 0.01 Pearson Δ | Beats Mean-Shift baseline (0.30 ± 0.02) |
| Norman (Both Genes Seen) | 0.74 ± 0.02 Pearson Δ | Beats Mean-Shift baseline (0.53 ± 0.05) |
| TISCH (Cross-Study Clinical) | 0.28 ± 0.02 Pearson Δ | 5.6x higher signal than Mean-Shift (0.05 ± 0.01) |
Two-Stage Residual Prediction & Pretrained ExpressionDecoders
Predicting raw post-perturbation gene counts wastes model capacity on generic cellular stress and housekeeping genes. CellGemma predicts only the residual relative to a dataset-wide mean-shift baseline:
- Stage 1 (`CellGemma`): Consumes a preamble, perturbation metadata (e.g., drug name, SMILES string, and concentration), the baseline cell’s top 1,000 expressed genes (
Source:), and the mean-shift ranking (Mean Global prediction:), emitting ranked residual differentially expressed genes (+GENE/-GENE). - Stage 2 (`ExpressionDecoder`): Lightweight dataset-specific MLP decoders stored under
decoders/<dataset>/convert Stage 1 rankings and baseline control expression into non-negative continuous expression and log-fold change (LFC) vectors via an ELU-scaled exponential clamp. Pretrained decoders ship for small molecules (tahoe,l1000,emeraldbay,sciplex), CRISPR (nadig/replogle,vcc,norman), and cytokines/clinical (parse,dong,tisch).
Non-Conversational Prompt Format Required
CellGemma-E4B is fine-tuned strictly on structured Source: and Mean Global prediction: cell-sentence prompts rather than chat templates. Sending conversational instructions without the exact preamble and dataset mean_delta_global.json degrades Pearson Δ.
Reproducible CellGemma-E4B + ExpressionDecoder Inference Setup
Because CellGemma-E4B uses bfloat16 weights with 4.5B effective parameters, it executes locally on a single workstation GPU (e.g., 16–24 GB VRAM) using standard transformers and safetensors.
# Install CellGemma inference dependencies
pip install -U transformers torch accelerate safetensors huggingface_hubimport json, torch, safetensors.torch
from huggingface_hub import hf_hub_download
from transformers import AutoModelForCausalLM, AutoTokenizer
MODEL_ID = "google/cellgemma-e4b"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForCausalLM.from_pretrained(
MODEL_ID, device_map="auto", dtype=torch.bfloat16
).eval()
# Load dataset-specific ExpressionDecoder config & global mean deltas (e.g., tahoe, norman)
cfg_path = hf_hub_download(MODEL_ID, "decoders/tahoe/config.json")
with open(cfg_path, encoding="utf-8") as f:
decoder_cfg = json.load(f)
print("Loaded Tahoe ExpressionDecoder:", decoder_cfg)When paired with Smoke Monkey Harness and DeepMind Paper Finder, bio-AI pipelines can screen thousands of candidate molecules offline and cross-reference prioritized targets against peer-reviewed oncology literature.
Frequently Asked Questions
Q:Why does CellGemma-E4B list 8B total parameters and 4.5B effective parameters?
Gemma 4 E4B uses Per-Layer Embeddings (PLE), where large per-layer embedding lookup tables expand total parameter count to 8B while keeping active per-token compute at 4.5B effective parameters for fast single-GPU inference.
Q:Why did Google DeepMind add 20,000 gene tokens to CellGemma?
Standard BPE tokenizers split unfamiliar gene symbols into multiple subwords, inflating sequence length and blurring gene identity. Dedicated whole-gene tokens (282K total vocabulary) let CellGemma encode a 1,000-gene baseline cell compactly inside its 16K context.
Q:What datasets and perturbation modalities are included in CellGemma-E4B?
The Hugging Face repository includes pretrained ExpressionDecoders for 10 benchmarks across small-molecule drugs (tahoe, l1000, emeraldbay, sciplex), single/combinatorial CRISPR (nadig/replogle, vcc, norman), and cytokines/clinical tumors (parse, dong, tisch).
Q:Can CellGemma-E4B run privately on local hardware without cloud APIs?
Yes. Released under the Apache 2.0 license, google/cellgemma-e4b runs in bfloat16 on a single modern workstation GPU with zero external network calls.
Q:What did CellGemma validate in wet-lab oncology experiments?
After virtually screening ~20,000 human genes and 15,000 drugs, CellGemma prioritized candidate compounds predicted to raise GPNMB surface expression on resistant thyroid cancer cells—pretreatment enabled human GPNMB CAR T cells to eliminate previously unresponsive tumor cells.
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.