Expand description
Native DTG-MA skill bake (Patent 2) — no Python, no torch.
The certified recipe of converter/make_skill_l1fcd.py, in Rust on
the FcdModel f32 replica:
- Phase A — a trainable L1 mask over FFN neurons (one logit per neuron, applied to the input of down_proj as σ(m)): pure LM loss on the task corpus + a progressive L1 penalty. Every 30 steps the binarized mask (σ>τ) is scored on held-out chunks; the best checkpoint — the denoising bottom — is restored at the end. Pruning noise neurons IMPROVES the model before it starts to hurt.
- Phase B — FCD: the FFN of the last N layers trains against the same LM loss with the hard mask active (cosine LR), held-out gated, best checkpoint restored.
Attention (softmax and GDN alike) is FROZEN and carries no gradient
— exactly like the reference recipe (torch.no_grad() around the
attention branch): the backward walks the residual stream through
the FFN chain only, which is what makes a pure-Rust backward small.
Structs§
- Answer
Span - Supervised chat records scored on the assistant’s answer only: every
target from the first token after
start(the rendered generation prompt, e.g.<|Bot|></think>) through the firstendtoken (the turn terminator) carries the LM loss; the prompt is context. This is the multi-token sibling offocus_tokens— a JSON verdict, a number, a sentence — where a one-token label does not fit. - Attn
Grads - Their gradients (f64 accumulators), same shapes.
- Attn
Masters - Trained attention + norm masters of a full-layer FCD layer (f32).
- Bake
Artifacts - The trained artifacts: everything the defrag writer needs, f32.
- Bake
Checkpoint - Bake
Hyper - Hyper-parameters — defaults are the certified recipe.
- Bake
Report - What the bake measured and produced.
- Held
Tags - Held records’ tags (e.g. the benchmark family of each validation record): the names, and one name index per held record.
- Token
Text - Decoded text per token id (see
AnswerSpan::values).
Functions§
- answer_
targets - The scored target range
(first, last)(inclusive, indices intoids) of one record, orNonewhen the record carries no answer. - answer_
values - The target positions of each top-level value of the JSON object an
answer span holds (
{"q1": "option_24", "q2": 3}→ two groups), in order. A token overlapping a value’s characters belongs to it, so a token that merges a quote with the label’s first letters is graded with the label. Positions are indices intoids, withinfirst..=last. - mask_
init_ logit - mask_
init_ logit_ for - Mask logit at step zero, solved for the loop depth.
- mask_
step_ scale - Learning-rate scale for the mask step, given the loop depth.
- replica_
score_ file_ mask - Score a WRITTEN specialist through the replica’s own math (f32 dequant of whatever the file carries) with the file’s binary mask held hard — the decomposition probe that tells “the requant at write cost the quality” from “the runtime applies the mask differently”. Returns (bare, masked) held-PPL over the chunks.
- skill_
bake - The whole recipe.
logreceives progress lines.