use case · basics · ESM-2 t6 8M (q8) · WASM · ~8 MB

Masked-Residue & Amino-Acid Biochemistry Lab

Click any amino acid in the protein ribbon below to replace it with <mask> and run Meta's ESM-2 8M (facebook/esm2_t6_8M_UR50D) locally in a Web Worker. Watch how the model spreads probability mass across all 20 canonical amino acids grouped by biochemical family, measures site conservation via Shannon entropy, and ranks the true wild-type residue.

1 · Model & protein sequence

Prepare ESM-2 8M above, then click any residue in the ribbon to run masked-residue prediction.

2 · Interactive residue ribbon (click any amino acid to place <mask>)

Hydrophobic Aromatic Polar Positive (+) Negative (−) Special (G/P)

3 · Exact 20-amino-acid distribution & biochemistry breakdown

Masked site–
Top-1 prediction–
Wild-type rank–
Shannon entropy–
Latency & runtime–

Top-5 predicted amino acids

Run a masked prediction to inspect the top-5 amino-acid probabilities.

All 20 canonical amino acids grouped by biochemical property

4 · Inside the worker & masked-marginal scoring math

Because this ONNX export omits mask_token from the convenience pipeline config, the worker inserts <mask> directly into AutoModelForMaskedLM and computes a numerically stable 20-amino-acid log-softmax.

Show the code — maskedLogits() & predict() in worker.js
Show the code — LLR & Shannon entropy helpers in esm-core.mjs