phammminhhieu's picture
TRACE-VLA code snapshot 2026-11-22 11:47 +07: 456 canonical files + SHA256 manifest + sync report
b4396f0 verified
|
Raw History Blame Contribute Delete
17.3 kB

Round-2 probe β€” SPEC (fixed 2026-11-18 BEFORE any round-2 training)

Coordinator 5. Source research: ~/workspace/research_notes/ moe-vla-bigger-optimizations-round2-20261118-0205/report.md (shortlist #1 MI, #2 orthogonal outputs by construction, #3 IntraCL-lite; #4/#5 queued, NOT in this round). Stage-1 + coordinator-4 chain are closed: no routing pressure tried so far (control / no-balance / DeepSeek bias / skillroute inputs / entropy) and no frontend intervention passed its gate. Program-level diagnosis carried into this round: soft mixtures of unconstrained experts are non-identifiable, and per-task-uniform load balancing forbids conditional specialization.

Common protocol (identical to Stage 1 / frontend probe)

  • Base configuration for every arm = sera-v4-d-skillroute: v4_moe_mode=skillroute (router input = [context mean; state; pooled text], 1536-d), init = init_skillroute (routing identical to control at init), from scratch, seed 42, same data order, batch 8 x accum 4, joint stage, LR peak 1e-4, warmup 200 micro-steps, cosine -> 1e-5 @10k, bf16, eval_split 0.1, 10,000 micro-steps per arm, sequential.
  • Reference (already measured, NOT retrained): D@10k β€” val FM (eval_loss total) 0.3979; routing @10k task_cos mean 0.766 [0.740, 0.745, 0.636, 0.944], eff [5.27, 6.12, 7.00, 8.00], no dead/swamp; probe 5/70, right-object 21/60 = 35.0%.
  • Routing measurement: P1 set (3,840 obs), measure_routing.py, at 2k / 5k / 10k per arm (batch 8 in parallel with training is proven safe; 10k after the arm finishes if needed).
  • Gate (gate_eval.py operationalization, unchanged): at 10k β€” mean task_cos < 0.90 AND eff experts <= 5.0 in >= 2 blocks AND no dead (<1% selection) / no swamping (>60%) expert AND differentiation trend rising (mean task_cos strictly decreasing 2k -> 5k -> 10k).
  • Val-FM elimination rule: an arm whose eval_loss @10k is > 0.02 worse than D@10k's 0.3979 (i.e. > 0.4179, same total-loss accounting as the arm's own logged eval_loss) is eliminated WITHOUT a probe.
  • Closed-loop probe (only for arms that pass the routing gate AND are not FM-eliminated): fixed 70 ep (libero_spatial #5; libero_goal #0, #9; libero_10 #0, #6, #7, #8; 10 ep/task, seed 0, eval_v4.py). Pass = >= 9/70 (D/F0 = 5/70, +4 rule). Right-object rate reported alongside (same heuristic detector as Leg 2; comparative only).
  • Kill rules (per arm, as Stage 1): any expert > 80% of selections at a measured milestone; loss divergence (NaN or > 3x running band sustained); repeated OOM -> stop that arm, log, move on.
  • Protocol discipline: no mid-run changes to gamma/lambda/tau, no probing of eliminated arms, no extra arms. Deviations, if forced by a bug, are recorded in WORKLOG + this SPEC before continuing.
  • Secondary diagnostic for ALL round-2 arms @10k (and D@10k as reference): pair-split routing cosine from per-task mean routing vectors β€” mean pairwise cosine split by pair type: same-verb vs different-verb, same-object vs different-object (factor table below). This distinguishes "good sharing" from "no specialization"; it does NOT change the gate.

Arm G β€” sera-v4-g-mi (shortlist #1: MI routing loss)

  • Change vs base: the uniform balance term is REMOVED and replaced by a mutual-information term; specialization 0.0002 kept (isolates the balance -> MI swap, per tasking). total = FM - gamma * MI + 0.0002 * specialization MI = mean over 4 blocks of I(T; E), estimated per micro-batch from the full softmax routing probabilities p [B,8] and the sample task ids (batch task_index; fallback: groups of identical instruction strings β€” LIBERO has exactly one instruction per task): p_E = mean_i p_i (marginal) p_E|t = mean of p_i over samples of task t I = H(p_E) - sum_t (n_t/B) * H(p_E|t) (nats, float32) I is differentiable through p (batch-statistics estimator, the SDP / Mod-Squad form). Known estimator property, recorded in advance: with B=8 and mostly-unique tasks per batch, H(E|T) is close to the mean per-sample entropy, so the term rewards per-sample sharpness + cross-sample diversity; over many batches this is the task-conditional pressure. The milestone routing measurements, not the logged batch MI, are the verdict instrument.
  • gamma = 0.01. Justification (fixed in advance): the only published anchor (Mod-Squad w_MI = 0.001) sits on a summed multi-task loss and does not transfer directly; the report's rule is magnitude matching β€” the MI term should run at ~1-5% of FM magnitude. gamma * I with I in [0, ln 8 = 2.08]: at I = 0.5-1.0 (meaningful differentiation) the term is 0.005-0.010 vs FM ~ 0.4-0.5 late in training = 1-2.5%; at the theoretical max it is 0.021 ~ 5%. gamma = 0.01 also matches the scale of the balance term it replaces (0.01 x ~1.25-2.0 ~ 0.013-0.020). Logged per step as mi_loss (the mean I) and mi_term (gamma * I).
  • Config: new field v4_mi_gamma (default 0.0 = off; all existing arms unaffected). Run name: sera-v4-g-mi.

Arm H β€” sera-v4-h-ortho (shortlist #2: orthogonal expert outputs)

  • Change vs base: NO loss change (control losses: FM + 0.01 balance + 0.0002 specialization, skillroute mode). In each MoEBlock, the 4 selected experts' outputs for a sample are orthogonalized BY CONSTRUCTION before the gate-weighted mix: per (sample, token): stack selected outputs O = [o_1..o_4] (each in R^512); QR of O^T (512x4) -> Q with orthonormal columns; sign-stabilize columns by sign(diag(R)) (MOORE Gram-Schmidt / SMP QR form); orthogonalized outputs = rows of Q^T, rescaled by the mean original row norm s = mean_i ||o_i|| so output scale is preserved; routed = sum_slot w_slot * o~_slot. Expert call order (batch-major / slot-minor) is unchanged, so the A5 hook reconstruction and z-intermediates (specialization loss) are unaffected. Soft orthogonality losses on weights are FORBIDDEN in this arm (measured negative result, report A2).
  • Config: new field v4_ortho_outputs (default False = off). When off, MoEBlock executes the original accumulation loop bitwise. Run name: sera-v4-h-ortho.
  • Extra logged check: in the numerical pre-launch check, the Gram matrix of orthogonalized outputs per (sample, token) must be ~ s^2 * I (off-diagonal ~ 0 relative to diagonal).

Arm I β€” sera-v4-i-intracl (shortlist #3: IntraCL-lite)

  • Change vs base: losses = control (FM + 0.01 balance + 0.0002 specialization) PLUS a contrastive term on router logits: total = ... + lambda_intra * L_IntraCL, lambda_intra = 0.01, tau_c = 0.1. lambda justification (fixed in advance, one pre-launch correction): the governing rule is magnitude matching β€” the initial term should be ~0.1, ~5% of FM at init. The 40-step smoke (2026-11-18, before the arm launched) measured L_IntraCL ~ 7-8 on real batches, not the ~ln(B-1) ~ 1.95 first estimated: the report's form sums w_ij-weighted log terms over ALL pairs, and LIBERO batches are dense in same-verb pairs (30/40 tasks are put / pick_up). lambda was therefore corrected 0.05 -> 0.01 BEFORE launch (initial term ~0.07-0.08), keeping the registered magnitude rule, not the first number. SMoDP's exact lambdas are not published in the text read, and F2's lesson (lambda 0.1 on a representation-level loss taxed FM by ~0.17) argues for staying at the small end; unlike F2, this term's gradient is confined to the router (next bullet), so the FM tax channel is indirect (through changed routing only).
  • Logits and gradient confinement (the F2-avoidance design): the contrastive branch RECOMPUTES per-block logits as router_b(router_input_detached) + goal_delta_b(summary_detached), where router_input and the goal summary are stashed during encode_observation and detached. Values are identical to the routing logits used for action; gradients from L_IntraCL reach ONLY the 4 router Linears and the 4 goal-delta Linears β€” never the vision backbone (frozen anyway), vision/text projections, fusion, state MLP, or experts. Verified numerically before launch (grad comparison vs lambda=0 on identical seed/batch).
  • r_i = concatenation over the 4 blocks of the recomputed logits [32-d]; sim_ij = <r^i, r^_j> / tau_c on L2-normalized r. Pair weights from FREE verb/object factors of the LIBERO task names (table below; every training chunk inherits its task's factors): w_ij = 0.5 * Jaccard(verbset_i, verbset_j) + 0.5 * Jaccard(objectset_i, objectset_j), i != j L_IntraCL = -(1/B) * sum_i sum{j != i} w_ij * logsoftmax_j( sim_i ) (report B2 form) Rows whose total weight is 0 contribute 0. Logged as intracl_loss.
  • Config: new fields v4_intracl_lambda (0.0 = off), v4_intracl_tau (0.1). Run name: sera-v4-i-intracl.

Verb/object factor table (from the 40 dataset task strings)

Verbs are the action words in the instruction; objects are the manipulated objects (containers / devices / landmarks excluded). Compound tasks carry both verbs / both objects.

idx task (short) verbset objectset 0 white mug L plate + yellow-white mug R plate {put} {white mug, yellow and white mug} 1 white mug on plate + pudding right of plate {put} {white mug, chocolate pudding} 2 yellow-white mug in microwave + close {put, close} {yellow and white mug} 3 turn on stove + moka pot on it {turn_on, put} {moka pot} 4 both alphabet soup + cream cheese in basket {put} {alphabet soup, cream cheese box} 5 both alphabet soup + tomato sauce in basket {put} {alphabet soup, tomato sauce} 6 both moka pots on stove {put} {moka pot} 7 both cream cheese box + butter in basket {put} {cream cheese box, butter} 8 black bowl in bottom drawer + close {put, close} {black bowl} 9 pick up book -> back compartment of caddy {pick_up} {book} 10 bowl on plate {put} {bowl} 11 wine bottle on rack {put} {wine bottle} 12 open top drawer + bowl inside {open, put} {bowl} 13 cream cheese in bowl {put} {cream cheese} 14 wine bottle on top of cabinet {put} {wine bottle} 15 push plate to front of stove {push} {plate} 16 turn on stove {turn_on} {stove} 17 bowl on stove {put} {bowl} 18 bowl on top of cabinet {put} {bowl} 19 open middle drawer of cabinet {open} {drawer} 20 pick up orange juice -> basket {pick_up} {orange juice} 21 pick up ketchup -> basket {pick_up} {ketchup} 22 pick up cream cheese -> basket {pick_up} {cream cheese} 23 pick up bbq sauce -> basket {pick_up} {bbq sauce} 24 pick up alphabet soup -> basket {pick_up} {alphabet soup} 25 pick up milk -> basket {pick_up} {milk} 26 pick up salad dressing -> basket {pick_up} {salad dressing} 27 pick up butter -> basket {pick_up} {butter} 28 pick up tomato sauce -> basket {pick_up} {tomato sauce} 29 pick up chocolate pudding -> basket {pick_up} {chocolate pudding} 30-39 pick up black bowl (10 landmark variants) -> plate {pick_up} {black bowl}

Note the two deliberate sharing axes this creates: idx 30-39 share verb AND object with each other but differ from idx 8 ({put, close}, black bowl) only in verb; idx 22 vs 13 share the object cream cheese across verbs; idx 24/28 vs 4/5 share objects across verb groups.

Zero-cost eval check β€” execution horizon (parallel, no training)

  • DEVIATION recorded 2026-11-18 ~10:40 (before any horizon result was read, forced by a trunk fact): the checkpoint config has n_action_steps = 4, so the trunk select_action's SERA_EXECUTE_STEPS ablation is capped at [1, 4] and β€” correcting the assumption in the first draft of this section β€” ALL previous local probes (F0 5/70, F1 7/70, and the lineage probes through the same select_action) executed 4 of each 16-step chunk, not 16. The horizon check is therefore re-scoped to execute in {1, 4, 16}: 4 = the running replication of the F0 protocol (env var, stock eval_v4.py); 1 = env var, stock eval_v4.py; 16 = eval-only override of pcfg.n_action_steps to 16 at load time (eval_horizon.py, checkpoint on disk untouched) + SERA_EXECUTE_STEPS=16. (8 dropped: the informative contrasts are the two extremes against the 4-step status quo.)
  • On D checkpoint 010000, same fixed 70-ep set, seed 0. Report success /70 + right-object for each horizon next to the 5/70 baseline. This is a probe-protocol measurement, not an arm; no gate applies. (Literature anchor: SmolVLA execute-10 vs execute-50 = 82.8 vs 51.8 β€” executing a LARGER fraction of each chunk hurt; locally the fractions are 1/16, 4/16, 16/16.)

Order of execution (no-idle rule)

Horizon checks run first (zero code, GPU otherwise idle), then G -> H -> I sequentially; each arm's code is prepared and numerically checked while the previous arm trains; routing measurements at batch 8 in parallel with training where the schedule allows.

Arm J addendum (approved by Young 2026-11-18 11:20; registered

before launch; queued AFTER G, H, I β€” the running chain is not

interrupted)

Arm J β€” sera-v4-j-datasubset (data-distribution probe)

  • Question: is the similarity among training tasks itself the reason routing does not differentiate? Same D-skillroute configuration, from scratch, seed 42, 10k micro-steps, identical recipe β€” the ONLY change is the training data: a subset of ~10 maximally diverse tasks (--dataset.episodes restricted to their episodes).
  • Subset (dataset task_index; chosen from the verified 40-task list to maximize verb / object / suite diversity; 405 episodes): 1 (put white mug on plate + chocolate pudding right of plate β€” two-object sequential), 2 (put mug in microwave and close it β€” put+close), 3 (turn on stove + put moka pot β€” turn_on+put), 9 (pick up book into caddy β€” unique objects), 11 (put wine bottle on rack), 15 (push plate to front of stove β€” the only push task), 16 (turn on the stove β€” pure turn_on, no grasping), 19 (open the middle drawer β€” pure open, no object), 21 (pick up ketchup into basket β€” Object-suite representative), 30 (pick up black bowl next to cookie box onto plate β€” Spatial representative). All six verb types in the dataset appear (put, pick_up, turn_on, open, close, push); suites L10 x4 / Goal x4 / Object x1 / Spatial x1; ~17 object/fixture families. The two big redundancy blocks of the full data are cut to one representative each: Object's 10 near-identical pick-to-basket tasks (20-29) and Spatial's 10 near-identical black-bowl tasks (30-39); Goal's four bowl-put variants (10/13/17/18) are dropped entirely.
  • Measurement: standard P1 set at 2k/5k/10k (measure_routing.py β€” effective experts, dead/swamp, JS, A5 as usual), PLUS the headline: cross-task cosine computed on the SUBSET tasks only (per-task mean routing vectors from the same cache, pairwise among the 10 subset tasks; measure_subset.py). The full-40 cosine is reported as reference. D@10k full-data headline for comparison: 0.766.
  • Registered interpretation (fixed in advance): subset cosine @10k >= ~0.72 -> task similarity in the data is EXONERATED as the main cause (routing still does not differentiate even with maximally different tasks); <= ~0.65 -> data similarity is a REAL contributing factor; between -> partial / inconclusive, reported as such.
  • val FM: NOT comparable to D@10k (different data) β€” the 0.02 FM elimination rule does NOT apply to arm J; FM is reported as an internal trajectory only. No closed-loop probe for arm J (its verdict is routing-only; the fixed probe set is mostly outside the subset). Kill rules as Stage 1.

Correction note (2026-11-18, documentation only)

The factor table in the Arm I section lists dataset indices next to instruction strings; several indices were mislabeled (benchmark order was used instead of the dataset's tasks.parquet order β€” e.g. "push the plate..." is dataset index 15, "turn on the stove" is 16). Verified 2026-11-18 against tasks.parquet and the code: the table is keyed by instruction STRING in modeling_base.py, all 40 strings are present, and every verb/object annotation matches its own string. Arms G and I are therefore unaffected; only the index labels in this document were wrong. The authoritative index list is the one printed from tasks.parquet (0-9 LIBERO-10, 10-19 Goal, 20-29 Object, 30-39 Spatial).