Skip to content

fix(policies): use the noise passed to predict_action_chunk in X-VLA, LaWAM and VLA-JEPA - #4814

Closed
shoumikhin wants to merge 3 commits into
huggingface:mainfrom
shoumikhin:noise-honor-ignored
Closed

shoumikhin wants to merge 3 commits into
huggingface:mainfrom
shoumikhin:noise-honor-ignored

Conversation

@shoumikhin

@shoumikhin shoumikhin commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem

X-VLA, LaWAM and VLA-JEPA accept noise in predict_action_chunk and select_action, but ignore it and draw new starting noise inside the model. A caller therefore cannot use that input to compare runs or check a compiled or exported policy against the original.

Change

Each policy passes noise to its starting draw and uses the supplied tensor instead. The tensor is not modified. When it is None, the same draw runs as before, preserving seeded behavior. select_action uses noise only when computing a new chunk.

Expected shapes:

  • X-VLA: (batch_size, chunk_size, policy.model.dim_action).
  • LaWAM: (batch_size, chunk_size, flow_action_dim).
  • VLA-JEPA: (batch_size, chunk_size, action_dim).

X-VLA and LaWAM use the model's action width, which can exceed the dataset's width. New internal arguments are keyword-only and default to None; public signatures are unchanged. Main's new dtype configuration is retained.

Tests

The rebase onto current main applied without conflicts and preserved every patch. On the rebased head, the X-VLA, LaWAM, VLA-JEPA and dtype tests passed on macOS arm64 CPU with Python 3.12 and PyTorch 2.11 (158 passed; 3 need CUDA and 9 need extended Hub tests, all skipped). Every rebased commit passed whitespace checks.

The regression tests use tiny random-weight models, or LaWAM's flow head, to check repeatability, unchanged caller tensors, agreement with the default seeded draw, and forwarding through select_action. Earlier validation confirmed that every new test fails without the source change. The existing policy tests passed on Linux aarch64 CPU; tests requiring a GPU or Hub download were skipped.

Copilot AI balanced review requested due to automatic review settings September 30, 2026 13:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added policies Items related to robot policies tests Problems with test coverage, failures, or improvements to testing labels Sep 30, 2026
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

shoumikhin pushed a commit to shoumikhin/lerobot that referenced this pull request Sep 30, 2026
@shoumikhin
shoumikhin force-pushed the noise-honor-ignored branch from 7ad8cf3 to 7b69e2b Compare October 1, 2026 06:16
shoumikhin added a commit to shoumikhin/lerobot that referenced this pull request Oct 1, 2026
@shoumikhin
shoumikhin force-pushed the noise-honor-ignored branch from 7b69e2b to f2dd7aa Compare October 3, 2026 02:39
XVLAPolicy.predict_action_chunk and select_action accepted a noise
argument but ignored it, so the flow always started from a fresh
torch.randn draw. Pass it through to XVLAModel.generate_actions, which
now uses it as the starting sample and draws exactly as before when it
is None.
LaWAMPolicy.predict_action_chunk and select_action accepted a noise
argument but deleted it, so the flow always started from a fresh
sample_noise draw. Pass it through the backend's predict_action to
ConditionalFlowMatchingHead.sample_actions_cfg, which now uses it as
the starting sample and draws exactly as before when it is None.
VLAJEPAPolicy.predict_action_chunk and select_action accepted a noise
argument but ignored it, so the flow always started from a fresh
torch.randn draw. Pass it through VLAJEPAModel.predict_action to
VLAJEPAActionHead.predict_action, which now uses it as the starting
sample and draws exactly as before when it is None.
@shoumikhin

Copy link
Copy Markdown
Contributor Author

Folded into #4813, as Maximellerbach asked.

@shoumikhin shoumikhin closed this Oct 7, 2026
shoumikhin added a commit to shoumikhin/lerobot that referenced this pull request Oct 12, 2026
huggingface#4813 now also holds huggingface#4814, huggingface#4815, huggingface#4816 and huggingface#4817, folded in at a reviewer's
request, and moves every passed noise to the draw's device and dtype. Export
already has all of it, from the earlier merges and "policies: move a passed
noise to the draw's device and dtype", so the tree does not change.

select_action in X-VLA keeps export's call through predict_action_chunk
(huggingface#4827), which forwards the noise, instead of huggingface#4813's direct
_get_action_chunk call.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

policies Items related to robot policies tests Problems with test coverage, failures, or improvements to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants