> ## Documentation Index
> Fetch the complete documentation index at: https://proto.evodesign.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Generators

> Components that propose candidate sequences during optimization

<div class="card-strip-wrapper">
  <div class="card-strip" data-duration="96">
    <a href="/docs/language/generators/mpnn-mutation" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/mpnn-mutation/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/evo1" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/evo1/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/random-protein" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/random-protein/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/ligandmpnn" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/ligandmpnn/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/progen2" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/progen2/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/msa" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/msa/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/fampnn" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/fampnn/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/esm2" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/esm2/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/freebindcraft" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/freebindcraft/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/esm3" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/esm3/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/evo2" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/evo2/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/semigreedy-mutation" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/semigreedy-mutation/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/random-nucleotide" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/random-nucleotide/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/position-weight" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/position-weight/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/proteinmpnn" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/proteinmpnn/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/rfdiffusion-mpnn-binder" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/rfdiffusion-mpnn-binder/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/mpnn-mutation" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/mpnn-mutation/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/evo1" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/evo1/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/random-protein" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/random-protein/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/ligandmpnn" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/ligandmpnn/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/progen2" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/progen2/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/msa" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/msa/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/fampnn" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/fampnn/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/esm2" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/esm2/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/freebindcraft" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/freebindcraft/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/esm3" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/esm3/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/evo2" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/evo2/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/semigreedy-mutation" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/semigreedy-mutation/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/random-nucleotide" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/random-nucleotide/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/position-weight" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/position-weight/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/proteinmpnn" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/proteinmpnn/carousel.png" alt="" loading="lazy" />
    </a>

    <a href="/docs/language/generators/rfdiffusion-mpnn-binder" class="card-strip-item">
      <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/rfdiffusion-mpnn-binder/carousel.png" alt="" loading="lazy" />
    </a>
  </div>
</div>

# Generators

Generators propose candidate sequences during optimization. Where [constraints](/docs/language/concepts/constraints) define the requirements and [optimizers](/docs/language/concepts/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](/docs/language/concepts/segments), applies its strategy (random mutation, protein language model, structure-conditioned design), and fills the `proposal_sequences` pool for the optimizer to evaluate.

