kissin42 commited on
Commit
718ddee
·
verified ·
1 Parent(s): 5efcb05

docs: report 100-episode KV8/32/128 sweep

Browse files
Files changed (1) hide show
  1. README.md +47 -48
README.md CHANGED
@@ -42,21 +42,21 @@ The code (GitHub) repository is the public inference runtime. It loads policy bu
42
 
43
  | Bundle | Ctx | Return | Norm. | Simple Ref. | Medium Ref. |
44
  |---|---:|---:|---:|---:|---:|
45
- | `ant-v5` | 32 | 5508.14±1159.84 | 82.72±17.20 | 59.99 ✓ | 86.54 ✗ |
46
- | `halfcheetah-v5` | 32 | 5791.81±2273.95 | 36.67±13.78 | 43.54 ✗ | 74.83 ✗ |
47
- | `hopper-v5` | 32 | 3178.60±28.23 | 82.32±0.74 | 42.65 ✓ | 72.91 ✓ |
48
- | `walker2d-v5` | 32 | 4201.65±49.50 | 61.34±0.73 | 59.51 ✓ | 83.26 ✗ |
49
- | `humanoid-v5` | 32 | 7572.63±1437.13 | 87.86±16.92 | 63.29 ✓ | 81.30 ✓ |
50
- | `humanoidstandup-v5` | 32 | 227703.73±61036.30 | 72.21±23.15 | 48.39 ✓ | 89.86 ✗ |
51
- | `pusher-v5` | 32 | -30.22±5.58 | 95.63±4.53 | — | 94.19 ✓ |
52
- | `swimmer-v5` | 32 | 257.76±5.97 | 72.63±1.68 | — | 59.44 ✓ |
53
 
54
  **Gymnasium environment IDs:** `Ant-v5`, `HalfCheetah-v5`, `Hopper-v5`, `Walker2d-v5`, `Humanoid-v5`, `HumanoidStandup-v5`, `Pusher-v5`, and `Swimmer-v5`.
55
  HF bundle subfolders are lowercase and case-sensitive (e.g. `humanoidstandup-v5`).
56
 
