Skip to content

history: learned null token for dropped and episode-start-padded history - #715

Draft
RyanPCo wants to merge 1 commit into
ryanco/fixed-budget-ladderfrom
ryanco/history-null-token
Draft

RyanPCo wants to merge 1 commit into
ryanco/fixed-budget-ladderfrom
ryanco/history-null-token

Conversation

@RyanPCo

@RyanPCo RyanPCo commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Copying the current step / frame into the past slots (the old history
dropout, and what the dataset's front padding produced) looks exactly like a
genuinely static hand or scene. Missing history is now a learned null token,
by default:

  • MLPPolicyStem (history_len > 1): a (D,) null_token replaces the per-step
    MLP token of every past step that history_dropout drops (per sample, train
    only) or that the dataset's proprio_history_mask marks as front padding
    (train and eval); the per-step time embedding is still added. The mask now
    travels HPT.process_batch_for_training -> _robomimic_to_hpt_data -> stem
    (history_mask kwarg) instead of being dropped.
  • RDTModel (image_history > 1): a (D,) null_frame replaces a dropped or
    padded past frame's stem tokens, under the usual position, frame and camera
    embeddings. The dataset now emits _hist_mask for a single lagged
    frame too; RDT appends the current frame's 1 as _mask.
  • The current step / frame is never nulled. torch.where keeps both null
    params in the graph every step, so plain DDP sees no unused parameter.

history_null_token / image_history_null_token (default true) select the
legacy copy-current path, bit-identical to before. Every config that sets
history_dropout / image_history_dropout gets null-token semantics at its
existing rate. The kp RDT models (rdt_bc_mecka_kp_dinov3_vitb and
rdt_1b_..., i.e. the mecka private opscale and freeform op2 recipes) set
both explicitly, with history_dropout and image_history_dropout 0.1.

Architecture change: new parameters. A checkpoint from before this lacks
them; loading one warns and switches that stem / model back to the legacy
copy-current semantics it was trained with, so old runs still evaluate and
resume.

Co-Authored-By: Claude Opus 5.5 [email protected]
Claude-Session: https://claude.ai/code/session_01X86xQuci4asKUkiCwqMiKF

Ported from ideas in #710 (no IDs taken). Combined stack: ruff clean; 562 targeted unit tests pass on CPU; no GPU smoke run yet.

🤖 Generated with Claude Code

https://claude.ai/code/session_01X86xQuci4asKUkiCwqMiKF

Copying the current step / frame into the past slots (the old history
dropout, and what the dataset's front padding produced) looks exactly like a
genuinely static hand or scene. Missing history is now a learned null token,
by default:

- MLPPolicyStem (history_len > 1): a (D,) null_token replaces the per-step
  MLP token of every past step that history_dropout drops (per sample, train
  only) or that the dataset's proprio_history_mask marks as front padding
  (train and eval); the per-step time embedding is still added. The mask now
  travels HPT.process_batch_for_training -> _robomimic_to_hpt_data -> stem
  (history_mask kwarg) instead of being dropped.
- RDTModel (image_history > 1): a (D,) null_frame replaces a dropped or
  padded past frame's stem tokens, under the usual position, frame and camera
  embeddings. The dataset now emits <camera>_hist_mask for a single lagged
  frame too; RDT appends the current frame's 1 as <camera>_mask.
- The current step / frame is never nulled. torch.where keeps both null
  params in the graph every step, so plain DDP sees no unused parameter.

history_null_token / image_history_null_token (default true) select the
legacy copy-current path, bit-identical to before. Every config that sets
history_dropout / image_history_dropout gets null-token semantics at its
existing rate. The kp RDT models (rdt_bc_mecka_kp_dinov3_vitb and
rdt_1b_..., i.e. the mecka private opscale and freeform op2 recipes) set
both explicitly, with history_dropout and image_history_dropout 0.1.

Architecture change: new parameters. A checkpoint from before this lacks
them; loading one warns and switches that stem / model back to the legacy
copy-current semantics it was trained with, so old runs still evaluate and
resume.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01X86xQuci4asKUkiCwqMiKF

RyanPCo commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

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