Generators
Generators propose candidate sequences during optimization. Where constraints define the requirements and optimizers orchestrate the search, generators determine where new candidate sequences come from. Every optimization step begins with generators proposing candidates. A generator takes the current sequences in a Segment, applies its strategy (random mutation, protein language model, structure-conditioned design), and fills theproposal_sequences pool for the optimizer to evaluate.
Generator Categories
Proto organizes generators by how they produce sequences. The three most common categories are below; a fourth, gradient-based generation (PositionWeightGenerator), produces differentiable position weights for the Gradient optimizer. Each category makes different trade-offs between speed, biological realism, and required prior knowledge.
- Mutation
- Autoregressive
- Inverse Folding
Refine existing sequences by modifying selected positions.Mutation generators start from an existing sequence and introduce changes, either uniformly random or guided by a protein language model’s uncertainty estimates. Most require a starting sequence (See the Generator Reference for all available mutation generators and their configuration options.
ESM2Generator, for example, raises if the segment has none); the random generators (RandomProteinGenerator, RandomNucleotideGenerator) are the exception and initialize one automatically when none is provided.When to use: A starting sequence is available and the goal is to refine it. This is the most common category for iterative optimization.python
Assigning Generators to Segments
Before an optimizer can use a generator, it must be assigned to a specific Segment. This tells the generator which part of the construct to modify.python
assign() method validates compatibility:
- The segment’s
sequence_typemust be supported by the generator - Ligand segments cannot have generators assigned (they’re fixed)
python
Multiple Generators
In multi-segment constructs, different generators can be assigned to different segments. Each generator independently proposes candidates for its assigned segment:python
GPU Memory & Batch Size
GPU generators process multiple proposal sequences per forward pass. Thebatch_size config parameter controls how many sequences are sent to the GPU at once. All generators default to batch_size=1 (sequential processing); increase it to enable batching.
The framework splits the full set of proposals into chunks of batch_size and processes each chunk on the GPU. For example, if the optimizer requests 50 proposals and batch_size=16, the generator runs 4 forward passes (16 + 16 + 16 + 2).
Next Steps
Constraints
Quality requirements that sequences must satisfy
Optimizers
Learn how optimizers coordinate generators and constraints
Tools
Explore the bioinformatics tools that power generators
Generator Reference
Full API reference for each generator















