﻿# scGPT input pairs gene identity with a separately transformed expression value

Keep scGPT gene vocabulary, expression matrix columns, preprocessing layers, and zero/missing/padding semantics aligned when constructing single-cell inputs.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-scgpt-gene-vocabulary-expression-value-pair/
Language: en

## A cell is not ordinary text with gene names

A single-cell inference pipeline may turn matrix columns into a sequence of gene tokens and feed associated expression values alongside them. Sorting the names independently from the values breaks the input while leaving both tensors well formed. The model receives valid identifiers attached to the wrong measurements.

The [scGPT workflow](https://raw.githubusercontent.com/bowang-lab/scGPT/main/README.md) introduces a specialized single-cell model interface. Preserve the joint gene/value representation rather than flattening it into a natural-language prompt.

## Vocabulary identity differs from matrix position

The [gene tokenizer](https://raw.githubusercontent.com/bowang-lab/scGPT/main/scgpt/tokenizer/gene_tokenizer.py) defines vocabulary operations for gene identifiers. A source matrix column number is not automatically a model vocabulary index. Map identifiers through the matching vocabulary and apply the same selection and ordering to expression values.

Record identifier conversion and filtering decisions. If a source gene is absent from the vocabulary, retain that fact instead of silently assigning it another known gene. A default token does not establish biological equivalence.

## Expression preprocessing defines the numeric input

The [preprocessor](https://raw.githubusercontent.com/bowang-lab/scGPT/main/scgpt/preprocess.py) exposes normalization, transformation, and binning choices. A value from a raw-count layer and a value from a binned layer are different model inputs even if both fit inside a numeric tensor.

Keep the selected matrix layer and resolved preprocessing configuration with the checkpoint. Reapplying a transformation to already transformed data can produce plausible numbers under the wrong convention, so inspect source provenance before running the preparation path.

## Zero, missing feature, and padding are different

A measured expression value of zero is not the same observation as a gene unavailable in the source assay. Padding positions introduced for batching have another computational role. Collapsing these categories can change the representation of the cell.

The [tensor-axis guide](/journal/tensor-axes-batch-sequence-hidden/) helps distinguish feature identity from batch layout. Define masking and retained-gene policy explicitly for the selected workflow rather than inferring them from a tensor value alone.

## Audit gene-value correspondence on inspected cells

Create a preparation report that traces selected source columns to gene tokens and transformed values. Verify the same cell alone and within a padded batch under the intended inference configuration.

The [artifact validation guide](/journal/safetensors-artifact-validation/) motivates storing vocabulary and preprocessing sidecars together. This establishes computational input consistency; a cell embedding or predicted label still needs task-specific scientific validation and should not be presented as an independently verified biological observation.
