robochunk / README.md
PAOP123's picture
Card: results, load-and-plot snippet, hashes, timeline; boundary figure
9482153 verified
|
Raw History Blame Contribute Delete
9.61 kB
---
license: mit
tags: [robotics, h-net, dynamic-chunking, behaviour-cloning, pre-registered]
library_name: pytorch
---
# RoboChunk checkpoints
**Independent re-implementation of H-Net-style dynamic chunking for robot trajectories. Not affiliated with the H-Net authors (Sukjun Hwang, Brandon Wang, Albert Gu) or Cartesia.**
Checkpoints from **RoboChunk**, a pre-registered study of H-Net-style dynamic chunking on robot trajectories
(FetchPickAndPlace-v4, scripted expert with labelled motion phases). Code, pre-registrations, decision log and the full
report: **https://github.com/NapoleonPK/robochunk-study**. Simulated data and result files: https://huggingface.co/datasets/PAOP123/robochunk-sim
## Results
| test | criterion | key numbers (from `runs/results_*.json`) | verdict |
|---|---|---|---|
| H1 | learned router βˆ’ every baseline β‰₯ 0.10 boundary F1 (Β±3), CI excludes 0 | learned 0.358 vs Fixed 0.594; difference βˆ’0.236 [βˆ’0.253, βˆ’0.219] | **fail** |
| H2 | learned bits/step < Fixed at β‰₯ 2 of 3 N, compression matched | N=5: -13.165 vs -12.650; N=10: -13.150 vs -12.825; N=20: -13.208 vs -13.009 (compression 15.5 < 0.8 N, counts as fail) | **pass** |
| H3 | β‰₯ 2Γ— chance near gripper events and p < 0.01, on both datasets | SO-100 1.89Γ— (p = 0.001); Koch 1.77Γ— (p = 0.001) | **significant but below threshold** |
| H4 | Spearman ρ(novelty, gain) β‰₯ 0.6 over 11 clean candidates | ρ = 0.782 (p = 0.0045); 95% CI [0.25, 0.95] (post hoc); corrupted data scored most novel in 4 of 4 | **pass** |
| H1-v2 | refractory router βˆ’ every baseline β‰₯ 0.10 raw F1 (fresh data) | vs Fixed +0.042 [+0.023, +0.061] | **fail** (predicted) |
| H1b-v2 | chance-corrected (circular shift) difference > 0 vs every baseline, CI excludes 0 | vs Fixed +0.103 [+0.084, +0.122]; smallest (vs Velocity minima) +0.055 [+0.038, +0.072] | **pass** |
| H3-v2 | refractory router, β‰₯ 2Γ— chance near gripper events, SO-100 and Koch | SO-100 1.53Γ— (p = 0.001); Koch 1.52Γ— (p = 0.001) | **not supported** |
| H3b-v2 | same rule on a fresh dataset (SO-101, 5 test episodes) | 1.74Γ— (p = 0.004) | **fail** |
![Episode boundaries](https://huggingface.co/PAOP123/robochunk/resolve/main/figures/fig1_episodes.png)
*True motion phases (bands) and the boundaries each rule places on six simulated test episodes, N = 10.*
Full report with all numbers, caveats and deviations: `REPORT.md` in the GitHub repository.
## Load a checkpoint and plot its boundaries
```python
# Needs the code: git clone https://github.com/NapoleonPK/robochunk-study && cd robochunk-study && pip install -r requirements.txt
import matplotlib.pyplot as plt, torch, yaml
from huggingface_hub import snapshot_download
from robochunk.data import Normalizer
from robochunk.datasets import load_dataset
from robochunk.train import DEFAULTS, build_model, evaluate
run = "exp_refractory_N10_s0" # any folder under runs/ in this repo
ckpt = snapshot_download("PAOP123/robochunk", allow_patterns=f"runs/{run}/*")
snapshot_download("PAOP123/robochunk-sim", repo_type="dataset", allow_patterns="sim/test.npz", local_dir="data")
d = f"{ckpt}/runs/{run}"
cfg = {**DEFAULTS, **yaml.safe_load(open(f"{d}/config.yaml"))}
eps = load_dataset({**cfg, "splits": {"test": "test"}})["test"]
model = build_model(cfg, eps[0]["x"].shape[1])
model.load_state_dict(torch.load(f"{d}/best.pt", map_location="cpu"))
ev = evaluate(model, cfg, eps[:1], None, Normalizer.load(f"{d}/norm.json"), torch.device("cpu"), keep=True)
ep, b = eps[0], ev["bounds"][0]
plt.step(range(len(ep["phase"])), ep["phase"], where="post", label="true phase")
plt.vlines(b[b > 0], -0.5, 6.5, color="C1", label="router boundaries")
plt.yticks(range(7), ["approach", "descend", "close", "lift", "transport", "open", "retreat"])
plt.xlabel("step (25 Hz)"); plt.legend(); plt.show()
```
## Contents
`runs/<run_id>/` for every simulated-data and Part B run:
- `best.pt` β€” PyTorch state dict at the best validation epoch; `config.yaml` β€” run settings; `norm.json` β€” input
normalisation; `metrics.json` β€” test metrics and stop reason; `history.json` β€” training curve; `git.txt` β€” code commit
at training time (an old hash: see *History rewrite* below).
- Run ids: `sim_<method>_N<N>_s<seed>` (main study), `exp_refractory_N10_s*` (refractory router, exploratory in v1,
tested in v2), `v2_sim_refractory_N10_s3–5` (v2 secondary seeds), `abl_*` (ablations), `partb_*` (models trained on
the Part B reference set for novelty scoring), `proxy_sim` (entropy-baseline proxy). Real-robot checkpoints are not
published.
## Pre-registration hashes
SHA-256 of the pre-registration files at each tag and now (`shasum -a 256 PREREGISTRATION*.md`). `PREREGISTRATION.md` changed once, by Amendment 1, before any main result; neither file has changed since its last tag.
| file | SHA-256 | tag (commit) |
|---|---|---|
| `PREREGISTRATION.md` | `e78668239e7401270c572d3feaef8d62cb2210e9d582ae640d525c94b52d8850` | `prereg` (`7ffc024`) |
| `PREREGISTRATION.md` | `628c6ad61a63b9ee08a84e2d4bf71d6ff3562c84c463cb87767c8c012ec86095` | `prereg-amend1` (`fb5e2ad`) |
| `PREREGISTRATION.md` | `628c6ad61a63b9ee08a84e2d4bf71d6ff3562c84c463cb87767c8c012ec86095` | `prereg-v2` (`9e99328`) |
| `PREREGISTRATION_v2.md` | `fa2700491bb7ca95826a0f81b868b538ebae54b47ba37d609a6e18ebd860c6b7` | `prereg-v2` (`9e99328`) |
| `PREREGISTRATION.md` | `628c6ad61a63b9ee08a84e2d4bf71d6ff3562c84c463cb87767c8c012ec86095` | current file |
| `PREREGISTRATION_v2.md` | `fa2700491bb7ca95826a0f81b868b538ebae54b47ba37d609a6e18ebd860c6b7` | current file |
## Timeline evidence
Timestamps recorded by third parties (UTC). Source details: `docs/timeline_evidence.json` in https://github.com/NapoleonPK/robochunk-study.
| UTC | source | what it shows |
|---|---|---|
| 2026-10-29 13:08:38 | GitHub push event (earlier private repo) | push to main ending at old commit 1f1faa0 (= 7ffc024, tag prereg) |
| 2026-10-29 13:08:51 | Gmail, sent check-in email | check-in 1+2; its text quotes 'Pre-registration committed as 1f1faa0 (tag "prereg")' |
| 2026-10-29 18:29:16 | Gmail, sent check-in email | 'Amendment 1 is committed and pushed (tag prereg-amend1). No main result existed before it.' (tag name, no hash) |
| 2026-10-29 18:35:33 | GitHub push event (earlier private repo) | push whose previous head was old commit f61d0f3 (= fb5e2ad, tag prereg-amend1), so that commit was on GitHub by then |
| 2026-10-30 08:27:17 | Gmail, sent check-in email | v1 results H1-H3 reported (v2 was designed after this, as PREREGISTRATION_v2.md states) |
| 2026-10-30 08:42:19 | Gmail, sent email | draft PREREGISTRATION_v2.md rev. 1 attached, for approval |
| 2026-10-30 08:53:41 | Gmail, sent email | draft PREREGISTRATION_v2.md rev. 2 attached, for approval (the approved rev. 3 was not emailed) |
| 2026-10-30 09:42:58 | GitHub (public repo created) | NapoleonPK/robochunk-study created with the rewritten history, including tag prereg-v2 (9e99328) |
| 2026-10-30 10:39:31 | GitHub Actions (public) | first CI run, on commit 53c390d, which has 9e99328 (tag prereg-v2) as an ancestor; the v2 training runs started after this |
| 2026-10-30 13:42:56 | GitHub Actions (public) | CI run on commit 9e1347d, which adds runs/results_v2.json (v2 analysis, single run) |
| 2026-10-30 13:45:55 | Gmail, sent check-in email | v2 results reported |
| 2026-10-31 07:12:27 | Hugging Face commit | dataset PAOP123/robochunk-sim, first upload (commit f509bea0ce) |
| 2026-10-31 07:13:24 | Hugging Face commit | model PAOP123/robochunk, first upload (commits be8a09a8f0, 9f7f28c5ac at 07:13:29Z) |
Self-reported (git and local run logs, not independent): 2026-10-29 13:08:32 git commit 7ffc024 (old 1f1faa0), tag prereg; 2026-10-29 18:28:57 git commit fb5e2ad (old f61d0f3), tag prereg-amend1; 2026-10-29 18:29:02 first v1 main run started (runs/main_queue.log; no run had finished before the amendment); 2026-10-30 08:57:49 git commit 9e99328 (old d9b86c7), tag prereg-v2; 2026-10-30 08:58:28 git commit ac72fec: fresh simulated test split generated after the tag, SHA-256 recorded; 2026-10-30 11:14:00 v2 training runs started (runs/after_main.log, POLICIES_DONE 12:14 local time); 2026-10-30 13:40:00 v2 runs finished (V2_DONE 14:40 local time); analyze_v2.py run once afterwards.
**History rewrite and commit map.** Before the repository was made public (2026-10-30), its git history was rewritten once with `git filter-repo --replace-text`, only to replace the author's personal e-mail address in `docs/BRIEF.md`. File contents, dates, messages and tags are otherwise unchanged, so the pre-registration files have the same SHA-256 in the old and the new commits (checked for all three tags), but every commit hash changed. Emails, the earlier private repository and run `git.txt` files cite the old hashes; `docs/HISTORY.md` and `docs/commit-map.txt` map them to the new ones (for example `1f1faa0` β†’ `7ffc024`, tag `prereg`). Gmail: message 'date' from the Gmail API for messages sent from the author's account to the same address (verifiable by the account owner; originals with headers available on request). GitHub events: repository events API of the earlier private repository NapoleonPK/robochunk (visible to its owner while it exists). GitHub Actions and Hugging Face: public.
## Credits
The model follows **H-Net** (Sukjun Hwang, Brandon Wang, Albert Gu, *Dynamic Chunking for End-to-End Hierarchical Sequence Modeling*, arXiv:2507.07955) and Cartesia's posts on dynamic chunking. Simulation: Gymnasium-Robotics and MuJoCo. Author: TΓ©o Tran Van Lieu. Code written with Claude (Anthropic) as a coding agent.