OpenFold: A Trainable PyTorch Reproduction of AlphaFold2
New1. Overview
OpenFold is maintained by the AQLab team at Columbia University, led by Mohammed AlQuraishi. The repository was created on 14 September 2021 and, at the time of verification for this entry, carries roughly 3454 stars, 703 forks, and 246 open issues. The default branch is main, the implementation language is Python, and the license is Apache-2.0. Its purpose is precise: to provide an equivalent implementation of AlphaFold2 written in PyTorch that can be trained, fine-tuned, and inspected layer by layer, without altering the underlying architecture.
Two public milestones exist and they should be kept apart. The date-released field inside CITATION.cff records 12 November 2021, roughly a year before the date embedded in the paper DOI. The bioRxiv preprint itself shows a second version posted on 24 November 2022. In other words, usable code appeared about a year before the full argument was formally published, the typical shape of a tool that lands first and is argued for later.
The paper, titled "OpenFold: Retraining AlphaFold2 yields new insights into its learning mechanisms and capacity for generalization", lists 29 authors with Gustaf Ahdritz and Nazim Bouatta as co-first authors and AlQuraishi last. Its DOI is 10.1101/2022.11.20.517210, the preprint runs to 45 pages, and it carries a CC BY 4.0 license. Contributing institutions span Columbia University, Harvard Medical School, New York University, the Flatiron Institute, OpenBioML, NVIDIA, EleutherAI, and the Texas Advanced Computing Center, mixing academic groups with compute infrastructure providers.
The contribution is not simply another re-implementation. What OpenFold actually delivers is the conversion of AlphaFold2 from a set of closed pretrained weights into a public system that can be retrained repeatedly, and with it a set of empirical findings about how the model learns to fold. Those findings in turn became the practical basis for training subsequent structural models. The accompanying dataset, OpenProteinSet, pushes multiple sequence alignment into the tens of millions.
Within this site, OpenFold belongs to the category of trainable foundation models for structural biology, adjacent to the large-scale pretraining route discussed in the physics foundation models collection. Its peers in the same series are the AlphaFold entry and the RoseTTAFold entry, which differ in emphasis; a section below compares them directly.
2. How It Works
OpenFold reproduces the computational logic of AlphaFold2 in full and makes no modification to the architecture itself. This is the premise on which every later analysis rests: the authors compare OpenFold and AlphaFold2 predictions on the CAMEO validation set and find highly concordant lDDT-Cα values, and the scatter plot in the paper is the direct evidence for the claim of faithfulness.
The AlphaFold2 backbone, the Evoformer, is a geometric deep learning module that attends along both a sequence axis and a spatial axis. Attention along the sequence axis propagates information across the rows of a multiple sequence alignment, while pairwise residue biases encode spatial contact relationships. OpenFold translates this structure into PyTorch tensor operations and ships the training loop, the fine-tuning stage, template search, and weight conversion tooling. The scripts/ directory holds about 45 scripts covering database download, alignment precomputation, embedding precomputation, and weight conversion.
The paper's account of how the model learns to fold is unusually concrete. At the very start of training, the model uses a so-called black hole initialization that places every residue at the origin, so predictions are point-like and zero-dimensional. The structure then extends along a single axis into a one-dimensional tube. A few hundred steps later the tube stretches in an orthogonal direction into a curved two-dimensional surface where flattened secondary structure elements become visible, and only once the two-dimensional extent is nearly realized do predictions begin to fill out into a three-dimensional volume. The authors quantify this progression with PCA and dRMSD, and they find that the one-, two-, and three-dimensional projections converge almost simultaneously, indicating that learning proceeds continuously in spatial dimension rather than switching after each stage completes.
A second observation concerns scale. Early in training the global GDT-TS barely moves while the GDT-TS of ten-residue fragments rises quickly; by the end of training the gap between fragment and whole-protein GDT-TS shrinks to roughly ten points. Local structure is learned before global structure.
Three engineering changes distinguish OpenFold from the original. The first is an FP16 low-precision training mode that makes training feasible on commercially available GPUs. The second modifies the clamping strategy of the primary structural loss, FAPE: the original clamps entire batches on a large fraction of training steps, whereas OpenFold clamps the equivalent fraction of samples inside each batch so that every batch retains some unclamped chains. Fifteen independent runs confirm the effect, with the old protocol producing two rapidly converging runs, two late-converging runs, and one non-converging run, while the new protocol converges rapidly in all fifteen. The third targets memory separately for training and inference: training uses short fragments of 256 to 384 residues to avoid storing intermediate computations, whereas inference sequences may be more than an order of magnitude longer, with memory growing approximately cubically with length.
3. Scope and Assumptions
The prerequisites of OpenFold begin on the data side. A faithful reproduction of AlphaFold2 needs three external resources: multiple sequence alignment databases, structural template libraries, and pretrained parameters. The repository provides a matching set of download scripts covering the AlphaFold databases, BFD, MGnify, UniRef90, UniRef30, Uniclust30, the PDB file collections, soloseq embeddings, and OpenFold's own parameter weights. The framework requirements are equally concrete: environment.yml pins Python 3.10, PyTorch 2.5, and CUDA 12.4, and depends on DeepSpeed 0.14.5, Flash Attention, HMMER and HH-suite from bioconda, OpenMM, PDBFixer, PyTorch Lightning, and wandb.
Scale comes next. The paper reports a full training run of roughly 50000 GPU hours spanning more than 90000 steps. That figure positions OpenFold as a research-grade engineering effort rather than a casual re-implementation. Even so, the authors show the model reaches about 90 percent of its final accuracy in 1500 GPU hours, roughly 3 percent of total training time, and about 95 percent in 2500 GPU hours. This curve is the most practically useful result in the project, because it means feasibility testing of new architectures and new data can be scoped to a small fraction of the original budget.
Evaluation has its own assumptions. The central metric, lDDT-Cα, requires experimentally determined structures as reference, and the validation set is drawn from CAMEO, the community standard for blind structure prediction. Moving this metric to other physics-AI settings such as molecular property prediction or binding site identification means redefining the reference frame, since the metric itself does not transfer directly.
The licensing structure must also be kept clear. The code follows AlphaFold2's Apache-2.0 and is permissive enough for commercial use. The DeepMind pretrained parameters are distributed under CC BY 4.0, and the README records explicitly that this replaced the earlier and stricter CC BY-NC 4.0 terms in January 2022. The two layers differ in permissiveness and should be confirmed separately before commercial deployment.
4. Getting Started
The most economical path runs inference first and defers training. The repository provides run_pretrained_openfold.py as the inference entry point, openfold/config.py to centralize hyperparameters and data paths, notebooks/OpenFold.ipynb for interactive examples, and experiments/test_templates_openfold.py demonstrating template features. Official documentation is hosted on ReadTheDocs at openfold.readthedocs.io/en/latest/, with separate chapters for installation, inference, and training.
Data preparation follows a fixed order: fetch databases and parameters through the scripts/download_*.sh family, then choose an alignment precomputation route (precompute_alignments.py or precompute_alignments_mmseqs.py) and an embedding precomputation step (precompute_embeddings.py), and only then enter the training script. Two environment-fixing paths are offered, Dockerfile and environment.yml, along with deepspeed_config.json and build_deepspeed_config.py for multi-node multi-GPU training. A set of format conversion tools also lives in scripts/, including convert_of_weights_to_jax.py and convert_v1_to_v2_weights.py for migrating between AlphaFold2 parameter versions.
Users targeting consumer hardware can follow download_colabfold_envdb.sh and prep_mmseqs_dbs.sh to build a lightweight environment database along the MMseqs2 route, and download_openfold_params_huggingface.sh offers an alternative channel for obtaining weights without depending on a single mirror.
Deployment must respect the coupling between weights and configuration. Pretrained parameters and the normalization statistics that go with them form one unit, and mixing parameters from one version with configuration from another introduces systematic offsets in predictions. The repository pairs versioned parameter directories with matching configuration files, so replacements should be made as complete units.
5. Comparison with Alternatives
Against the original DeepMind release documented in the AlphaFold entry, OpenFold differs in three respects. First is training capability: the original ships weights and inference code but does not deliver the data pipeline and intermediate details with equal openness, whereas OpenFold releases the training loop, the loss implementation, and the precomputation scripts. Second is licensing: both codebases are Apache-2.0, but OpenFold additionally provides a download path for the DeepMind parameters along with a note that the terms moved from CC BY-NC 4.0 to CC BY 4.0. Third is community size, with the DeepMind repository at roughly 14900 stars, OpenFold near 3454, and ColabFold near 2984.
Compared with RoseTTAFold, OpenFold takes a route of strict reproduction plus mechanism study rather than introducing a different architecture. RoseTTAFold emphasizes training efficiency and its distilled architecture offers a real inference advantage, while OpenFold emphasizes computational equivalence with AlphaFold2 and treats the question of what actually happens inside a faithful implementation as the object of research.
ColabFold overlaps in audience but differs in emphasis. It is built around making folding accessible to all through MMseqs2 in place of Jackhmmer, which sharply lowers hardware and database requirements; it is MIT licensed and heavily engineered. OpenFold is built around trainability and analyzability, is Apache-2.0 licensed, and comes with a complete experimental record at paper resolution. The ColabFold paper appeared in Nature Methods with DOI 10.1038/s41592-022-01488-1, while the OpenFold paper remains a bioRxiv preprint.
The language-model-centered ESMFold line belongs in the same spectrum: it replaces MSA with a protein language model and claims zero-shot mutation effect prediction, gaining orders of magnitude in speed while sitting at a lower absolute accuracy than MSA-driven AlphaFold-line methods. The two routes are complementary, and the OpenFold paper itself lists whether data-driven representation learning can substitute for MSA as an open question, noting in the discussion that the AlphaFold2 architecture may hold the potential to be repurposed for other molecular modeling problems.
In the broader framing of this site, OpenFold and the MACE entry represent two different kinds of trainable scientific base. One learns structure from sequence, the other learns an energy potential from atomic configurations. What they share is the practice of distilling knowledge about a physical system into a differentiable, trainable model; what differs is the input representation and the target quantity.
6. Benchmarks and Evidence
The OpenFold paper offers a rare set of experiments that treat the training process itself as the object of study. All figures below are taken from the paper text and figure captions.
On reproducibility, the lDDT-Cα scatter plot on the CAMEO validation set shows high concordance between OpenFold and AlphaFold2, which is the direct basis for the claim of faithfulness. On training efficiency, 1500 GPU hours reach roughly 90 percent of final accuracy, 2500 GPU hours reach about 95 percent, and the full run costs approximately 50000 GPU hours over more than 90000 steps. The fine-tuning stage is evaluated separately: its effect on overall structural quality metrics is limited, even when restricted to proteins longer than 500 residues, and its primary utility appears to be correcting violations of known chemical constraints such as steric clashes. The pLDDT confidence metric is over-confident early in training, then enters a phase of under-confidence and converges gradually.
Data ablation subsamples the training set down to 17000, 10000, 5000, 2500, 2000, and 1000 chains, each trained for at least 7000 steps without self-distillation. Only 10000 chains, about 7.6 percent of the full training set, suffice to reach essentially the same initial lDDT-Cα as a model trained on everything. The full-data model reaches a peak lDDT-Cα of 0.83 after 20000 steps, while the 10000-sample model already exceeds 0.81 after 7000 steps. The smallest subset of 1000 chains, 0.76 percent of the full set, reaches lDDT-Cα of 0.64, exceeding the median lDDT-Cα of 0.62 achieved at CASP13 by the first AlphaFold. Template contribution is ablated separately, and the conclusion is that templates contribute little to prediction quality on average even in the low-data regime, consistent with the original AlphaFold2 ablation.
Fold space generalization uses the CATH hierarchy. After filtering there are roughly 440000 domains spanning 1385 topologies, 42 architectures, and 4 classes. At the topology level 100 topologies are held out randomly; at the architecture level 5 are held out for a total of 100 chains, 20 per architecture; at the class level the held-out set comprises domains that are neither mainly alpha nor mainly beta. All runs use no templates and train to about 7000 steps. Three conclusions follow: retaining 10 percent of topologies, about 6400 chains, performs worse than randomly retaining 5000 chains, showing that removing entire regions of fold space costs more than simply reducing data volume; retaining 5 percent of topologies, 2000 chains, still reaches lDDT-Cα near 0.6, comparable to the first AlphaFold trained on more than 100000 chains; and a training set drawn from a single architecture peaks near 0.6. The most counterintuitive result is that class-stratified models, trained respectively on mainly alpha data with 15400 chains or mainly beta data with 21100 chains, still exceed lDDT-Cα of 0.7 on domains containing both alpha helices and beta sheets.
The accompanying dataset OpenProteinSet is reported in three tiers in Table 1: about 140000 PDB unique chains with MSA, template hits, and experimentally determined structures; about 270000 filtered Uniclust30 proteins with MSA, template hits, and structures predicted by AlphaFold2; and 16 million unfiltered Uniclust30 sequences with MSA but no templates and no structures. MSAs are computed with HHMer and HHblits in A3M format, templates are HHSearch HHR files, and predicted structures are PDB files. All data is released under CC BY 4.0, hosted in the openfold/ directory of the AWS Registry of Open Data, and accompanied by a datasheet. Snapshot dates are 19 December 2021 for UniRef90, 20 December 2021 for BFD, 28 December 2021 for Uniclust30, and 14 January 2022 for MGnify. The paper also notes that OpenFold is no worse than AlphaFold2 on exactly 50 percent of targets.
Inference speed appears in Table 1 as seconds on a single A100, given as OpenFold over AlphaFold2: length 100 takes 2.8 against 8.8, a 3.14-fold gap; 300 takes 13.0 against 21.9; 500 takes 34.7 against 50.8; 1000 takes 215.3 against 222.8; 1100 takes 288.7 against 278.1; 1500 takes 614.1 against 549.1; 2000 takes 1251.2 against 1081.1; 2500 takes 2223.9 against out of memory; and 4700 takes 13908.8 against out of memory. OpenFold is faster on short sequences, while AlphaFold2 manages memory more efficiently on long ones.
7. Role in Physics-AI Workflows
Inside structural biology, OpenFold supports three main lines of use.
The first embeds structure prediction into drug discovery and protein engineering pipelines as an upstream step. Structure acquisition used to be the bottleneck; with a locally deployable and batchable predictor, virtual screening and mutational stability assessment move earlier into the design phase. The engineering precondition here is memory management and parallel scheduling for long sequences, which is exactly what the bundled DeepSpeed configuration and batch submission scripts address.
The second treats OpenFold as a trainable base for fine-tuning on specific tasks. The two figures of 10000 chains reaching equivalent initial accuracy and 1500 GPU hours reaching 90 percent accuracy together define the feasible budget for fine-tuning. This echoes the recurring engineering lesson in the surrogate modeling and reduced order collection on this site, namely that small samples plus physical structure can substitute for raw compute.
The third couples structure prediction with downstream physics computation. The presence of both OpenMM and PDBFixer in environment.yml is not incidental: the intent is that predicted structures flow directly into molecular dynamics simulation, advancing from static structure to dynamic trajectory. This sits upstream of the industrial solvers gathered in the numerics and solvers collection.
From a cross-domain perspective, OpenProteinSet offers a transferable pattern: it shows how a species-level public database can be turned into a machine-learning-ready dataset through tiered subsampling, an attached datasheet, explicit license terms and snapshot dates, and distribution through cloud object storage. The recipe holds for anyone intending to train on public databases, independent of the structural biology content.
There is also a productive contrast with the physics-informed neural network primers collection. The PINN route tries to write physical constraints directly into the loss function, whereas the OpenFold paper offers an empirical counterweight. The authors tried enabling physical violation penalties for steric clashes and non-physical bond lengths to correct collapsed structures, and that penalty broke training stability. AlphaFold2 instead adopts a curriculum strategy in which physical violations are penalized only in the later stages of training. That experience is directly useful to anyone planning to inject physical priors into a loss function.
8. Limitations and Failure Modes
The failure modes of OpenFold fall into four groups.
The first is structural collapse early in training. During the one- and two-dimensional phases of spatial learning, predicted structures violate basic chemical laws badly. This is not random noise but a necessary stage of the learning process, and reading it as a broken model leads to abandoning training prematurely. At the same time, forcing a physical penalty during that stage introduces the stability problem described above.
The second is insufficient coverage of fold space. When the training set lacks a class of topology, performance on similar folds drops sharply, and the drop exceeds what a mere reduction in data volume would cause. In other words, the diversity dimension of the data matters more than its quantity, which has direct consequences for how a data recipe should be designed.
The third is the resource constraint on long sequences. Inference memory grows approximately cubically with sequence length. AlphaFold2 runs out of memory at 2500 residues, while OpenFold can still run there at 2223.9 seconds and needs 13908.8 seconds at 4700 residues. Batch prediction of long proteins is therefore not viable on a single card and requires chunking strategies or distributed deployment.
The fourth concerns licensing and redistribution boundaries. The Apache-2.0 code and the CC BY 4.0 parameters are two independent sets of terms. Although OpenProteinSet is released under CC BY 4.0, the structures in its unfiltered Uniclust30 tier are AlphaFold2 predictions rather than experimentally determined entries, so mixing structurally derived data from different origins requires checking the upstream licenses separately.
There is also a layer of functional limits. OpenFold reproduces the AlphaFold2 architecture and its training mechanisms; it does not perform complex modeling, which lives in the AlphaFold-Multimer line with DOI 10.1101/2021.10.04.463034, and it does not perform conformational sampling or free energy calculations. What it outputs is a single static structure, not a trajectory and not a thermodynamic quantity.
9. Version and Source Notes
Several easily conflated points are pinned down here.
Repository state: the default branch is main, the last push was on 16 December 2025, repository metadata was updated on 3 November 2026, and the archived flag is false. The repository tree holds 269 entries and 235 files, with the root containing LICENSE, README.md, CITATION.cff, Dockerfile, environment.yml, deepspeed_config.json, setup.py, and the openfold/, scripts/, tests/, docs/, and notebooks/ directories.
Licensing state: the GitHub API reports Apache-2.0 for the repository, matching the root LICENSE file. The README Copyright Notice separately states that the DeepMind pretrained parameters are under CC BY 4.0 and that this replaced the stricter CC BY-NC 4.0 terms as of January 2022. The three-layer structure should be understood separately: OpenFold code under Apache-2.0, DeepMind parameters under CC BY 4.0, and OpenProteinSet data under CC BY 4.0.
Citation metadata: the preferred-citation in CITATION.cff with cff-version 1.2.0 lists 29 authors, starting with Gustaf Ahdritz under ORCID 0000-0001-8283-5324 and ending with Mohammed AlQuraishi, carries DOI 10.1101/2022.11.20.517210, and records a date-released of 12 November 2021. The BibTeX block in the README lists the same 29 authors but records the year as 2022. Where the two conflict, the DOI and the bioRxiv record govern: the preprint dates to November 2022 with a second version on 24 November 2022, and 12 November 2021 corresponds to the public code release.
Paper metadata: the bioRxiv preprint runs to 45 pages and about 122140 characters, carries a CC BY 4.0 license, and its title foregrounds learning mechanisms and capacity for generalization. The OpenProteinSet paper is arXiv 2308.05326, released on 10 August 2023, with 10 authors and a body of 17 pages and about 53666 characters.
Data metadata: the three tiers of OpenProteinSet, roughly 140000 PDB chains, roughly 270000 filtered Uniclust30 entries, and 16 million unfiltered Uniclust30 entries, are given in Table 1, and the paper describes the source as the PDB as of April 2022, a moment immediately before CASP15. That date should accompany any citation. The database snapshot dates of 19 December 2021 for UniRef90, 20 December 2021 for BFD, 28 December 2021 for Uniclust30, and 14 January 2022 for MGnify are not the same moment as the PDB content date and must not be conflated.
Metric metadata: lDDT-Cα is the primary metric with CAMEO as validation set, GDT-TS supports the multi-scale analysis, and pLDDT is the model's self-assessed confidence, highly correlated with true lDDT-Cα early in training but marked by over-confidence. Cross-paper comparison requires matching metric definitions and validation sets.
Comparison metadata: the inference speed table gives seconds on a single A100 for lengths from 100 to 4700 residues. Beyond 2500 residues the AlphaFold2 column records out of memory, and the ratio there is treated as infinite rather than as a continuous numeric value.
10. References
- OpenFold paper, "OpenFold: Retraining AlphaFold2 yields new insights into its learning mechanisms and capacity for generalization", bioRxiv preprint, DOI 10.1101/2022.11.20.517210, second version posted 24 November 2022, 45 pages, CC BY 4.0.
- OpenFold official repository: https://github.com/aqlaboratory/openfold , Apache-2.0, default branch
main. - OpenFold official documentation on ReadTheDocs: https://openfold.readthedocs.io/en/latest/ , covering installation, inference, and training.
- OpenFold
CITATION.cff, in-repository citation metadata file, cff-version 1.2.0, 29 authors, date-released 2021-11-12. - OpenProteinSet paper, "OpenProteinSet: Training data for structural biology at scale", arXiv 2308.05326, 10 August 2023.
- OpenProteinSet dataset hosting page on the AWS Registry of Open Data: https://registry.opendata.aws/openfold/ , including the datasheet.
- DeepMind AlphaFold2 paper, "Highly accurate protein structure prediction with AlphaFold", Nature, DOI 10.1038/s41586-021-03819-2.
- AlphaFold-Multimer paper, "Protein complex prediction with AlphaFold-Multimer", bioRxiv, DOI 10.1101/2021.10.04.463034.
- ColabFold paper, "ColabFold: making protein folding accessible to all", Nature Methods, DOI 10.1038/s41592-022-01488-1.
- ColabFold official repository: https://github.com/sokrypton/ColabFold , MIT license.
- DeepMind AlphaFold2 official repository: https://github.com/google-deepmind/alphafold , Apache-2.0.
- ESMFold preprint, "Language models enable zero-shot prediction of the effects of mutations on protein structure", bioRxiv, DOI 10.1101/2021.07.09.450648.
- OpenMM paper, "OpenMM 7: Rapid development of high performance algorithms for molecular dynamics", PLOS Computational Biology, DOI 10.1371/journal.pcbi.1005659.
- UniProt database paper, "UniProt: the universal protein knowledgebase", Nucleic Acids Research, DOI 10.1093/nar/gky092.
- MGnify database paper, "MGnify: the microbiome analysis resource in 2020", Nucleic Acids Research, DOI 10.1093/nar/gkz1035.
- Original CATH structure classification paper, "CATH - a hierarchic classification of protein domain structures", Structure, DOI 10.1016/s0969-2126(97)00260-8.
- DeepSpeed ZeRO paper, "ZeRO: Memory Optimizations Toward Training Trillion Parameter Models", arXiv 1910.02054.
- CAMEO structure prediction blind assessment community entry point: https://www.cameo3d.org/ .