Semi-Equivariant Conditional Normalizing Flows

Eyal Rozenberg, Daniel Freedman

TL;DR

This paper introduces Semi-Equivariant Conditional Normalizing Flows, a continuous generative framework designed to model 3D conditional graphs—specifically generating molecular ligands conditioned on protein binding pockets. By defining a new notion of semi-equivariance, the method mathematically guarantees that the conditional distribution remains invariant under simultaneous rigid transformations (rotations and translations) and node permutations of the target and ligand.

What Problem Does This Paper Address?

In structure-based drug design and 3D computer vision (e.g., shape completion), models must learn conditional distributions of the form $p(G \mid \hat{G})$, where both the condition (base graph $\hat{G}$, such as a protein receptor) and the target (complement graph $G$, such as a drug-like ligand) are 3D geometric graphs.

This presents two major challenges:

  1. Geometric Symmetry: The probability density must obey conditional rigid invariance—rotating or translating the receptor and ligand together should not alter the likelihood: $$p(TG \mid T\hat{G}) = p(G \mid \hat{G}) \quad \forall T \in \mathrm{E}(3)$$ Permuting the ordering of atoms in either graph must also leave the likelihood unchanged.

  2. Scale Imbalance: A receptor is often 1–2 orders of magnitude larger than a ligand. Naively processing them together in a single joint equivariant graph network causes the ligand signals to be "drowned out" by the massive base graph.

Methods

The authors propose a modular architecture utilizing Continuous Normalizing Flows (CNFs) driven by Ordinary Differential Equations (ODEs) alongside Equivariant Graph Neural Networks (EGNNs):

  • Markov Decomposition: The joint ligand distribution is factored into number of atoms, node features/coordinates, edges, and graph properties: $$p(G \mid \hat{G}) = p(N \mid \hat{G}) \cdot p(V \mid N, \hat{G}) \cdot p(E \mid N, V, \hat{G}) \cdot p(A \mid N, V, E, \hat{G})$$
  • Decoupled Architecture:
  • A Base Graph EGNN extracts layer-wise invariant feature signatures $\hat{g}^\ell$ from the receptor via permutation-invariant pooling.
  • A Conditional EGNN operates purely on the ligand while conditioning on the receptor's invariant signatures and flow time $t$, preventing the ligand from being drowned out.
  • Semi-Equivariance: The vector field $\gamma(G, \hat{G})$ driving the continuous flow is defined as rotation semi-equivariant ($\gamma(T_{\text{rot}}G, T\hat{G}) = T_{\text{rot}}\gamma(G, \hat{G})$) and permutation semi-equivariant.
  • Complex-Wide Centering (Invariant Theorem): Because translations affect spatial coordinates, transforming coordinates by subtracting the center of mass of the entire complex (both receptor and ligand) bridges semi-equivariance in the flow's vector field to full rigid-body $\mathrm{E}(3)$ invariance in the resulting probability distribution.
       [ Base Graph (Receptor) Ĝ ]
                   │
            (Base Graph EGNN)
                   │
                   ▼
     [ Invariant Signatures ĝˡ ]
                   │
  [ Flow Noise z ] ┼─────────────► (Conditional EGNN Flow)
                                              │
                                              ▼
                             [ Invariant Centering (Ω, ω) ]
                                              │
                                              ▼
                                 [ Generated Ligand G ]

Datasets

  • CrossDocked2020: A standardized dataset containing roughly 22.5 million cross-docked ligand-receptor poses derived from the Protein Data Bank (PDB).
  • Filtered Benchmark: Following standard practice, data was filtered to docked pairs with RMSD $< 2\,\text{Å}$, ligand size $\le 30$ atoms, atom types limited to $\{\text{C}, \text{N}, \text{O}, \text{F}\}$, and valid Vina docking scores. The filtered set yielded 132,863 training pairs and 63,929 validation pairs.
  • Evaluation Baseline: Compared against GraphBP, an autoregressive 3D molecular generation model, evaluated over 10 target receptors (90 receptor–ligand test pairs).

Key Insights and Ideas

  • Decoupling Without Losing Equivariance: Instead of running expensive message-passing across all base-complement node pairs, condensing the base graph into transformation-invariant signatures allows the complement flow to maintain exact equivariance at a fraction of the representational interference.
  • Flows Inherit Symmetry Through Affine Shifts: By pairing a semi-equivariant vector field with an affine shift based on the combined system’s barycenter ($\hat{x}_{\text{av}}$ and $x^v_{\text{av}}$), standard Gaussian base distributions ($z \sim \mathcal{N}(0, I)$) yield rigorously $\mathrm{E}(3)$-invariant conditional densities.
  • Likelihood as a Molecular Scoring Function: The conditional likelihood $p(G \mid \hat{G})$ acts as an effective knowledge-based statistical potential without ever training directly on affinity labels:
  • Lower negative log-likelihood (NLL) directly corresponds with better empirical docking scores (AutoDock Vina) and lower RMSD.
  • Artificially translating or rotating a ligand away from its optimal pocket pose monotonically worsens the NLL.

Key Results

  • Chemical Validity: Generated molecules achieved 99.87% validity (via RDKit sanitization), outperforming GraphBP (99.75%).
  • Realistic Geometries: Average bond length was $1.45 \pm 0.10\,\text{Å}$, closely tracking ground-truth reference molecules ($1.42 \pm 0.08\,\text{Å}$), whereas GraphBP produced distorted bonds ($1.65 \pm 0.95\,\text{Å}$).
  • Binding Affinity ($\Delta\text{Binding}$): Measured as the percentage of generated molecules that outperform the original crystal ligand in predicted binding affinity (via gnina docking and CNN scoring). The proposed method reached $35.7\%$ versus $22.76\%$ for GraphBP—a $56.81\%$ relative improvement.

Limitations and Future Work

  • Computational Cost: Training is slow—requiring approximately 18 days on an NVIDIA A100 GPU for 39 epochs due to ODE integration.
  • Chemical Scope Constraints: Experiments were limited to relatively small ligands ($\le 30$ atoms) and four common heavy atom types ($\text{C}, \text{N}, \text{O}, \text{F}$).
  • Bond Post-Processing: While the mathematical framework defines an edge distribution $p(E \mid N, V, \hat{G})$, inference in experiments relied on OpenBabel to connect generated atomic coordinates into covalent graphs.

Summary updated

BibTeX
@inproceedings{rozenberg2023semi,
  author = {Eyal Rozenberg and Daniel Freedman},
  title = {{Semi-Equivariant Conditional Normalizing Flows}},
  booktitle = {Physics4ML @ ICLR},
  year = {2023},
  url = {https://openreview.net/forum?id=jzfb_0Odl6l},
}
Figure