57
  Training data is expert-free: bundles are trained using Minari simple and medium datasets only; expert trajectories are not used for training. The runs behind these numbers are public at [wandb.ai/causal-gpt-rl/mujoco](https://wandb.ai/causal-gpt-rl/mujoco).
58
 
59
- `Return` and `Norm.` are mean±std over 50 episodes with seeds `0..49`. `Ctx` is
60
  context length. `max_steps=1000`, and KV cache max length is set to `Ctx`.
61
 
62
  `Norm.` puts random at 0 and expert at 100. `Simple Ref.` and `Medium Ref.` are
@@ -71,8 +71,8 @@ were trained on `medium-v0` alone.
71
 
72
  To measure a bundle under that protocol, use
73
  [`examples/deploy/reproduce.py`](https://github.com/ccnets-team/causal-gpt-rl/blob/main/examples/deploy/reproduce.py):
74
- `python -m examples.deploy.reproduce --env-id Ant-v5`. The Quick Start's
75
- `run_episodes` seeds only its first reset, so it cannot express `0..49`.
76
 
77
  Normalized scores use random=0 and expert=100:
78
 
@@ -87,27 +87,26 @@ Normalized scores use random=0 and expert=100:
87
  ![Why long-context extrapolation can be stable in RL — two measures leave the same first step, a short arrow to the trained window of 32 and a long one to a 1000-step retention, over a single unbroken bar of tokens that runs on past the shorter one](assets/long-context-extrapolation-in-rl.svg)
88
 
89
  All bundles above share a `context_length` of **32** — the model's context
90
- window used in training, and not a limit at inference. `kv_cache_max_len`, how
91
- much rollout history is retained, is a load-time knob; the headline scores use
92
- `kv=32` (1×), and the sweep below runs well past it — `Humanoid-v5` scores
93
- highest among the displayed sweep settings at 2×, at 90.10±13.34. Sweeping retention to 16 (0.5×), 32 (1×), and 64
94
- (2×) tokens under the same protocol — 50 episodes, seeds `0..49`,
95
- `max_steps=1000`:
96
-
97
- | Bundle | `kv=16` (0.5×) | `kv=32` (1×) | `kv=64` (2×) | `kv=1000` (31.25×) |
98
- | --- | ---: | ---: | ---: | ---: |
99
- | `ant-v5` | 76.24±25.18 | **82.72±17.20** | 82.28±23.35 | 84.66±18.63 |
100
- | `halfcheetah-v5` | 37.37±15.62 | **36.67±13.78** | 39.14±14.24 | 39.17±15.94 |
101
- | `hopper-v5` | 82.37±0.71 | 82.32±0.74 | **82.48±0.61** | 82.26±0.98 |
102
- | `walker2d-v5` | **61.74±0.73** | 61.34±0.73 | 61.40±0.69 | 60.73±3.73 |
103
- | `humanoid-v5` | 86.20±23.84 | 87.86±16.92 | **90.10±13.34** | 86.25±20.91 |
104
- | `humanoidstandup-v5` | **76.58±22.80** | 72.21±23.15 | 69.10±26.10 | — |
105
- | `pusher-v5` | 95.65±4.72 | 95.63±4.53 | **95.69±4.72** | — |
106
- | `swimmer-v5` | 79.19±1.54 | 72.63±1.68 | **79.24±3.84** | — |
107
-
108
- KV1000 (31.25×) was measured only for Ant, HalfCheetah, Hopper, Walker2d, and Humanoid. It is a far-out-of-training-context extrapolation, not a recommended default serving setting. Unmeasured cells are shown as `—`.
109
-
110
- Scores are normalized with random=0 and expert=100. Values are mean±std over 50 episodes.
111
 
112
  The `kv=32` column repeats the main table's `Norm.` column; the others are the
113
  same protocol at a different retention.
@@ -115,22 +114,22 @@ same protocol at a different retention.
115
  <details>
116
  <summary><strong>KV retention interpretation</strong></summary>
117
 
118
- At `kv=64` the rollout attends past the model's 32-token window, so every column
119
- beyond `kv=32` extrapolates. That window is not a cap — the `kv=1000` column
120
- sits far past it. What bounds retention is the episode: a cache only holds the
121
- steps that have run, so with `max_steps=1000` any `kv` above 1000 behaves
122
- exactly like `kv=1000`.
123
-
124
- For most environments, differences across 0.5×/1×/2× are within run-to-run
125
- noise (`Trend` marks these `≈`).
126
-
127
- - **Ant-v5:** KV32 has the highest mean and completion rate; KV1000 is close on mean with one fewer full episode.
128
- - **Hopper-v5:** stable across retention lengths; KV64 has the highest mean, while KV1000 completes 49/50 full episodes.
129
- - **Walker2d-v5:** 0.5× has the highest mean; 1× and 2× are close, and all three complete 50/50 episodes. KV1000 completes 48/50 and is not the recommended default.
130
- - **Humanoid-v5:** strongest and steadiest at 2×, scoring 93.37±0.45.
131
- - **HumanoidStandup-v5:** highest and steadiest at 0.5×, scoring 76.58±22.80.
132
- - **Pusher-v5:** flat across all three retention lengths at 95.65–95.69.
133
- - **Swimmer-v5:** 0.5× and 2× tie on mean; 0.5× is substantially steadier.
134
 
135
  </details>
136
 
 
42
 
43
  | Bundle | Ctx | Return | Norm. | Simple Ref. | Medium Ref. |
44
  |---|---:|---:|---:|---:|---:|
45
+ | `ant-v5` | 32 | 5330.29±1666.34 | 80.08±24.71 | 59.99 ✓ | 86.54 ✗ |
46
+ | `halfcheetah-v5` | 32 | 5795.90±2747.69 | 36.69±16.65 | 43.54 ✗ | 74.83 ✗ |
47
+ | `hopper-v5` | 32 | 3178.28±27.49 | 82.31±0.72 | 42.65 ✓ | 72.91 ✓ |
48
+ | `walker2d-v5` | 32 | 4203.97±61.68 | 61.37±0.91 | 59.51 ✓ | 83.26 ✗ |
49
+ | `humanoid-v5` | 32 | 7817.46±1254.06 | 90.74±14.77 | 63.29 ✓ | 81.30 ✓ |
50
+ | `humanoidstandup-v5` | 32 | 239740.89±59256.34 | 76.78±22.47 | 48.39 ✓ | 89.86 ✗ |
51
+ | `pusher-v5` | 32 | -29.89±5.57 | 95.89±4.52 | — | 94.19 ✓ |
52
+ | `swimmer-v5` | 32 | 258.32±6.23 | 72.78±1.75 | — | 59.44 ✓ |
53
 
54
  **Gymnasium environment IDs:** `Ant-v5`, `HalfCheetah-v5`, `Hopper-v5`, `Walker2d-v5`, `Humanoid-v5`, `HumanoidStandup-v5`, `Pusher-v5`, and `Swimmer-v5`.
55
  HF bundle subfolders are lowercase and case-sensitive (e.g. `humanoidstandup-v5`).
56
 
57
  Training data is expert-free: bundles are trained using Minari simple and medium datasets only; expert trajectories are not used for training. The runs behind these numbers are public at [wandb.ai/causal-gpt-rl/mujoco](https://wandb.ai/causal-gpt-rl/mujoco).
58
 
59
+ `Return` and `Norm.` are mean±std over 100 episodes with seeds `0..99`. `Ctx` is
60
  context length. `max_steps=1000`, and KV cache max length is set to `Ctx`.
61
 
62
  `Norm.` puts random at 0 and expert at 100. `Simple Ref.` and `Medium Ref.` are
 
71
 
72
  To measure a bundle under that protocol, use
73
  [`examples/deploy/reproduce.py`](https://github.com/ccnets-team/causal-gpt-rl/blob/main/examples/deploy/reproduce.py):
74
+ `python -m examples.deploy.reproduce --env-id Ant-v5 --episodes 100`. The Quick Start's
75
+ `run_episodes` seeds only its first reset, so it cannot express `0..99`.
76
 
77
  Normalized scores use random=0 and expert=100:
78
 
 
87
  ![Why long-context extrapolation can be stable in RL — two measures leave the same first step, a short arrow to the trained window of 32 and a long one to a 1000-step retention, over a single unbroken bar of tokens that runs on past the shorter one](assets/long-context-extrapolation-in-rl.svg)
88
 
89
  All bundles above share a `context_length` of **32** — the model's context
90
+ window used in training, and not a limit at inference. `kv_cache_max_len`, how
91
+ much rollout history is retained, is a load-time knob; the headline scores use
92
+ `kv=32` (1×). The wider sweep below shows that retention is environment-dependent:
93
+ Humanoid is nearly tied at KV32 and KV128, while Swimmer strongly favors KV8.
94
+ Sweeping retention to 8 (0.25×), 32 (1×), and 128
95
+ (4×) tokens under the same protocol — 100 episodes, seeds `0..99`,
96
+ `max_steps=1000`:
97
+
98
+ | Bundle | `kv=8` (0.25×) | `kv=32` (1×) | `kv=128` (4×) |
99
+ | --- | ---: | ---: | ---: |
100
+ | `ant-v5` | 73.62±27.09 | 80.08±24.71 | **82.63±21.18** |
101
+ | `halfcheetah-v5` | 35.74±17.29 | **36.69±16.65** | 34.82±18.25 |
102
+ | `hopper-v5` | 82.30±0.61 | 82.31±0.72 | **82.64±1.05** |
103
+ | `walker2d-v5` | 61.24±3.79 | **61.37±0.91** | 61.17±2.62 |
104
+ | `humanoid-v5` | 86.92±21.35 | 90.74±14.77 | **90.75±13.69** |
105
+ | `humanoidstandup-v5` | 75.44±25.56 | **76.78±22.47** | 74.41±25.00 |
106
+ | `pusher-v5` | 95.60±4.64 | **95.89±4.52** | 95.81±4.52 |
107
+ | `swimmer-v5` | **80.97±2.68** | 72.78±1.75 | 80.35±2.90 |
108
+
109
+ Scores are normalized with random=0 and expert=100. Values are mean±std over 100 episodes.
 
110
 
111
  The `kv=32` column repeats the main table's `Norm.` column; the others are the
112
  same protocol at a different retention.
 
114
  <details>
115
  <summary><strong>KV retention interpretation</strong></summary>
116
 
117
+ At `kv=128` the rollout attends well past the model's 32-token training window,
118
+ so that column is a 4× extrapolation. The wider 0.25×/1×/4× spacing makes
119
+ environment-specific effects visible without treating retention as uniformly
120
+ beneficial.
121
+
122
+ - **Ant-v5:** mean rises with retention; KV128 also has the best horizon count
123
+ in this 100-seed batch (84/100).
124
+ - **HalfCheetah-v5:** KV32 has the highest mean, but all three settings have
125
+ broad return distributions.
126
+ - **Hopper-v5:** essentially flat; KV128 has the highest mean but one early end.
127
+ - **Walker2d-v5:** KV32 is highest and much steadier than KV8 or KV128.
128
+ - **Humanoid-v5:** KV32 and KV128 tie on mean; KV128 is modestly steadier, while
129
+ KV32 reaches the horizon more often (97/100 versus 95/100).
130
+ - **HumanoidStandup-v5:** KV32 has the highest mean and lowest dispersion.
131
+ - **Pusher-v5:** flat across all three retention lengths.
132
+ - **Swimmer-v5:** KV8 and KV128 are both far stronger than KV32.
133
 
134
  </details>
135