TL;DR
Diffusion and flow matching models are fantastic at generating images on fixed-size canvases, but they stumble when asked to build objects whose sizes aren't known in advance—like molecules or proteins. Branching Flows solves this by treating generation like a phylogenetic tree: starting from simple noise, elements drift, split in two, or get deleted at rates learned by the model. It seamlessly plugs into discrete, continuous, and manifold-valued spaces, allowing generative models to decide how much to build on the fly.
What Problem Does This Paper Address?
When generating text, autoregressive models handle variable length effortlessly: they just keep spitting out words until they hit a <STOP> token. Diffusion and flow matching models abandon this left-to-right constraint, making them brilliant for 3D structures and grids—at the cost of needing a fixed, pre-declared number of elements before generation even begins.
This creates a major headache in science and engineering, particularly for what the authors call the "unknown-length infix sampling" problem. Imagine designing a flexible binding loop to bridge two rigid, pre-existing regions of an antibody. You know the flanking 3D structures, and you want a generative model to fill in the gap. How many amino acids should span that space? You usually don't know a priori. Existing variable-length diffusion/flow methods are generally restricted to either purely discrete tokens or purely continuous coordinates, or rely on wasteful padding tricks. Scientists need a unified, theoretically sound way to let multimodal states grow and shrink dynamically.
Methods
Standard flow matching transports a fixed number of noise points ($X_0$) to data points ($X_1$) along smooth trajectories. Branching Flows extends the Generator Matching framework by coupling a variable-length noise sample to a target data sample (augmented with extra "to-be-deleted" elements) using a latent forest of rooted binary trees.
Here is how the pieces fit together:
- Phylogenetic-style evolution: During training, elements evolve from the roots ($t=0$) toward the leaves ($t=1$). Along a branch, each element moves independently under any standard flow matching "base" process (Euclidean, discrete, $SO(3)$ manifolds, or multimodal combinations). At tree bifurcations, an element duplicates in place and the two copies decouple; at marked leaves, the element is deleted.
- Steering with "Anchors": In standard flow matching, an element steers directly toward its final data endpoint. Here, an early element might be the ancestor of several final data points. The authors introduce anchors—intermediate targets placed at internal tree nodes (such as the spatial average of all descendant atoms)—to guide the drift before a split occurs.
- Drop the scaffolding at inference: Extending Generator Matching theory to time-evolving discrete latent variables, the authors prove that the auxiliary tree structure can be marginalized out. A neural network simply learns to predict three things per element given the current state: the base velocity/transition rates, the expected remaining splits (via a Poisson loss), and the deletion probability (via binary cross-entropy). At generation time, there are no trees—elements just drift, split, and vanish organically.
Datasets
The authors evaluate Branching Flows across four distinct tasks and domains (note: exact dataset names for the protein tasks are not discussed in the main text, as details are deferred to the appendices):
- QM9: Small organic molecules (jointly modeling continuous 3D atom coordinates and discrete atom types) for both unconditional generation and conditional "molecule completion."
- Antibody Heavy Chains: Discrete amino acid sequences for unconditional generation and multi-segment infix completion.
- Multimodal Protein Backbones & All-Atom Co-design: Protein structures and sequences used to fine-tune two existing pretrained architectures: ChainStorm (3D positions, $SO(3)$ orientations, and discrete sequence labels) and La Proteina ($C_\alpha$ coordinates paired with 8D continuous latents encoding all-atom sidechains).
Key Insights and Ideas
- Spawning by splitting beats spawning from thin air: Prior continuous variable-length methods (like Transdimensional Jump Diffusion) insert new elements by predicting a spatial probability distribution over where the new atom should appear—effectively forcing a network to output a complex mixture of Gaussians. Duplicating an existing element in place and letting base dynamics separate the copies sidesteps this bottleneck entirely.
- Cheap variable-length upgrades for pretrained models: You don't have to train massive biomolecular models from scratch. Adding lightweight split and deletion heads to fixed-length pretrained protein models (ChainStorm and La Proteina) took just 1–2 days on a single consumer GPU, showing that fixed-length representations already encode the geometric intuition needed to regulate size.
- Domain-aware trees give a free boost: While the math works for almost any valid tree-sampling scheme, choosing trees that merge spatially proximate atoms reduces average drift and improves molecular validity—turning the latent tree construction into a clean playground for inductive biases.
Key Results
- Small Molecules (QM9): Branching Flows closely matches the true data distribution on molecular properties and UMAP fingerprint embeddings. On unconditional generation, a proximity-weighted tree variant achieves 0.990 validity and a multivariate Jensen-Shannon divergence ($\text{JSD}_m$) of 0.069, outperforming variable-length Transdimensional Jumps (0.978 validity, 0.120 $\text{JSD}_m$) and nearly matching an "oracle-length" flow model cheated with the true atom count (0.063 $\text{JSD}_m$). On conditional molecule completion, it achieves 0.079 $\text{JSD}_m$, crushing a heuristic length-sampling baseline (0.191).
- Antibody Sequences: On conditional sequence completion, Branching Flows outperforms Edit Flows across all distribution-matching metrics ($1 - \text{KS}_D$), including length (0.976 vs. 0.931) and AbNatiV humanness (0.981 vs. 0.886), closely trailing the unfair oracle-length baseline.
- Protein Design: Fine-tuning La Proteina with Branching Flows boosts MPNN1 designability from 0.972 to 0.990, co-designability from 0.952 to 0.966, and structural diversity from 110 to 128 clusters (across 500 samples), with negligible wall-clock overhead from the branching mechanics.
Limitations and Future Work
- No formal recipe for the design space: While empirically robust on QM9, there is no formal theory dictating optimal choices for tree topologies, anchor definitions, or split/deletion hazard schedules across new domains.
- Missing evaluation metrics for 3D protein infilling: Although the authors demonstrate variable-length antibody CDR3 loop sampling in 3D, they note a lack of quantitative benchmarks to rigorously score multimodal structural completion.
- Annealing and likelihoods: Unlike standard fixed-length flows where approximate likelihoods can be computed via ODEs and structural sampling benefits from well-studied temperature annealing, likelihood calculation and systematic annealing strategies for Branching Flows remain open questions for future work.
Summary updated