mepi31415 commited on
Commit
43e55d7
·
verified ·
1 Parent(s): 9bbe878

Publish WorldToken release card and license

Browse files
Files changed (2) hide show
  1. LICENSE +21 -0
  2. README.md +211 -0
LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2026 WorldToken authors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
README.md ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ tags:
4
+ - robotics
5
+ - imitation-learning
6
+ - robocasa
7
+ - arxiv:2608.22591
8
+ ---
9
+
10
+ # WorldToken Checkpoints
11
+
12
+ [Paper](https://arxiv.org/abs/2608.22591) | [Code](https://github.com/me271828/WorldToken) | [Experiment records](https://huggingface.co/datasets/mepi31415/WorldToken_Experiment_Records) | [Checkpoints](https://huggingface.co/mepi31415/WorldToken_Checkpoints) | [Hugging Face paper page](https://huggingface.co/papers/2608.22591)
13
+
14
+ Model card and index for the **26 selected RoboCasa checkpoints** accompanying
15
+ **WorldToken: Time-First Sequence Modeling for Robotic Imitation Learning**.
16
+
17
+ WorldToken maps RGB observations, proprioception and task language into tokens,
18
+ models their history with a causal Transformer, and predicts action chunks with
19
+ a diffusion head. The BC-Transformer entry uses the native robomimic baseline.
20
+
21
+ | Paper section | Assets | Checkpoints |
22
+ |---|---|---:|
23
+ | [§4 — Multitask control and scaling](04_robocasa_scaling/README.md) | N1–N3 scaling grid, seed 0, D50/D100/D300/D1000/D2900; BC-Transformer at D300, seed 123 | 15 + 1 |
24
+ | [§5 — Token interface](05_token_interface/README.md) | N2, K=4 and K=50, seed 0, all five data settings | 10 |
25
+
26
+ Each run has its own directory and `run_info.json` with its parameters,
27
+ original training name and final step. The section indexes list the expected
28
+ weight filenames; BC-Transformer uses `models/model_epoch_1000.pth`.
29
+
30
+ Each directory also includes a `config.json`, copied from the matching
31
+ training record with HDF5 data paths normalized to
32
+ `${DATA_ROOT}/robocasa/mg_im/v0.1/...`. The 25 WorldToken configs also carry
33
+ the matching public recipe's `eval_window_spec` for offline holdout RMSE;
34
+ the BC-Transformer uses its separate native evaluation pipeline.
35
+
36
+ ## Release availability
37
+
38
+ The fixed release scope is 26 selected checkpoints, uploaded in batches.
39
+ This first batch contains 10 scaling-grid checkpoints: N1 and N2, seed 0,
40
+ at D50, D100, D300, D1000 and D2900. The remaining 16 weights are pending;
41
+ their configurations and entries are already included in the section indexes.
42
+ The section tables describe the complete planned release. Check the repository
43
+ file list for the weights currently available.
44
+
45
+ ## Training and evaluation records
46
+
47
+ These policies were trained by imitation learning on the paper's 23-task
48
+ RoboCasa MG demonstration subsets and evaluated on 23 tasks × 50 episodes,
49
+ with three full-history repeats per checkpoint.
50
+
51
+ Full details are in the companion [WorldToken Experiment Records](https://huggingface.co/datasets/mepi31415/WorldToken_Experiment_Records) package
52
+ (`WorldToken_Experiment_Records`), under the same `<section>/<run>/` path:
53
+
54
+ - `config.json` and split files: architecture, training settings and data selection.
55
+ - Training logs: optimization and holdout metrics.
56
+ - `rollouts/`: episode outcomes, summary statistics and videos.
57
+
58
+ Use the matching run's results when assessing a checkpoint; paper averages over
59
+ multiple training seeds are not the score of a single released weight file.
60
+
61
+ ## Usage
62
+
63
+ Download all currently available weights and their configurations with the
64
+ Hugging Face CLI:
65
+
66
+ ```bash
67
+ hf download mepi31415/WorldToken_Checkpoints --local-dir ./WorldToken_Checkpoints
68
+ ```
69
+
70
+ For only the N2/D300 example below, append
71
+ `--include "04_robocasa_scaling/scaling_n2_d300_seed0/*"`.
72
+ Set `CHECKPOINT_ROOT` to the absolute path of the downloaded directory.
73
+
74
+
75
+ Follow the code repository's [environment setup](https://github.com/me271828/WorldToken/blob/main/environments/README.md)
76
+ and [data preparation](https://github.com/me271828/WorldToken/blob/main/environments/DATA.md).
77
+ Evaluation requires RoboCasa assets and demonstration HDF5 metadata as well as
78
+ the weight file. From the WorldToken code repository, after setting
79
+ `DATA_ROOT` and `CHECKPOINT_ROOT` to your local downloads:
80
+
81
+ ```bash
82
+ RUN=scaling_n2_d300_seed0
83
+ SECTION=04_robocasa_scaling
84
+ EVAL_RUN="$PWD/runs/checkpoint_eval/$RUN"
85
+ mkdir -p "$EVAL_RUN"
86
+ cp "$CHECKPOINT_ROOT/$SECTION/$RUN/config.json" "$EVAL_RUN/config.json"
87
+ python -m experiments.common.rollout \
88
+ --config "experiments/$SECTION/configs/$RUN.json" \
89
+ --run-dir "$EVAL_RUN" --data-root "$DATA_ROOT" \
90
+ --checkpoint "$CHECKPOINT_ROOT/$SECTION/$RUN/checkpoint_step_00030000.pt"
91
+ ```
92
+
93
+ This runs one full-history evaluation and saves new outputs under `EVAL_RUN`.
94
+ The section READMEs in the code repository describe other variants and the baseline.
95
+
96
+ ### Offline holdout RMSE (WorldToken)
97
+
98
+ Use the code repository's Linux/CUDA model environment and prepare the frozen
99
+ CLIP text encoder as described in its environment instructions. Download the
100
+ matching experiment-records package as well as the checkpoint. From the code
101
+ repository root, set these paths to your local copies:
102
+
103
+ ```bash
104
+ export CODE_ROOT="$PWD"
105
+ export DATA_ROOT=/absolute/path/to/data
106
+ export CHECKPOINT_ROOT=/absolute/path/to/WorldToken_Checkpoints
107
+ export RECORDS_ROOT=/absolute/path/to/WorldToken_Experiment_Records
108
+ export RUN=scaling_n2_d300_seed0
109
+ export SECTION=04_robocasa_scaling
110
+ export EVAL_RUN="$CODE_ROOT/runs/checkpoint_eval/$RUN"
111
+ # Optional: an existing CLIP cache from the matching training environment.
112
+ # export LANG_EMB_CACHE=/absolute/path/to/robocasa_clip.npz
113
+ ```
114
+
115
+ Prepare an evaluation copy with the snippet below. Historical split files may
116
+ use `robocasa/v0.1/...`; it maps each HDF5 path to the published config by its
117
+ portable `single_stage/...` identity, preserving the demonstration list.
118
+ It copies an optional existing language cache, or builds one from the holdout
119
+ language strings using the pinned robomimic CLIP wrapper. `ROBOMIMIC_SRC` is
120
+ optional when that source is already installed in the environment. The
121
+ original records and source cache are not modified.
122
+
123
+ ```bash
124
+ python - <<'PY'
125
+ import json
126
+ import os
127
+ import shutil
128
+ from pathlib import Path
129
+
130
+ from worldtoken.data import build_lang_embeddings, portable_episode_key
131
+ from worldtoken.eval_holdout_rmse import load_persisted_holdout_refs
132
+ from worldtoken.train_utils import expand_path_placeholders
133
+
134
+ run = Path(os.environ["EVAL_RUN"]).resolve()
135
+ relative = Path(os.environ["SECTION"]) / os.environ["RUN"]
136
+ records = Path(os.environ["RECORDS_ROOT"]) / relative
137
+ config_path = Path(os.environ["CHECKPOINT_ROOT"]) / relative / "config.json"
138
+ config = json.loads(config_path.read_text(encoding="utf-8"))
139
+ run.mkdir(parents=True, exist_ok=True)
140
+
141
+ paths = config.get("hdf5_paths") or config["dataset"]
142
+ by_file = {portable_episode_key(p): str(expand_path_placeholders(p).resolve()) for p in paths}
143
+ if len(by_file) != len(paths):
144
+ raise ValueError("Duplicate portable HDF5 identities in config")
145
+ split = json.loads((records / "holdout_demos.json").read_text(encoding="utf-8"))
146
+ for demo in split["demos"]:
147
+ demo["hdf5_path"] = by_file[portable_episode_key(demo["hdf5_path"])]
148
+ (run / "holdout_demos.json").write_text(json.dumps(split, indent=2) + "\n", encoding="utf-8")
149
+ shutil.copy2(records / "metrics.jsonl.gz", run / "metrics.jsonl.gz")
150
+
151
+ cache = run / "holdout_clip.npz"
152
+ if os.environ.get("LANG_EMB_CACHE"):
153
+ source = expand_path_placeholders(os.environ["LANG_EMB_CACHE"]).resolve()
154
+ if source != cache:
155
+ shutil.copy2(source, cache)
156
+ src = os.environ.get("ROBOMIMIC_SRC") # Use the local installation, not an archived source path.
157
+ src = expand_path_placeholders(src).resolve() if src else None
158
+ config["lang_emb_cache"] = str(cache)
159
+ config["robomimic_src"] = str(src) if src else None
160
+ spec = expand_path_placeholders(config["eval_window_spec"]).resolve()
161
+ if not spec.is_file():
162
+ raise FileNotFoundError(spec)
163
+ config["eval_window_spec"] = str(spec)
164
+ (run / "config.json").write_text(json.dumps(config, indent=2) + "\n", encoding="utf-8")
165
+ build_lang_embeddings(
166
+ load_persisted_holdout_refs(run), device_arg="cpu", cache_path=cache,
167
+ robomimic_src=src, mode=config["lang_emb_mode"], write_cache=True,
168
+ )
169
+ print(f"Prepared {run}; fixed windows: {spec}")
170
+ PY
171
+
172
+ python -m worldtoken.eval_holdout_rmse \
173
+ --run-dir "$EVAL_RUN" \
174
+ --checkpoint "$CHECKPOINT_ROOT/$SECTION/$RUN/checkpoint_step_00030000.pt" \
175
+ --require-fixed-windows
176
+ ```
177
+
178
+ For another WorldToken run, change `SECTION`, `RUN` and the weight filename
179
+ together. Always use the window spec from its matching recipe; the two C=10
180
+ files have different historical start frames and cannot be substituted based
181
+ on history length alone. If evaluating an already prepared historical run
182
+ whose config lacks this field, obtain the path from that run's public recipe
183
+ and pass `--eval-window-spec PATH` with `--require-fixed-windows`. The latter
184
+ prevents silent window reselection.
185
+
186
+ The result under `EVAL_RUN/holdout_grouped_rmse_v2/` includes the actual window
187
+ path, evaluation protocol, and `legacy_v1_parity` against the
188
+ final-step row in the copied `metrics.jsonl.gz`. An existing `metrics.jsonl`
189
+ takes precedence, so use a dedicated evaluation directory for each run.
190
+ Add `--require-legacy-parity` to fail when no reference is available or the
191
+ comparison exceeds `--legacy-parity-atol` (default `5e-6`); the result is saved
192
+ for inspection before a parity failure. Use `--force` to recompute an existing
193
+ result after changing inputs.
194
+
195
+ Keep `eval_batch_size`, `eval_seed`, `holdout_rmse_samplers`, denoising settings
196
+ and `precision` unchanged for a paper comparison. Diffusion samples depend on
197
+ batch boundaries, so reducing batch size can change the answer despite fixed
198
+ windows. Use a complete matching language cache when available; rebuilding it
199
+ or changing hardware/software can introduce numerical differences, which
200
+ should be reported with the parity result. The fixed-window check validates
201
+ sample selection, not numerical equivalence of the complete evaluator.
202
+ The `--debug-max-demos` and `--debug-crops-per-demo` subset options cannot be
203
+ combined with fixed windows, which require the full saved split and crop count.
204
+
205
+ ## Scope and license
206
+
207
+ These are simulation research policies; real-robot performance and transfer to
208
+ other tasks or observation/action interfaces have not been established.
209
+ The weights and documentation in this package are licensed under the
210
+ [MIT License](LICENSE). Third-party materials retain their own licenses.
211
+ The separate experiment-records package specifies its own license.