<div className="block dark:hidden">
  <svg viewBox="0 0 860 300" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Generator optimization loop" style={{width:"100%",height:"auto",display:"block"}}><defs><pattern id="gridgenerators1L" width="22" height="22" patternUnits="userSpaceOnUse"><circle cx="2" cy="2" r="1.2" fill="#344649" fillOpacity="0.10" /></pattern><marker id="arrgenerators1L" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 L3,5 z" fill="#768b8e" /></marker></defs><rect x="12" y="12" width="836" height="276" rx="16" fill="#f9fcfc" stroke="#dee9e8" strokeWidth="1.2" /><rect x="12" y="12" width="836" height="276" rx="16" fill="url(#gridgenerators1L)" /><path d="M234,98 L333,98" fill="none" stroke="#9eb4b2" strokeWidth="1.6" markerEnd="url(#arrgenerators1L)" /><path d="M525,98 L624,98" fill="none" stroke="#9eb4b2" strokeWidth="1.6" markerEnd="url(#arrgenerators1L)" /><path d="M721,130 L721,198" fill="none" stroke="#9eb4b2" strokeWidth="1.6" markerEnd="url(#arrgenerators1L)" /><path d="M626,232 L236,232" fill="none" stroke="#9eb4b2" strokeWidth="1.6" markerEnd="url(#arrgenerators1L)" /><path d="M139,200 L139,132" fill="none" stroke="#9eb4b2" strokeWidth="1.6" markerEnd="url(#arrgenerators1L)" /><rect x="44" y="66" width="190" height="64" rx="10" fill="#f4f9f9" stroke="#dbe6e4" strokeWidth="1.2" /><rect x="54" y="78" width="4" height="40" rx="2" fill="#2f8f6b" /><text x="139" y="104" fontFamily="'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace" fontSize="14" fontWeight="600" fill="#1d2c2f" textAnchor="middle">result\_sequences</text><rect x="335" y="66" width="190" height="64" rx="10" fill="#046e7a" /><rect x="345" y="78" width="4" height="40" rx="2" fill="#bfe2e7" /><text x="430" y="104" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="14" fontWeight="600" fill="#ffffff" textAnchor="middle">Generator</text><rect x="626" y="66" width="190" height="64" rx="10" fill="#f4f9f9" stroke="#dbe6e4" strokeWidth="1.2" /><rect x="636" y="78" width="4" height="40" rx="2" fill="#046e7a" /><text x="721" y="104" fontFamily="'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace" fontSize="14" fontWeight="600" fill="#1d2c2f" textAnchor="middle">proposal\_sequences</text><rect x="44" y="200" width="190" height="64" rx="10" fill="#eef2f4" stroke="#dbe3e6" strokeWidth="1.2" /><rect x="54" y="212" width="4" height="40" rx="2" fill="#768b8e" /><text x="139" y="238" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="14" fontWeight="600" fill="#344649" textAnchor="middle">Optimizer</text><rect x="626" y="200" width="190" height="64" rx="10" fill="#eef2f4" stroke="#dbe3e6" strokeWidth="1.2" /><rect x="636" y="212" width="4" height="40" rx="2" fill="#768b8e" /><text x="721" y="238" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="14" fontWeight="600" fill="#344649" textAnchor="middle">Constraints</text><g fill="#ffffff" stroke="#9eb4b2" strokeWidth="1.4"><circle cx="234" cy="98" r="3.2" /><circle cx="335" cy="98" r="3.2" /><circle cx="525" cy="98" r="3.2" /><circle cx="626" cy="98" r="3.2" /><circle cx="721" cy="130" r="3.2" /><circle cx="721" cy="200" r="3.2" /><circle cx="626" cy="232" r="3.2" /><circle cx="234" cy="232" r="3.2" /><circle cx="139" cy="200" r="3.2" /><circle cx="139" cy="130" r="3.2" /></g><rect x="260" y="87.25" width="50" height="21.5" rx="6" fill="#f9fcfc" stroke="#e2e9ea" strokeWidth="1" /><text x="285" y="102" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="11" fontWeight="400" fill="#506467" textAnchor="middle">input</text><rect x="547" y="87.25" width="56" height="21.5" rx="6" fill="#f9fcfc" stroke="#e2e9ea" strokeWidth="1" /><text x="575" y="102" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="11" fontWeight="400" fill="#506467" textAnchor="middle">sample</text><rect x="405" y="221.25" width="50" height="21.5" rx="6" fill="#f9fcfc" stroke="#e2e9ea" strokeWidth="1" /><text x="430" y="236" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="11" fontWeight="400" fill="#506467" textAnchor="middle">score</text><rect x="96" y="155.25" width="86" height="21.5" rx="6" fill="#f9fcfc" stroke="#e2e9ea" strokeWidth="1" /><text x="139" y="170" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="11" fontWeight="400" fill="#506467" textAnchor="middle">select best</text></svg>
</div>

<div className="hidden dark:block">
  <svg viewBox="0 0 860 300" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Generator optimization loop" style={{width:"100%",height:"auto",display:"block"}}><defs><pattern id="gridgenerators1D" width="22" height="22" patternUnits="userSpaceOnUse"><circle cx="2" cy="2" r="1.2" fill="#9eb4b2" fillOpacity="0.10" /></pattern><marker id="arrgenerators1D" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 L3,5 z" fill="#7e9498" /></marker></defs><rect x="12" y="12" width="836" height="276" rx="16" fill="#0e1718" stroke="#2b3c3e" strokeWidth="1.2" /><rect x="12" y="12" width="836" height="276" rx="16" fill="url(#gridgenerators1D)" /><path d="M234,98 L333,98" fill="none" stroke="#566b6e" strokeWidth="1.6" markerEnd="url(#arrgenerators1D)" /><path d="M525,98 L624,98" fill="none" stroke="#566b6e" strokeWidth="1.6" markerEnd="url(#arrgenerators1D)" /><path d="M721,130 L721,198" fill="none" stroke="#566b6e" strokeWidth="1.6" markerEnd="url(#arrgenerators1D)" /><path d="M626,232 L236,232" fill="none" stroke="#566b6e" strokeWidth="1.6" markerEnd="url(#arrgenerators1D)" /><path d="M139,200 L139,132" fill="none" stroke="#566b6e" strokeWidth="1.6" markerEnd="url(#arrgenerators1D)" /><rect x="44" y="66" width="190" height="64" rx="10" fill="#1a2a2b" stroke="#33474a" strokeWidth="1.2" /><rect x="54" y="78" width="4" height="40" rx="2" fill="#37a07c" /><text x="139" y="104" fontFamily="'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace" fontSize="14" fontWeight="600" fill="#eef5f4" textAnchor="middle">result\_sequences</text><rect x="335" y="66" width="190" height="64" rx="10" fill="#0a7e8c" /><rect x="345" y="78" width="4" height="40" rx="2" fill="#c0e6ea" /><text x="430" y="104" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="14" fontWeight="600" fill="#ffffff" textAnchor="middle">Generator</text><rect x="626" y="66" width="190" height="64" rx="10" fill="#1a2a2b" stroke="#33474a" strokeWidth="1.2" /><rect x="636" y="78" width="4" height="40" rx="2" fill="#0a7e8c" /><text x="721" y="104" fontFamily="'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace" fontSize="14" fontWeight="600" fill="#eef5f4" textAnchor="middle">proposal\_sequences</text><rect x="44" y="200" width="190" height="64" rx="10" fill="#1b2829" stroke="#33474a" strokeWidth="1.2" /><rect x="54" y="212" width="4" height="40" rx="2" fill="#7e9498" /><text x="139" y="238" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="14" fontWeight="600" fill="#d6e1df" textAnchor="middle">Optimizer</text><rect x="626" y="200" width="190" height="64" rx="10" fill="#1b2829" stroke="#33474a" strokeWidth="1.2" /><rect x="636" y="212" width="4" height="40" rx="2" fill="#7e9498" /><text x="721" y="238" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="14" fontWeight="600" fill="#d6e1df" textAnchor="middle">Constraints</text><g fill="#13201f" stroke="#566b6e" strokeWidth="1.4"><circle cx="234" cy="98" r="3.2" /><circle cx="335" cy="98" r="3.2" /><circle cx="525" cy="98" r="3.2" /><circle cx="626" cy="98" r="3.2" /><circle cx="721" cy="130" r="3.2" /><circle cx="721" cy="200" r="3.2" /><circle cx="626" cy="232" r="3.2" /><circle cx="234" cy="232" r="3.2" /><circle cx="139" cy="200" r="3.2" /><circle cx="139" cy="130" r="3.2" /></g><rect x="260" y="87.25" width="50" height="21.5" rx="6" fill="#13201f" stroke="#33474a" strokeWidth="1" /><text x="285" y="102" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="11" fontWeight="400" fill="#9eb4b2" textAnchor="middle">input</text><rect x="547" y="87.25" width="56" height="21.5" rx="6" fill="#13201f" stroke="#33474a" strokeWidth="1" /><text x="575" y="102" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="11" fontWeight="400" fill="#9eb4b2" textAnchor="middle">sample</text><rect x="405" y="221.25" width="50" height="21.5" rx="6" fill="#13201f" stroke="#33474a" strokeWidth="1" /><text x="430" y="236" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="11" fontWeight="400" fill="#9eb4b2" textAnchor="middle">score</text><rect x="96" y="155.25" width="86" height="21.5" rx="6" fill="#13201f" stroke="#33474a" strokeWidth="1" /><text x="139" y="170" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="11" fontWeight="400" fill="#9eb4b2" textAnchor="middle">select best</text></svg>
</div>

## 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](/docs/language/optimizers/gradient). Each category makes different trade-offs between speed, biological realism, and required prior knowledge.

