UncertainGen: Scalable Uncertainty-Aware Representation Learning of DNA Sequences

Abdulkadir Celikkanat, Andres R Masegosa, Mads Albertsen, Thomas Dyhre NielsenNeurIPS 2026

TL;DR

When sequencing a scoop of soil or ocean water, we get millions of shredded DNA fragments from thousands of microbes—and some of those fragments look identical or are literally shared across species. Standard AI models force each fragment into a single, rigid point in mathematical space, creating geometric traffic jams for ambiguous DNA. UncertainGen maps DNA sequences to probability clouds instead of points, outperforming massive genomic language models at sorting microbial DNA while using orders of magnitude fewer parameters.

What Problem Does This Paper Address?

Imagine throwing a thousand different jigsaw puzzles into a blender, scooping out a handful of confetti, and trying to sort the pieces back into their original boxes—without knowing how many boxes there were to begin with. That is metagenomic binning: grouping fragmented DNA reads from an environmental sample by their species of origin.

To do this, algorithms convert DNA strings into numerical vectors (embeddings)—either by counting short substrings of length $k$ ($k$-mers) or by feeding raw DNA into massive genomic Large Language Models (LLMs)—and then cluster those vectors.

Here is the catch: existing methods are deterministic. Every DNA fragment gets mapped to one exact coordinate. Biology, however, is messy. Microbes swap genes constantly (horizontal gene transfer), meaning the exact same DNA sequence genuinely belongs to multiple species. Furthermore, distinct sequences can accidentally share identical $k$-mer counts. When contrastive learning tries to pull an ambiguous fragment toward two separated species clusters simultaneously, geometry loses: the point gets stranded in no-man's-land between them.

Figure 1: Illustration of the metagenomic binning process. Starting from a set of DNA sequences (a), the process ends with their two-dimensional embeddings derived from 2-mer profiles (d). In general, these embeddings allow the DNA fragments from two different species to be correctly clustered. However, the second and third DNA sequences in (a) pose an exception: although distinct, their k-mer representations shown in (c) are highly similar and, consequently, their embeddings are also very close (shown as the two empty circled points in (d)). Because the k-mer profiles of DNA within a species tend to be (locally) similar, the contrastive learning procedure attempts to position such fragments in both clusters, but, since this is not possible, ultimately places them between them.

Methods

UncertainGen keeps the lightweight speed of $k$-mer inputs rather than using heavy sequence transformers, but upgrades the geometry from fixed points to multivariate Gaussian distributions.

  • What’s standard: Following self-supervised contrastive learning, each DNA sequence is chopped in half to create a "positive pair" (guaranteed same species), while random sequence pairings form "negative pairs" (likely different species).
  • What’s new: Instead of one encoder, UncertainGen uses two tiny neural networks (just a single hidden layer of 512 units outputting 256 dimensions): one predicts the embedding's center (mean $\mu$), and the other predicts its spread (diagonal covariance $S$).
  • Natural non-Euclidean distance: Rather than bolting on heuristic distribution metrics like KL-divergence, the authors marginalize the pairwise match probability over the uncertainty of both Gaussian clouds. This yields clean, closed-form math where a generalized Mahalanobis distance emerges naturally. The variance acts as a local metric tensor—stretching andwarping space so an ambiguous sequence can statistically "reach" multiple clusters at once.

Datasets

No new real-world benchmarks were introduced; the authors adopt standard controlled benchmarks from prior foundation-model studies (specifically DNABERT-S) to cleanly isolate representation quality:

  • Training: 100,000 sequence pairs subsampled from a 2-million-pair dataset (creating ~20.1 million total pairs with negatives).
  • Toy Synthetic Dataset: 100-bp sequences generated from 5 distinct 4-mer distributions, plus synthetic "multi-class" hybrids to test uncertainty behavior in 2D.
  • Metagenomic Benchmarks (6 datasets): Reference 5 & 6 (synthetic fungal and viral genomes) and Plant 5 & 6 and Marine 5 & 6 (complex microbial communities from CAMI2).

