scVI (Single-cell Variational Inference) is a deep generative model that combines a variational autoencoder with a zero-inflated negative binomial (ZINB) distribution to probabilistically model single-cell RNA sequencing data. It explicitly treats batch effects as a learned latent variable, enabling the simultaneous normalization, imputation, and visualization of scRNA-seq data without assuming linear corrections.
Glossary
scVI (Single-cell Variational Inference)

What is scVI (Single-cell Variational Inference)?
scVI is a deep generative model that uses a variational autoencoder to model single-cell RNA-seq data with a zero-inflated negative binomial distribution, explicitly accounting for batch effects as a latent variable for probabilistic normalization.
Unlike linear methods such as ComBat, scVI learns a non-linear, probabilistic mapping of gene expression to a low-dimensional latent space that captures biological variability while conditioning out technical artifacts. The model estimates library size and batch-specific scaling factors as part of its generative process, producing denoised, batch-corrected expression estimates that preserve the inherent uncertainty and zero-inflation characteristic of single-cell data.
Core Characteristics of scVI
scVI (Single-cell Variational Inference) is a deep generative model that uses a variational autoencoder with a zero-inflated negative binomial distribution to model single-cell RNA-seq data, explicitly treating batch effects as a latent variable for probabilistic normalization.
Zero-Inflated Negative Binomial (ZINB) Likelihood
scVI models raw UMI counts directly using a ZINB distribution, which explicitly accounts for two key properties of scRNA-seq data: overdispersion (variance exceeding the mean) and zero-inflation (an excess of zero counts due to dropout events).
- The ZINB is parameterized by three outputs from the decoder: mean expression (μ), gene-specific dispersion (r), and a dropout probability (π)
- This avoids the need for arbitrary log-transformations or pseudocount additions that distort the data distribution
- The model learns that a zero count can arise from either true biological absence or technical dropout, preserving biological signals
Latent Variable Batch Correction
Batch effects are modeled as a latent variable within the variational autoencoder framework, allowing scVI to learn a batch-agnostic representation of cell state.
- A one-hot encoded batch identifier is provided as an input to the decoder alongside the latent cell representation
- The encoder learns to produce a latent space that captures biological variation only, while the decoder uses the batch ID to reconstruct batch-specific technical artifacts
- This design enables probabilistic batch correction where uncertainty is propagated rather than producing a single point estimate
Library Size Normalization
scVI handles varying sequencing depths through an explicit library size factor that is modeled as an observed random variable.
- The model conditions on the log-transformed total UMI count per cell, treating it as a known covariate
- This separates technical variation in total counts from genuine biological differences in gene expression proportions
- The approach is more robust than global scaling methods like CPM normalization because it is integrated into the probabilistic generative process
Amortized Variational Inference
scVI uses amortized inference through a shared encoder neural network, enabling rapid posterior approximation for thousands of cells without per-cell optimization.
- The encoder maps each cell's gene expression vector to the parameters of a Gaussian posterior distribution over the latent space
- This is computationally efficient: once trained, new cells can be embedded with a single forward pass
- The reparameterization trick enables gradient-based optimization of the evidence lower bound (ELBO) using stochastic gradient descent
Differential Expression with Uncertainty
scVI provides a Bayesian framework for differential expression testing that accounts for both biological variability and technical uncertainty.
- Posterior samples are drawn from the latent space to generate multiple plausible expression estimates for each gene in each condition
- A Bayes factor or log-fold change distribution is computed, providing a measure of statistical confidence
- This approach naturally handles the zero-inflated nature of the data without relying on ad-hoc pseudocounts or arbitrary detection thresholds
Scalable Training with minibatches
scVI is trained using minibatch stochastic variational inference, allowing it to scale to datasets with millions of cells.
- The training procedure subsamples cells and genes at each iteration, keeping memory requirements constant regardless of dataset size
- This enables the model to be applied to atlas-scale integration projects such as the Human Cell Atlas
- The architecture supports GPU acceleration, with training times scaling sub-linearly with the number of cells
Frequently Asked Questions
Clear, technically precise answers to the most common questions about the scVI probabilistic framework for single-cell data normalization and analysis.
scVI (single-cell Variational Inference) is a deep generative model that uses a variational autoencoder (VAE) architecture to model single-cell RNA-seq data. It explicitly represents the observed gene expression counts as being drawn from a zero-inflated negative binomial (ZINB) distribution, which naturally accounts for the overdispersion and dropout events characteristic of scRNA-seq data. The model learns a low-dimensional latent representation of each cell that captures true biological heterogeneity. Critically, scVI treats batch identifiers as a latent variable within the decoder, conditioning the reconstructed gene expression on both the biological latent code and the batch assignment. This forces the encoder to learn a batch-invariant representation of cell state, achieving probabilistic normalization without the need for a separate, post-hoc correction step. Training proceeds via stochastic variational inference, maximizing the evidence lower bound (ELBO).
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Understanding scVI requires familiarity with the probabilistic and architectural components that underpin its batch-aware, generative approach to single-cell data normalization.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us