Skip to content

fix(train): add retrieval replay to SFT workflow; repair broken replay paths - #138

Merged
ppodolsky merged 1 commit into
mainfrom
audit-llm-code-and-repos
Aug 6, 2026
Merged

fix(train): add retrieval replay to SFT workflow; repair broken replay paths#138
ppodolsky merged 1 commit into
mainfrom
audit-llm-code-and-repos

Conversation

@ppodolsky

Copy link
Copy Markdown
Contributor

Two problems with workflow.sft.example.json — one measured, one that would have failed the run at launch.

Retrieval decays during causal-only training (measured)

Held-out retrieval top-1 across the current pretraining run:

Split 249k (peak) 285.5k 291.5k 392k
School 22.4% 10.5% 10.5% 12.5%
University 31.9% 24.7% 23.1% 17.2%
Advanced 42.5% 34.4% 28.8% 21.3%

Advanced MRR 0.541 → 0.325 over ~143k causal-only steps. Recall@10 is now falling too (university 0.656 → 0.553), so the embedding is losing documents outright, not just ranking them worse. Training loss cannot show any of this — it only reflects the objective currently running.

SFT is five consecutive supervised-generation phases, so it would erode the retriever the same way. Four retrieval_representation replay phases are now interleaved after each SFT phase at layer 24 / temperature 0.05, each using its own pretraining stage's retrieval shard and geometry: 8.1% of tokens, alongside the existing 15.7% causal foundation replay.

The dose is a starting point, not a derived optimum. Verify with hermes-train eval --objective contrastive_retrieval on all three held-out splits before and after SFT against the 249k peak, and raise it if retrieval still regresses.

All four causal replay paths were broken

They pointed at /opt/hermes-run/moe-300m-v5-optimized-20260731/data/, which does not exist on the training host — the shards live under /opt/hermes-run/moe-300m-v4/data/. Every replay phase would have failed to open its data.

Note on geometry

Retrieval phases are sized against the validator's worst case of 33 sequences per example (MAX_RETRIEVAL_REPRESENTATION_DOCUMENTS), not the 4 our data carries, so batch and shuffle bounds hold for any negatives count the schema permits.

Validates against retriever_300m_moe.mal: 13 phases, 18,100 steps, 915.9M compute tokens.

… paths

Two problems with the SFT workflow, one measured and one that would have failed
the run at launch.

Measured: retrieval capability decays during causal-only training. Held-out
top-1 on the advanced split fell 42.5% (step 249k peak) -> 34.4% -> 28.8% ->
21.3% (step 392k) across ~143k causal-only steps, with university 31.9% ->
17.2% and school 22.4% -> 12.5%; recall@10 is now falling too, so the
embedding is losing documents outright rather than merely ranking them worse.
Training loss cannot show this because it only reflects the objective
currently running. SFT is five consecutive supervised-generation phases, so it
would erode the retriever -- the actual product -- the same way. Four
retrieval_representation replay phases are now interleaved after each SFT
phase at layer 24 / temperature 0.05, using each pretraining stage's own
retrieval shard and geometry: 8.1% of tokens, alongside the existing 15.7%
causal foundation replay.

The replay dose is a starting point, not a derived optimum. Verify it by
running `hermes-train eval --objective contrastive_retrieval` on all three
held-out splits before and after SFT and comparing against the 249k peak; if
retrieval still regresses, raise the dose rather than accepting it.

Broken paths: all four causal replay phases pointed at
/opt/hermes-run/moe-300m-v5-optimized-20260731/data/, which does not exist on
the training host. The shards live under /opt/hermes-run/moe-300m-v4/data/.
Every replay phase would have failed to open its data.

Retrieval phase geometry is sized against the validator's worst case of 33
sequences per example (MAX_RETRIEVAL_REPRESENTATION_DOCUMENTS), not the 4 our
data actually carries, so the batch and shuffle bounds hold for any negatives
count the schema permits.

Workflow validates against retriever_300m_moe.mal: 13 phases, 18,100 steps,
915.9M compute tokens.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant