BlockFormer: Transformer-based inference from genomic contact maps

Eloïse Touron, Pedro L. C. Rodrigues, Julyan Arbel, Nelle Varoquaux, Michael ArbelNeurIPS 2026

TL;DR

Finding key genomic landmarks like centromeres inside tangled 3D DNA maps is traditionally a slow, optimization-heavy slog that must be restarted from scratch for every new organism. BlockFormer solves this by combining a custom Vision Transformer—built specifically to read matrices made of variably sized "blocks"—with an ultra-lightweight synthetic data simulator. Trained once on fake data, it generalizes zero-shot to real biological maps across wildly different species, pinpointing genomic features in seconds rather than hours.

What Problem Does This Paper Address?

Inside a cell’s nucleus, DNA isn't a neat linear string; it’s folded into a dense 3D hairball. Biologists study this organization using Hi-C contact maps: giant matrices that act like heatmaps showing how frequently any two pieces of DNA bump into each other. Because genomes are divided into chromosomes, these maps have a distinct block-wise structure, where each rectangular block captures interactions between a specific pair of chromosomes.

Crucial biological features leave distinct visual footprints in these blocks. For instance, centromeres (the structural hubs vital for cell division) tend to cluster together in 3D space, creating aligned bright spots across inter-chromosomal ("trans") blocks.

Inferring exact centromere locations from these maps is a classic inverse problem, and existing solutions hit a wall:

  • Optimization methods (like the state-of-the-art Centurion) fit Gaussian curves to these bright spots, which is non-convex, computationally expensive, and non-amortized—meaning you start from zero for every new dataset.
  • Standard deep learning struggles because different species have wildly different numbers and sizes of chromosomes, breaking fixed-size architectures like CNNs, and manually annotated training maps are scarce.
  • Biophysical simulators could generate synthetic training data, but simulating actual 3D polymer physics is far too slow to produce thousands of population-level maps.

Methods

The authors pair a custom neural architecture with a clever simulation shortcut.

First, instead of predicting all $n$ chromosome parameters at once, they decompose the map: to find the centromere of chromosome $i$, BlockFormer looks at a sequence of blocks showing how chromosome $i$ interacts with other chromosomes. While based on a standard Vision Transformer (ViT), it introduces two novel block-aware adaptations:

  1. Per-block patching: Each interaction block is asymmetrically zero-padded on its right and bottom edges so image patches never bleed across chromosome boundaries.
  2. 3D positional encoding: Instead of standard 2D image coordinates, every patch gets a 3D coordinate (i, j, k)—representing the block index i and the patch's relative (j, k) position inside that block. A class token is projected via a sigmoid layer to output a normalized relative position between 0 and 1.
Figure 2: Architecture of BlockFormer. The input Ci is any sequence of blocks of interactions between entity i and others (size of the map (H, W)) and the output is the parameter estimation ˆθi. N is the number of patches, P the patch size, D the embedding dimension and B the number of transformer blocks.

Second, to train BlockFormer without scarce real labels or sluggish physics engines, the authors built a lightweight phenomenological simulator. Skipping 3D DNA folding entirely, it directly paints synthetic 2D blocks using a 2D Gaussian spot at the centromere intersection, a depleted "cross" of non-interaction, and up to 10% background Gaussian noise.

Finally, BlockFormer isn't limited to point estimates; the authors also plug the pre-trained network into Simulation-Based Inference frameworks (ABC and Neural Posterior Estimation) as a learned summary statistic to output full Bayesian uncertainty distributions.

Datasets

  • Training: 50,000 purely synthetic contact maps generated at 32 kilobase (kb) resolution with randomized block counts, block dimensions, and spot sizes.
  • Evaluation (Real Hi-C data): Seven yeast species (including S. cerevisiae and S. pombe), the malaria parasite P. falciparum across three lifecycle stages, the plant A. thaliana (whose chromosomes are ~30x larger than yeast's), and single-loop chromosomal regions from the human IMR90 cell line (at 5 kb resolution).

Key Insights and Ideas

  • Don't simulate the physics; simulate the summary statistic: You don't need molecular dynamics to train an inference network if the visual signature is simple. Directly simulating 2D noisy spots takes milliseconds and transfers seamlessly to messy, real-world biology.
  • Respecting block geometry enables scale-free generalization: Ablation studies show that 3D per-block positional encoding and per-block padding are the secret sauce allowing a tiny 4-layer transformer to generalize across arbitrary numbers of chromosomes and resolutions.
  • Zero-shot task transfer via pattern geometry: Because BlockFormer fundamentally learns to locate aligned spot-like enrichments, it can localize chromatin loops in human DNA without any retraining, outperforming Centurion on single-block regions.

Key Results

Trained once for 10 hours on a single GPU, BlockFormer delivers sub-resolution accuracy (errors smaller than a single pixel/genomic window) and massive speedups on CPU inference:

  • Drastic speedups and accuracy on out-of-distribution genomes: On the large plant genome A. thaliana (using a coarse-to-fine refinement step), Centurion struggles—taking ~3.6 hours (13,103 s) to reach a poor normalized error of 34.82. BlockFormer + fitting takes 56.7 seconds and achieves an error of 6.12. On P. falciparum, BlockFormer matches Centurion’s 0.18 error in 34.8 s vs. 1,064.7 s (~30x faster).
Table 2: Species with out-of-training chromosomes sizes, too noisy map or high resolution: we apply the refinement step as in Appendix C.3.1. P.F.r. stands for the stage rings of the parasite. Comparison of normalized error (the smaller the better) and time. (5 random seeds)
  • Sub-kilobase precision on yeast: On S. cerevisiae (32 kb resolution), standalone BlockFormer beats Centurion’s initialization in both accuracy (0.26–0.37 normalized error vs. 0.62) and speed (~0.5 s vs. 3.0 s). Adding curve-fitting refines estimates to ~2 kb (0.08 normalized error) over 5x faster than Centurion.
  • Superior uncertainty quantification: Used as a Bayesian summary statistic, BlockFormer yields sharp, well-calibrated posterior distributions centered on the ground truth, whereas CNN-based summary statistics produce visibly biased estimates.
Figure 3: Inference using ABC-Pearson (see Appendix H.1), ABC-CNN, ABC-Transf, (see Appendix H.2) NPE-CNN, and NPE-Transf (a) (see Appendix I). Color shades increase from lightest to darkest across rounds. Densities are estimated with the 5% best θ according to the ABC criterion or sampled from the flow. In some dimensions, only the BlockFormer-based approaches ABC-Transf and NPE-Transf are accurate (e.g. the densities for the centromere of chromosome 1 and 12), the CNN-based methods lead to biased densities. (b) Mean absolute error distance between θ and θref, computed over the 5% best-performing samples. The horizontal gray dashed line stands for the resolution of the contact map Cref (in bp).
  • Pattern robustness: When synthetic spots are distorted into squares or corrupted by decoy spots, Centurion's Gaussian assumptions falter, while BlockFormer maintains sub-resolution precision.

Limitations and Future Work

  • Single-target bottleneck: By design, BlockFormer outputs exactly one parameter per entity. It cannot natively count or locate an unknown number of multiple targets in a map,nor can it flag when a feature is absent. Consequently, human chromatin loop detection had to be restricted to pre-filtered regions guaranteed to contain a single loop.
  • Extreme scale mismatch: At very high resolutions (e.g., 20 kb) or massive chromosome sizes far outside the synthetic training range, standalone accuracy degrades unless paired with a downsampling/refinement step.
  • Future directions: The authors suggest pairing BlockFormer with other domain-specific simulators to tackle broader inverse problems on block-structured interaction maps, such as inferring full 3D genome configurations.

Summary updated

Abstract

Locating genomic features from genomic contact maps, such as centromere identification from genome-wide chromosome conformation capture techniques, notably Hi-C, can be formulated as an inverse problem: infer one parameter per entity given a map summarizing pairwise interactions through blocks of variable numbers and sizes. In this work, we introduce a data-driven approach that leverages shared structure between these contact maps, such as global alignment between localized patterns, while handling the variability in number and size of chromosomes arising in real-world data. Our approach relies on a transformer architecture capable of handling such variability and a custom simulator to generate abundant, yet computationally cheap synthetic data for training. Applied to the problem of centromere localization, the method recovers genomic positions at or below the map resolution across species with various genome sizes using a coarse-to-fine refinement step when chromosome sizes fall outside the training range. We concentrate our evaluation on Hi-C data, where the block structure is well characterized and ground truth is available.
BibTeX
@inproceedings{touron2026blockformer,
  author = {Eloïse Touron and Pedro L. C. Rodrigues and Julyan Arbel and Nelle Varoquaux and Michael Arbel},
  title = {{BlockFormer: Transformer-based inference from genomic contact maps}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=KLwEUS6ukk},
}
Figure