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

# ESM C Perplexity

> Score protein naturalness by ESM C mean NLL and report perplexity.

![ESM C Perplexity](https://proto-bio.github.io/proto-assets/images/constraint/esmc-perplexity/hero.png)

> [!NOTE]
>
> **License:** ESM C (Cambrian) is open source and free for academic and commercial use under an MIT license. Please refer to [the license](https://github.com/Biohub/esm/blob/main/LICENSE.md) for full terms.

This constraint 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;Tools Used Tools Used  Source Source  Cite Cite

![](https://proto-bio.github.io/proto-assets/images/tool/esmc/social.png)

&#x20;Go to Tool Page

[Open](https://proto.evodesign.org/docs/tools/masked-models/esmc.md)

![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/constraint/sequence_scoring/esmc_perplexity_constraint.py#L147)

@misccandido2026language\@softwareevolutionaryscale\_2024

```bibtex theme={null}
@misc{candido2026language,
  title={Language Modeling Materializes a World Model of Protein Biology},
  author={Candido, Salvatore and Hayes, Thomas and Derry, Alexander and Rao, Roshan and Lin, Zeming and Verkuil, Robert and Wu, Bryan and Lee, Jin Sub and Bruguera, Elise S. and Keval, Jehan A. and Kopylov, Mykhailo and Pak, John E. and Wu, Wesley and Thomas, Neil and Mataraso, Samson and Hsu, Alvin and Trotman-Grant, Ashton C. and Fatras, Kilian and dos Santos Costa, Allan and Badkundri, Rohil and Ak{\i}n, Halil and Oktay, Deniz and Deaton, Jonathan and Montabana, Elizabeth and Sitwala, Hrishita and Yu, Yue and Wiggert, Marius and Carlin, Dylan Alexander and Goering, Anthony W. and Blazejewski, Tomasz and Sandora, McCullen and Hla, Michael and Jia, Tina Z. and Kloker, Leon H. and Sofroniew, Nicholas J. and Uehara, Masatoshi and Pannu, Jassi and Bachas, Sharrol and Liu, Daniel S. and Sercu, Tom and Rives, Alexander},
  year={2026},
  url={https://www.biorxiv.org/content/10.64898/2026.06.03.729735},
  note={Preprint}
}

@software{evolutionaryscale_2024,
  author={{EvolutionaryScale Team}},
  title={evolutionaryscale/esm},
  year={2024},
  publisher={Zenodo},
  doi={10.5281/zenodo.14219303},
  url={https://doi.org/10.5281/zenodo.14219303}
}
```

&#x20;Copy citation

Constraint 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)
Forward ESM C protein scoring via masked pseudo-log-likelihood.

## API Reference

ConfigESMCPerplexityConfig[ Source](https://github.com/evo-design/proto-language/blob/1a97e675c7e5e4ae0e92be91b1bb7b49f1331104/proto_language/constraint/sequence_scoring/esmc_perplexity_constraint.py#L42)

Configuration for ESM C perplexity scoring (forward + gradient).

**model\_checkpoint** `enum` (default: esmc\_300m)

ESM C model checkpoint to use

Options: `esmc_300m`, `esmc_600m`, `esmc_6b`

**temperature** `number` *required*

Softmax temperature for ESM C (fixed for this constraint).

**use\_ste** `boolean` (default: True)

Hard one-hot forward pass with soft-probability gradients.

**device** `string` (default: cuda)

Device for ESM C execution, e.g. 'cuda' or 'cuda:0'.

**batch\_size** `integer`

AA positions per ESM C forward pass. Lower if OOM, higher for throughput.

**score\_mode** `enum` (default: nll)

Return raw mean NLL by default, or ESM C perplexity when set to 'ppl'.

Options: `nll`, `ppl`

## Usage

```python python icon="python" theme={null}
from proto_language.core import Constraint
from proto_language.constraint import esmc_perplexity_constraint, ESMCPerplexityConfig

constraint = Constraint(
    inputs=[segment],
    function=esmc_perplexity_constraint,
    function_config=ESMCPerplexityConfig(
        # Configure parameters here
    ),
)

scores = constraint.evaluate()
```

## Metadata

| Property | Value |
| - | - |
| Key | `esmc-perplexity` |
| Function | `esmc_perplexity_constraint` |
| Category | `sequence_scoring` |
| Mode | `dual` |
| Uses GPU | `True` |
| Supported Types | `protein` |


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