ADR-D48: Stage-1 standard embedding configs replace the rung-1 seeds#
- Status:
Accepted
- Date:
2026-10-05
- Author:
Francisco Miguel Pérez Canales
- Phase:
thesis campaign, stage 1 (transversal PLM ablation)
Context: the registry described a campaign that no longer exists#
The eight EmbeddingConfig rows in the registry were seeded by three
migrations in July 2026 (e7a1c4f9b2d6, a1c9e4b7d2f8, f2b8d1c6a94e)
for the rung-1 ladder, which the experiment graph has since retired. They were
wrong for the campaign about to run, in four separate ways:
The roster was chosen to fit an 8 GB RTX 4060. ESM-2 3B and ESM-2 150M were left out for that reason. The compute node has a 12 GB RTX 3060.
Two rows were never comparable members of a PLM axis.
esm2_8mwas a mechanism cell, a smoke test of the pipeline.protstis a 512-d text-aligned projection whose backend honours onlynormalize, so its recordedmax_length=2048described nothing it did.max_length=2048ran ESM-2 and ESM-C beyond the roughly 1024-token context they were trained on.The roster contradicted ADR-D35, which names the eight PLMs of the campaign.
None of them had ever been used. On 2026-10-05 no row of sequence_embedding,
prediction_set, reranker_model, dataset or
embedding_config.derived_from_embedding_config_id referenced any of them.
That window closes with the first embedding written, smoke tests included.
Decision#
1. Stage 1 is a transversal ablation on one standard recipe. Its purpose is
to choose two PLMs: a fast one for the research line and a heavy one for a later
run. All eight ADR-D35 PLMs run on the same recipe: last layer
(layer_indices=[0]), layer_agg=mean, pooling=mean,
normalize=True, normalize_residues=False, max_length=1022,
use_chunking=False, embedding_scale=1.0.
key |
checkpoint |
backend |
dim |
CUDA dtype |
embedding_config_id |
|---|---|---|---|---|---|
esm2_150m |
facebook/esm2_t30_150M_UR50D |
esm |
640 |
fp16 |
|
esm2_650m |
facebook/esm2_t33_650M_UR50D |
esm |
1280 |
fp16 |
|
esm2_3b |
facebook/esm2_t36_3B_UR50D |
esm |
2560 |
fp16 |
|
esmc_600m |
esmc_600m |
esm3c |
1152 |
fp16 |
|
prot_t5 |
Rostlab/prot_t5_xl_half_uniref50-enc |
t5 |
1024 |
fp16 |
|
prostt5 |
Rostlab/ProstT5 |
t5 |
1024 |
fp16 |
|
ankh_base |
ElnaggarLab/ankh-base |
ankh |
768 |
bf16 |
|
ankh_large |
ElnaggarLab/ankh-large |
ankh |
1536 |
bf16 |
|
max_length counts tokens including special tokens on the esm, t5 and ankh
backends and residues on esm3c. The residues seen are therefore 1020 for ESM-2
and ProstT5 (<AA2fold> prefix), 1021 for ProtT5 and Ankh, and 1022 for
ESM-C. This is recorded, not corrected: the difference touches only sequences
that are truncated anyway. param_count is seeded NULL and filled by
count_backend_parameters, which counts the module each backend executes.
2. One migration retires and seeds (3cd5f76d282f). An empty
embedding_config table makes /annotate mint a default config, so the
DELETE and the INSERT share one transaction. A retired row that something
references turns the upgrade into a refusal: a cascade would be a
reconciliation, not a replacement. The downgrade restores the rung-1 rows
exactly, param_count and created_at included.
tests/test_stage1_standard_configs.py ties the restated derivation to the
application’s, pins the roster to apps/lafa_knn_8plm PLM_SPECS, and runs
upgrade, downgrade and the guard against a live Postgres.
3. Stage 1 embeds the whole store once, and the donor bank is an axis.
Population: every row of
sequenceat dispatch. The store is being rebuilt to a GAF-derived universe (see below), so the count is recorded at dispatch rather than here. Before the rebuild it held 528,545 unique sequences behind 617,103 proteins. The pass is dispatched with neitherquery_set_idnoraccessions, which is the code path that selects every sequence. It is written here as the decision so that it is not read as the defect it would be anywhere else. At dispatch, the count and the sha256 of the sorted sequence hashes are recorded, and a pass is closed only when its coverage equals that set.Why the whole store: embeddings are keyed by
(sequence, config)andcompute_embeddingsskips what already exists, so one pass serves VALID, TEST, the TRAIN windows and SF-JEPA. A narrower population now would be a second pass later. It is also a superset of both donor banks below, so the bank question costs no embedding.A narrower population, when one is needed, travels as a
QuerySet, never asaccessions. AnINlist binds one parameter per accession and Postgres caps a statement at 65,535, so a largeaccessionspayload is accepted, queued and then fails at execution.Donor bank, an axis with two levels, applied in the
predict_go_termspayload. No extra embedding is needed:permissive: every annotation in the cutoff release (GOA 220 for VALID), with
donor_policyunset;experimental: evidence in
protea.core.evaluation._EXP_CODES(13 GO codes plus their 13 ECO equivalents), withdonor_policy.evidence_codesset to_EXP_CODES.
On the pre-rebuild store the two banks at GOA 220 were 556,468 and 85,989 proteins. Their sizes on the rebuilt store are recorded with the run.
Donors carrying a
NOTqualifier are excluded by the loaders in both.Prior, declared as a prior and not as a measurement. The previous campaign is remembered as favouring the permissive bank in every panel its note lists, most strongly in NK. Its rows were destroyed on 2026-09-14, and the note carrying the figures is undated, so it is not citable here. The mechanism is plausible: restricting to experimental evidence keeps about one donor in six, and the ones it keeps are well-studied proteins, so the nearest donor sits farther away and transfers more terms. Stage 1 measures it, and its
evaluation_resultids become the citable source.
4. The software regime of the compute node is part of the result. It moves
stored coordinates without moving any id. protea-node-sync governs only the
seven git siblings of the declared coordinator. The node therefore pins the
numeric path by hand and records it:
transformers 4.48.1 and tokenizers 0.21.4 (from the lock). In this version ESM and T5 have no SDPA or flash path, so attention is eager. Newer transformers routes them through SDPA, which moved 88% of fp16 coordinates in a measurement made for protea-backends#45. This governs seven of the eight PLMs.
esm 3.2.1.post1 (from the lock) and torch 2.11.0+cu130, pinned explicitly: the lock has no CUDA build of torch at all. torch governs ESM-C, whose forward pass does not go through transformers.
flash_attnis not installed.esm declares
torchtext. The lock’s torchtext 0.18.0 has no wheel for the node’s Python 3.14.4, and esm never imports it. This divergence is accepted.The server runs Python 3.12.13, so it cannot reproduce node vectors byte for byte even with identical packages.
The declaration stays frozen for the whole of stage 1. A jump that carries a migration must set
coordinatorandschema-appliedto the same new sha, after the server has applied it.Regime fingerprint. 17 fixed sequences, chosen by length (including the 1020 and 1023 boundary and the longest in the store, 35,991 residues) plus one with
Xand one withU, are embedded by every stage-1 config one sequence per forward pass (batch 1, no padding). Shape, dtype and the sha256 of the float32 vector and of its float16 cast are recorded per vector. Measured 2026-10-05: two runs in separate processes agree byte for byte on 136 of 136 vectors, so byte equality is attainable on this GPU in half precision and the regime check compares hashes. It is repeated before the first pass and after the last, withpip freezekept alongside. Production passes run atbatch_size=1for the same reason. The procedure, the sequences and the reference output are indocs/campaign/stage1/.
5. The selection rule is fixed before anything is measured.
The rule has two steps, read in order.
Step 1, bank. Metric, estimand and uncertainty as in step 2. For each PLM, take the paired difference permissive minus experimental, then its mean over the eight PLMs. The experimental bank is chosen only if the 95% interval of that mean lies entirely below -0.02, that is, only if it is better by more than the margin. Otherwise the permissive bank, the prior, is kept. All sixteen PLM by bank cells are published, so an interaction is visible rather than averaged away.
Step 2, PLM, within the bank chosen in step 1:
Metric: KNN-only
f_micro_won VALID-A (220 -> 227, each side under its native DAG, the declared frame), repeated on VALID-B (both sides under the t0 pivot). Both are rebuilt after the binding rule of PROTEA#976 and the universe rebuild, and their ids are recorded with the run.Estimand: the flat mean of the nine category by aspect cells. That is how LAFA reports, and it keeps NK, the frontier of the project, from being outvoted by PK, which holds 79.9% of the VALID-A proteins.
Uncertainty: a paired bootstrap stratified by cell, resampling proteins within each cell (
compare_paired_panelsmachinery). No sigma constant from outside the record is used.Equivalence: a PLM is equivalent to the best when the lower bound of the 95% interval of its difference exceeds -0.02. The 0.02 is a practical margin (
_TARGET_EFFECTin_graph_panels.py), not a derived quantity. Projected from configuration-class sigmas, the minimum detectable effect of the flat mean is about 0.0045, and about 0.0136 at three times those sigmas. The variance of the aggregate is dominated by the small MFO cells (LK.MFO and NK.MFO, about 58%), so all nine per-cell intervals are published with it.heavy = the highest
f_micro_w. fast = the cheapest model (GPU hours per pass, then dimensions) that is equivalent to the best; if that is the heavy one, the next model on the cost frontier.
Consequences#
The registry matches ADR-D35 and the campaign. The ids of ADR-D35’s May table are not revived: their recipes differed (ESM at 1024 tokens, an un-normalised ankh-base, a chunked esm2_3b). ADR-D35 keeps the roster; this record replaces the ids.
Stage 1 costs one forward pass per sequence of the rebuilt store and PLM, once. Later windows and SF-JEPA reuse them, and the bank axis adds prediction sets, not embeddings.
Every stage-1 number is read in one software regime, and that regime is written down where both machines read it.
What this record does not settle#
The store it runs on. On 2026-10-05 the protein universe is being rebuilt from the GAF history rather than from a present-day UniProt query: the proteins with evidence in the 13 LAFA-regime codes in any release, any taxonomy, isoforms kept. A present-day query would bias the historical windows, because a protein that had evidence in 2018 and lost it would not appear. The GAFs are reloaded after the universe, because the foreign key silently drops every accession not in
protein. Every count in this record that predates the rebuild is labelled as such.The MFO ground truth. PROTEA#976 drops MFO from proteins whose direct F annotations are all
GO:0005515(protein binding) or its descendants, which is about 31% of the proteins with any MFO in GOA 220. The VALID evaluation sets are rebuilt after it, and three of the nine cells the selection rule averages are MFO.PLM-independent neighbourhood strata. The neighbourhood axes of
protea.core.strataare read from each run’s own retrieval, so a protein can fall in different strata under different PLMs. Their donor evidence is also not aspect-specific. A sequence-search neighbourhood (MMseqs2, per aspect, against the bank at the cutoff) is the proposed fix.Three definitions of “experimental” coexist:
evaluation._EXP_CODES(26), a duplicate inbuild_go_cooccurrenceand a 6-code set inproteins_stats.query_setcarries no content hash, so a QuerySet is referable but not verifiable from inside the system. Any narrower population used later needs its sha recorded outside, as section 3 does for the whole store.
References#
Migration
alembic/versions/3cd5f76d282f_stage1_standard_configs_replace_rung1.pytests/test_stage1_standard_configs.pyADR-D35 (roster), ADR-D40 (temporal protocol), ADR-D46 (IA as a corpus artifact; the VALID IA is recomputed on the rebuilt corpus and recorded with the run)
docs/campaign/stage1/REGIME.md,fingerprint.py,fingerprint-sequences.fastaandfingerprint-2026-10-05.jsonagent-farm/plans/DECLARED-REVISION.txtandagent-farm/scripts/services/protea-node-sync.sh