<Tabs>
  <Tab title="Mutation">
    **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 (`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.

    <div className="block dark:hidden">
      <svg viewBox="0 0 760 210" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Mutation generator transforms a sequence" style={{width:"100%",height:"auto",display:"block"}}><defs><pattern id="gridgenerators2L" width="22" height="22" patternUnits="userSpaceOnUse"><circle cx="2" cy="2" r="1.2" fill="#344649" fillOpacity="0.10" /></pattern><marker id="arrgenerators2L" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 L3,5 z" fill="#768b8e" /></marker></defs><rect x="12" y="12" width="736" height="186" rx="16" fill="#f9fcfc" stroke="#dee9e8" strokeWidth="1.2" /><rect x="12" y="12" width="736" height="186" rx="16" fill="url(#gridgenerators2L)" /><path d="M284,105 L474,105" fill="none" stroke="#9eb4b2" strokeWidth="1.6" markerEnd="url(#arrgenerators2L)" /><rect x="64" y="63" width="220" height="84" rx="10" fill="#eef2f4" stroke="#dbe3e6" strokeWidth="1.2" /><rect x="160" y="75" width="28" height="3.5" rx="2" fill="#768b8e" /><text x="174" y="110" fontFamily="'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace" fontSize="14" fontWeight="600" fill="#344649" textAnchor="middle">MKTAY<tspan fontWeight="800" fill="#046e7a">L</tspan>LIGL...</text><rect x="476" y="63" width="220" height="84" rx="10" fill="#046e7a" /><rect x="572" y="75" width="28" height="3.5" rx="2" fill="#bfe2e7" /><text x="586" y="110" fontFamily="'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace" fontSize="14" fontWeight="600" fill="#ffffff" textAnchor="middle">MKTAY<tspan fontWeight="800" fill="#bfe2e7">V</tspan>LIGL...</text><g fill="#ffffff" stroke="#9eb4b2" strokeWidth="1.4"><circle cx="284" cy="105" r="3.2" /><circle cx="476" cy="105" r="3.2" /></g><rect x="322" y="94.25" width="116" height="21.5" rx="6" fill="#f9fcfc" stroke="#e2e9ea" strokeWidth="1" /><text x="380" y="109" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="11" fontWeight="400" fill="#506467" textAnchor="middle">mutate positions</text></svg>
    </div>

    <div className="hidden dark:block">
      <svg viewBox="0 0 760 210" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Mutation generator transforms a sequence" style={{width:"100%",height:"auto",display:"block"}}><defs><pattern id="gridgenerators2D" width="22" height="22" patternUnits="userSpaceOnUse"><circle cx="2" cy="2" r="1.2" fill="#9eb4b2" fillOpacity="0.10" /></pattern><marker id="arrgenerators2D" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 L3,5 z" fill="#7e9498" /></marker></defs><rect x="12" y="12" width="736" height="186" rx="16" fill="#0e1718" stroke="#2b3c3e" strokeWidth="1.2" /><rect x="12" y="12" width="736" height="186" rx="16" fill="url(#gridgenerators2D)" /><path d="M284,105 L474,105" fill="none" stroke="#566b6e" strokeWidth="1.6" markerEnd="url(#arrgenerators2D)" /><rect x="64" y="63" width="220" height="84" rx="10" fill="#1b2829" stroke="#33474a" strokeWidth="1.2" /><rect x="160" y="75" width="28" height="3.5" rx="2" fill="#7e9498" /><text x="174" y="110" fontFamily="'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace" fontSize="14" fontWeight="600" fill="#d6e1df" textAnchor="middle">MKTAY<tspan fontWeight="800" fill="#0a7e8c">L</tspan>LIGL...</text><rect x="476" y="63" width="220" height="84" rx="10" fill="#0a7e8c" /><rect x="572" y="75" width="28" height="3.5" rx="2" fill="#c0e6ea" /><text x="586" y="110" fontFamily="'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace" fontSize="14" fontWeight="600" fill="#ffffff" textAnchor="middle">MKTAY<tspan fontWeight="800" fill="#c0e6ea">V</tspan>LIGL...</text><g fill="#13201f" stroke="#566b6e" strokeWidth="1.4"><circle cx="284" cy="105" r="3.2" /><circle cx="476" cy="105" r="3.2" /></g><rect x="322" y="94.25" width="116" height="21.5" rx="6" fill="#13201f" stroke="#33474a" strokeWidth="1" /><text x="380" y="109" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="11" fontWeight="400" fill="#9eb4b2" textAnchor="middle">mutate positions</text></svg>
    </div>

    **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 python icon="python" theme={null}
    from proto_language.generator import (
        RandomNucleotideGenerator, RandomNucleotideGeneratorConfig
    )
    from proto_tools.transforms.masking import MaskingStrategy

    generator = RandomNucleotideGenerator(
        RandomNucleotideGeneratorConfig(masking_strategy=MaskingStrategy(num_mutations=5))
    )
    ```

    See the [Generator Reference](/docs/language/generators/random-nucleotide) for all available mutation generators and their configuration options.
  </Tab>

  <Tab title="Autoregressive">
    **Generate sequences from scratch, token by token (left-to-right).**

    Autoregressive generators use large language models trained on biological sequences to generate entirely new sequences. They don't need a starting sequence; they create one from a prompt or from nothing.

    <div className="block dark:hidden">
      <svg viewBox="0 0 760 210" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Autoregressive generator extends a sequence" style={{width:"100%",height:"auto",display:"block"}}><defs><pattern id="gridgenerators3L" width="22" height="22" patternUnits="userSpaceOnUse"><circle cx="2" cy="2" r="1.2" fill="#344649" fillOpacity="0.10" /></pattern><marker id="arrgenerators3L" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 L3,5 z" fill="#768b8e" /></marker></defs><rect x="12" y="12" width="736" height="186" rx="16" fill="#f9fcfc" stroke="#dee9e8" strokeWidth="1.2" /><rect x="12" y="12" width="736" height="186" rx="16" fill="url(#gridgenerators3L)" /><path d="M284,105 L474,105" fill="none" stroke="#9eb4b2" strokeWidth="1.6" markerEnd="url(#arrgenerators3L)" /><rect x="64" y="63" width="220" height="84" rx="10" fill="#eef2f4" stroke="#dbe3e6" strokeWidth="1.2" /><rect x="160" y="75" width="28" height="3.5" rx="2" fill="#768b8e" /><text x="174" y="110" fontFamily="'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace" fontSize="14" fontWeight="600" fill="#344649" textAnchor="middle">ATG</text><rect x="476" y="63" width="220" height="84" rx="10" fill="#046e7a" /><rect x="572" y="75" width="28" height="3.5" rx="2" fill="#bfe2e7" /><text x="586" y="110" fontFamily="'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace" fontSize="14" fontWeight="600" fill="#ffffff" textAnchor="middle">ATGCCTGAA...2000bp</text><g fill="#ffffff" stroke="#9eb4b2" strokeWidth="1.4"><circle cx="284" cy="105" r="3.2" /><circle cx="476" cy="105" r="3.2" /></g><rect x="346" y="94.25" width="68" height="21.5" rx="6" fill="#f9fcfc" stroke="#e2e9ea" strokeWidth="1" /><text x="380" y="109" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="11" fontWeight="400" fill="#506467" textAnchor="middle">generate</text></svg>
    </div>

    <div className="hidden dark:block">
      <svg viewBox="0 0 760 210" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Autoregressive generator extends a sequence" style={{width:"100%",height:"auto",display:"block"}}><defs><pattern id="gridgenerators3D" width="22" height="22" patternUnits="userSpaceOnUse"><circle cx="2" cy="2" r="1.2" fill="#9eb4b2" fillOpacity="0.10" /></pattern><marker id="arrgenerators3D" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 L3,5 z" fill="#7e9498" /></marker></defs><rect x="12" y="12" width="736" height="186" rx="16" fill="#0e1718" stroke="#2b3c3e" strokeWidth="1.2" /><rect x="12" y="12" width="736" height="186" rx="16" fill="url(#gridgenerators3D)" /><path d="M284,105 L474,105" fill="none" stroke="#566b6e" strokeWidth="1.6" markerEnd="url(#arrgenerators3D)" /><rect x="64" y="63" width="220" height="84" rx="10" fill="#1b2829" stroke="#33474a" strokeWidth="1.2" /><rect x="160" y="75" width="28" height="3.5" rx="2" fill="#7e9498" /><text x="174" y="110" fontFamily="'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace" fontSize="14" fontWeight="600" fill="#d6e1df" textAnchor="middle">ATG</text><rect x="476" y="63" width="220" height="84" rx="10" fill="#0a7e8c" /><rect x="572" y="75" width="28" height="3.5" rx="2" fill="#c0e6ea" /><text x="586" y="110" fontFamily="'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace" fontSize="14" fontWeight="600" fill="#ffffff" textAnchor="middle">ATGCCTGAA...2000bp</text><g fill="#13201f" stroke="#566b6e" strokeWidth="1.4"><circle cx="284" cy="105" r="3.2" /><circle cx="476" cy="105" r="3.2" /></g><rect x="346" y="94.25" width="68" height="21.5" rx="6" fill="#13201f" stroke="#33474a" strokeWidth="1" /><text x="380" y="109" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="11" fontWeight="400" fill="#9eb4b2" textAnchor="middle">generate</text></svg>
    </div>

    **When to use:** Novel sequences are needed (especially long DNA), or the goal is to sample from the model's learned distribution over natural sequences.

    <Warning>
      Autoregressive generators overwrite any existing sequences in the segment. If the segment already has input sequences, they will be replaced.
    </Warning>

    ```python python icon="python" theme={null}
    from proto_language.generator import (
        Evo2Generator, Evo2GeneratorConfig
    )

    generator = Evo2Generator(
        Evo2GeneratorConfig(
            prompts=["ACGT"],
            model_checkpoint="evo2_7b",
            temperature=1.0,
        )
    )
    ```

    See the [Generator Reference](/docs/language/generators/evo2) for all available autoregressive generators and their configuration options.
  </Tab>

  <Tab title="Inverse Folding">
    **Design sequences that fold into a target 3D structure.**

    Inverse folding generators solve the inverse protein design problem: given a desired backbone structure (as a PDB file), predict the amino acid sequence most likely to fold into that shape. They don't need a starting sequence; unknown positions are initialized as `X`.

    <div className="block dark:hidden">
      <svg viewBox="0 0 760 210" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Inverse folding generator designs a sequence from a structure" style={{width:"100%",height:"auto",display:"block"}}><defs><pattern id="gridgenerators4L" width="22" height="22" patternUnits="userSpaceOnUse"><circle cx="2" cy="2" r="1.2" fill="#344649" fillOpacity="0.10" /></pattern><marker id="arrgenerators4L" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 L3,5 z" fill="#768b8e" /></marker></defs><rect x="12" y="12" width="736" height="186" rx="16" fill="#f9fcfc" stroke="#dee9e8" strokeWidth="1.2" /><rect x="12" y="12" width="736" height="186" rx="16" fill="url(#gridgenerators4L)" /><path d="M284,105 L474,105" fill="none" stroke="#9eb4b2" strokeWidth="1.6" markerEnd="url(#arrgenerators4L)" /><rect x="64" y="63" width="220" height="84" rx="10" fill="#eef2f4" stroke="#dbe3e6" strokeWidth="1.2" /><rect x="160" y="75" width="28" height="3.5" rx="2" fill="#768b8e" /><text x="174" y="101" fontFamily="'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace" fontSize="14" fontWeight="600" fill="#344649" textAnchor="middle">target.pdb</text><text x="174" y="120" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="11.5" fontWeight="400" fill="#768b8e" textAnchor="middle">(3D structure)</text><rect x="476" y="63" width="220" height="84" rx="10" fill="#046e7a" /><rect x="572" y="75" width="28" height="3.5" rx="2" fill="#bfe2e7" /><text x="586" y="110" fontFamily="'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace" fontSize="14" fontWeight="600" fill="#ffffff" textAnchor="middle">MKTAYLLIGL...</text><g fill="#ffffff" stroke="#9eb4b2" strokeWidth="1.4"><circle cx="284" cy="105" r="3.2" /><circle cx="476" cy="105" r="3.2" /></g><rect x="334" y="94.25" width="92" height="21.5" rx="6" fill="#f9fcfc" stroke="#e2e9ea" strokeWidth="1" /><text x="380" y="109" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="11" fontWeight="400" fill="#506467" textAnchor="middle">inverse fold</text></svg>
    </div>

    <div className="hidden dark:block">
      <svg viewBox="0 0 760 210" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Inverse folding generator designs a sequence from a structure" style={{width:"100%",height:"auto",display:"block"}}><defs><pattern id="gridgenerators4D" width="22" height="22" patternUnits="userSpaceOnUse"><circle cx="2" cy="2" r="1.2" fill="#9eb4b2" fillOpacity="0.10" /></pattern><marker id="arrgenerators4D" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="6.5" markerHeight="6.5" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 L3,5 z" fill="#7e9498" /></marker></defs><rect x="12" y="12" width="736" height="186" rx="16" fill="#0e1718" stroke="#2b3c3e" strokeWidth="1.2" /><rect x="12" y="12" width="736" height="186" rx="16" fill="url(#gridgenerators4D)" /><path d="M284,105 L474,105" fill="none" stroke="#566b6e" strokeWidth="1.6" markerEnd="url(#arrgenerators4D)" /><rect x="64" y="63" width="220" height="84" rx="10" fill="#1b2829" stroke="#33474a" strokeWidth="1.2" /><rect x="160" y="75" width="28" height="3.5" rx="2" fill="#7e9498" /><text x="174" y="101" fontFamily="'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace" fontSize="14" fontWeight="600" fill="#d6e1df" textAnchor="middle">target.pdb</text><text x="174" y="120" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="11.5" fontWeight="400" fill="#9eb4b2" textAnchor="middle">(3D structure)</text><rect x="476" y="63" width="220" height="84" rx="10" fill="#0a7e8c" /><rect x="572" y="75" width="28" height="3.5" rx="2" fill="#c0e6ea" /><text x="586" y="110" fontFamily="'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace" fontSize="14" fontWeight="600" fill="#ffffff" textAnchor="middle">MKTAYLLIGL...</text><g fill="#13201f" stroke="#566b6e" strokeWidth="1.4"><circle cx="284" cy="105" r="3.2" /><circle cx="476" cy="105" r="3.2" /></g><rect x="334" y="94.25" width="92" height="21.5" rx="6" fill="#13201f" stroke="#33474a" strokeWidth="1" /><text x="380" y="109" fontFamily="Geist, ui-sans-serif, system-ui, -apple-system, sans-serif" fontSize="11" fontWeight="400" fill="#9eb4b2" textAnchor="middle">inverse fold</text></svg>
    </div>

    **When to use:** A target protein structure (from experiment or computational design) is available, and the goal is to find sequences that fold into it.

    ```python python icon="python" theme={null}
    from proto_language.generator import (
        ProteinMPNNGenerator, ProteinMPNNGeneratorConfig
    )

    generator = ProteinMPNNGenerator(
        ProteinMPNNGeneratorConfig(
            structure_inputs="target.pdb",
            temperature=0.1,
        )
    )
    ```

    See the [Generator Reference](/docs/language/generators/proteinmpnn) for all available inverse folding generators and their configuration options.
  </Tab>
</Tabs>

## 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 python icon="python" theme={null}
from proto_language.core import Segment
from proto_language.generator import (
    RandomNucleotideGenerator, RandomNucleotideGeneratorConfig
)
from proto_tools.transforms.masking import MaskingStrategy

# Create a segment
segment = Segment(length=100, sequence_type="dna")

# Create and assign the generator
generator = RandomNucleotideGenerator(
    RandomNucleotideGeneratorConfig(masking_strategy=MaskingStrategy(num_mutations=5))
)
generator.assign(segment)
```

The `assign()` method validates compatibility:

* The segment's `sequence_type` must be supported by the generator
* Ligand segments cannot have generators assigned (they're fixed)

```python python icon="python" theme={null}
# This works: ESM2 supports protein
protein_segment = Segment(length=100, sequence_type="protein")
esm2_gen = ESM2Generator(ESM2GeneratorConfig())
esm2_gen.assign(protein_segment)

# This raises ValueError: ESM2 doesn't support DNA
dna_segment = Segment(length=100, sequence_type="dna")
esm2_gen.assign(dna_segment)
```

## Multiple Generators

In multi-segment constructs, different generators can be assigned to different segments. Each generator independently proposes candidates for its assigned segment:

```python python icon="python" theme={null}
from proto_language.core import Segment, Construct
from proto_language.optimizer import MCMCOptimizer, MCMCOptimizerConfig

# Two segments with different generation strategies
promoter = Segment(length=200, sequence_type="dna", label="promoter")
coding_seq = Segment(length=300, sequence_type="dna", label="cds")

construct = Construct([promoter, coding_seq])

# Assign different generators to each segment
gen_promoter = RandomNucleotideGenerator(
    RandomNucleotideGeneratorConfig(masking_strategy=MaskingStrategy(num_mutations=20))
)
gen_cds = RandomNucleotideGenerator(
    RandomNucleotideGeneratorConfig(masking_strategy=MaskingStrategy(num_mutations=6))
)

gen_promoter.assign(promoter)
gen_cds.assign(coding_seq)

optimizer = MCMCOptimizer(
    constructs=[construct],
    generators=[gen_promoter, gen_cds],
    constraints=[...],
    config=MCMCOptimizerConfig(num_steps=500, num_results=5, proposals_per_result=10),
)
```

<Tip>
  Use different mutation counts for different segments. Conserved regions (like coding sequences) benefit from fewer mutations per step, while exploratory regions (like promoters) can tolerate more.
</Tip>

## GPU Memory & Batch Size

GPU generators process multiple proposal sequences per forward pass. The `batch_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).

