> ## 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.

# Surrogate Optimizer

> Surrogate-assisted search for expensive scorers: generators propose a large candidate pool each round, a bootstrapped ridge-regression ensemble ranks candidates by lower confidence bound, and only the most promising few are scored with the real constraints.

![Surrogate Optimizer](https://proto-bio.github.io/proto-assets/images/optimizer/surrogate/hero.png)

This optimizer 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.

***

&#x20;Source

![Proto](https://mintcdn.com/bio-pro/cMLt8hAqaP9M3LKy/assets/logo/logo-light.svg?fit=max\&auto=format\&n=cMLt8hAqaP9M3LKy\&q=85\&s=f5e5dfd1b8f9b9db3a0be0e2eb01f678)

evo-design/proto-language

&#x20;View source

[Open](https://github.com/evo-design/proto-language/blob/1a97e675c7e5e4ae0e92be91b1bb7b49f1331104/proto_language/optimizer/surrogate_optimizer.py#L157)

Optimizer contributors[![](https://avatars.githubusercontent.com/u/61667248?v=4\&s=64)adititm](https://github.com/adititm)[![](https://avatars.githubusercontent.com/u/21143637?v=4\&s=64)bviggiano](https://github.com/bviggiano)
Surrogate-assisted optimizer that limits real constraint evaluations per round.

## API Reference

ConfigSurrogateOptimizerConfig[ Source](https://github.com/evo-design/proto-language/blob/1a97e675c7e5e4ae0e92be91b1bb7b49f1331104/proto_language/optimizer/surrogate_optimizer.py#L75)

Configuration object for SurrogateOptimizer.

**num\_rounds** `integer` *required*

Propose-predict-score rounds; each scores up to evaluations\_per\_round candidates.

**candidates\_per\_round** `integer` (default: 100)

Candidates proposed by the generators each round and ranked by the surrogate.

**evaluations\_per\_round** `integer` (default: 10)

Maximum new candidates scored with the real constraints each round; must be \<= candidates.

**num\_results** `integer`

Number of best sequences kept by real energy. Overrides program count.

**beta** `number` (default: 1.0)

Weight on surrogate std in the lower confidence bound mean - beta \* std.

**unique\_results** `boolean` (default: False)

Keep one copy of each candidate (all segments compared) in the results; may return fewer.

**diversity\_clustering** `Mmseqs2ClusteringConfig`

MMseqs2 clustering; results keep the best of each cluster first. None disables it.

**seed** `integer`

Random seed for reproducible optimization, generator, and constraint tool streams.

**tracking\_interval** `integer` (default: 1)

Save history and log progress every N steps. Step 0 and final step always saved.

**track\_proposals** `boolean` (default: False)

Save granular per-proposal results (accept/reject) in history snapshots.

**verbose** `boolean` (default: False)

Emit per-step debug information about proposals, scores, and acceptance through the logger.

**checkpoint\_interval** `integer`

With a checkpoint\_dir, checkpoint the running stage every N iterations. None: stage ends only.

**plateau\_patience** `integer`

Stop after N iterations in a row without improving the best energy (first sets it). None disables.

**plateau\_min\_delta** `number` (default: 0.0)

Minimum decrease of the best energy that counts as improvement for plateau\_patience.

## Usage

```python python icon="python" theme={null}
>>> config = SurrogateOptimizerConfig(num_rounds=10, candidates_per_round=500, evaluations_per_round=20)
>>> opt = SurrogateOptimizer(constructs=[construct], generators=[gen], constraints=[c], config=config)
>>> opt.run()
```

## Metadata

| Property | Value |
| - | - |
| Key | `surrogate` |
| Class | `SurrogateOptimizer` |
| Targets Single Segment | `False` |
| Uses GPU | `False` |
| Required Constraint Mode | `discrete` |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.