Skip to main content

POMA: Probabilistic Output-Space Multimodal Alignment for Biological Foundation Models

PyPI Manuscript Lean 4 Companion: LogiCA Python 3.10+ PyTorch 2.1+ License: MIT

POMA: Probabilistic Output-Space Multimodal Alignment for Biological Foundation Models

POMA (Probabilistic Output-Space Multimodal Alignment) generalizes the conditional likelihood objective underlying masked language modeling (MLM) to native continuous biological measurements. Rather than replacing calibrated sequence likelihoods with pointwise MSE regression, numerical tokenization, or representation-only latent projections, POMA equips pretrained discrete and continuous biological foundation models with structured predictive densities in their native output spaces, connected through unit-invariant, context-matched likelihood-ratio alignment.

Because one learned statistical object preserves calibrated densities directly over native observables, a single trained POMA checkpoint exposes six unified capabilities without task-specific retraining:

  • Probabilistic Adaptation & Uncertainty Quantification across nine structured output families (LowRankMVN, heavy-tailed LowRankMVT, multimodal CoupledGMM, zero-inflated HurdleContinuous, CoupledTobit, BandedLowRank, Gaussian, Kumaraswamy, ZINB);
  • Zero-Retraining Analytical Conditional Inference via exact Woodbury/Schur conditioning (76×–752× per-update speedup on frozen scGPT, >2,800× vs. 117M DreaMS re-encoding, 6.4×10⁻⁶ sequential-vs-joint Bayesian coherence);
  • Shortcut-Resistant Cross-Modal Alignment via context-matched mixture-reference likelihood ratios and adaptive bidirectional weighting;
  • Continuous & Cross-Modal Dependency Maps extracting exact Woodbury precision / partial-correlation matrices and cross-modal KL perturbation maps;
  • Bayesian Epistemic Closure & Experimental Design (POMA-Laplace, Rao-Blackwellized joint feasibility, and cost-budgeted EVSI/cost acquisition);
  • Exact-Target Property-Conditioned Generation (Exact Local MH, Factor-Augmented MH, and Coordinate Gibbs) preserving $\pi_\beta(x) \propto p_0(x)\exp(\beta U(x))$.

Repository Structure

POMA/
├── src/poma/                            # Modular Python library (`pip install -e .`)
│   ├── backbones.py                     # Universal wrappers for discrete (HF MLM) & continuous (DreaMS, scGPT, custom) BioFMs
│   ├── model.py                         # Unified `POMA` (9 density families + Schur conditioning) & `CrossModalPOMA`
│   ├── bayesian.py                      # `BayesianPOMA` (last-layer Laplace, uncertainty decomposition, joint feasibility, EVSI/cost)
│   ├── dependency.py                    # `DependencyMapper` (Woodbury precision/partial-corr & cross-modal KL maps)
│   ├── generation.py                    # `POMAGenerator` (Exact Local MH & Coordinate Gibbs sequence design)
│   ├── logica_bridge.py                 # Drop-in `LogiCAPOMABridge` for AI-SysBio/LogiCA backbones
│   └── models/                          # Core density heads, spectral heads, bioFM alignment blocks & losses
├── example/                             # Quickstart + all manuscript reproduction scripts (Main & Supp. E1–E15)
│   ├── quickstart.py                    # End-to-end runnable showcase of all 6 POMA capabilities
│   ├── README.md                        # Complete mapping from manuscript tables/experiments to scripts
│   └── 01_download_datasets.py .. 53_run_e15_unified_checkpoint.py
├── manuscript/                          # Latest manuscript PDF, LaTeX source & publication figures
│   ├── POMA_manuscript.pdf              # Full compiled manuscript + supplementary
│   ├── main.tex                         # Standalone LaTeX source
│   └── figures/                         # POMA_Figure1.pdf, POMA_Figure2.pdf, POMA_FigureS1.pdf
├── lean/                                # Complete Lean 4 formalization (130/130 theorems, 0 sorries)
│   ├── Poma.lean                        # Root Lean 4 library entry point
│   ├── AxiomCheck.lean                  # Machine-checked axiom audit
│   └── Poma/                            # Formal proofs of invariance, Schur coherence, Laplace, EVSI & MH theorems
├── figures/                             # Top-level rendered figures (POMA_Figure1.png, POMA_Figure2.png)
├── results/                             # Aggregated benchmark tables & audit summaries
└── tests/                               # Unit test suite covering the library API, heads, Bayes & samplers

Installation

Python 3.10 or later is recommended. Install directly from PyPI:

# Core library (`import poma`)
pip install poma-bio

# With chemistry (RDKit + SELFIES), single-cell (anndata), antibody (AbLang2), or all extras
pip install "poma-bio[chem]"
pip install "poma-bio[all]"

Or install from source in editable mode:

git clone https://github.com/AI-SysBio/POMA.git
cd POMA
pip install -e ".[all]"

# Run the unit test suite & end-to-end quickstart
pytest tests/ -v
python example/quickstart.py

Quickstart: Using the Modular poma Library

1. Plug in Any Pretrained Discrete or Continuous Foundation Model

import torch
from poma import ContinuousBackbone, CrossModalPOMA, DiscreteBackbone, POMA

# Discrete BioFM (any Hugging Face Masked LM: ChemBERTa, ESM-2, SELFormer, Nucleotide Transformer)
mol_fm = DiscreteBackbone.from_pretrained("DeepChem/ChemBERTa-77M-MLM", freeze=True)

# Continuous BioFM (official 117M DreaMS, frozen scGPT, or any custom PyTorch encoder)
spec_fm = ContinuousBackbone.from_dreams(num_tokens=8, freeze=True)
# scgpt_fm, gene_vocab = ContinuousBackbone.from_scgpt(freeze=True)

