Inferensys

Glossary

Sequence Log-Likelihood

The log-transformed probability assigned to a genomic sequence by an autoregressive model, quantifying how well the sequence conforms to learned patterns of natural DNA for constraint and pathogenicity scoring.
ML engineer managing model versions on laptop, version history visible, technical Git-like workflow.
PROBABILISTIC SEQUENCE SCORING

What is Sequence Log-Likelihood?

A core metric in autoregressive genomic language models that quantifies how well a DNA sequence conforms to learned biological patterns.

Sequence log-likelihood is the logarithm of the probability assigned to a genomic sequence by an autoregressive model, computed as the sum of log-probabilities for each nucleotide given its preceding context. It serves as a quantitative measure of how well a sequence conforms to the learned patterns of natural DNA, with higher values indicating greater conformity to the training distribution.

In genomic analysis, this metric underpins zero-shot variant effect prediction by comparing log-likelihoods between reference and alternate alleles—a drop in likelihood signals a potentially pathogenic mutation. It also enables evolutionary constraint scoring and synthetic sequence quality assessment without requiring labeled training data for each specific task.

PROBABILISTIC SEQUENCE EVALUATION

Key Characteristics of Sequence Log-Likelihood

Sequence log-likelihood is the core metric for evaluating how well a genomic sequence conforms to the patterns learned by an autoregressive model. It serves as a quantitative bridge between raw nucleotide strings and functional biological insight.

01

Autoregressive Probability Decomposition

The model decomposes the joint probability of a sequence using the chain rule: log P(x) = Σ log P(xᵢ | x<ᵢ). Each nucleotide is predicted based solely on its preceding context. A higher log-likelihood indicates the sequence is a better fit to the training distribution of natural DNA.

  • Unidirectional context: Only left-to-right (5' to 3') dependencies are modeled
  • Token-level scoring: Probability is computed incrementally at each position
  • Normalization: Log-space computation prevents numerical underflow for long sequences
02

Constraint and Conservation Scoring

Log-likelihood serves as a direct measure of evolutionary constraint. Functional genomic elements under purifying selection exhibit higher likelihood scores because they match the patterns the model learned from conserved regions across the genome.

  • Coding exons typically score higher than intergenic regions
  • Promoters and enhancers show elevated likelihood due to motif conservation
  • Sharp drops in likelihood often indicate loss-of-function mutations
03

Variant Effect Computation

The functional impact of a genetic variant is quantified as the log-likelihood ratio (LLR) between the reference and alternate alleles: LLR = log P(x_ref) - log P(x_alt). A positive LLR indicates the variant disrupts the learned sequence patterns and is likely deleterious.

  • Zero-shot capability: No labeled variant data required
  • Context-aware: The model considers flanking sequence context
  • Strand symmetry: Scores are typically averaged across both DNA strands
04

Perplexity as a Derived Metric

Perplexity is the exponentiated average negative log-likelihood: PPL = exp(-1/N Σ log P(xᵢ)). It represents the model's effective branching factor—how many equally likely choices the model faces at each position. Lower perplexity indicates stronger predictive confidence.

  • Intuitive scale: Perplexity of 4 means the model is as uncertain as a uniform choice among 4 nucleotides
  • Length normalization: Enables comparison across sequences of different lengths
  • Benchmark standard: Primary metric for evaluating genomic language model performance
05

In-Silico Mutagenesis Foundation

Log-likelihood enables computational saturation mutagenesis—systematically substituting every position with all possible nucleotides and measuring the likelihood change. Positions where substitutions cause large likelihood drops are predicted to be functionally critical.

  • Nucleotide resolution: Identifies individual base pairs critical for function
  • Scalable screening: Computationally evaluates all possible single-nucleotide variants
  • Motif discovery: Clusters of sensitive positions often correspond to transcription factor binding sites
06

Anomaly Detection in Genomic Sequences

Sequences with abnormally low log-likelihood relative to a background distribution are flagged as statistical outliers. This principle is applied to detect sequencing artifacts, contamination, horizontal gene transfer events, and pathogenic insertions.

  • Quality control: Identifies low-quality or misassembled genomic regions
  • Pathogen detection: Foreign DNA often deviates from host genomic patterns
  • Synthetic construct identification: Engineered sequences may violate natural k-mer frequencies
SEQUENCE LOG-LIKELIHOOD

Frequently Asked Questions

Answers to common questions about how autoregressive genomic models assign probability scores to DNA sequences and how these scores are used to measure evolutionary constraint and predict variant effects.

Sequence log-likelihood is the natural logarithm of the probability that an autoregressive genomic language model assigns to a specific DNA sequence, quantifying how well the sequence conforms to the model's learned distribution of natural genomic patterns. The model decomposes the joint probability of a sequence into a product of conditional probabilities, where each nucleotide or token is predicted given all preceding context: P(x) = ∏ P(x_i | x_{<i}). Taking the logarithm converts this product into a sum of log-probabilities, yielding a numerically stable score where higher values indicate sequences that are more 'typical' according to the model's training distribution. This metric serves as a foundational tool for variant effect prediction, evolutionary constraint scoring, and synthetic sequence evaluation, as it provides a principled probabilistic framework for assessing how mutations alter a sequence's conformity to learned regulatory grammar.

Prasad Kumkar

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.