ESM-IF1 (Inverse Folding)
Date Published

Links
Background ESM-IF1 (also published as the GVPTransformer inverse folding model) is part of the ESM family of protein language and structure models developed by Meta's FAIR team. Unlike sequence-only language models, ESM-IF1 is trained to map 3D backbone geometry to amino-acid sequences: it takes backbone atom coordinates as input and outputs conditional sequence probabilities. The model was trained on roughly 12 million structures predicted by AlphaFold2 and combines invariant geometric input processing layers with a sequence-to-sequence transformer. The released checkpoint (esm_if1_gvp4_t16_142M_UR50) contains ~124M parameters, 20 model layers and a 512-dimensional embedding, and the repository provides code, pre-trained weights, and example notebooks for getting started. Core capabilities ESM-IF1 supports two primary workflows: (1) sequence design/sampling for a fixed backbone and (2) conditional scoring of candidate sequences given a backbone. Sampling can generate diverse candidate sequences through temperature-controlled sampling; a higher temperature yields more diversity, while very low temperatures (e.g., 1e-6) prioritize native-sequence recovery. Scoring computes conditional log-likelihoods per sequence (average log-likelihood per residue) so you can rank designs or assess the plausibility of mutations in a structural context. The model was benchmarked to achieve ~51% native sequence recovery on structurally held-out backbones and ~72% recovery for buried residues — making it a state-of-the-art choice for fixed-backbone design tasks. Practical usage and example workflows The repository includes ready-to-run scripts and a Colab notebook for common tasks. Use sample_sequences.py to produce fasta-formatted design libraries from an input PDB/mmCIF, with flags to choose chain(s), set sampling temperature, and specify the number of samples. Use score_log_likelihoods.py to compute conditional log-likelihoods for one or many sequences against a given structure; outputs are saved as CSV with average per-residue log-likelihoods for straightforward ranking. Typical design pipelines combine ESM-IF1 sampling with downstream validation: (a) generate a candidate library with ESM-IF1, (b) rank designs with ESM-IF1 scoring, (c) predict structures for top candidates using a folding model (e.g., ESMFold or AlphaFold/ColabFold), and (d) triage by predicted stability, binding interfaces, or other downstream metrics prior to experimental testing. Handling partial structures and missing coordinates ESM-IF1 was trained with span-masking to tolerate missing backbone coordinates, so it can design or score sequences for partially determined backbones (gapped chains, modeled loops, or structures with unresolved regions). This makes the model well-suited for protein engineering tasks where only a scaffold or partial interface is known, enabling targeted sequence design for loops or interface residues while conditioning on the rest of the backbone. Integration, environment, and tooling ESM-IF1 is distributed in the FAIR-ESM repository and can be used via the provided PyTorch codebase. Prerequisites include Python with PyTorch; the repo also documents integration with Hugging Face transformers and availability via torch.hub for other ESM models. Install the package with pip install fair-esm or install the bleeding-edge code via pip install git+https://github.com/facebookresearch/esm.git. Example notebooks and scripts live in examples/inverse_folding; a Colab notebook demonstrates sequence design and scoring without local setup. The codebase is MIT-licensed; the ESM Metagenomic Atlas data referenced in the repo is provided under CC BY 4.0. Large-model inference strategies (e.g., CPU offloading or FSDP) and tips for using GPU resources are described elsewhere in the repo and are applicable when combining ESM-IF1 with other large ESM models. When to use ESM-IF1 Use ESM-IF1 when you need to design or evaluate sequences for a specific backbone geometry (fixed-backbone design), to score the structural compatibility of variants, or to generate sequence diversity conditioned on a scaffold. It's especially useful for scaffold-focused engineering (binding scaffolds, enzyme active-site neighborhoods, buried core redesign) and cases where you want a rapid, structure-conditioned sequence prior to computational folding or wet-lab validation. Combine ESM-IF1 with folding predictors (ESMFold, AlphaFold/ColabFold) and downstream filters (stability predictors, interface analyses) to build end-to-end in silico design pipelines.