Training Cell Encoders Across Simulated Sequencing "Codecs"

Speech models break when audio passes through a compression codec they never saw in training, and audio researchers handle this by treating each codec as a known, lossy transformation of a clean signal. Single-cell RNA sequencing has the same problem in a different guise. Each capture platform measures the same underlying cell through its own lossy channel. A droplet-based 3′ counting protocol and a full-length plate protocol differ in which transcripts they capture, how deep they sequence, how much ambient RNA leaks in, and how many genes drop out. Today these differences are removed after the fact, by a batch-correction step that must see every new dataset and must be refit each time. This approach has a documented failure mode: correction strong enough to merge platforms also flattens real biological variation within cell types.

We propose to borrow the cross-codec recipe directly. We write each sequencing platform as a parameterized "codec," a stochastic capture model that turns a cell's true expression profile into observed counts. We pass deep, high-quality profiles through many randomly drawn codecs. Then we train an encoder so that a cell degraded by any codec maps to the same representation as its clean version, while the structure among cells within a type is preserved. The claim to test is concrete. An encoder trained this way should embed cells from a platform held out of training without any query-time correction. It should match or beat transductive batch correction on cross-platform label transfer, and it should lose less within-cell-type variation. The decisive ablation is whether physically structured codec augmentation beats the generic random gene masking that current single-cell self-supervised learning already uses.

What Exists and What Is Missing

The literature linking these two directions is thin, and the closest work goes in a different direction. Two papers bring codec machinery into single-cell biology through vector quantization. CVQVAE uses a discrete codebook to align paired modalities (RNA, chromatin accessibility, surface protein) within one experiment. MetaQ quantizes cells into codebook "metacells" so that atlases can be summarized in linear time. Both borrow the quantizer from codec design, not the property we care about here, which is robustness to unseen channels. Neither is evaluated on transfer to a held-out sequencing platform. The most obvious combination at this intersection is to drop the normal-distribution codebook of NDVQ into one of these single-cell quantizers. NDVQ is a neural audio codec whose codebook entries carry learned variances to add safety margins between codes. We do not pursue that combination as the core idea. Codebook margins address noise at cluster boundaries within a fixed data distribution. They say nothing about generalizing to a channel the model has never seen, and that is what cross-codec work is actually about.

The motivating evidence comes from two places. The first is the multi-center reference study, A Comprehensive Multi-Center Cross-platform Benchmarking Study of Single-cell RNA Sequencing Using Reference Samples. It profiled the same two cell lines on 10X Chromium, Fluidigm C1, C1 HT and WaferGen at five sites. It found that platforms differ systematically in sensitivity, that limma and ComBat failed, and that CCA over-corrected until cancer and B-lymphoblastoid cells overlapped. The second is Benchmarking deep learning methods for biologically conserved single-cell integration. Across 16 VAE-based integration methods, it showed that standard mixing metrics reward erasing within-type variation. It introduced a correlation-preserving loss, Corr-MSE, that raised intra-cell-type conservation by 6.61% on average.

We reuse Corr-MSE as a constraint. The difference is that we apply it during inductive training against simulated channels, not during transductive integration of fixed batches. On the audio side, the method comes from two sources. Convolutional Neural Networks to Enhance Coded Speech trains on pairs of clean and coded speech, and its authors note that reaching peak performance usually requires a separate model per codec. Fast Steganalysis Method for VoIP Streams distills a teacher network into a small student. We combine the two ideas: the teacher sees the clean profile, and the student sees the codec output.

Core Mechanism

Let $x \in \mathbb{R}^{G}_{\ge 0}$ be a cell's relative transcript abundances over $G$ genes, estimated from a deep, full-length reference profile. A codec with parameters $c$ produces counts:

$$ y_g \sim \mathrm{NB}\big(\, d_c \cdot s_c(\ell_g, x_g)\, x_g + a_c\, \bar{x}_g ,\ \phi_c \big). $$

Here $d_c$ is sequencing depth and $s_c$ is a per-gene capture sensitivity that depends on transcript length $\ell_g$ and abundance. This term encodes the difference between 3′ counting and full-length capture, as well as low-abundance dropout. The term $a_c$ is the ambient contamination fraction, $\bar{x}$ is the ambient profile, and $\phi_c$ is the overdispersion parameter of the negative binomial (NB) count distribution.

Codec parameters are drawn from a broad prior. We fit the prior's ranges to the training platforms only, then widen it.

The encoder $f$ is trained with three terms. The first is a distillation term that pulls $f(y)$ toward a frozen teacher embedding of the clean $x$. The second is a contrastive term that makes two codec draws of the same cell agree. The third is Corr-MSE, which keeps the cell-to-cell correlation matrix within a minibatch close to the teacher's.

The codec model is deliberately simple. Its job is not to simulate platforms faithfully but to span the directions along which real platforms differ. We test this directly. We fit $c$ to each real held-out platform and report transfer performance as a function of how far that fit lies outside the training prior, much as cross-codec audio work separates near codecs from far ones.

Research Program

The work has three parts.

The first part builds and validates the codec family. On the reference study, we fit codec parameters per platform by moment matching on detected genes per cell, the mean–dropout relationship, and the gene-length dependence of detection. We then check whether degrading WaferGen or C1 full-length profiles through the fitted 10X codec reproduces 10X's marginal statistics.

The second part trains encoders. Clean sources are deep full-length profiles. The deep mouse and rat cells of Deep sequencing reveals cell-type-specific patterns of single-cell transcriptome variation, with more than 5 million exonic reads per cell, serve as a high-fidelity reference for checking the codec model. They are too few for training. Training uses the plate-based, full-length portions of the CELLxGENE corpus used by scGPT, along with Tabula Sapiens from scSSL-Bench. Wherever the platform annotation allows it, every platform family used for evaluation is held out entirely from training.

