Antimicrobial peptide generation and screening — running entirely in your browser.
Samples from the reinforcement-learning-steered generator — β = 0.5, the only setting that passed every reward-hacking check. The model runs in your browser, so these peptides are invented now and have never existed. Each is then scored by the same two classifiers.
Peptides invented by the generator, screened through descriptor windows, an activity model, a haemolysis model and a novelty threshold. Scores were computed by the pipeline, not in your browser. Click a column to sort.
ESMFold predictions for the top 50 candidates. μ(structure) is amphipathicity measured from the predicted geometry; μ(sequence) is the usual formula, which assumes a perfect helix. Where they disagree, the assumption is the reason.
Peptides come in evolutionary families. Split a corpus at random and close relatives land on both sides, so a model scores well by recognising a family it already saw. This project splits by single-linkage homology clusters at 50% identity, never divided across train and test.
Experiment E9 measured the cost. Same models, same seed, same hyperparameters — only the split differs:
| model | homology-disjoint | naive random | headroom closed |
|---|---|---|---|
| logistic regression | 0.5283 | 0.8161 | 61.0% |
| ESM-2 | 0.8136 | 0.9255 | 60.0% |
| random forest | 0.8353 | 0.9091 | 44.8% |
| charge only (no fitted parameters) | 0.5695 | 0.6760 | 24.7% |
A naive split puts 22 byte-identical copies of training sequences into the test set. The last row fits nothing, so it cannot memorise — whatever it gains is pure distribution shift, and it is the floor the others should be read against.
H2 predicted a protein language model would beat descriptor baselines. It did not — on either task, frozen or fine-tuned, under either split scheme. That is reported because it is the result.
Optimising against a classifier invites fooling the classifier. Seven checks were written before the runs. Without the KL penalty the policy produced 14-residue peptides overloaded with leucine (+0.134), alanine (+0.078) and lysine (+0.076) — the amphipathic-cationic stereotype pushed to a cartoon, which both scorers rated highly because both share a training corpus. Only β = 0.5 passes every check, and that is the policy behind these candidates.
Code, split manifests, every result file, seeds, package versions, a model
card and a WHAT_FAILED.md listing eight bugs that each changed a
result are in the repository, which stays readable whether or not this page is
working.