# Cross-modal output-space alignment with shortcut-resistant context-matched PMI (E12)
aligner = CrossModalPOMA(
    primary_dim=mol_fm.hidden_dim,
    partner_dim=spec_fm.hidden_dim,
    adapter_dim=128,
    num_heads=4,
)
# Contrastive loss using context-matched mixture reference log(q(x|y) / E_{y'}[q(x|y')])
loss = aligner.alignment_loss(ll_x_given_y, ll_y_given_x, temperature=0.15, context_matched=True)

2. Probabilistic Prediction & Zero-Retraining Analytical Conditioning

from poma import POMA

# Choose from: "mvn", "mvt", "gmm", "hurdle", "tobit", "banded_lowrank", "gaussian", "kumaraswamy", "zinb"
model = POMA(hidden_dim=64, distribution="mvn", rank=3)

h = torch.randn(16, 6, 64)                  # (batch, K coordinates/assays, hidden_dim)
y = torch.randn(16, 6)                      # continuous measurements
obs_mask = torch.rand(16, 6) > 0.25         # arbitrary missingness pattern
obs_mask[:, 0] = True

# Exact O(|S| r^2 + r^3) Woodbury masked negative log-likelihood
loss = model.nll(h, y, obs_mask=obs_mask)
pred = model.predict(h[:4])                 # pred.mean, pred.variance, pred.lower95, pred.upper95

# Exact analytical Schur conditioning given newly observed coordinates (zero retraining!)
triage_mask = torch.tensor([[False, False, True, True, True, True]] * 4)
cond = model.condition(h[:4], y[:4], triage_mask)

3. Bayesian Epistemic Uncertainty, Dependency Maps & Exact-Target Generation

from poma import BayesianPOMA, DependencyMapper, POMAGenerator

# Closed-form last-layer Laplace epistemic uncertainty, joint feasibility & EVSI/cost
bayes = BayesianPOMA(model, prior_precision=3.0).fit(h, y, obs_mask=obs_mask)
unc = bayes.decompose_uncertainty(h[:4])    # aleatoric_var, epistemic_var, total_var
feas = bayes.joint_feasibility(h[:4], lower=torch.full((6,), -1.0), upper=torch.full((6,), 1.0))
evsi = bayes.evsi_per_cost(h[:4], lower=torch.full((6,), -1.0), upper=torch.full((6,), 1.0),
                           assay_costs=torch.tensor([10., 8., 1., 1., 2., 2.]))

# Continuous covariance, correlation, exact Woodbury precision & partial-correlation dependency maps
dep = DependencyMapper.continuous_dependency_map(model, h[:2])
# dep.covariance, dep.correlation, dep.precision, dep.partial_correlation

# Property-conditioned discrete sequence generation preserving pi_beta(x) propto p_0(x) exp(beta U(x))
generator = POMAGenerator(log_prior_fn=prior_fn, log_utility_fn=utility_fn, beta=1.0)
gen_out = generator.sample_exact_local_mh(init_seq="ACDEFGH", editable_positions=[1, 2, 3, 4], n_steps=100)

Manuscript Reproduction (example/) & Lean 4 Formalization (lean/)

  • Reproducing Manuscript Results: See example/README.md for the complete index of all 63 scripts reproducing every main-text benchmark and supplementary validation experiment (E1–E15), including large-scale ChemBERTa-77M $\leftrightarrow$ 117M DreaMS alignment, 500-unique-molecule retrieval, shortcut-resistant context-matched alignment, representation leakage audits, mask-matched neural vs. analytical Schur conditioning, and unified single-checkpoint evaluation.
  • Machine-Checked Formalization (lean/): All mathematical statements in the manuscript—likelihood-ratio unit invariance, Woodbury/Schur sequential-vs-joint coherence, Laplace epistemic closure, decision-aware acquisition bounds, and exact MH stationary invariance—are formally verified in Lean 4 (130/130 theorems, zero sorrys; see lean/README.md).

Citation

@article{pelissier2026poma,
  title   = {Probabilistic Output-Space Multimodal Alignment for Biological Foundation Models},
  author  = {Pelissier, Aurelien},
  journal = {Preprint},
  year    = {2026},
  url     = {https://github.com/AI-SysBio/POMA}
}

Metadata

Release files for poma-bio 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for poma-bio 1.0.0
File Size Uploaded Provenance Actions
poma_bio-1.0.0.tar.gz 142.5 kB Without provenance Details for poma_bio-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for poma-bio 1.0.0
File Interpreter ABI Platform Actions
poma_bio-1.0.0-py3-none-any.whl Python 3 none any Details for poma_bio-1.0.0-py3-none-any.whl

Total release size: 288.7 kB

Release files / poma_bio-1.0.0.tar.gz

Download URL poma_bio-1.0.0.tar.gz
Size 142.5 kB
Tags Source
SHA-256 checksum
How to use checksums
bc6704de133a18f927fba5c31f6d6de314d38164b681f9ec5019a3bfb05376fa
BLAKE2b-256 checksum
How to use checksums
fb0d3f36a1a36086125edcef0fc71239be2a1eecd884d31bfcea40d0f351a3a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / poma_bio-1.0.0-py3-none-any.whl

Download URL poma_bio-1.0.0-py3-none-any.whl
Size 146.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa8364473b2fa7af8bacd9eecc753fcb73a997602764909b5e6c7f89166c2b35
BLAKE2b-256 checksum
How to use checksums
487c4dc5e91ca34c386a0a7e370078738d69541654aae4e1dbcc25184cabced7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Security for poma-bio 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page