Skip to main content
ESM2 Protein Language Model
License: ESM2 is open source and free for academic and commercial use under an MIT license. Please refer to the license for full terms.

This generator is open source. Any third-party models, product names, or trademarks referenced are the property of their respective owners, and Proto is not affiliated with them.


Go to Tool Page
evo-design/proto-language/proto_language/generator/esm2_generator.py
View source
Copy citation
Generator contributors
Protein sequence mutation/refinement generator using ESM2 language model.
This generator uses the ESM2 protein language model to refine existing protein sequences through iterative mutation. It masks positions according to the configured masking strategy and samples biologically plausible amino acids at those positions. The generator category is "mutation", indicating it refines proposal sequences through targeted mutations.

API Reference

ConfigESM2GeneratorConfig Source
Configuration object for ESM2Generator.This class defines configuration parameters for the ESM2 generator, which uses a protein language model to refine existing protein sequences through iterative mutation of masked positions. In Proto Language, ESM2 is registered as a mutation-category generator that edits the supplied starting sequence; the segment must carry a sequence (directly or from a prior optimizer stage).
enum
default:"esm2_t33_650M_UR50D"
ESM-2 model variant to load (e.g. esm2_t33_650M_UR50D).Options: esm2_t6_8M_UR50D, esm2_t12_35M_UR50D, esm2_t30_150M_UR50D, esm2_t33_650M_UR50D, esm2_t36_3B_UR50D, esm2_t48_15B_UR50D
MaskingStrategy
Controls which positions to mask for sampling. Default: random 30%.
enum
default:"single_pass"
‘single_pass’ fills all masks in one forward; ‘iterative_refinement’ runs a MaskGIT-style loop.Options: single_pass, iterative_refinement
number
default:"1.0"
Sharpness of sampling. Below 1 sharpens toward the likely amino acid; above 1 increases diversity.
number
default:"1.0"
Nucleus sampling cumulative probability cutoff used in iterative refinement. 1.0 disables it.
integer
default:"20"
Number of iterative-refinement rounds. Returns diminish above 20.
enum
default:"cosine"
Per-round unmask rate. ‘cosine’ commits more positions late; ‘linear’ commits the same each round.Options: cosine, linear
enum
default:"random"
How positions are picked each round. ‘entropy’ takes most-confident first; ‘random’ is uniform.Options: random, entropy
boolean
default:"True"
Anneal temperature toward 0 across rounds
string
default:"cuda"
GPU device to run ESM2 on (e.g. ‘cuda’ or ‘cuda:0’).
integer
default:"1"
Number of sequences to process simultaneously on GPU

Usage

python

Metadata