Key Insights and Ideas

  • Deterministic embeddings hit a hard geometric wall: Using sphere-packing theory, the authors prove that fixed-variance (or point) embeddings mathematically cannot satisfy all attraction/repulsion constraints once a sequence is shared across too many distinct species. Varying covariance adds the degrees of freedom needed to break this bottleneck.
  • Variance is a built-in ambiguity detector: When a fragment belongs to multiple species, Theorem 3.4 proves its learned variance must blow up while pure-species variances shrink. In 2D toy tests, hybrid sequences landed right between clusters with massive variance values.
  • Uncertainty enables smart filtering: Because noisy or multi-species fragments get tagged with high variance (log-determinant), you can filter them out before clustering—preserving far more high-recall species bins than random filtering.

Key Results

Evaluated on the number of high-quality species bins recovered ($F_1 > 0.9$) using unsupervised K-Medoids clustering:

  • Beats all baselines across the board: UncertainGen outperformed deterministic $k$-mer baselines and large foundation models (HyenaDNA, DNABERT-2, and DNABERT-S) across all six Reference, Plant, and Marine datasets.
  • Massive efficiency gains: UncertainGen achieves roughly 0.37 average high-quality bin performance with well under a million parameters ($\sim 10^{5.7}$), beating the ~100-million-parameter ($\sim 10^{8.1}$) DNABERT-S ($\sim 0.27$) while training on just 5% of the positive pairs.
  • Compact power: Ablations show probabilistic variance helps most when embedding dimensions are small ($D = 16$ or $32$), where Euclidean space gets crowded fastest.
Figure 2: Performance versus model size. UNCERTAINGEN (our approach) achieves a favorable trade-off between model size (log-scale) and the perfor- mance in metagenomic binning tasks compared with existing lightweight and large foundation models.

Limitations and Future Work

  • Unverified biological sources & calibration: While variance clearly tracks ambiguity, it isn't necessarily statistically calibrated. Also, because the benchmark datasets lack annotations for horizontal gene transfer or conserved regions, the authors couldn't verify which biological mechanisms triggered high variance in real data.
  • Simple building blocks: Each fragment is modeled as a single Gaussian (rather than a multi-modal mixture) using tiny two-layer networks and basic $k$-mers.
  • Not a full pipeline yet: Real-world binning tools also use sequencing coverage (read depth) and assembly graphs. Integrating UncertainGen’s uncertainty-aware embeddings into end-to-end reconstruction pipelines—and exploring non-Gaussian distributions—is next on the horizon.

Summary updated

Abstract

Learning effective representations of DNA sequences is fundamental to genomic data analysis, especially in the presence of high sequence similarity and inter-species DNA sharing. Existing approaches rely on deterministic embeddings, such as k-mer statistics or representations from large language models, which fail to capture the inherent uncertainty in short and ambiguous DNA fragments. We propose UncertainGen, a lightweight probabilistic representation learning framework that embeds DNA sequences as distributions in a latent space. The learned embedding variance captures positional ambiguity, increasing for sequences compatible with multiple genomic clusters. We establish theoretical guarantees on embedding distinguishability, and show that the probabilistic formulation induces a data-adaptive metric that expands the effective representational space. We evaluate UncertainGen in the metagenomic binning task to demonstrate the practical benefits of uncertainty-aware representations. Experiments show that probabilistic embeddings consistently outperform deterministic k-mer and large genome foundation models, while remaining lightweight and efficient.
BibTeX
@inproceedings{celikkanat2026uncertaingen,
  author = {Abdulkadir Celikkanat and Andres R Masegosa and Mads Albertsen and Thomas Dyhre Nielsen},
  title = {{UncertainGen: Scalable Uncertainty-Aware Representation Learning of DNA Sequences}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=WYGzgFvBK2},
}
Figure