The third part evaluates transfer under a leave-one-platform-out protocol, with special attention to whether biological continua survive.

Baselines

The naive reference point is PCA on highly variable genes with no correction, embedding the held-out platform directly. scSSL-Bench reports PCA at a cell-typing F1 of about 0.07 against more than 0.80 for learned representations. That gap sets the floor for any learned method.

The first transductive baseline is Harmony, together with BBKNN and MNN. The reference study found that these preserved biological separation where CCA did not. They will be fit with the held-out platform included, which gives them access to query data that our encoder never sees. If our encoder matches them without that access, that counts as a result. Beating them means higher kNN label-transfer accuracy at equal or better within-cell-line structure preservation.

The second transductive baseline is the strongest deep integration recipe in the file: an scVI-family model trained with the Corr-MSE loss of Yi et al., given the same gene set and the same training budget. This is the closest competitor in spirit, because it already protects within-type variation. Beating it inductively is the main bar.

The foundation-model baseline is scGPT, used both zero-shot and fine-tuned on the same training cells. scGPT reports AvgBIO up to 0.924, AvgBATCH up to 0.975, and multiple sclerosis annotation accuracy of 0.856 on its own benchmarks. We found no reported result on Lacuna for scGPT, Harmony or any of the other baselines as numeric scores on the HCC1395/HCC1395BL cross-platform benchmark. That benchmark reports only qualitative over-correction findings, so all numbers on it will be produced here under one protocol.

The key ablation uses the same encoder, loss and compute, and replaces codec augmentation with random 20% gene masking. scSSL-Bench reports this as the best augmentation across tasks, and it is used there in VICReg. VICReg reaches F1 above 0.80 on cell typing. A second ablation removes the clean teacher, so the remaining difference isolates the contribution of privileged clean profiles. A third ablation removes Corr-MSE, which isolates over-correction. All methods receive the same tuning budget, measured in validation runs, on training platforms only.

Why not just…?

Why not just use random gene masking, which scSSL-Bench already found optimal? This is the most serious threat. Masking already mimics dropout, which is a large part of platform differences. Our bet is that masking misses the structured parts of the channel: dropout that depends on gene length and abundance, depth shifts, and ambient contamination. These are the parts that differ between 3′ and full-length protocols. The matched ablation settles the question. If masking at tuned strength equals codec augmentation on held-out platforms, the claim fails and we will report it.

Why not just run Harmony or scVI with Corr-MSE on each new dataset? They work transductively and the reference study shows Harmony behaves well. They require refitting whenever data arrive. Their output depends on which datasets are co-integrated. They expose the user to the over-correction trade-off that Yi et al. document. An inductive encoder that matches them without seeing the query would be useful by itself. If they clearly win, the result shows how much query-time adaptation is worth.

Why not just scale a foundation model? Assessing Scale and Predictive Diversity in Models for Single-Cell Transcriptomics based on Geneformer found that going from 1M to 30M cells did not improve zero-shot batch mitigation. scSSL-Bench found that generic self-supervised methods often match or beat specialized single-cell models. Scale alone therefore does not appear to teach channel invariance. Our scGPT comparison tests this on held-out platforms specifically.

Why not just select platform-invariant genes? The cross-codec emotion recognition work of Albin et al. generalized by keeping only compression-robust features, and the single-cell analog would be a gene subset whose detection is stable across platforms. This is cheap, and we include it as a baseline: genes ranked by cross-platform detection stability on the training platforms. Its likely weakness is that it discards the low-abundance genes that full-length platforms capture well, and these genes often mark rare or intermediate states.

Why not just add NDVQ-style codebooks to MetaQ or CVQVAE? Margins in a quantized space may help stability, and we can try them as an encoder variant. They do not supply what is missing here, which is exposure to the space of channels. Without that exposure there is no reason to expect generalization to unseen platforms.

Proposed Experiments and Decisive Checks

The primary experiment uses leave-one-platform-out evaluation on the HCC1395/HCC1395BL reference data. For each of the four platforms, the encoder is trained without that platform's family. Held-out cells are then embedded and labelled by kNN against cells from the other platforms.

We report four quantities: cell-line transfer accuracy; mixing of platforms within each cell line; preservation of within-line structure, measured as correlation of cell-cycle and expression-program scores against within-platform embeddings; and the CCA-style failure check of whether the two lines stay separated. Cell-line identity is easy, so the within-line structure measures carry most of the weight.

The second check targets continua. We use the dorsal striatum data of Diversity of Interneurons in the Dorsal Striatum Revealed by Single-Cell RNA Sequencing and PatchSeq, which span STRT-seq-2i and C1-STRT. We train with one platform held out and ask whether the Pvalb gradient within the Pthlh population survives in the held-out embedding. Survival is measured as the rank correlation between embedding position and Pvalb expression. An encoder that invents invariance by collapsing states will fail this test even if it mixes platforms well.

The third check uses atlas scale. We use scSSL-Bench's cell-typing protocol on Tabula Sapiens, holding out technologies where the metadata records them, and compare against its reported VICReg and scGPT levels.

Across all three, the result that would confirm the idea has three parts. First, codec augmentation beats masked augmentation on held-out platforms. Second, it matches transductive Corr-MSE integration without query access. Third, the benefit shrinks smoothly as the held-out platform's fitted codec moves outside the training prior. If the benefit does not shrink this way, the gains are probably not coming from the codec model at all.