<Tip>
  If GPU out-of-memory (OOM) errors occur, reduce the generator's `batch_size` in its config. This is especially common with long sequences or large models. See the [Generator Reference](/docs/language/generators/esm2) for per-generator configuration details and available parameters.
</Tip>

## Next Steps

<CardGroup cols={2}>
  <Card title="Constraints" icon="square-function" href="/docs/language/concepts/constraints">
    Quality requirements that sequences must satisfy
  </Card>

  <Card title="Optimizers" icon="chart-line" href="/docs/language/concepts/optimizers">
    Learn how optimizers coordinate generators and constraints
  </Card>

  <Card title="Tools" icon="wrench" href="/docs/language/concepts/tools">
    Explore the bioinformatics tools that power generators
  </Card>

  <Card title="Generator Reference" icon="code" href="/docs/language/generators/random-nucleotide">
    Full API reference for each generator
  </Card>
</CardGroup>

## Generator Catalog

<div class="tool-catalog-grid">
  <a href="/docs/language/generators/esm2" class="tool-catalog-card">
    <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/esm2/carousel.png" alt="" loading="lazy" />
  </a>

  <a href="/docs/language/generators/esm3" class="tool-catalog-card">
    <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/esm3/carousel.png" alt="" loading="lazy" />
  </a>

  <a href="/docs/language/generators/evo1" class="tool-catalog-card">
    <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/evo1/carousel.png" alt="" loading="lazy" />
  </a>

  <a href="/docs/language/generators/evo2" class="tool-catalog-card">
    <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/evo2/carousel.png" alt="" loading="lazy" />
  </a>

  <a href="/docs/language/generators/fampnn" class="tool-catalog-card">
    <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/fampnn/carousel.png" alt="" loading="lazy" />
  </a>

  <a href="/docs/language/generators/freebindcraft" class="tool-catalog-card">
    <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/freebindcraft/carousel.png" alt="" loading="lazy" />
  </a>

  <a href="/docs/language/generators/ligandmpnn" class="tool-catalog-card">
    <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/ligandmpnn/carousel.png" alt="" loading="lazy" />
  </a>

  <a href="/docs/language/generators/mpnn-mutation" class="tool-catalog-card">
    <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/mpnn-mutation/carousel.png" alt="" loading="lazy" />
  </a>

  <a href="/docs/language/generators/msa" class="tool-catalog-card">
    <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/msa/carousel.png" alt="" loading="lazy" />
  </a>

  <a href="/docs/language/generators/position-weight" class="tool-catalog-card">
    <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/position-weight/carousel.png" alt="" loading="lazy" />
  </a>

  <a href="/docs/language/generators/progen2" class="tool-catalog-card">
    <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/progen2/carousel.png" alt="" loading="lazy" />
  </a>

  <a href="/docs/language/generators/proteinmpnn" class="tool-catalog-card">
    <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/proteinmpnn/carousel.png" alt="" loading="lazy" />
  </a>

  <a href="/docs/language/generators/random-nucleotide" class="tool-catalog-card">
    <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/random-nucleotide/carousel.png" alt="" loading="lazy" />
  </a>

  <a href="/docs/language/generators/random-protein" class="tool-catalog-card">
    <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/random-protein/carousel.png" alt="" loading="lazy" />
  </a>

  <a href="/docs/language/generators/rfdiffusion-mpnn-binder" class="tool-catalog-card">
    <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/rfdiffusion-mpnn-binder/carousel.png" alt="" loading="lazy" />
  </a>

  <a href="/docs/language/generators/semigreedy-mutation" class="tool-catalog-card">
    <img noZoom class="card-art" src="https://proto-bio.github.io/proto-assets/images/generator/semigreedy-mutation/carousel.png" alt="" loading="lazy" />
  </a>
</div>
