Harryis commited on
Commit
62b8e8c
·
verified ·
1 Parent(s): 330b98e

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +9 -0
  2. wandb/run-20251218_182331-3lp68bhy/files/code/cleanrl/cleanrl/ppo_rubikscube.py +517 -0
  3. wandb/run-20251218_182331-3lp68bhy/files/requirements.txt +315 -0
  4. wandb/run-20251218_182331-3lp68bhy/files/wandb-metadata.json +92 -0
  5. wandb/run-20251218_182331-3lp68bhy/files/wandb-summary.json +1 -0
  6. wandb/run-20251218_182448-on6j4c96/files/code/cleanrl/cleanrl/ppo_rubikscube.py +517 -0
  7. wandb/run-20251218_182448-on6j4c96/files/config.yaml +201 -0
  8. wandb/run-20251218_182448-on6j4c96/files/diff.patch +1162 -0
  9. wandb/run-20251218_182448-on6j4c96/files/diff_8d73639b99b38265453f898b8d6af7d4af50d56e.patch +1162 -0
  10. wandb/run-20251218_182448-on6j4c96/files/requirements.txt +315 -0
  11. wandb/run-20251218_182448-on6j4c96/files/wandb-metadata.json +92 -0
  12. wandb/run-20251218_182448-on6j4c96/files/wandb-summary.json +1 -0
  13. wandb/run-20251218_182448-on6j4c96/run-on6j4c96.wandb +3 -0
  14. wandb/run-20251218_182745-ahjkdup0/files/code/cleanrl/cleanrl/ppo_rubikscube.py +517 -0
  15. wandb/run-20251218_182745-ahjkdup0/files/config.yaml +201 -0
  16. wandb/run-20251218_182745-ahjkdup0/files/diff.patch +1162 -0
  17. wandb/run-20251218_182745-ahjkdup0/files/diff_8d73639b99b38265453f898b8d6af7d4af50d56e.patch +1162 -0
  18. wandb/run-20251218_182745-ahjkdup0/files/requirements.txt +315 -0
  19. wandb/run-20251218_182745-ahjkdup0/files/wandb-metadata.json +92 -0
  20. wandb/run-20251218_182745-ahjkdup0/files/wandb-summary.json +1 -0
  21. wandb/run-20251218_182745-ahjkdup0/run-ahjkdup0.wandb +3 -0
  22. wandb/run-20251218_183419-wvypkl8w/files/code/cleanrl/cleanrl/ppo_rubikscube.py +517 -0
  23. wandb/run-20251218_183419-wvypkl8w/files/config.yaml +201 -0
  24. wandb/run-20251218_183419-wvypkl8w/files/diff.patch +1162 -0
  25. wandb/run-20251218_183419-wvypkl8w/files/diff_8d73639b99b38265453f898b8d6af7d4af50d56e.patch +1162 -0
  26. wandb/run-20251218_183419-wvypkl8w/files/requirements.txt +315 -0
  27. wandb/run-20251218_183419-wvypkl8w/files/wandb-metadata.json +92 -0
  28. wandb/run-20251218_183419-wvypkl8w/files/wandb-summary.json +1 -0
  29. wandb/run-20251218_183419-wvypkl8w/run-wvypkl8w.wandb +3 -0
  30. wandb/run-20251218_184253-g8kppnjh/files/code/cleanrl/cleanrl/ppo_rubikscube.py +517 -0
  31. wandb/run-20251218_184253-g8kppnjh/files/config.yaml +201 -0
  32. wandb/run-20251218_184253-g8kppnjh/files/diff.patch +1162 -0
  33. wandb/run-20251218_184253-g8kppnjh/files/diff_8d73639b99b38265453f898b8d6af7d4af50d56e.patch +1162 -0
  34. wandb/run-20251218_184253-g8kppnjh/files/requirements.txt +315 -0
  35. wandb/run-20251218_184253-g8kppnjh/files/wandb-metadata.json +92 -0
  36. wandb/run-20251218_184253-g8kppnjh/files/wandb-summary.json +1 -0
  37. wandb/run-20251218_184253-g8kppnjh/run-g8kppnjh.wandb +3 -0
  38. wandb/run-20251218_185248-ts36d12x/files/code/cleanrl/cleanrl/ppo_rubikscube.py +517 -0
  39. wandb/run-20251218_185248-ts36d12x/files/config.yaml +201 -0
  40. wandb/run-20251218_185248-ts36d12x/files/diff.patch +1162 -0
  41. wandb/run-20251218_185248-ts36d12x/files/diff_8d73639b99b38265453f898b8d6af7d4af50d56e.patch +1162 -0
  42. wandb/run-20251218_185248-ts36d12x/files/requirements.txt +315 -0
  43. wandb/run-20251218_185248-ts36d12x/files/wandb-metadata.json +92 -0
  44. wandb/run-20251218_185248-ts36d12x/files/wandb-summary.json +1 -0
  45. wandb/run-20251218_185248-ts36d12x/run-ts36d12x.wandb +3 -0
  46. wandb/run-20251218_190243-6eiq1qnz/files/config.yaml +961 -0
  47. wandb/run-20251218_190243-6eiq1qnz/files/media/table/val/generations_0_6cb7f39cae32c2b9f416.table.json +1 -0
  48. wandb/run-20251218_190243-6eiq1qnz/files/media/table/val/generations_109_6afe86429a1aeaa2828a.table.json +0 -0
  49. wandb/run-20251218_190243-6eiq1qnz/files/media/table/val/generations_119_e2ca09a14d71e17c86dd.table.json +0 -0
  50. wandb/run-20251218_190243-6eiq1qnz/files/media/table/val/generations_129_8ccea2d2f61887ccb050.table.json +0 -0
.gitattributes CHANGED
@@ -650,3 +650,12 @@ wandb/run-20260622_183609-bhcblf16/run-bhcblf16.wandb filter=lfs diff=lfs merge=
650
  wandb/run-20260622_183641-19mq6q1z/run-19mq6q1z.wandb filter=lfs diff=lfs merge=lfs -text
651
  wandb/run-20251217_181044-gmt9ya4m/run-gmt9ya4m.wandb filter=lfs diff=lfs merge=lfs -text
652
  wandb/run-20251218_002911-rvpar64n/run-rvpar64n.wandb filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
650
  wandb/run-20260622_183641-19mq6q1z/run-19mq6q1z.wandb filter=lfs diff=lfs merge=lfs -text
651
  wandb/run-20251217_181044-gmt9ya4m/run-gmt9ya4m.wandb filter=lfs diff=lfs merge=lfs -text
652
  wandb/run-20251218_002911-rvpar64n/run-rvpar64n.wandb filter=lfs diff=lfs merge=lfs -text
653
+ wandb/run-20251218_182448-on6j4c96/run-on6j4c96.wandb filter=lfs diff=lfs merge=lfs -text
654
+ wandb/run-20251218_182745-ahjkdup0/run-ahjkdup0.wandb filter=lfs diff=lfs merge=lfs -text
655
+ wandb/run-20251218_183419-wvypkl8w/run-wvypkl8w.wandb filter=lfs diff=lfs merge=lfs -text
656
+ wandb/run-20251218_184253-g8kppnjh/run-g8kppnjh.wandb filter=lfs diff=lfs merge=lfs -text
657
+ wandb/run-20251218_185248-ts36d12x/run-ts36d12x.wandb filter=lfs diff=lfs merge=lfs -text
658
+ wandb/run-20251218_190243-6eiq1qnz/run-6eiq1qnz.wandb filter=lfs diff=lfs merge=lfs -text
659
+ wandb/run-20251218_201054-j0xb9suw/run-j0xb9suw.wandb filter=lfs diff=lfs merge=lfs -text
660
+ wandb/run-20251218_210047-o51cj6g5/run-o51cj6g5.wandb filter=lfs diff=lfs merge=lfs -text
661
+ wandb/run-20251218_211229-yi7iasga/run-yi7iasga.wandb filter=lfs diff=lfs merge=lfs -text
wandb/run-20251218_182331-3lp68bhy/files/code/cleanrl/cleanrl/ppo_rubikscube.py ADDED
@@ -0,0 +1,517 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PPO with small MLP for RAGEN Rubik's Cube 2x2 using the existing env (no env edits)
2
+ import os
3
+ import random
4
+ import time
5
+ from dataclasses import dataclass
6
+ from pathlib import Path
7
+ from typing import Tuple, Dict, Any, List
8
+ import json
9
+ import re
10
+
11
+ import gymnasium as gym
12
+ import numpy as np
13
+ import torch
14
+ import torch.nn as nn
15
+ import torch.optim as optim
16
+ import tyro
17
+ from torch.distributions.categorical import Categorical
18
+
19
+ import sys
20
+ sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../../'))
21
+
22
+ from ragen.env.rubikscube.env import RubiksCube2x2Env
23
+ from ragen.env.rubikscube.config import RubiksCube2x2Config
24
+
25
+
26
+ class RubiksCubeWrapper(gym.Env):
27
+ """
28
+ Adapter to use ragen RubiksCube2x2Env with Gymnasium vector API.
29
+ - Converts text observation to one-hot vector of 24 stickers x 6 colors.
30
+ - Maps agent actions [0..11] to env actions [1..12].
31
+ - Exposes proper observation_space and action_space.
32
+ """
33
+ metadata = {"render_modes": ["rgb_array", "human", "ansi"]}
34
+
35
+ def __init__(self, env: RubiksCube2x2Env):
36
+ super().__init__()
37
+ self._env = env
38
+ # 24 stickers, 6 colors -> one-hot size 144
39
+ self._colors = ['W', 'O', 'G', 'R', 'B', 'Y']
40
+ self._color_to_idx = {c: i for i, c in enumerate(self._colors)}
41
+ self.observation_space = gym.spaces.Box(low=0.0, high=1.0, shape=(24 * len(self._colors),), dtype=np.float32)
42
+ self.action_space = gym.spaces.Discrete(12)
43
+ # precompile regex to extract 4 letters within [X, X]\n [X, X]
44
+ # Lines look like: "Up (U): [W, W]\n [W, W]"
45
+ self._face_pat = re.compile(r"\[(?:\s*([A-Z])\s*,\s*([A-Z])\s*\])\n\s*\[(?:\s*([A-Z])\s*,\s*([A-Z])\s*\])")
46
+
47
+ def _encode_obs(self, text_obs: str) -> np.ndarray:
48
+ # Extract the six face blocks in the order U, L, F, R, B, D as rendered
49
+ faces_order = ["Up (U):", "Left (L):", "Front (F):", "Right (R):", "Back (B):", "Down (D):"]
50
+ onehots: List[int] = []
51
+ # Build a map from header to its block text
52
+ lines = text_obs.splitlines()
53
+ # Collect blocks starting after header line and including the next line for second row
54
+ i = 0
55
+ blocks: List[str] = []
56
+ while i < len(lines):
57
+ line = lines[i]
58
+ for header in faces_order:
59
+ if line.startswith(header):
60
+ # Join current line's bracketed pair and the next line (which contains the second pair)
61
+ # Remove the "Header:" prefix to keep only the bracket portions
62
+ content = line[len(header):].strip()
63
+ next_line = lines[i + 1] if i + 1 < len(lines) else ""
64
+ block = f"{content}\n{next_line}"
65
+ blocks.append(block)
66
+ break
67
+ i += 1
68
+ # Fallback: if regex fails, return zeros
69
+ if len(blocks) != 6:
70
+ return np.zeros(24 * len(self._colors), dtype=np.float32)
71
+ stickers: List[int] = []
72
+ for blk in blocks:
73
+ m = self._face_pat.search(blk)
74
+ if not m:
75
+ return np.zeros(24 * len(self._colors), dtype=np.float32)
76
+ # order: 0,1,2,3 per render() doc
77
+ c0, c1, c2, c3 = m.group(1), m.group(2), m.group(3), m.group(4)
78
+ stickers.extend([c0, c1, c2, c3])
79
+ # stickers now length 24; convert to one-hot
80
+ grid = np.zeros((24, len(self._colors)), dtype=np.float32)
81
+ for idx, ch in enumerate(stickers):
82
+ cidx = self._color_to_idx.get(ch, None)
83
+ if cidx is not None:
84
+ grid[idx, cidx] = 1.0
85
+ return grid.reshape(-1)
86
+
87
+ def reset(self, *, seed: int | None = None, options: Dict[str, Any] | None = None):
88
+ text_obs = self._env.reset(seed=seed)
89
+ obs = self._encode_obs(text_obs)
90
+ return obs, {}
91
+
92
+ def step(self, action: int):
93
+ mapped = int(action) + 1 # 0..11 -> 1..12
94
+ text_obs, reward, done, info = self._env.step(mapped)
95
+ obs = self._encode_obs(text_obs)
96
+ terminated = bool(done)
97
+ truncated = False
98
+ return obs, float(reward), terminated, truncated, info or {}
99
+
100
+ def render(self):
101
+ return self._env.render()
102
+
103
+ def close(self):
104
+ self._env.close()
105
+
106
+
107
+ @dataclass
108
+ class Args:
109
+ exp_name: str = os.path.basename(__file__)[: -len(".py")]
110
+ seed: int = 1
111
+ torch_deterministic: bool = True
112
+ cuda: bool = True
113
+ track: bool = True
114
+ wandb_project_name: str = "cleanRL"
115
+ wandb_entity: str | None = None
116
+ capture_video: bool = False
117
+
118
+ # Algorithm
119
+ env_id: str = "RubiksCube2x2"
120
+ total_timesteps: int = 1000_000
121
+ learning_rate: float = 2.5e-4
122
+ num_envs: int = 8
123
+ num_steps: int = 128
124
+ anneal_lr: bool = True
125
+ gamma: float = 0.99
126
+ gae_lambda: float = 0.95
127
+ num_minibatches: int = 4
128
+ update_epochs: int = 4
129
+ norm_adv: bool = True
130
+ clip_coef: float = 0.2
131
+ clip_vloss: bool = True
132
+ ent_coef: float = 0.01
133
+ vf_coef: float = 0.5
134
+ max_grad_norm: float = 0.5
135
+ target_kl: float | None = None
136
+
137
+ # Rubik specific
138
+ scramble_depth: int = 1
139
+ max_steps_env: int = 20
140
+
141
+ # runtime filled
142
+ batch_size: int = 0
143
+ minibatch_size: int = 0
144
+ num_iterations: int = 0
145
+ eval_splits: int = 2
146
+ eval_episodes: int = 4000
147
+
148
+
149
+ def make_env(idx, run_name, seed, scramble_depth, max_steps_env, capture_video=False):
150
+ def thunk():
151
+ config = RubiksCube2x2Config(scramble_depth=scramble_depth, max_steps=max_steps_env, render_mode='text')
152
+ env = RubiksCube2x2Env(config)
153
+ env = RubiksCubeWrapper(env)
154
+ env = gym.wrappers.TimeLimit(env, max_episode_steps=max_steps_env)
155
+ env = gym.wrappers.RecordEpisodeStatistics(env)
156
+ if capture_video and idx == 0:
157
+ env = gym.wrappers.RecordVideo(env, f"videos/{run_name}")
158
+ return env
159
+ return thunk
160
+
161
+
162
+ def layer_init(layer, std=np.sqrt(2), bias_const=0.0):
163
+ torch.nn.init.orthogonal_(layer.weight, std)
164
+ torch.nn.init.constant_(layer.bias, bias_const)
165
+ return layer
166
+
167
+
168
+ class Agent(nn.Module):
169
+ def __init__(self, envs):
170
+ super().__init__()
171
+ obs_shape = int(np.array(envs.single_observation_space.shape).prod())
172
+ hidden = 128
173
+ self.critic = nn.Sequential(
174
+ layer_init(nn.Linear(obs_shape, hidden)),
175
+ nn.Tanh(),
176
+ layer_init(nn.Linear(hidden, hidden)),
177
+ nn.Tanh(),
178
+ layer_init(nn.Linear(hidden, 1), std=1.0),
179
+ )
180
+ self.actor = nn.Sequential(
181
+ layer_init(nn.Linear(obs_shape, hidden)),
182
+ nn.Tanh(),
183
+ layer_init(nn.Linear(hidden, hidden)),
184
+ nn.Tanh(),
185
+ layer_init(nn.Linear(hidden, envs.single_action_space.n), std=0.01),
186
+ )
187
+
188
+ def get_value(self, x):
189
+ return self.critic(x)
190
+
191
+ def get_action_and_value(self, x, action=None):
192
+ logits = self.actor(x)
193
+ probs = Categorical(logits=logits)
194
+ if action is None:
195
+ action = probs.sample()
196
+ return action, probs.log_prob(action), probs.entropy(), self.critic(x)
197
+
198
+
199
+ if __name__ == "__main__":
200
+ args = tyro.cli(Args)
201
+ args.batch_size = int(args.num_envs * args.num_steps)
202
+ args.minibatch_size = int(args.batch_size // args.num_minibatches)
203
+ args.num_iterations = args.total_timesteps // args.batch_size
204
+ run_name = f"{args.env_id}__{args.exp_name}__{args.seed}__{int(time.time())}"
205
+
206
+ if args.track:
207
+ import wandb
208
+ wandb.init(
209
+ project=args.wandb_project_name,
210
+ entity=args.wandb_entity,
211
+ config=vars(args),
212
+ name=run_name,
213
+ monitor_gym=True,
214
+ save_code=True,
215
+ )
216
+ try:
217
+ wandb.define_metric("global_step")
218
+ for prefix in ["train/*", "rollout/*", "eval/*", "losses/*", "charts/*", "perf/*"]:
219
+ wandb.define_metric(prefix, step_metric="global_step")
220
+ except Exception:
221
+ pass
222
+
223
+ # seeding
224
+ random.seed(args.seed)
225
+ np.random.seed(args.seed)
226
+ torch.manual_seed(args.seed)
227
+ torch.backends.cudnn.deterministic = args.torch_deterministic
228
+
229
+ device = torch.device("cuda" if torch.cuda.is_available() and args.cuda else "cpu")
230
+
231
+ # envs
232
+ envs = gym.vector.SyncVectorEnv([
233
+ make_env(i, run_name, args.seed, args.scramble_depth, args.max_steps_env, args.capture_video)
234
+ for i in range(args.num_envs)
235
+ ])
236
+ assert isinstance(envs.single_action_space, gym.spaces.Discrete)
237
+
238
+ agent = Agent(envs).to(device)
239
+ optimizer = optim.Adam(agent.parameters(), lr=args.learning_rate, eps=1e-5)
240
+
241
+ # storage
242
+ obs = torch.zeros((args.num_steps, args.num_envs) + envs.single_observation_space.shape).to(device)
243
+ actions = torch.zeros((args.num_steps, args.num_envs) + envs.single_action_space.shape).to(device)
244
+ logprobs = torch.zeros((args.num_steps, args.num_envs)).to(device)
245
+ rewards = torch.zeros((args.num_steps, args.num_envs)).to(device)
246
+ dones = torch.zeros((args.num_steps, args.num_envs)).to(device)
247
+ values = torch.zeros((args.num_steps, args.num_envs)).to(device)
248
+
249
+ # start
250
+ global_step = 0
251
+ start_time = time.time()
252
+ next_obs, _ = envs.reset(seed=args.seed)
253
+ next_obs = torch.Tensor(next_obs).to(device)
254
+ next_done = torch.zeros(args.num_envs).to(device)
255
+
256
+ # eval helper similar to FrozenLake: collect greedy eval trajectories and write metrics.json
257
+ def collect_eval_trajectories(agent_model, make_env_fn, n_episodes, step_tag):
258
+ out_dir = Path(f"runs/{run_name}/trajectories/step_{step_tag}")
259
+ out_dir.mkdir(parents=True, exist_ok=True)
260
+ out_path = out_dir / "trajectories.jsonl"
261
+ env = make_env_fn()
262
+ collected = 0
263
+ summary_returns = []
264
+ summary_success = []
265
+ with out_path.open("w") as f:
266
+ while collected < n_episodes:
267
+ state, _ = env.reset(seed=args.seed + 100000 + collected)
268
+ traj_states = [state.tolist()]
269
+ traj_actions = []
270
+ traj_rewards = []
271
+ traj_dones = []
272
+ traj_success = []
273
+ done = False
274
+ step_count = 0
275
+ max_eval_steps = getattr(env, '_max_episode_steps', None) or int(args.max_steps_env)
276
+ while not done:
277
+ with torch.no_grad():
278
+ logits = agent_model.actor(torch.tensor(state, dtype=torch.float32, device=device).unsqueeze(0))
279
+ action = int(torch.argmax(logits, dim=1).item())
280
+ next_state, reward, terminated, truncated, info = env.step(action)
281
+ traj_actions.append(int(action))
282
+ traj_rewards.append(float(reward))
283
+ step_count += 1
284
+ d = bool(terminated) or bool(truncated) or (step_count >= max_eval_steps)
285
+ traj_dones.append(d)
286
+ traj_success.append(bool((info or {}).get('success', False)))
287
+ state = next_state
288
+ traj_states.append(state.tolist())
289
+ done = d
290
+ ep_ret = float(sum(traj_rewards))
291
+ ep_succ = bool(any(traj_success))
292
+ record = {
293
+ "states": traj_states,
294
+ "actions": traj_actions,
295
+ "rewards": traj_rewards,
296
+ "dones": traj_dones,
297
+ "success": traj_success,
298
+ "episode_return": ep_ret,
299
+ "episode_success": ep_succ,
300
+ }
301
+ f.write(json.dumps(record) + "\n")
302
+ collected += 1
303
+ summary_returns.append(ep_ret)
304
+ summary_success.append(1.0 if ep_succ else 0.0)
305
+ env.close()
306
+ try:
307
+ metrics = {
308
+ "global_step": int(step_tag),
309
+ "episodes": int(n_episodes),
310
+ "success_rate": float(np.mean(summary_success)) if len(summary_success) else 0.0,
311
+ "avg_return": float(np.mean(summary_returns)) if len(summary_returns) else 0.0,
312
+ "std_return": float(np.std(summary_returns)) if len(summary_returns) else 0.0,
313
+ }
314
+ with (out_dir / "metrics.json").open("w") as mf:
315
+ json.dump(metrics, mf)
316
+ except Exception as e:
317
+ print(f"Warning: failed to write eval metrics: {e}")
318
+
319
+ # training loop
320
+ eval_every_iters = max(1, args.num_iterations // args.eval_splits)
321
+ for iteration in range(1, args.num_iterations + 1):
322
+ # Anneal LR
323
+ if args.anneal_lr:
324
+ frac = 1.0 - (iteration - 1.0) / args.num_iterations
325
+ lrnow = frac * args.learning_rate
326
+ optimizer.param_groups[0]["lr"] = lrnow
327
+
328
+ # accumulate per-iteration episode successes
329
+ iter_successes = []
330
+ for step in range(0, args.num_steps):
331
+ global_step += args.num_envs
332
+ obs[step] = next_obs
333
+ dones[step] = next_done
334
+
335
+ with torch.no_grad():
336
+ action, logprob, _, value = agent.get_action_and_value(next_obs)
337
+ values[step] = value.flatten()
338
+ actions[step] = action
339
+ logprobs[step] = logprob
340
+
341
+ next_obs, reward, terminations, truncations, infos = envs.step(action.cpu().numpy())
342
+ next_done = np.logical_or(terminations, truncations)
343
+ rewards[step] = torch.tensor(reward).to(device).view(-1)
344
+ next_obs, next_done = torch.Tensor(next_obs).to(device), torch.Tensor(next_done).to(device)
345
+
346
+ # Episode stats logging similar to FrozenLake
347
+ try:
348
+ mask = None
349
+ if isinstance(infos, dict):
350
+ if "_episode" in infos:
351
+ mask = np.asarray(infos["_episode"]).astype(bool)
352
+ elif "episode" in infos and isinstance(infos["episode"], dict) and "_l" in infos["episode"]:
353
+ mask = np.asarray(infos["episode"]["_l"]).astype(bool)
354
+ if mask is not None and np.any(mask):
355
+ r_arr = np.asarray(infos.get("episode", {}).get("r", np.zeros_like(mask, dtype=float)))
356
+ l_arr = np.asarray(infos.get("episode", {}).get("l", np.zeros_like(mask, dtype=int)))
357
+ # prefer success from info; fallback to ep return > 0
358
+ if "success" in infos:
359
+ succ_arr = np.asarray(infos.get("success", np.zeros_like(mask, dtype=bool))).astype(float)
360
+ else:
361
+ try:
362
+ succ_arr = (np.asarray(r_arr) > 0).astype(float)
363
+ except Exception:
364
+ succ_arr = np.zeros_like(mask, dtype=float)
365
+ # collect iteration successes for training success rate
366
+ try:
367
+ for s in np.asarray(succ_arr)[mask]:
368
+ iter_successes.append(float(s))
369
+ except Exception:
370
+ pass
371
+ if args.track:
372
+ try:
373
+ import wandb
374
+ log_dict = {
375
+ "global_step": int(global_step),
376
+ "rollout/ep_rew_mean": float(np.mean(r_arr[mask])) if np.any(mask) else None,
377
+ "rollout/ep_len_mean": float(np.mean(l_arr[mask])) if np.any(mask) else None,
378
+ "rollout/success_rate": float(np.mean(succ_arr[mask])) if np.any(mask) else None,
379
+ }
380
+ wandb.log(log_dict, step=global_step)
381
+ except Exception:
382
+ pass
383
+ except Exception:
384
+ pass
385
+
386
+ # GAE
387
+ with torch.no_grad():
388
+ next_value = agent.get_value(next_obs).reshape(1, -1)
389
+ advantages = torch.zeros_like(rewards).to(device)
390
+ lastgaelam = 0
391
+ for t in reversed(range(args.num_steps)):
392
+ if t == args.num_steps - 1:
393
+ nextnonterminal = 1.0 - next_done
394
+ nextvalues = next_value
395
+ else:
396
+ nextnonterminal = 1.0 - dones[t + 1]
397
+ nextvalues = values[t + 1]
398
+ delta = rewards[t] + args.gamma * nextvalues * nextnonterminal - values[t]
399
+ advantages[t] = lastgaelam = delta + args.gamma * args.gae_lambda * nextnonterminal * lastgaelam
400
+ returns = advantages + values
401
+
402
+ # flatten batch
403
+ b_obs = obs.reshape((-1,) + envs.single_observation_space.shape)
404
+ b_logprobs = logprobs.reshape(-1)
405
+ b_actions = actions.reshape((-1,) + envs.single_action_space.shape)
406
+ b_advantages = advantages.reshape(-1)
407
+ b_returns = returns.reshape(-1)
408
+ b_values = values.reshape(-1)
409
+
410
+ # update
411
+ b_inds = np.arange(args.batch_size)
412
+ clipfracs = []
413
+ for epoch in range(args.update_epochs):
414
+ np.random.shuffle(b_inds)
415
+ for start in range(0, args.batch_size, args.minibatch_size):
416
+ end = start + args.minibatch_size
417
+ mb_inds = b_inds[start:end]
418
+
419
+ _, newlogprob, entropy, newvalue = agent.get_action_and_value(b_obs[mb_inds], b_actions.long()[mb_inds])
420
+ logratio = newlogprob - b_logprobs[mb_inds]
421
+ ratio = logratio.exp()
422
+
423
+ with torch.no_grad():
424
+ old_approx_kl = (-logratio).mean()
425
+ approx_kl = ((ratio - 1) - logratio).mean()
426
+ clipfracs += [((ratio - 1.0).abs() > args.clip_coef).float().mean().item()]
427
+
428
+ mb_advantages = b_advantages[mb_inds]
429
+ if args.norm_adv:
430
+ mb_advantages = (mb_advantages - mb_advantages.mean()) / (mb_advantages.std() + 1e-8)
431
+
432
+ pg_loss1 = -mb_advantages * ratio
433
+ pg_loss2 = -mb_advantages * torch.clamp(ratio, 1 - args.clip_coef, 1 + args.clip_coef)
434
+ pg_loss = torch.max(pg_loss1, pg_loss2).mean()
435
+
436
+ newvalue = newvalue.view(-1)
437
+ if args.clip_vloss:
438
+ v_loss_unclipped = (newvalue - b_returns[mb_inds]) ** 2
439
+ v_clipped = b_values[mb_inds] + torch.clamp(
440
+ newvalue - b_values[mb_inds], -args.clip_coef, args.clip_coef,
441
+ )
442
+ v_loss_clipped = (v_clipped - b_returns[mb_inds]) ** 2
443
+ v_loss = 0.5 * torch.max(v_loss_unclipped, v_loss_clipped).mean()
444
+ else:
445
+ v_loss = 0.5 * ((newvalue - b_returns[mb_inds]) ** 2).mean()
446
+
447
+ entropy_loss = entropy.mean()
448
+ loss = pg_loss - args.ent_coef * entropy_loss + v_loss * args.vf_coef
449
+
450
+ optimizer.zero_grad()
451
+ loss.backward()
452
+ nn.utils.clip_grad_norm_(agent.parameters(), args.max_grad_norm)
453
+ optimizer.step()
454
+
455
+ if args.target_kl is not None and approx_kl > args.target_kl:
456
+ break
457
+
458
+ # metrics
459
+ y_pred, y_true = b_values.cpu().numpy(), b_returns.cpu().numpy()
460
+ var_y = np.var(y_true)
461
+ explained_var = np.nan if var_y == 0 else 1 - np.var(y_true - y_pred) / var_y
462
+
463
+ sps = int(global_step / (time.time() - start_time))
464
+ train_success_rate = float(np.mean(iter_successes)) if len(iter_successes) else 0.0
465
+ print(f"Iter {iteration:4d}/{args.num_iterations} | SPS: {sps:5d} | R: {rewards.mean().item():6.3f}")
466
+ if args.track:
467
+ try:
468
+ import wandb
469
+ wandb.log({
470
+ "global_step": int(global_step),
471
+ "charts/progress": float(100.0 * iteration / max(1, args.num_iterations)),
472
+ "train/value_loss": float(v_loss.item()),
473
+ "train/policy_loss": float(pg_loss.item()),
474
+ "losses/value_loss": float(v_loss.item()),
475
+ "losses/policy_loss": float(pg_loss.item()),
476
+ "train/entropy": float(entropy_loss.item()),
477
+ "train/old_approx_kl": float(old_approx_kl.item()),
478
+ "train/approx_kl": float(approx_kl.item()),
479
+ "train/clipfrac": float(np.mean(clipfracs)) if len(clipfracs) else 0.0,
480
+ "losses/explained_variance": float(explained_var),
481
+ "charts/avg_reward": float(rewards.mean().item()),
482
+ "charts/avg_value": float(values.mean().item()),
483
+ "perf/SPS": int(sps),
484
+ "charts/SPS": int(sps),
485
+ "train/success_rate": train_success_rate,
486
+ "charts/train_success_rate": train_success_rate,
487
+ "train/learning_rate": float(optimizer.param_groups[0]["lr"]),
488
+ }, step=global_step)
489
+ except Exception:
490
+ pass
491
+
492
+ # periodic evaluation collection
493
+ if iteration % eval_every_iters == 0:
494
+ try:
495
+ eval_thunk = make_env(0, run_name, args.seed + 9999, args.scramble_depth, args.max_steps_env, False)
496
+ collect_eval_trajectories(agent, eval_thunk, n_episodes=args.eval_episodes, step_tag=global_step)
497
+ if args.track:
498
+ try:
499
+ import json as _json
500
+ from pathlib import Path as _Path
501
+ mpath = _Path(f"runs/{run_name}/trajectories/step_{global_step}/metrics.json")
502
+ if mpath.exists():
503
+ with mpath.open("r") as mf:
504
+ metrics = _json.load(mf)
505
+ wandb.log({
506
+ "eval/success_rate": metrics.get("success_rate"),
507
+ "eval/avg_return": metrics.get("avg_return"),
508
+ "eval/std_return": metrics.get("std_return"),
509
+ "eval/episodes": metrics.get("episodes"),
510
+ }, step=global_step)
511
+ except Exception:
512
+ pass
513
+ print(f"Collected {args.eval_episodes} eval trajectories at global_step {global_step}")
514
+ except Exception as e:
515
+ print(f"Warning: eval trajectory collection failed at step {global_step}: {e}")
516
+
517
+ envs.close()
wandb/run-20251218_182331-3lp68bhy/files/requirements.txt ADDED
@@ -0,0 +1,315 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ colorama==0.4.6
2
+ psutil==7.1.2
3
+ ragen==0.1
4
+ ragen==0.1
5
+ setuptools==80.9.0
6
+ wheel==0.45.1
7
+ pip==25.3
8
+ ragen==0.1
9
+ pytz==2025.2
10
+ nvidia-cusparselt-cu12==0.6.2
11
+ mpmath==1.3.0
12
+ typing_extensions==4.15.0
13
+ sympy==1.13.1
14
+ pylatexenc==2.10
15
+ nvidia-cusolver-cu12==11.6.1.9
16
+ numpy==1.26.4
17
+ Markdown==3.10
18
+ absl-py==2.3.1
19
+ pyasn1_modules==0.4.2
20
+ Werkzeug==3.1.3
21
+ networkx==3.3
22
+ MarkupSafe==2.1.5
23
+ fsspec==2025.9.0
24
+ filelock==3.19.1
25
+ nvidia-cudnn-cu12==9.1.0.70
26
+ Jinja2==3.1.6
27
+ tensorboard==2.20.0
28
+ triton==3.2.0
29
+ pillow==11.3.0
30
+ xxhash==3.6.0
31
+ nvidia-nvtx-cu12==12.4.127
32
+ nvidia-nvjitlink-cu12==12.4.127
33
+ nvidia-nccl-cu12==2.21.5
34
+ nvidia-curand-cu12==10.3.5.147
35
+ wrapt==2.0.1
36
+ nvidia-cufft-cu12==11.2.1.3
37
+ pyjnius==1.7.0
38
+ nvidia-cuda-runtime-cu12==12.4.127
39
+ nvidia-cuda-nvrtc-cu12==12.4.127
40
+ websockets==15.0.1
41
+ nvidia-cuda-cupti-cu12==12.4.127
42
+ zipp==3.23.0
43
+ nvidia-cublas-cu12==12.4.5.8
44
+ nvidia-cusparse-cu12==12.3.1.170
45
+ flash_attn==2.8.3
46
+ rsa==4.9.1
47
+ einops==0.8.1
48
+ py-cpuinfo==9.0.0
49
+ pure_eval==0.2.3
50
+ ptyprocess==0.7.0
51
+ gym-notices==0.1.0
52
+ flatbuffers==25.9.23
53
+ fastrlock==0.8.3
54
+ Farama-Notifications==0.0.4
55
+ faiss-gpu==1.7.2
56
+ antlr4-python3-runtime==4.9.3
57
+ wcwidth==0.2.14
58
+ wasabi==1.1.3
59
+ uvloop==0.22.1
60
+ urllib3==2.5.0
61
+ tzdata==2025.2
62
+ typing-inspection==0.4.2
63
+ traitlets==5.14.3
64
+ tqdm==4.67.1
65
+ tomli==2.3.0
66
+ threadpoolctl==3.6.0
67
+ tenacity==9.1.2
68
+ tabulate==0.9.0
69
+ spacy-loggers==1.0.5
70
+ spacy-legacy==3.0.12
71
+ soupsieve==2.8
72
+ sniffio==1.3.1
73
+ smmap==5.0.2
74
+ six==1.17.0
75
+ shellingham==1.5.4
76
+ sentencepiece==0.2.1
77
+ scipy==1.15.3
78
+ safetensors==0.6.2
79
+ rpds-py==0.29.0
80
+ rignore==0.7.6
81
+ regex==2025.11.3
82
+ RapidFuzz==3.14.3
83
+ rank-bm25==0.2.2
84
+ pyzmq==27.1.0
85
+ PyYAML==6.0.3
86
+ pytokens==0.3.0
87
+ python-multipart==0.0.20
88
+ python-json-logger==4.0.0
89
+ python-dotenv==1.2.1
90
+ PySocks==1.7.1
91
+ pyparsing==3.2.5
92
+ PyJWT==2.10.1
93
+ Pygments==2.19.2
94
+ pygame==2.6.1
95
+ pydantic_core==2.41.5
96
+ pycparser==2.23
97
+ pycountry==24.6.1
98
+ pybind11==3.0.1
99
+ pyarrow==22.0.0
100
+ psutil==7.1.3
101
+ protobuf==4.25.8
102
+ propcache==0.4.1
103
+ prometheus_client==0.23.1
104
+ platformdirs==4.5.0
105
+ pexpect==4.9.0
106
+ pathspec==0.12.1
107
+ partial-json-parser==0.2.1.1.post6
108
+ parso==0.8.5
109
+ packaging==25.0
110
+ orjson==3.11.4
111
+ opentelemetry-semantic-conventions-ai==0.4.13
112
+ opencv-python-headless==4.12.0.88
113
+ ninja==1.13.0
114
+ nest-asyncio==1.6.0
115
+ mypy_extensions==1.1.0
116
+ murmurhash==1.0.15
117
+ multidict==6.7.0
118
+ msgspec==0.19.0
119
+ msgpack==1.1.2
120
+ mdurl==0.1.2
121
+ loguru==0.7.3
122
+ llvmlite==0.44.0
123
+ llguidance==0.7.30
124
+ lark==1.2.2
125
+ kiwisolver==1.4.9
126
+ joblib==1.5.2
127
+ jiter==0.12.0
128
+ itsdangerous==2.2.0
129
+ interegular==0.3.3
130
+ ImageIO==2.37.2
131
+ idna==3.11
132
+ humanfriendly==10.0
133
+ httpx-sse==0.4.3
134
+ httptools==0.7.1
135
+ html2text==2025.4.15
136
+ hf-xet==1.2.0
137
+ h11==0.16.0
138
+ grpcio==1.76.0
139
+ frozenlist==1.8.0
140
+ fonttools==4.60.1
141
+ executing==2.2.1
142
+ exceptiongroup==1.3.0
143
+ eval_type_backport==0.2.2
144
+ docstring_parser==0.17.0
145
+ dnspython==2.8.0
146
+ distro==1.9.0
147
+ diskcache==5.6.3
148
+ dill==0.4.0
149
+ decorator==5.2.1
150
+ debugpy==1.8.17
151
+ Cython==3.2.1
152
+ cymem==2.0.13
153
+ cycler==0.12.1
154
+ cupy-cuda12x==13.6.0
155
+ contourpy==1.3.2
156
+ colorama==0.4.6
157
+ codetiming==1.4.0
158
+ cloudpickle==3.1.2
159
+ cloudpathlib==0.23.0
160
+ click==8.3.1
161
+ charset-normalizer==3.4.4
162
+ certifi==2025.11.12
163
+ catalogue==2.0.10
164
+ cachetools==6.2.2
165
+ blis==1.3.2
166
+ blinker==1.9.0
167
+ blake3==1.0.8
168
+ attrs==25.4.0
169
+ async-timeout==5.0.1
170
+ asttokens==3.0.1
171
+ astor==0.8.1
172
+ annotated-types==0.7.0
173
+ annotated-doc==0.0.4
174
+ airportsdata==20250909
175
+ aiohappyeyeballs==2.6.1
176
+ yarl==1.22.0
177
+ uvicorn==0.38.0
178
+ typer-slim==0.20.0
179
+ thefuzz==0.22.1
180
+ stack-data==0.6.3
181
+ srsly==2.5.1
182
+ smart_open==7.5.0
183
+ sentry-sdk==2.44.0
184
+ scikit-learn==1.7.2
185
+ requests==2.32.5
186
+ referencing==0.37.0
187
+ python-dateutil==2.9.0.post0
188
+ pydantic==2.12.4
189
+ prompt_toolkit==3.0.52
190
+ preshed==3.0.11
191
+ opentelemetry-proto==1.26.0
192
+ omegaconf==2.3.0
193
+ numba==0.61.2
194
+ nltk==3.9.2
195
+ multiprocess==0.70.18
196
+ matplotlib-inline==0.2.1
197
+ markdown-it-py==4.0.0
198
+ jedi==0.19.2
199
+ importlib_metadata==8.0.0
200
+ httpcore==1.0.9
201
+ gymnasium==1.2.2
202
+ gym==0.26.2
203
+ googleapis-common-protos==1.72.0
204
+ gitdb==4.0.12
205
+ gguf==0.17.1
206
+ Flask==3.1.2
207
+ faiss-cpu==1.13.0
208
+ email-validator==2.3.0
209
+ depyf==0.18.0
210
+ Deprecated==1.3.1
211
+ coloredlogs==15.0.1
212
+ cffi==2.0.0
213
+ black==25.11.0
214
+ beautifulsoup4==4.14.2
215
+ anyio==4.11.0
216
+ aiosignal==1.4.0
217
+ watchfiles==1.1.1
218
+ tiktoken==0.12.0
219
+ starlette==0.49.3
220
+ sse-starlette==3.0.3
221
+ rich==14.2.0
222
+ pydantic-settings==2.12.0
223
+ pydantic-extra-types==2.10.6
224
+ pandas==2.3.3
225
+ opentelemetry-exporter-otlp-proto-common==1.26.0
226
+ onnxruntime==1.23.2
227
+ matplotlib==3.10.7
228
+ lm-format-enforcer==0.10.12
229
+ jsonschema-specifications==2025.9.1
230
+ ipython==8.37.0
231
+ hydra-core==1.3.2
232
+ huggingface-hub==0.36.0
233
+ httpx==0.28.1
234
+ gym-sokoban==0.0.6
235
+ GitPython==3.1.45
236
+ cryptography==46.0.3
237
+ confection==0.1.5
238
+ cleantext==1.1.4
239
+ aiohttp==3.13.2
240
+ weasel==0.4.3
241
+ wandb==0.23.0
242
+ typer==0.19.2
243
+ virtualenv==20.35.4
244
+ pyasn1==0.6.1
245
+ torch==2.6.0
246
+ tokenizers==0.22.1
247
+ thinc==8.3.9
248
+ rich-toolkit==0.15.1
249
+ prometheus-fastapi-instrumentator==7.1.0
250
+ openai==2.8.0
251
+ jsonschema==4.25.1
252
+ gdown==5.2.0
253
+ fastapi==0.121.2
254
+ anthropic==0.73.0
255
+ xformers==0.0.29.post2
256
+ transformers==4.57.1
257
+ proto-plus==1.26.1
258
+ torchvision==0.21.0
259
+ torchdata==0.11.0
260
+ torchaudio==2.6.0
261
+ together==1.5.30
262
+ tensordict==0.8.3
263
+ spacy==3.8.9
264
+ ray==2.51.1
265
+ outlines_core==0.1.26
266
+ mistral_common==1.8.5
267
+ mcp==1.21.1
268
+ fastapi-cloud-cli==0.3.1
269
+ fastapi-cli==0.0.16
270
+ datasets==4.4.1
271
+ accelerate==1.11.0
272
+ xgrammar==0.1.18
273
+ pyserini==1.2.0
274
+ peft==0.18.0
275
+ outlines==0.1.11
276
+ opentelemetry-exporter-otlp-proto-http==1.26.0
277
+ opentelemetry-exporter-otlp-proto-grpc==1.26.0
278
+ kimina-client==0.2.1
279
+ compressed-tensors==0.9.3
280
+ opentelemetry-exporter-otlp==1.26.0
281
+ vllm==0.8.5
282
+ py-spy==0.4.1
283
+ opencensus-context==0.1.3
284
+ distlib==0.4.0
285
+ colorful==0.5.8
286
+ tensorboard-data-server==0.7.2
287
+ google-auth==2.43.0
288
+ google-api-core==2.28.1
289
+ aiohttp-cors==0.8.1
290
+ opentelemetry-exporter-prometheus==0.59b0
291
+ opencensus==0.11.4
292
+ verl==0.5.0.dev0
293
+ opentelemetry-api==1.38.0
294
+ opentelemetry-semantic-conventions==0.59b0
295
+ opentelemetry-sdk==1.38.0
296
+ typeguard==4.4.4
297
+ shtab==1.8.0
298
+ tyro==0.9.35
299
+ verl==0.5.0.dev0
300
+ autocommand==2.2.2
301
+ backports.tarfile==1.2.0
302
+ importlib_metadata==8.0.0
303
+ inflect==7.3.1
304
+ jaraco.collections==5.1.0
305
+ jaraco.context==5.3.0
306
+ jaraco.functools==4.0.1
307
+ jaraco.text==3.12.1
308
+ more-itertools==10.3.0
309
+ packaging==24.2
310
+ platformdirs==4.2.2
311
+ tomli==2.0.1
312
+ typeguard==4.3.0
313
+ typing_extensions==4.12.2
314
+ wheel==0.45.1
315
+ zipp==3.19.2
wandb/run-20251218_182331-3lp68bhy/files/wandb-metadata.json ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "os": "Linux-5.14.0-284.25.1.el9_2.x86_64-x86_64-with-glibc2.35",
3
+ "python": "CPython 3.10.19",
4
+ "startedAt": "2025-12-18T10:23:31.950845Z",
5
+ "args": [
6
+ "--track"
7
+ ],
8
+ "program": "/mnt/general/wanghy/RAGEN/cleanrl/cleanrl/ppo_rubikscube.py",
9
+ "codePath": "cleanrl/cleanrl/ppo_rubikscube.py",
10
+ "codePathLocal": "cleanrl/cleanrl/ppo_rubikscube.py",
11
+ "git": {
12
+ "remote": "https://github.com/mll-lab-nu/RAGEN.git",
13
+ "commit": "8d73639b99b38265453f898b8d6af7d4af50d56e"
14
+ },
15
+ "email": "haoyu-wa22@mails.tsinghua.edu.cn",
16
+ "root": "/mnt/general/wanghy/RAGEN",
17
+ "host": "pt-4d654cf4576f4d23ad3d3919f12932fe-worker-0",
18
+ "executable": "/root/local/miniconda3/envs/ragen/bin/python",
19
+ "cpu_count": 64,
20
+ "cpu_count_logical": 128,
21
+ "gpu": "NVIDIA H100 80GB HBM3",
22
+ "gpu_count": 8,
23
+ "disk": {
24
+ "/": {
25
+ "total": "5153960755200",
26
+ "used": "447519772672"
27
+ }
28
+ },
29
+ "memory": {
30
+ "total": "2163642122240"
31
+ },
32
+ "gpu_nvidia": [
33
+ {
34
+ "name": "NVIDIA H100 80GB HBM3",
35
+ "memoryTotal": "85520809984",
36
+ "cudaCores": 16896,
37
+ "architecture": "Hopper",
38
+ "uuid": "GPU-35e2d43d-4067-82ce-90d4-def9e389bf28"
39
+ },
40
+ {
41
+ "name": "NVIDIA H100 80GB HBM3",
42
+ "memoryTotal": "85520809984",
43
+ "cudaCores": 16896,
44
+ "architecture": "Hopper",
45
+ "uuid": "GPU-af4135e3-88f2-e9ac-518d-502c75a85429"
46
+ },
47
+ {
48
+ "name": "NVIDIA H100 80GB HBM3",
49
+ "memoryTotal": "85520809984",
50
+ "cudaCores": 16896,
51
+ "architecture": "Hopper",
52
+ "uuid": "GPU-d7fdeeba-fe9b-ec03-d9f7-6724fe4266b5"
53
+ },
54
+ {
55
+ "name": "NVIDIA H100 80GB HBM3",
56
+ "memoryTotal": "85520809984",
57
+ "cudaCores": 16896,
58
+ "architecture": "Hopper",
59
+ "uuid": "GPU-ccc4f668-3882-5a8e-2c07-c5cd08f6f666"
60
+ },
61
+ {
62
+ "name": "NVIDIA H100 80GB HBM3",
63
+ "memoryTotal": "85520809984",
64
+ "cudaCores": 16896,
65
+ "architecture": "Hopper",
66
+ "uuid": "GPU-7b73c0cf-d3d5-e10c-7176-a43be1e41001"
67
+ },
68
+ {
69
+ "name": "NVIDIA H100 80GB HBM3",
70
+ "memoryTotal": "85520809984",
71
+ "cudaCores": 16896,
72
+ "architecture": "Hopper",
73
+ "uuid": "GPU-81b58d94-5d1f-8ec2-f9d2-fd56172ed177"
74
+ },
75
+ {
76
+ "name": "NVIDIA H100 80GB HBM3",
77
+ "memoryTotal": "85520809984",
78
+ "cudaCores": 16896,
79
+ "architecture": "Hopper",
80
+ "uuid": "GPU-03e8bc66-3b44-6794-49fd-5392fbdda6d1"
81
+ },
82
+ {
83
+ "name": "NVIDIA H100 80GB HBM3",
84
+ "memoryTotal": "85520809984",
85
+ "cudaCores": 16896,
86
+ "architecture": "Hopper",
87
+ "uuid": "GPU-b7cf0ec6-7c29-1179-dceb-09565da51890"
88
+ }
89
+ ],
90
+ "cudaVersion": "12.4",
91
+ "writerId": "zrvrl6pdc6hzbh0erqwl9hu99oek6ey0"
92
+ }
wandb/run-20251218_182331-3lp68bhy/files/wandb-summary.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"train/success_rate":1,"train/policy_loss":0.008788106963038445,"perf/SPS":2270,"_step":101208,"rollout/ep_rew_mean":1,"losses/explained_variance":0.9954127543605864,"train/value_loss":9.734073991296555e-09,"train/learning_rate":0.00022515368852459017,"losses/policy_loss":0.008788106963038445,"charts/SPS":2270,"losses/value_loss":9.734073991296555e-09,"train/old_approx_kl":-0.006179366260766983,"charts/progress":10.040983606557377,"charts/train_success_rate":1,"_timestamp":1.766053461148376e+09,"train/clipfrac":0.03662109375,"_wandb":{"runtime":47},"charts/avg_reward":0.5,"_runtime":47.983079283,"global_step":101208,"train/approx_kl":0.007127484306693077,"rollout/ep_len_mean":1,"rollout/success_rate":1,"charts/avg_value":0.9949655532836914,"train/entropy":0.7567218542098999}
wandb/run-20251218_182448-on6j4c96/files/code/cleanrl/cleanrl/ppo_rubikscube.py ADDED
@@ -0,0 +1,517 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PPO with small MLP for RAGEN Rubik's Cube 2x2 using the existing env (no env edits)
2
+ import os
3
+ import random
4
+ import time
5
+ from dataclasses import dataclass
6
+ from pathlib import Path
7
+ from typing import Tuple, Dict, Any, List
8
+ import json
9
+ import re
10
+
11
+ import gymnasium as gym
12
+ import numpy as np
13
+ import torch
14
+ import torch.nn as nn
15
+ import torch.optim as optim
16
+ import tyro
17
+ from torch.distributions.categorical import Categorical
18
+
19
+ import sys
20
+ sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../../'))
21
+
22
+ from ragen.env.rubikscube.env import RubiksCube2x2Env
23
+ from ragen.env.rubikscube.config import RubiksCube2x2Config
24
+
25
+
26
+ class RubiksCubeWrapper(gym.Env):
27
+ """
28
+ Adapter to use ragen RubiksCube2x2Env with Gymnasium vector API.
29
+ - Converts text observation to one-hot vector of 24 stickers x 6 colors.
30
+ - Maps agent actions [0..11] to env actions [1..12].
31
+ - Exposes proper observation_space and action_space.
32
+ """
33
+ metadata = {"render_modes": ["rgb_array", "human", "ansi"]}
34
+
35
+ def __init__(self, env: RubiksCube2x2Env):
36
+ super().__init__()
37
+ self._env = env
38
+ # 24 stickers, 6 colors -> one-hot size 144
39
+ self._colors = ['W', 'O', 'G', 'R', 'B', 'Y']
40
+ self._color_to_idx = {c: i for i, c in enumerate(self._colors)}
41
+ self.observation_space = gym.spaces.Box(low=0.0, high=1.0, shape=(24 * len(self._colors),), dtype=np.float32)
42
+ self.action_space = gym.spaces.Discrete(12)
43
+ # precompile regex to extract 4 letters within [X, X]\n [X, X]
44
+ # Lines look like: "Up (U): [W, W]\n [W, W]"
45
+ self._face_pat = re.compile(r"\[(?:\s*([A-Z])\s*,\s*([A-Z])\s*\])\n\s*\[(?:\s*([A-Z])\s*,\s*([A-Z])\s*\])")
46
+
47
+ def _encode_obs(self, text_obs: str) -> np.ndarray:
48
+ # Extract the six face blocks in the order U, L, F, R, B, D as rendered
49
+ faces_order = ["Up (U):", "Left (L):", "Front (F):", "Right (R):", "Back (B):", "Down (D):"]
50
+ onehots: List[int] = []
51
+ # Build a map from header to its block text
52
+ lines = text_obs.splitlines()
53
+ # Collect blocks starting after header line and including the next line for second row
54
+ i = 0
55
+ blocks: List[str] = []
56
+ while i < len(lines):
57
+ line = lines[i]
58
+ for header in faces_order:
59
+ if line.startswith(header):
60
+ # Join current line's bracketed pair and the next line (which contains the second pair)
61
+ # Remove the "Header:" prefix to keep only the bracket portions
62
+ content = line[len(header):].strip()
63
+ next_line = lines[i + 1] if i + 1 < len(lines) else ""
64
+ block = f"{content}\n{next_line}"
65
+ blocks.append(block)
66
+ break
67
+ i += 1
68
+ # Fallback: if regex fails, return zeros
69
+ if len(blocks) != 6:
70
+ return np.zeros(24 * len(self._colors), dtype=np.float32)
71
+ stickers: List[int] = []
72
+ for blk in blocks:
73
+ m = self._face_pat.search(blk)
74
+ if not m:
75
+ return np.zeros(24 * len(self._colors), dtype=np.float32)
76
+ # order: 0,1,2,3 per render() doc
77
+ c0, c1, c2, c3 = m.group(1), m.group(2), m.group(3), m.group(4)
78
+ stickers.extend([c0, c1, c2, c3])
79
+ # stickers now length 24; convert to one-hot
80
+ grid = np.zeros((24, len(self._colors)), dtype=np.float32)
81
+ for idx, ch in enumerate(stickers):
82
+ cidx = self._color_to_idx.get(ch, None)
83
+ if cidx is not None:
84
+ grid[idx, cidx] = 1.0
85
+ return grid.reshape(-1)
86
+
87
+ def reset(self, *, seed: int | None = None, options: Dict[str, Any] | None = None):
88
+ text_obs = self._env.reset(seed=seed)
89
+ obs = self._encode_obs(text_obs)
90
+ return obs, {}
91
+
92
+ def step(self, action: int):
93
+ mapped = int(action) + 1 # 0..11 -> 1..12
94
+ text_obs, reward, done, info = self._env.step(mapped)
95
+ obs = self._encode_obs(text_obs)
96
+ terminated = bool(done)
97
+ truncated = False
98
+ return obs, float(reward), terminated, truncated, info or {}
99
+
100
+ def render(self):
101
+ return self._env.render()
102
+
103
+ def close(self):
104
+ self._env.close()
105
+
106
+
107
+ @dataclass
108
+ class Args:
109
+ exp_name: str = os.path.basename(__file__)[: -len(".py")]
110
+ seed: int = 1
111
+ torch_deterministic: bool = True
112
+ cuda: bool = True
113
+ track: bool = True
114
+ wandb_project_name: str = "cleanRL"
115
+ wandb_entity: str | None = None
116
+ capture_video: bool = False
117
+
118
+ # Algorithm
119
+ env_id: str = "RubiksCube2x2"
120
+ total_timesteps: int = 1000_000
121
+ learning_rate: float = 2.5e-4
122
+ num_envs: int = 8
123
+ num_steps: int = 128
124
+ anneal_lr: bool = True
125
+ gamma: float = 0.99
126
+ gae_lambda: float = 0.95
127
+ num_minibatches: int = 4
128
+ update_epochs: int = 4
129
+ norm_adv: bool = True
130
+ clip_coef: float = 0.2
131
+ clip_vloss: bool = True
132
+ ent_coef: float = 0.01
133
+ vf_coef: float = 0.5
134
+ max_grad_norm: float = 0.5
135
+ target_kl: float | None = None
136
+
137
+ # Rubik specific
138
+ scramble_depth: int = 2
139
+ max_steps_env: int = 20
140
+
141
+ # runtime filled
142
+ batch_size: int = 0
143
+ minibatch_size: int = 0
144
+ num_iterations: int = 0
145
+ eval_splits: int = 2
146
+ eval_episodes: int = 4000
147
+
148
+
149
+ def make_env(idx, run_name, seed, scramble_depth, max_steps_env, capture_video=False):
150
+ def thunk():
151
+ config = RubiksCube2x2Config(scramble_depth=scramble_depth, max_steps=max_steps_env, render_mode='text')
152
+ env = RubiksCube2x2Env(config)
153
+ env = RubiksCubeWrapper(env)
154
+ env = gym.wrappers.TimeLimit(env, max_episode_steps=max_steps_env)
155
+ env = gym.wrappers.RecordEpisodeStatistics(env)
156
+ if capture_video and idx == 0:
157
+ env = gym.wrappers.RecordVideo(env, f"videos/{run_name}")
158
+ return env
159
+ return thunk
160
+
161
+
162
+ def layer_init(layer, std=np.sqrt(2), bias_const=0.0):
163
+ torch.nn.init.orthogonal_(layer.weight, std)
164
+ torch.nn.init.constant_(layer.bias, bias_const)
165
+ return layer
166
+
167
+
168
+ class Agent(nn.Module):
169
+ def __init__(self, envs):
170
+ super().__init__()
171
+ obs_shape = int(np.array(envs.single_observation_space.shape).prod())
172
+ hidden = 128
173
+ self.critic = nn.Sequential(
174
+ layer_init(nn.Linear(obs_shape, hidden)),
175
+ nn.Tanh(),
176
+ layer_init(nn.Linear(hidden, hidden)),
177
+ nn.Tanh(),
178
+ layer_init(nn.Linear(hidden, 1), std=1.0),
179
+ )
180
+ self.actor = nn.Sequential(
181
+ layer_init(nn.Linear(obs_shape, hidden)),
182
+ nn.Tanh(),
183
+ layer_init(nn.Linear(hidden, hidden)),
184
+ nn.Tanh(),
185
+ layer_init(nn.Linear(hidden, envs.single_action_space.n), std=0.01),
186
+ )
187
+
188
+ def get_value(self, x):
189
+ return self.critic(x)
190
+
191
+ def get_action_and_value(self, x, action=None):
192
+ logits = self.actor(x)
193
+ probs = Categorical(logits=logits)
194
+ if action is None:
195
+ action = probs.sample()
196
+ return action, probs.log_prob(action), probs.entropy(), self.critic(x)
197
+
198
+
199
+ if __name__ == "__main__":
200
+ args = tyro.cli(Args)
201
+ args.batch_size = int(args.num_envs * args.num_steps)
202
+ args.minibatch_size = int(args.batch_size // args.num_minibatches)
203
+ args.num_iterations = args.total_timesteps // args.batch_size
204
+ run_name = f"{args.env_id}__{args.exp_name}__{args.seed}__{int(time.time())}"
205
+
206
+ if args.track:
207
+ import wandb
208
+ wandb.init(
209
+ project=args.wandb_project_name,
210
+ entity=args.wandb_entity,
211
+ config=vars(args),
212
+ name=run_name,
213
+ monitor_gym=True,
214
+ save_code=True,
215
+ )
216
+ try:
217
+ wandb.define_metric("global_step")
218
+ for prefix in ["train/*", "rollout/*", "eval/*", "losses/*", "charts/*", "perf/*"]:
219
+ wandb.define_metric(prefix, step_metric="global_step")
220
+ except Exception:
221
+ pass
222
+
223
+ # seeding
224
+ random.seed(args.seed)
225
+ np.random.seed(args.seed)
226
+ torch.manual_seed(args.seed)
227
+ torch.backends.cudnn.deterministic = args.torch_deterministic
228
+
229
+ device = torch.device("cuda" if torch.cuda.is_available() and args.cuda else "cpu")
230
+
231
+ # envs
232
+ envs = gym.vector.SyncVectorEnv([
233
+ make_env(i, run_name, args.seed, args.scramble_depth, args.max_steps_env, args.capture_video)
234
+ for i in range(args.num_envs)
235
+ ])
236
+ assert isinstance(envs.single_action_space, gym.spaces.Discrete)
237
+
238
+ agent = Agent(envs).to(device)
239
+ optimizer = optim.Adam(agent.parameters(), lr=args.learning_rate, eps=1e-5)
240
+
241
+ # storage
242
+ obs = torch.zeros((args.num_steps, args.num_envs) + envs.single_observation_space.shape).to(device)
243
+ actions = torch.zeros((args.num_steps, args.num_envs) + envs.single_action_space.shape).to(device)
244
+ logprobs = torch.zeros((args.num_steps, args.num_envs)).to(device)
245
+ rewards = torch.zeros((args.num_steps, args.num_envs)).to(device)
246
+ dones = torch.zeros((args.num_steps, args.num_envs)).to(device)
247
+ values = torch.zeros((args.num_steps, args.num_envs)).to(device)
248
+
249
+ # start
250
+ global_step = 0
251
+ start_time = time.time()
252
+ next_obs, _ = envs.reset(seed=args.seed)
253
+ next_obs = torch.Tensor(next_obs).to(device)
254
+ next_done = torch.zeros(args.num_envs).to(device)
255
+
256
+ # eval helper similar to FrozenLake: collect greedy eval trajectories and write metrics.json
257
+ def collect_eval_trajectories(agent_model, make_env_fn, n_episodes, step_tag):
258
+ out_dir = Path(f"runs/{run_name}/trajectories/step_{step_tag}")
259
+ out_dir.mkdir(parents=True, exist_ok=True)
260
+ out_path = out_dir / "trajectories.jsonl"
261
+ env = make_env_fn()
262
+ collected = 0
263
+ summary_returns = []
264
+ summary_success = []
265
+ with out_path.open("w") as f:
266
+ while collected < n_episodes:
267
+ state, _ = env.reset(seed=args.seed + 100000 + collected)
268
+ traj_states = [state.tolist()]
269
+ traj_actions = []
270
+ traj_rewards = []
271
+ traj_dones = []
272
+ traj_success = []
273
+ done = False
274
+ step_count = 0
275
+ max_eval_steps = getattr(env, '_max_episode_steps', None) or int(args.max_steps_env)
276
+ while not done:
277
+ with torch.no_grad():
278
+ logits = agent_model.actor(torch.tensor(state, dtype=torch.float32, device=device).unsqueeze(0))
279
+ action = int(torch.argmax(logits, dim=1).item())
280
+ next_state, reward, terminated, truncated, info = env.step(action)
281
+ traj_actions.append(int(action))
282
+ traj_rewards.append(float(reward))
283
+ step_count += 1
284
+ d = bool(terminated) or bool(truncated) or (step_count >= max_eval_steps)
285
+ traj_dones.append(d)
286
+ traj_success.append(bool((info or {}).get('success', False)))
287
+ state = next_state
288
+ traj_states.append(state.tolist())
289
+ done = d
290
+ ep_ret = float(sum(traj_rewards))
291
+ ep_succ = bool(any(traj_success))
292
+ record = {
293
+ "states": traj_states,
294
+ "actions": traj_actions,
295
+ "rewards": traj_rewards,
296
+ "dones": traj_dones,
297
+ "success": traj_success,
298
+ "episode_return": ep_ret,
299
+ "episode_success": ep_succ,
300
+ }
301
+ f.write(json.dumps(record) + "\n")
302
+ collected += 1
303
+ summary_returns.append(ep_ret)
304
+ summary_success.append(1.0 if ep_succ else 0.0)
305
+ env.close()
306
+ try:
307
+ metrics = {
308
+ "global_step": int(step_tag),
309
+ "episodes": int(n_episodes),
310
+ "success_rate": float(np.mean(summary_success)) if len(summary_success) else 0.0,
311
+ "avg_return": float(np.mean(summary_returns)) if len(summary_returns) else 0.0,
312
+ "std_return": float(np.std(summary_returns)) if len(summary_returns) else 0.0,
313
+ }
314
+ with (out_dir / "metrics.json").open("w") as mf:
315
+ json.dump(metrics, mf)
316
+ except Exception as e:
317
+ print(f"Warning: failed to write eval metrics: {e}")
318
+
319
+ # training loop
320
+ eval_every_iters = max(1, args.num_iterations // args.eval_splits)
321
+ for iteration in range(1, args.num_iterations + 1):
322
+ # Anneal LR
323
+ if args.anneal_lr:
324
+ frac = 1.0 - (iteration - 1.0) / args.num_iterations
325
+ lrnow = frac * args.learning_rate
326
+ optimizer.param_groups[0]["lr"] = lrnow
327
+
328
+ # accumulate per-iteration episode successes
329
+ iter_successes = []
330
+ for step in range(0, args.num_steps):
331
+ global_step += args.num_envs
332
+ obs[step] = next_obs
333
+ dones[step] = next_done
334
+
335
+ with torch.no_grad():
336
+ action, logprob, _, value = agent.get_action_and_value(next_obs)
337
+ values[step] = value.flatten()
338
+ actions[step] = action
339
+ logprobs[step] = logprob
340
+
341
+ next_obs, reward, terminations, truncations, infos = envs.step(action.cpu().numpy())
342
+ next_done = np.logical_or(terminations, truncations)
343
+ rewards[step] = torch.tensor(reward).to(device).view(-1)
344
+ next_obs, next_done = torch.Tensor(next_obs).to(device), torch.Tensor(next_done).to(device)
345
+
346
+ # Episode stats logging similar to FrozenLake
347
+ try:
348
+ mask = None
349
+ if isinstance(infos, dict):
350
+ if "_episode" in infos:
351
+ mask = np.asarray(infos["_episode"]).astype(bool)
352
+ elif "episode" in infos and isinstance(infos["episode"], dict) and "_l" in infos["episode"]:
353
+ mask = np.asarray(infos["episode"]["_l"]).astype(bool)
354
+ if mask is not None and np.any(mask):
355
+ r_arr = np.asarray(infos.get("episode", {}).get("r", np.zeros_like(mask, dtype=float)))
356
+ l_arr = np.asarray(infos.get("episode", {}).get("l", np.zeros_like(mask, dtype=int)))
357
+ # prefer success from info; fallback to ep return > 0
358
+ if "success" in infos:
359
+ succ_arr = np.asarray(infos.get("success", np.zeros_like(mask, dtype=bool))).astype(float)
360
+ else:
361
+ try:
362
+ succ_arr = (np.asarray(r_arr) > 0).astype(float)
363
+ except Exception:
364
+ succ_arr = np.zeros_like(mask, dtype=float)
365
+ # collect iteration successes for training success rate
366
+ try:
367
+ for s in np.asarray(succ_arr)[mask]:
368
+ iter_successes.append(float(s))
369
+ except Exception:
370
+ pass
371
+ if args.track:
372
+ try:
373
+ import wandb
374
+ log_dict = {
375
+ "global_step": int(global_step),
376
+ "rollout/ep_rew_mean": float(np.mean(r_arr[mask])) if np.any(mask) else None,
377
+ "rollout/ep_len_mean": float(np.mean(l_arr[mask])) if np.any(mask) else None,
378
+ "rollout/success_rate": float(np.mean(succ_arr[mask])) if np.any(mask) else None,
379
+ }
380
+ wandb.log(log_dict, step=global_step)
381
+ except Exception:
382
+ pass
383
+ except Exception:
384
+ pass
385
+
386
+ # GAE
387
+ with torch.no_grad():
388
+ next_value = agent.get_value(next_obs).reshape(1, -1)
389
+ advantages = torch.zeros_like(rewards).to(device)
390
+ lastgaelam = 0
391
+ for t in reversed(range(args.num_steps)):
392
+ if t == args.num_steps - 1:
393
+ nextnonterminal = 1.0 - next_done
394
+ nextvalues = next_value
395
+ else:
396
+ nextnonterminal = 1.0 - dones[t + 1]
397
+ nextvalues = values[t + 1]
398
+ delta = rewards[t] + args.gamma * nextvalues * nextnonterminal - values[t]
399
+ advantages[t] = lastgaelam = delta + args.gamma * args.gae_lambda * nextnonterminal * lastgaelam
400
+ returns = advantages + values
401
+
402
+ # flatten batch
403
+ b_obs = obs.reshape((-1,) + envs.single_observation_space.shape)
404
+ b_logprobs = logprobs.reshape(-1)
405
+ b_actions = actions.reshape((-1,) + envs.single_action_space.shape)
406
+ b_advantages = advantages.reshape(-1)
407
+ b_returns = returns.reshape(-1)
408
+ b_values = values.reshape(-1)
409
+
410
+ # update
411
+ b_inds = np.arange(args.batch_size)
412
+ clipfracs = []
413
+ for epoch in range(args.update_epochs):
414
+ np.random.shuffle(b_inds)
415
+ for start in range(0, args.batch_size, args.minibatch_size):
416
+ end = start + args.minibatch_size
417
+ mb_inds = b_inds[start:end]
418
+
419
+ _, newlogprob, entropy, newvalue = agent.get_action_and_value(b_obs[mb_inds], b_actions.long()[mb_inds])
420
+ logratio = newlogprob - b_logprobs[mb_inds]
421
+ ratio = logratio.exp()
422
+
423
+ with torch.no_grad():
424
+ old_approx_kl = (-logratio).mean()
425
+ approx_kl = ((ratio - 1) - logratio).mean()
426
+ clipfracs += [((ratio - 1.0).abs() > args.clip_coef).float().mean().item()]
427
+
428
+ mb_advantages = b_advantages[mb_inds]
429
+ if args.norm_adv:
430
+ mb_advantages = (mb_advantages - mb_advantages.mean()) / (mb_advantages.std() + 1e-8)
431
+
432
+ pg_loss1 = -mb_advantages * ratio
433
+ pg_loss2 = -mb_advantages * torch.clamp(ratio, 1 - args.clip_coef, 1 + args.clip_coef)
434
+ pg_loss = torch.max(pg_loss1, pg_loss2).mean()
435
+
436
+ newvalue = newvalue.view(-1)
437
+ if args.clip_vloss:
438
+ v_loss_unclipped = (newvalue - b_returns[mb_inds]) ** 2
439
+ v_clipped = b_values[mb_inds] + torch.clamp(
440
+ newvalue - b_values[mb_inds], -args.clip_coef, args.clip_coef,
441
+ )
442
+ v_loss_clipped = (v_clipped - b_returns[mb_inds]) ** 2
443
+ v_loss = 0.5 * torch.max(v_loss_unclipped, v_loss_clipped).mean()
444
+ else:
445
+ v_loss = 0.5 * ((newvalue - b_returns[mb_inds]) ** 2).mean()
446
+
447
+ entropy_loss = entropy.mean()
448
+ loss = pg_loss - args.ent_coef * entropy_loss + v_loss * args.vf_coef
449
+
450
+ optimizer.zero_grad()
451
+ loss.backward()
452
+ nn.utils.clip_grad_norm_(agent.parameters(), args.max_grad_norm)
453
+ optimizer.step()
454
+
455
+ if args.target_kl is not None and approx_kl > args.target_kl:
456
+ break
457
+
458
+ # metrics
459
+ y_pred, y_true = b_values.cpu().numpy(), b_returns.cpu().numpy()
460
+ var_y = np.var(y_true)
461
+ explained_var = np.nan if var_y == 0 else 1 - np.var(y_true - y_pred) / var_y
462
+
463
+ sps = int(global_step / (time.time() - start_time))
464
+ train_success_rate = float(np.mean(iter_successes)) if len(iter_successes) else 0.0
465
+ print(f"Iter {iteration:4d}/{args.num_iterations} | SPS: {sps:5d} | R: {rewards.mean().item():6.3f}")
466
+ if args.track:
467
+ try:
468
+ import wandb
469
+ wandb.log({
470
+ "global_step": int(global_step),
471
+ "charts/progress": float(100.0 * iteration / max(1, args.num_iterations)),
472
+ "train/value_loss": float(v_loss.item()),
473
+ "train/policy_loss": float(pg_loss.item()),
474
+ "losses/value_loss": float(v_loss.item()),
475
+ "losses/policy_loss": float(pg_loss.item()),
476
+ "train/entropy": float(entropy_loss.item()),
477
+ "train/old_approx_kl": float(old_approx_kl.item()),
478
+ "train/approx_kl": float(approx_kl.item()),
479
+ "train/clipfrac": float(np.mean(clipfracs)) if len(clipfracs) else 0.0,
480
+ "losses/explained_variance": float(explained_var),
481
+ "charts/avg_reward": float(rewards.mean().item()),
482
+ "charts/avg_value": float(values.mean().item()),
483
+ "perf/SPS": int(sps),
484
+ "charts/SPS": int(sps),
485
+ "train/success_rate": train_success_rate,
486
+ "charts/train_success_rate": train_success_rate,
487
+ "train/learning_rate": float(optimizer.param_groups[0]["lr"]),
488
+ }, step=global_step)
489
+ except Exception:
490
+ pass
491
+
492
+ # periodic evaluation collection
493
+ if iteration % eval_every_iters == 0:
494
+ try:
495
+ eval_thunk = make_env(0, run_name, args.seed + 9999, args.scramble_depth, args.max_steps_env, False)
496
+ collect_eval_trajectories(agent, eval_thunk, n_episodes=args.eval_episodes, step_tag=global_step)
497
+ if args.track:
498
+ try:
499
+ import json as _json
500
+ from pathlib import Path as _Path
501
+ mpath = _Path(f"runs/{run_name}/trajectories/step_{global_step}/metrics.json")
502
+ if mpath.exists():
503
+ with mpath.open("r") as mf:
504
+ metrics = _json.load(mf)
505
+ wandb.log({
506
+ "eval/success_rate": metrics.get("success_rate"),
507
+ "eval/avg_return": metrics.get("avg_return"),
508
+ "eval/std_return": metrics.get("std_return"),
509
+ "eval/episodes": metrics.get("episodes"),
510
+ }, step=global_step)
511
+ except Exception:
512
+ pass
513
+ print(f"Collected {args.eval_episodes} eval trajectories at global_step {global_step}")
514
+ except Exception as e:
515
+ print(f"Warning: eval trajectory collection failed at step {global_step}: {e}")
516
+
517
+ envs.close()
wandb/run-20251218_182448-on6j4c96/files/config.yaml ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _wandb:
2
+ value:
3
+ cli_version: 0.23.0
4
+ code_path: code/cleanrl/cleanrl/ppo_rubikscube.py
5
+ e:
6
+ ubi6kfhhs7rtnrt9cd5f40pg33djhcqy:
7
+ args:
8
+ - --track
9
+ codePath: cleanrl/cleanrl/ppo_rubikscube.py
10
+ codePathLocal: cleanrl/cleanrl/ppo_rubikscube.py
11
+ cpu_count: 64
12
+ cpu_count_logical: 128
13
+ cudaVersion: "12.4"
14
+ disk:
15
+ /:
16
+ total: "5153960755200"
17
+ used: "447519776768"
18
+ email: haoyu-wa22@mails.tsinghua.edu.cn
19
+ executable: /root/local/miniconda3/envs/ragen/bin/python
20
+ git:
21
+ commit: 8d73639b99b38265453f898b8d6af7d4af50d56e
22
+ remote: https://github.com/mll-lab-nu/RAGEN.git
23
+ gpu: NVIDIA H100 80GB HBM3
24
+ gpu_count: 8
25
+ gpu_nvidia:
26
+ - architecture: Hopper
27
+ cudaCores: 16896
28
+ memoryTotal: "85520809984"
29
+ name: NVIDIA H100 80GB HBM3
30
+ uuid: GPU-35e2d43d-4067-82ce-90d4-def9e389bf28
31
+ - architecture: Hopper
32
+ cudaCores: 16896
33
+ memoryTotal: "85520809984"
34
+ name: NVIDIA H100 80GB HBM3
35
+ uuid: GPU-af4135e3-88f2-e9ac-518d-502c75a85429
36
+ - architecture: Hopper
37
+ cudaCores: 16896
38
+ memoryTotal: "85520809984"
39
+ name: NVIDIA H100 80GB HBM3
40
+ uuid: GPU-d7fdeeba-fe9b-ec03-d9f7-6724fe4266b5
41
+ - architecture: Hopper
42
+ cudaCores: 16896
43
+ memoryTotal: "85520809984"
44
+ name: NVIDIA H100 80GB HBM3
45
+ uuid: GPU-ccc4f668-3882-5a8e-2c07-c5cd08f6f666
46
+ - architecture: Hopper
47
+ cudaCores: 16896
48
+ memoryTotal: "85520809984"
49
+ name: NVIDIA H100 80GB HBM3
50
+ uuid: GPU-7b73c0cf-d3d5-e10c-7176-a43be1e41001
51
+ - architecture: Hopper
52
+ cudaCores: 16896
53
+ memoryTotal: "85520809984"
54
+ name: NVIDIA H100 80GB HBM3
55
+ uuid: GPU-81b58d94-5d1f-8ec2-f9d2-fd56172ed177
56
+ - architecture: Hopper
57
+ cudaCores: 16896
58
+ memoryTotal: "85520809984"
59
+ name: NVIDIA H100 80GB HBM3
60
+ uuid: GPU-03e8bc66-3b44-6794-49fd-5392fbdda6d1
61
+ - architecture: Hopper
62
+ cudaCores: 16896
63
+ memoryTotal: "85520809984"
64
+ name: NVIDIA H100 80GB HBM3
65
+ uuid: GPU-b7cf0ec6-7c29-1179-dceb-09565da51890
66
+ host: pt-4d654cf4576f4d23ad3d3919f12932fe-worker-0
67
+ memory:
68
+ total: "2163642122240"
69
+ os: Linux-5.14.0-284.25.1.el9_2.x86_64-x86_64-with-glibc2.35
70
+ program: /mnt/general/wanghy/RAGEN/cleanrl/cleanrl/ppo_rubikscube.py
71
+ python: CPython 3.10.19
72
+ root: /mnt/general/wanghy/RAGEN
73
+ startedAt: "2025-12-18T10:24:48.379419Z"
74
+ writerId: ubi6kfhhs7rtnrt9cd5f40pg33djhcqy
75
+ m:
76
+ - "1": global_step
77
+ "6":
78
+ - 3
79
+ "7": []
80
+ - "2": charts/*
81
+ "5": 1
82
+ "6":
83
+ - 1
84
+ "7": []
85
+ - "2": perf/*
86
+ "5": 1
87
+ "6":
88
+ - 1
89
+ "7": []
90
+ - "2": train/*
91
+ "5": 1
92
+ "6":
93
+ - 1
94
+ "7": []
95
+ - "2": rollout/*
96
+ "5": 1
97
+ "6":
98
+ - 1
99
+ "7": []
100
+ - "2": eval/*
101
+ "5": 1
102
+ "6":
103
+ - 1
104
+ "7": []
105
+ - "2": losses/*
106
+ "5": 1
107
+ "6":
108
+ - 1
109
+ "7": []
110
+ python_version: 3.10.19
111
+ t:
112
+ "1":
113
+ - 1
114
+ - 11
115
+ - 30
116
+ - 49
117
+ - 50
118
+ - 51
119
+ - 105
120
+ "2":
121
+ - 1
122
+ - 11
123
+ - 30
124
+ - 49
125
+ - 50
126
+ - 51
127
+ - 105
128
+ "3":
129
+ - 7
130
+ - 13
131
+ - 16
132
+ - 61
133
+ "4": 3.10.19
134
+ "5": 0.23.0
135
+ "6": 4.57.1
136
+ "12": 0.23.0
137
+ "13": linux-x86_64
138
+ anneal_lr:
139
+ value: true
140
+ batch_size:
141
+ value: 1024
142
+ capture_video:
143
+ value: false
144
+ clip_coef:
145
+ value: 0.2
146
+ clip_vloss:
147
+ value: true
148
+ cuda:
149
+ value: true
150
+ ent_coef:
151
+ value: 0.01
152
+ env_id:
153
+ value: RubiksCube2x2
154
+ eval_episodes:
155
+ value: 4000
156
+ eval_splits:
157
+ value: 2
158
+ exp_name:
159
+ value: ppo_rubikscube
160
+ gae_lambda:
161
+ value: 0.95
162
+ gamma:
163
+ value: 0.99
164
+ learning_rate:
165
+ value: 0.00025
166
+ max_grad_norm:
167
+ value: 0.5
168
+ max_steps_env:
169
+ value: 20
170
+ minibatch_size:
171
+ value: 256
172
+ norm_adv:
173
+ value: true
174
+ num_envs:
175
+ value: 8
176
+ num_iterations:
177
+ value: 976
178
+ num_minibatches:
179
+ value: 4
180
+ num_steps:
181
+ value: 128
182
+ scramble_depth:
183
+ value: 2
184
+ seed:
185
+ value: 1
186
+ target_kl:
187
+ value: null
188
+ torch_deterministic:
189
+ value: true
190
+ total_timesteps:
191
+ value: 1000000
192
+ track:
193
+ value: true
194
+ update_epochs:
195
+ value: 4
196
+ vf_coef:
197
+ value: 0.5
198
+ wandb_entity:
199
+ value: null
200
+ wandb_project_name:
201
+ value: cleanRL
wandb/run-20251218_182448-on6j4c96/files/diff.patch ADDED
@@ -0,0 +1,1162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/config/base.yaml b/config/base.yaml
2
+ index a1659e4..9df6250 100644
3
+ --- a/config/base.yaml
4
+ +++ b/config/base.yaml
5
+ @@ -9,15 +9,16 @@ seed:
6
+ train: 10000
7
+ val: 123
8
+
9
+ -micro_batch_size_per_gpu: 4
10
+ +micro_batch_size_per_gpu: 1
11
+ ppo_mini_batch_size: 32
12
+ -model_path: Qwen/Qwen2.5-3B-Instruct
13
+ +model_path: /mnt/general/share/model/Qwen/Qwen2.5-0.5B-Instruct
14
+ +# Qwen/Qwen2.5-0.5B-Instruct
15
+ enable_response_mask: True # Enabling response mask could improve stability of rollout/old_log_prob, as P(st|history) are no longer calculated in loss here. See https://docs.google.com/document/d/1bg7obeiKTExuHHBl5uOiSpec5uLDZ2Tgvxy6li5pHX4/edit?usp=sharing for more details.
16
+ grpo_advantage_length_weight: False # if you do not enable this and critic/advantage_estimator is GRPO, and the critic/advantages/mean is too low, then you can try enabling this to encourage reasoning and forbid collapse
17
+
18
+ lora:
19
+ rank: 0
20
+ - alpha: 64
21
+ + alpha: 16
22
+ target_modules: all-linear
23
+
24
+ actor_rollout_ref:
25
+ @@ -46,10 +47,10 @@ actor_rollout_ref:
26
+ name: vllm
27
+ log_prob_micro_batch_size_per_gpu: ${micro_batch_size_per_gpu} # following micro_batch_size_per_gpu
28
+ tensor_model_parallel_size: 1
29
+ - max_model_len: 3600
30
+ + max_model_len: 7200 #3600 why** 14400
31
+ prompt_length: 1 # useless. Just put it here
32
+ response_length: 400 # single-turn response length
33
+ - gpu_memory_utilization: 0.5
34
+ + gpu_memory_utilization: 0.7
35
+ max_num_batched_tokens: 8192 # set only when enable_chunked_prefill is true
36
+ temperature: 1
37
+ rollout_filter_ratio: 0.25
38
+ @@ -90,26 +91,28 @@ algorithm:
39
+ kl_coef: 0.000
40
+
41
+ trainer:
42
+ - project_name: ragen_latest
43
+ + project_name:
44
+ experiment_name: test
45
+ local_log_dir: "results/"
46
+ - save_freq: 100
47
+ + save_freq: -1
48
+ total_training_steps: 200
49
+ validation_steps: 1 # validation instances = validation_steps * val_env_groups * group_size
50
+ val_before_train: True
51
+ n_gpus_per_node: 1
52
+ test_freq: 10
53
+ generations_to_log_to_wandb:
54
+ + train: 128
55
+ val: 20
56
+ logger: [ 'console', 'wandb' ]
57
+ max_actor_ckpt_to_keep: 1
58
+ max_critic_ckpt_to_keep: 1
59
+ + default_local_dir: /mnt/general/wanghy/RAGEN/saves/
60
+
61
+ agent_proxy:
62
+ max_context_window: -1 # set a value > 0 to enable context window for long trajectory
63
+ - max_turn: 5
64
+ + max_turn: 25 #25 why** 700
65
+ action_sep: "||"
66
+ - max_actions_per_turn: 2 # how many actions can be output at most in a single turn
67
+ + max_actions_per_turn: 1 # how many actions can be output at most in a single turn
68
+ use_turn_scores: False # important to GAE when applying token-level rewards to token-level advantages. If False, will take the sum of scores as the reward for the last turn.
69
+ enable_think: True # False -> no think RL
70
+ reward_normalization:
71
+ @@ -126,11 +129,11 @@ es_manager:
72
+ tags: ["CoordSokoban"]
73
+ n_groups: [8] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
74
+ val:
75
+ - env_groups: 32
76
+ - group_size: 16 # should be set to 1 because when val temperature is set to 0 and group size > 1, there will be repetitive prompts which leads to same trajectory.
77
+ + env_groups: 256
78
+ + group_size: 1 # should be set to 1 because when val temperature is set to 0 and group size > 1, there will be repetitive prompts which leads to same trajectory.
79
+ env_configs:
80
+ tags: ["CoordSokoban"]
81
+ - n_groups: [32] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
82
+ + n_groups: [256] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
83
+
84
+ ctx_manager:
85
+ generation: # go to vllm
86
+ diff --git a/config/envs.yaml b/config/envs.yaml
87
+ index 1002ac8..ba3ac6f 100644
88
+ --- a/config/envs.yaml
89
+ +++ b/config/envs.yaml
90
+ @@ -2,6 +2,7 @@ custom_envs:
91
+ SimpleSokoban:
92
+ env_type: sokoban
93
+ max_actions_per_traj: 10 # used in environment state manager to control the actual max actions executed per trajectory
94
+ + # ORIGNAL env_instruction
95
+ env_instruction: |
96
+ You are solving the Sokoban puzzle.
97
+ You are the player and you need to push all boxes to targets.
98
+ @@ -12,7 +13,7 @@ custom_envs:
99
+ env_config: # keys should be a subset of SokobanConfig
100
+ dim_x: 6
101
+ dim_y: 6
102
+ - num_boxes: 1
103
+ + num_boxes: 2
104
+ max_steps: 100
105
+
106
+ LargerSokoban:
107
+ @@ -65,7 +66,7 @@ custom_envs:
108
+ env_config: # keys should be a subset of SokobanConfig
109
+ dim_x: 6
110
+ dim_y: 6
111
+ - num_boxes: 1
112
+ + num_boxes: 2
113
+ max_steps: 100
114
+ observation_format: "grid_coord"
115
+
116
+ @@ -111,14 +112,14 @@ custom_envs:
117
+
118
+ FrozenLake:
119
+ env_type: frozen_lake
120
+ - max_actions_per_traj: 10
121
+ + max_actions_per_traj: 25
122
+ env_instruction: "You are solving the FrozenLake puzzle. Forbid the whole and go to the target. You may move to the unintended direction due to the slippery ice. Example answer format: <think>To forbid the hole and go to the target, I should go left then go up.</think><answer>Left || Up</answer>"
123
+ max_tokens: 100
124
+ env_config: null
125
+
126
+ CoordFrozenLake:
127
+ env_type: frozen_lake
128
+ - max_actions_per_traj: 10
129
+ + max_actions_per_traj: 25
130
+ env_instruction: |
131
+ You are solving the FrozenLake puzzle. The observation includes both a symbol grid and zero-indexed coordinates for the start, goal, player, and any holes.
132
+ Coordinates range from the top-left corner (0, 0) to the bottom-right corner (5, 5).
133
+ @@ -195,4 +196,80 @@ custom_envs:
134
+ max_actions_per_traj: 30
135
+ env_instruction: "You are a Lean theorem prover. Given a Lean theorem statement, propose a sequence of tactics that completes the proof. Think step by step about which tactics to apply next. Provide tactics separated by '||', for example <answer>intro || simp || rfl</answer>."
136
+ max_tokens: 512
137
+ - env_config: null # Please refer to ragen/env/lean/config.py for a full list of parameters.
138
+
139
+ + env_config: null # Please refer to ragen/env/lean/config.py for a full list of parameters.
140
+ +
141
+ +
142
+ + game_2048:
143
+ + env_type: game_2048
144
+ + max_actions_per_traj: 700
145
+ + env_instruction: |
146
+ + You are playing the 2048 game on a 4x4 grid. Merge equal tiles by sliding Up, Right, Down, or Left.
147
+ + If a move is invalid (no tiles move), a small penalty is applied. Respond with a single action.
148
+ + Example: <answer>Up</answer>
149
+ + max_tokens: 8192
150
+ + env_config: null
151
+ +
152
+ + blackjack:
153
+ + env_type: blackjack
154
+ + max_actions_per_traj: 10
155
+ + env_instruction: |
156
+ + You are playing Blackjack against a dealer. The dealer must hit on 16 or less and stand on 17 or more.
157
+ + Choose either Stick or Hit. Respond with a single action.
158
+ + Example: <answer>Hit</answer>
159
+ + max_tokens: 64
160
+ + env_config: null
161
+ +
162
+ + rubikscube:
163
+ + env_type: rubikscube
164
+ + max_actions_per_traj: 20
165
+ + env_instruction: |
166
+ + You are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.
167
+ + Available actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.
168
+ + - Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).
169
+ + - Modifiers: A letter alone means 90° clockwise (e.g., 'R'). A letter with prime (') means 90° counter-clockwise (e.g., "R'").
170
+ + Respond with a sequence of actions separated by "||".
171
+ + Example: <answer>U</answer>
172
+ + max_tokens: 96
173
+ + env_config:
174
+ + scramble_depth: 1
175
+ + max_steps: 20
176
+ + render_mode: "text"
177
+ +
178
+ + SimpleSudoku:
179
+ + env_type: sudoku
180
+ + max_actions_per_traj: 20
181
+ + env_instruction: |
182
+ + You are solving a Sudoku puzzle. Fill in the grid so that every row, column, and 2x2 box contains the numbers 1-4 without repetition.
183
+ + Initial cells are shown in [brackets] and cannot be modified. Empty cells are shown as dots (.).
184
+ + Place numbers one at a time using the format, for example: <answer>place 1 at row 2 col 3</answer> or <answer>1,2,3</answer>
185
+ + The environment will provide feedback on valid/invalid moves and show conflicts if any occur.
186
+ + max_tokens: 150
187
+ + parallel_friendly: false
188
+ + max_workers: 32
189
+ + env_config:
190
+ + grid_size: 4
191
+ + difficulty: "easy"
192
+ + render_format: "with_feedback"
193
+ + show_conflicts: false
194
+ + show_valid_numbers: false
195
+ + max_steps: 20
196
+ +
197
+ + MediumSudoku:
198
+ + env_type: sudoku
199
+ + max_actions_per_traj: 30
200
+ + env_instruction: |
201
+ + You are solving a Sudoku puzzle. Fill in the grid so that every row, column, and 3x3 box contains the numbers 1-9 without repetition.
202
+ + Initial cells are shown in [brackets] and cannot be modified. Empty cells are shown as dots (.).
203
+ + Place numbers one at a time using the format: <answer>place 5 at row 2 col 3</answer> or <answer>2,3,5</answer>
204
+ + The environment will provide feedback on valid/invalid moves and show conflicts if any occur.
205
+ + max_tokens: 150
206
+ + parallel_friendly: false
207
+ + max_workers: 32
208
+ + env_config:
209
+ + grid_size: 9
210
+ + difficulty: "medium"
211
+ + render_format: "with_feedback"
212
+ + show_conflicts: true
213
+ + show_valid_numbers: true
214
+ + max_steps: 81
215
+ +
216
+ diff --git a/config/eval.yaml b/config/eval.yaml
217
+ index e65f3a5..7775fd1 100644
218
+ --- a/config/eval.yaml
219
+ +++ b/config/eval.yaml
220
+ @@ -1,14 +1,15 @@
221
+ defaults:
222
+ - envs
223
+ -
224
+ +enable_response_mask: True
225
+ system:
226
+ - CUDA_VISIBLE_DEVICES: "0"
227
+ + CUDA_VISIBLE_DEVICES: "0,1,2,3,4,5,6,7"
228
+
229
+ seed:
230
+ train: 10000
231
+ val: 123
232
+
233
+ -model_path: Qwen/Qwen2.5-3B-Instruct
234
+ +model_path: /mnt/general/share/model/openai/gpt-oss-20b
235
+ +# /mnt/general/share/model/tyzhu/SPA-frozenlake-qwen2.5-1.5b-instruct
236
+
237
+ lora:
238
+ rank: 0
239
+ @@ -24,9 +25,9 @@ actor_rollout_ref:
240
+ rollout:
241
+ name: vllm
242
+ log_prob_micro_batch_size_per_gpu: ${micro_batch_size_per_gpu}
243
+ - tensor_model_parallel_size: 1
244
+ + tensor_model_parallel_size: 8
245
+ dtype: bfloat16
246
+ - max_model_len: 3600
247
+ + max_model_len: 7200
248
+ prompt_length: 1
249
+ response_length: 400
250
+ gpu_memory_utilization: 0.9
251
+ @@ -35,6 +36,7 @@ actor_rollout_ref:
252
+ free_cache_engine: True
253
+ enable_chunked_prefill: False
254
+ disable_log_stats: False
255
+ + do_sample: True
256
+ val_kwargs:
257
+ do_sample: True
258
+ temperature: 0.5
259
+ @@ -44,9 +46,9 @@ actor_rollout_ref:
260
+
261
+ agent_proxy:
262
+ max_context_window: -1
263
+ - max_turn: 5
264
+ + max_turn: 25
265
+ action_sep: "||"
266
+ - max_actions_per_turn: 2
267
+ + max_actions_per_turn: 1
268
+ use_turn_scores: False
269
+ enable_think: True
270
+ reward_normalization:
271
+ @@ -59,13 +61,13 @@ es_manager:
272
+ env_groups: 8
273
+ group_size: 16
274
+ env_configs:
275
+ - tags: ["CoordSokoban"]
276
+ + tags: ["BanditTest"]
277
+ n_groups: [8]
278
+ val:
279
+ env_groups: 32
280
+ - group_size: 16
281
+ + group_size: 128
282
+ env_configs:
283
+ - tags: ["CoordSokoban"]
284
+ + tags: ["BanditTest"]
285
+ n_groups: [32]
286
+
287
+ ctx_manager:
288
+ diff --git a/config/evaluate_api_llm.yaml b/config/evaluate_api_llm.yaml
289
+ index b21c95e..e2e6761 100644
290
+ --- a/config/evaluate_api_llm.yaml
291
+ +++ b/config/evaluate_api_llm.yaml
292
+ @@ -1,8 +1,11 @@
293
+ +#export OPENAI_BASE_URL="https://api.ohmygpt.com/v1"
294
+ +#export OPENAI_API_KEY="sk-o4sMxBkN5BB100C4D4a3T3BlBkFJF7791CA39EA14ca98041"
295
+ +#python -m ragen.eval_api hydra.searchpath='[file://./verl/verl/trainer/config]'
296
+ defaults:
297
+ - base # this is a symbolic link to the verl/verl/trainer/config/ppo_trainer.yaml file
298
+
299
+ model_config:
300
+ - model_name: gpt-4o # should be registered in model_info
301
+ + model_name: ark-deepseek-v3-250324 # should be registered in model_info
302
+ max_concurrency: 16
303
+
304
+ model_info:
305
+ @@ -24,9 +27,9 @@ model_info:
306
+ generation_kwargs:
307
+ temperature: 0
308
+ max_tokens: 512 # max_completion_tokens if o1-mini
309
+ - gpt-4o:
310
+ + gpt-4o-mini:
311
+ provider_name: openai
312
+ - model_name: gpt-4o
313
+ + model_name: gpt-4o-mini
314
+ generation_kwargs:
315
+ temperature: 0
316
+ max_tokens: 512 # max_completion_tokens if o1-mini
317
+ @@ -36,21 +39,42 @@ model_info:
318
+ generation_kwargs:
319
+ temperature: 0
320
+ max_completion_tokens: 512
321
+ + ark-deepseek-v3-250324:
322
+ + provider_name: openai
323
+ + model_name: ark-deepseek-v3-250324
324
+ + generation_kwargs:
325
+ + temperature: 0
326
+ + max_completion_tokens: 512
327
+ deepseek-v3:
328
+ provider_name: deepseek
329
+ model_name: deepseek-chat
330
+ generation_kwargs:
331
+ temperature: 0
332
+ max_completion_tokens: 512
333
+ + glm-4.6:
334
+ + provider_name: openai
335
+ + model_name: glm-4.6
336
+ + generation_kwargs:
337
+ + temperature: 0
338
+ + max_completion_tokens: 512
339
+ + TA/openai/gpt-oss-120b:
340
+ + provider_name: openai
341
+ + model_name: TA/openai/gpt-oss-120b
342
+ + generation_kwargs:
343
+ + temperature: 0
344
+ + max_tokens: 8192
345
+ + # max_retries: 5
346
+
347
+ -
348
+ -
349
+ +agent_proxy:
350
+ + max_turn: 5
351
+ es_manager:
352
+ val:
353
+ - env_groups: 256
354
+ + env_groups: 128
355
+ group_size: 1 # should be set to 1 because val temperature is set to 0 and same prompt leads to same output
356
+ env_configs:
357
+ - tags: ["CoordSokoban"]
358
+ - n_groups: [256] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
359
+ + tags: ["rubikscube"]
360
+ + n_groups: [128] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
361
+
362
+
363
+ +rollout:
364
+ + max_model_len: 7200
365
+
366
+ Submodule external/webshop-minimal contains modified content
367
+ diff --git a/external/webshop-minimal/requirements.txt b/external/webshop-minimal/requirements.txt
368
+ index 5a1b04f..238ed5a 100644
369
+ --- a/external/webshop-minimal/requirements.txt
370
+ +++ b/external/webshop-minimal/requirements.txt
371
+ @@ -4,7 +4,7 @@ flask
372
+ html2text
373
+ rank_bm25
374
+ pyserini
375
+ -faiss-cpu
376
+ +faiss-gpu
377
+ thefuzz
378
+ gdown
379
+ spacy
380
+ diff --git a/ragen/env/__init__.py b/ragen/env/__init__.py
381
+ index b0f3461..bc6838e 100644
382
+ --- a/ragen/env/__init__.py
383
+ +++ b/ragen/env/__init__.py
384
+ @@ -12,6 +12,14 @@ from .metamathqa.env import MetaMathQAEnv
385
+ from .metamathqa.config import MetaMathQAEnvConfig
386
+ from .lean.config import LeanEnvConfig
387
+ from .lean.env import LeanEnv
388
+ +from .game_2048.config import Game2048EnvConfig
389
+ +from .game_2048.env import Game2048Env
390
+ +from .blackjack.config import BlackjackEnvConfig
391
+ +from .blackjack.env import BlackjackEnv
392
+ +from .rubikscube.config import RubiksCube2x2Config
393
+ +from .rubikscube.env import RubiksCube2x2Env
394
+ +from .sudoku.config import SudokuEnvConfig
395
+ +from .sudoku.env import SudokuEnv
396
+
397
+
398
+ REGISTERED_ENVS = {
399
+ @@ -22,6 +30,10 @@ REGISTERED_ENVS = {
400
+ # 'alfworld': AlfredTXTEnv,
401
+ 'metamathqa': MetaMathQAEnv,
402
+ 'lean': LeanEnv,
403
+ + 'game_2048': Game2048Env,
404
+ + 'blackjack': BlackjackEnv,
405
+ + 'rubikscube': RubiksCube2x2Env,
406
+ + 'sudoku': SudokuEnv,
407
+ }
408
+
409
+ REGISTERED_ENV_CONFIGS = {
410
+ @@ -32,6 +44,10 @@ REGISTERED_ENV_CONFIGS = {
411
+ # 'alfworld': AlfredEnvConfig,
412
+ 'metamathqa': MetaMathQAEnvConfig,
413
+ 'lean': LeanEnvConfig,
414
+ + 'game_2048': Game2048EnvConfig,
415
+ + 'blackjack': BlackjackEnvConfig,
416
+ + 'rubikscube': RubiksCube2x2Config,
417
+ + 'sudoku': SudokuEnvConfig,
418
+ }
419
+
420
+ try:
421
+ diff --git a/ragen/env/frozen_lake/config.py b/ragen/env/frozen_lake/config.py
422
+ index de054f4..9950c34 100644
423
+ --- a/ragen/env/frozen_lake/config.py
424
+ +++ b/ragen/env/frozen_lake/config.py
425
+ @@ -8,7 +8,7 @@ class FrozenLakeEnvConfig:
426
+ size: int = 4
427
+ p: float = 0.9
428
+ success_rate: float = 0.8
429
+ - is_slippery: bool = True
430
+ + is_slippery: bool = False
431
+ map_seed: Optional[int] = None
432
+ render_mode: str = "text"
433
+ observation_format: str = "grid"
434
+ diff --git a/ragen/env/frozen_lake/env.py b/ragen/env/frozen_lake/env.py
435
+ index 9ee3add..eef11d8 100644
436
+ --- a/ragen/env/frozen_lake/env.py
437
+ +++ b/ragen/env/frozen_lake/env.py
438
+ @@ -13,6 +13,7 @@ from ragen.env.base import BaseDiscreteActionEnv
439
+ class FrozenLakeEnv(BaseDiscreteActionEnv, GymFrozenLakeEnv):
440
+ def __init__(self, config: FrozenLakeEnvConfig = FrozenLakeEnvConfig()):
441
+ # Using mappings directly from config
442
+ + # import pdb;pdb.set_trace()
443
+ self.config = config
444
+ self.GRID_LOOKUP = config.grid_lookup
445
+ self.ACTION_LOOKUP = config.action_lookup
446
+ @@ -95,6 +96,7 @@ class FrozenLakeEnv(BaseDiscreteActionEnv, GymFrozenLakeEnv):
447
+ if __name__ == "__main__":
448
+ import matplotlib.pyplot as plt
449
+ config = FrozenLakeEnvConfig(size=4, is_slippery=True)
450
+ + # import pdb;pdb.set_trace()
451
+ env = FrozenLakeEnv(config)
452
+ print(env.reset())
453
+ while True:
454
+ diff --git a/ragen/env/sokoban/env.py b/ragen/env/sokoban/env.py
455
+ index 17cd636..6922b54 100644
456
+ --- a/ragen/env/sokoban/env.py
457
+ +++ b/ragen/env/sokoban/env.py
458
+ @@ -33,6 +33,7 @@ class SokobanEnv(BaseDiscreteActionEnv, GymSokobanEnv):
459
+ def reset(self, seed=None, mode=None):
460
+ try:
461
+ with all_seed(seed):
462
+ + # import pdb;pdb.set_trace()
463
+ self.room_fixed, self.room_state, self.box_mapping, action_sequence = generate_room(
464
+ dim=self.dim_room,
465
+ num_steps=self.num_gen_steps,
466
+ diff --git a/ragen/llm_agent/agent_proxy.py b/ragen/llm_agent/agent_proxy.py
467
+ index c25b50d..f6c4088 100644
468
+ --- a/ragen/llm_agent/agent_proxy.py
469
+ +++ b/ragen/llm_agent/agent_proxy.py
470
+ @@ -287,6 +287,7 @@ def main(config):
471
+ proxy = LLMAgentProxy(config, actor_wg, tokenizer)
472
+ import time
473
+ start_time = time.time()
474
+ + # import pdb;pdb.set_trace()
475
+ rollouts = proxy.rollout(
476
+ DataProto(
477
+ batch=None,
478
+ diff --git a/ragen/llm_agent/base_llm.py b/ragen/llm_agent/base_llm.py
479
+ index 358a2eb..b6f7797 100644
480
+ --- a/ragen/llm_agent/base_llm.py
481
+ +++ b/ragen/llm_agent/base_llm.py
482
+ @@ -33,6 +33,7 @@ class OpenAIProvider(LLMProvider):
483
+ raise ValueError("OpenAI API key not provided and not found in environment variables")
484
+
485
+ self.client = AsyncOpenAI(api_key=self.api_key)
486
+ + # import pdb;pdb.set_trace()
487
+
488
+ async def generate(self, messages: List[Dict[str, str]], **kwargs) -> LLMResponse:
489
+ if "o1-mini" in self.model_name:
490
+ @@ -46,10 +47,7 @@ class OpenAIProvider(LLMProvider):
491
+ )
492
+ if response.choices[0].finish_reason in ['length', 'content_filter']:
493
+ raise ValueError("Content filtered or length exceeded")
494
+ - return LLMResponse(
495
+ - content=response.choices[0].message.content,
496
+ - model_name=response.model
497
+ - )
498
+ + return LLMResponse(content=response.choices[0].message.content,model_name=response.model)
499
+
500
+ class DeepSeekProvider(LLMProvider):
501
+ """DeepSeek API provider implementation"""
502
+ @@ -199,7 +197,7 @@ class ConcurrentLLM:
503
+
504
+ # Queue to store unfinished or failed tasks
505
+ current_batch = messages_list.copy()
506
+ - max_retries = kwargs.get("max_retries", 100)
507
+ + max_retries = kwargs.get("max_retries", 10)
508
+ retry_count = 0
509
+
510
+ while current_batch and retry_count < max_retries:
511
+ diff --git a/ragen/llm_agent/ctx_manager.py b/ragen/llm_agent/ctx_manager.py
512
+ index 905247a..af20a01 100644
513
+ --- a/ragen/llm_agent/ctx_manager.py
514
+ +++ b/ragen/llm_agent/ctx_manager.py
515
+ @@ -88,6 +88,7 @@ class ContextManager:
516
+ Initialize the ContextManager.
517
+ Processor is used to process the image data.
518
+ """
519
+ + # import pdb;pdb.set_trace()
520
+ self.config = config
521
+ self.tokenizer = tokenizer
522
+ self.processor = processor
523
+ @@ -311,7 +312,7 @@ class ContextManager:
524
+
525
+ llm_input_texts.append(text_with_prompt)
526
+ messages_list.append(messages)
527
+ -
528
+ + # import pdb;pdb.set_trace()
529
+ inputs = self.tokenizer(llm_input_texts, return_tensors="pt", padding=True, padding_side="left", truncation=False) # We have truncated previously, truncation in tokenizer may cause issues.
530
+ input_ids, attention_mask = inputs.input_ids, inputs.attention_mask
531
+ position_ids = (attention_mask.cumsum(dim=-1) - 1).clamp(min=0)
532
+ @@ -353,6 +354,30 @@ class ContextManager:
533
+ key: np.sum(value) / self.env_nums[key.split("/")[0]]
534
+ for key, value in metrics.items()
535
+ }
536
+ + # Derived metrics for wandb logging
537
+ + try:
538
+ + # charts/avg_episode_return: average across all 2048 env groups
539
+ + ep_keys = [k for k in metrics.keys() if k.endswith('/episodic_return')]
540
+ + if len(ep_keys) > 0:
541
+ + ep_vals = []
542
+ + for k in ep_keys:
543
+ + tag = k.split('/')[0]
544
+ + denom = self.env_nums.get(tag, max(1, len(metrics[k])))
545
+ + ep_vals.append(float(np.sum(metrics[k]) / denom))
546
+ + mean_metrics["charts/avg_episode_return"] = float(np.mean(ep_vals))
547
+ + except Exception:
548
+ + pass
549
+ + try:
550
+ + # rollout/max_tile: max over all envs in this batch
551
+ + tile_keys = [k for k in metrics.keys() if k.endswith('/max_tile')]
552
+ + if len(tile_keys) > 0:
553
+ + tile_vals = []
554
+ + for k in tile_keys:
555
+ + tile_vals.extend(metrics[k])
556
+ + if len(tile_vals) > 0:
557
+ + mean_metrics["rollout/max_tile"] = int(np.max(tile_vals))
558
+ + except Exception:
559
+ + pass
560
+ for key, values in metrics.items():
561
+ if not isinstance(values, list):
562
+ continue
563
+ diff --git a/ragen/llm_agent/es_manager.py b/ragen/llm_agent/es_manager.py
564
+ index b87a2b3..1a49d3e 100644
565
+ --- a/ragen/llm_agent/es_manager.py
566
+ +++ b/ragen/llm_agent/es_manager.py
567
+ @@ -128,18 +128,40 @@ class EnvStateManager:
568
+ env_outputs: List[Dict]
569
+ {env_id: int, history: List[Dict][{state: str, actions: List[str], reward: float, info: Dict, llm_response: str, llm_raw_response: str, (Optional)images: List[PIL.Image.Image]}]}
570
+ """
571
+ + # def _execute_actions(env, actions):
572
+ + # acc_reward, turn_info, turn_done = 0, {}, False
573
+ + # executed_actions = []
574
+ + # for action in actions:
575
+ + # _, reward, done, info = env.step(action)
576
+ + # acc_reward += reward
577
+ + # turn_info.update(info) # NOTE: currently use last info for multi-action
578
+ + # executed_actions.append(action)
579
+ + # if done:
580
+ + # turn_done = True
581
+ + # break
582
+ +
583
+ + # return acc_reward, turn_info, turn_done, executed_actions
584
+ def _execute_actions(env, actions):
585
+ - acc_reward, turn_info, turn_done = 0, {}, False
586
+ + acc_reward, turn_info, turn_done = 0.0, {}, False
587
+ + raw_acc_reward = 0.0
588
+ executed_actions = []
589
+ for action in actions:
590
+ _, reward, done, info = env.step(action)
591
+ - acc_reward += reward
592
+ + acc_reward += float(reward)
593
+ + try:
594
+ + raw_acc_reward += float(info.get('raw_reward', 0.0))
595
+ + except Exception:
596
+ + pass
597
+ turn_info.update(info) # NOTE: currently use last info for multi-action
598
+ executed_actions.append(action)
599
+ if done:
600
+ turn_done = True
601
+ break
602
+ -
603
+ + # Overwrite per-turn raw_reward to reflect the sum across all executed actions in this turn
604
+ + try:
605
+ + turn_info['raw_reward'] = float(raw_acc_reward)
606
+ + except Exception:
607
+ + pass
608
+ return acc_reward, turn_info, turn_done, executed_actions
609
+
610
+ def _log_env_state(status, history, cur_obs, max_actions_per_traj, executed_actions, all_actions, acc_reward, turn_done, turn_info, env_input):
611
+ @@ -198,6 +220,18 @@ class EnvStateManager:
612
+ 'success': float(status.terminated and (not status.truncated)),
613
+ 'num_actions': status.num_actions,
614
+ }
615
+ + # Add episodic-level metrics
616
+ + # try:
617
+ + # # Sum of per-turn rewards equals the episodic return (env-shaped reward)
618
+ + # env_metric['episodic_return'] = float(sum(status.rewards))
619
+ + # except Exception:
620
+ + # pass
621
+ + try:
622
+ + # Final max tile on the board at the end of the rollout
623
+ + import numpy as _np
624
+ + env_metric['max_tile'] = int(_np.max(entry['env'].grid))
625
+ + except Exception:
626
+ + pass
627
+ custom_metric = {}
628
+ for turn in cache['history']:
629
+ for k, v in turn.get('info', {}).items():
630
+ @@ -212,6 +246,12 @@ class EnvStateManager:
631
+ "Skipping non-numeric metric '%s' with value %r for env %s.",
632
+ k, v, entry['tag']
633
+ )
634
+ + # Add episodic_return as the SUM of raw_reward across steps (align with CleanRL)
635
+ + try:
636
+ + if 'raw_reward' in custom_metric:
637
+ + env_metric['episodic_return'] = float(np.sum(custom_metric['raw_reward']))
638
+ + except Exception:
639
+ + pass
640
+ for k, v in custom_metric.items():
641
+ # TODO: Move TURN_LVL_METRICS into the environment
642
+ if "webshop" not in cache['tag'].lower() or ("webshop" in cache['tag'].lower() and k in TURN_LVL_METRICS):
643
+ @@ -219,7 +259,12 @@ class EnvStateManager:
644
+ else:
645
+ env_metric['traj_sum/' + k] = np.sum(v)
646
+
647
+ -
648
+ + try:
649
+ + if 'score' in custom_metric and len(custom_metric['score']) > 0:
650
+ + env_metric['final_score'] = float(custom_metric['score'][-1])
651
+ + except Exception:
652
+ + pass
653
+ +
654
+ cache['history'][-1]['metrics'] = custom_metric
655
+ env_metric = {f"{entry['tag']}/{k}": v for k, v in env_metric.items()}
656
+ cache['metrics'] = env_metric
657
+ diff --git a/requirements.txt b/requirements.txt
658
+ index 2fd756e..9b521bf 100644
659
+ --- a/requirements.txt
660
+ +++ b/requirements.txt
661
+ @@ -7,7 +7,6 @@ accelerate
662
+ codetiming
663
+ datasets
664
+ dill
665
+ -flash-attn==2.7.4.post1
666
+ hydra-core
667
+ numpy
668
+ pandas
669
+ @@ -15,19 +14,19 @@ pybind11
670
+ ray>=2.10
671
+ tensordict>=0.8.0,<0.9.0
672
+ transformers
673
+ -vllm==0.8.2
674
+ +vllm==0.8.5
675
+ wandb
676
+ gymnasium
677
+ gymnasium[toy-text]
678
+
679
+ pyarrow>=15.0.0
680
+ pylatexenc
681
+ -torchdata
682
+ +# torchdata
683
+ debugpy
684
+
685
+ together
686
+ anthropic
687
+ -faiss-cpu==1.11.0
688
+ +faiss-gpu
689
+
690
+ # This is optional, but needs to be installed with main requirements if you want to use webshop
691
+ -r external/webshop-minimal/requirements.txt
692
+ diff --git a/scripts/setup_ragen.sh b/scripts/setup_ragen.sh
693
+ index f9a7cd9..85a93c4 100644
694
+ --- a/scripts/setup_ragen.sh
695
+ +++ b/scripts/setup_ragen.sh
696
+ @@ -94,10 +94,10 @@ main() {
697
+ pip install torch==2.5.0 --index-url https://download.pytorch.org/whl/cu124
698
+
699
+ print_step "Installing flash-attention..."
700
+ - pip3 install flash-attn==2.7.4.post1 --no-build-isolation
701
+ + # pip3 install flash-attn==2.7.4.post1 --no-build-isolation
702
+ else
703
+ print_step "Installing PyTorch without CUDA support..."
704
+ - pip install torch==2.5.0
705
+ + pip install torch==2.4.0
706
+ fi
707
+
708
+ # Install remaining requirements
709
+ @@ -137,8 +137,8 @@ main() {
710
+ conda install conda-forge::gdown
711
+ mkdir -p external/webshop-minimal/webshop_minimal/data/full
712
+ cd external/webshop-minimal/webshop_minimal/data/full
713
+ - gdown https://drive.google.com/uc?id=1A2whVgOO0euk5O13n2iYDM0bQRkkRduB # items_shuffle
714
+ - gdown https://drive.google.com/uc?id=1s2j6NgHljiZzQNL3veZaAiyW_qDEgBNi # items_ins_v2
715
+ + # gdown https://drive.google.com/uc?id=1A2whVgOO0euk5O13n2iYDM0bQRkkRduB # items_shuffle
716
+ + # gdown https://drive.google.com/uc?id=1s2j6NgHljiZzQNL3veZaAiyW_qDEgBNi # items_ins_v2
717
+ cd ../../../../..
718
+
719
+ echo -e "${GREEN}Installation completed successfully!${NC}"
720
+ diff --git a/train_all.sh b/train_all.sh
721
+ index 0157306..33035f5 100755
722
+ --- a/train_all.sh
723
+ +++ b/train_all.sh
724
+ @@ -6,246 +6,257 @@ USE_GRPO="algorithm.adv_estimator=grpo"
725
+ USE_PPO="algorithm.adv_estimator=gae" # by default.
726
+ USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
727
+
728
+ +
729
+ +# python train.py --config-name _8_2048 system.CUDA_VISIBLE_DEVICES="'0,1,2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=game_2048 $USE_PPO $USE_BASE
730
+ +
731
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'0,1'" trainer.project_name=ragen_latest_qwen_05B_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=rubikscube-1 $USE_PPO $USE_BASE
732
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-1.5B-Instruct trainer.experiment_name=rubikscube-2 $USE_PPO $USE_BASE
733
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'4,5'" trainer.project_name=ragen_latest_qwen_25_3b_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-3B-Instruct trainer.experiment_name=rubikscube-2 $USE_PPO $USE_BASE
734
+ +python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'6,7'" trainer.project_name=ragen_latest_qwen_05B_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=rubikscube-3 $USE_PPO $USE_BASE
735
+ +
736
+ # Section 3.1&3.2 - General Observations
737
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-ppo $USE_PPO $USE_BASE &
738
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-grpo $USE_GRPO $USE_BASE &
739
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE &
740
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-grpo $USE_GRPO $USE_BASE &
741
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozen_lake-ppo $USE_PPO $USE_BASE &
742
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozen_lake-grpo $USE_GRPO $USE_BASE &
743
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="'6,7'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=bandit-ppo-multitask $USE_PPO $USE_BASE &
744
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="'7'" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-ppo-frommlp $USE_PPO $USE_BASE
745
+
746
+ -# Section 4.1 - Filtering and critic
747
+ -# 0.25
748
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.25 actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
749
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
750
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
751
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
752
+ -
753
+ -wait
754
+ -
755
+ -# 0.5
756
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-ppo-rolloutfilter0.5 actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
757
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
758
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
759
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
760
+ -
761
+ -# 0.75
762
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.75 actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
763
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
764
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
765
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
766
+ -
767
+ -wait
768
+ -
769
+ -# Section 4.2 - Ablation on Critic/ClipHigh/KL. Start from Basic and add more components. The best setting for StarPO in agent is rollout_filter+Critic+Cliphigh+NoKL
770
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
771
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
772
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
773
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
774
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozenlake-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
775
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozenlake-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
776
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozenlake-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
777
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozenlake-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
778
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="'0,1'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=sokoban-ppo-box1-multitask $USE_PPO $USE_BASE
779
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-grpo $USE_GRPO $USE_BASE &
780
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
781
+
782
+ -wait
783
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'4,5,6,7'" trainer.project_name=ragen_latest_qwen_25_3b_it trainer.n_gpus_per_node=4 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_3B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
784
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'4,5,6,7'" trainer.n_gpus_per_node=4 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
785
+
786
+ -# Section 5.1 - Reasoning Helps Generalization
787
+ +# # Section 4.1 - Filtering and critic
788
+ +# # 0.25
789
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.25 actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
790
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
791
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
792
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
793
+
794
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-generalization \
795
+ - custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
796
+ - custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
797
+ - custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
798
+ - custom_envs.BanditTest.env_config.hi_arm_name="Librarian"
799
+ +# wait
800
+
801
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-generalization-nothink \
802
+ - custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
803
+ - custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
804
+ - custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
805
+ - custom_envs.BanditTest.env_config.hi_arm_name="Librarian" \
806
+ - agent_proxy.enable_think=False
807
+ +# # 0.5
808
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-ppo-rolloutfilter0.5 actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
809
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
810
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
811
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
812
+ +
813
+ +# # 0.75
814
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.75 actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
815
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
816
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
817
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
818
+
819
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=bandit-generalization-rev \
820
+ - custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
821
+ - custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
822
+ - custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
823
+ - custom_envs.BanditTest.env_config.hi_arm_name="Trader"
824
+ +# wait
825
+
826
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=bandit-generalization-rev-nothink \
827
+ - custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
828
+ - custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
829
+ - custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
830
+ - custom_envs.BanditTest.env_config.hi_arm_name="Trader" \
831
+ - agent_proxy.enable_think=False
832
+ +# # Section 4.2 - Ablation on Critic/ClipHigh/KL. Start from Basic and add more components. The best setting for StarPO in agent is rollout_filter+Critic+Cliphigh+NoKL
833
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
834
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
835
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
836
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
837
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozenlake-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
838
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozenlake-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
839
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozenlake-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
840
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozenlake-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
841
+
842
+ +# wait
843
+
844
+ -SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
845
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization micro_batch_size_per_gpu=8 model_path=Qwen/Qwen2.5-1.5B-Instruct&
846
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-generalization-nothink $SOKOBAN_GENERALIZATION_CONFIG agent_proxy.enable_think=False &
847
+ +# # Section 5.1 - Reasoning Helps Generalization
848
+
849
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-generalization \
850
+ +# custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
851
+ +# custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
852
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
853
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Librarian"
854
+
855
+ -# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=128 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SokobanDifferentGridVocab] es_manager.val.env_configs.n_groups=[128]"
856
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG &
857
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-generalization-nothink \
858
+ +# custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
859
+ +# custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
860
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
861
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Librarian" \
862
+ +# agent_proxy.enable_think=False
863
+
864
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=bandit-generalization-rev \
865
+ +# custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
866
+ +# custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
867
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
868
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Trader"
869
+
870
+ -# COMPOSITIONALITY_CONFIG="es_manager.train.env_groups=16 es_manager.train.env_configs.tags=[Bandit,SimpleSokoban] es_manager.train.env_configs.n_groups=[8,8] es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[Bandit,SimpleSokoban,LargerSokoban,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128] actor_rollout_ref.rollout.rollout_filter_ratio=1" # NOTE that we don't filter out low-var rollout in this setting
871
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=compositional-generalization $COMPOSITIONALITY_CONFIG &
872
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=compositional-generalization-nothink $COMPOSITIONALITY_CONFIG agent_proxy.enable_think=False &
873
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=bandit-generalization-rev-nothink \
874
+ +# custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
875
+ +# custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
876
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
877
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Trader" \
878
+ +# agent_proxy.enable_think=False
879
+
880
+ -wait
881
+
882
+ -# Section 5.2 - what leads to better reasoning?
883
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B-Instruct &
884
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B-Instruct &
885
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct trainer.n_gpus_per_node=2 &
886
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B-Instruct trainer.n_gpus_per_node=4 &
887
+ +# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
888
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization micro_batch_size_per_gpu=8 model_path=Qwen/Qwen2.5-1.5B-Instruct&
889
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-generalization-nothink $SOKOBAN_GENERALIZATION_CONFIG agent_proxy.enable_think=False &
890
+
891
+ -wait
892
+
893
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B &
894
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B &
895
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B &
896
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B &
897
+ +# # SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=128 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SokobanDifferentGridVocab] es_manager.val.env_configs.n_groups=[128]"
898
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG &
899
+
900
+ -wait
901
+
902
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-7B &
903
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B &
904
+ +# # COMPOSITIONALITY_CONFIG="es_manager.train.env_groups=16 es_manager.train.env_configs.tags=[Bandit,SimpleSokoban] es_manager.train.env_configs.n_groups=[8,8] es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[Bandit,SimpleSokoban,LargerSokoban,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128] actor_rollout_ref.rollout.rollout_filter_ratio=1" # NOTE that we don't filter out low-var rollout in this setting
905
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=compositional-generalization $COMPOSITIONALITY_CONFIG &
906
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=compositional-generalization-nothink $COMPOSITIONALITY_CONFIG agent_proxy.enable_think=False &
907
+
908
+ +# wait
909
+
910
+ -wait
911
+ +# # Section 5.2 - what leads to better reasoning?
912
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B-Instruct &
913
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B-Instruct &
914
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct trainer.n_gpus_per_node=2 &
915
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B-Instruct trainer.n_gpus_per_node=4 &
916
+
917
+ -# Section 6.1 varying action count
918
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-action-count-1 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=5 custom_envs.LargerSokoban.max_actions_per_traj=5 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=5 custom_envs.FrozenLake.max_actions_per_traj=5 agent_proxy.max_actions_per_turn=1 &
919
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-action-count-2 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=10 custom_envs.LargerSokoban.max_actions_per_traj=10 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=10 custom_envs.FrozenLake.max_actions_per_traj=10 agent_proxy.max_actions_per_turn=2 &
920
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-action-count-3 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=15 custom_envs.LargerSokoban.max_actions_per_traj=15 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=15 custom_envs.FrozenLake.max_actions_per_traj=15 agent_proxy.max_actions_per_turn=3 &
921
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-action-count-4 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=20 custom_envs.LargerSokoban.max_actions_per_traj=20 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=20 custom_envs.FrozenLake.max_actions_per_traj=20 agent_proxy.max_actions_per_turn=4 &
922
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-action-count-5 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=25 custom_envs.LargerSokoban.max_actions_per_traj=25 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=25 custom_envs.FrozenLake.max_actions_per_traj=25 agent_proxy.max_actions_per_turn=5 &
923
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-action-count-6 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=30 custom_envs.LargerSokoban.max_actions_per_traj=30 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=30 custom_envs.FrozenLake.max_actions_per_traj=30 agent_proxy.max_actions_per_turn=6 &
924
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-action-count-7 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=35 custom_envs.LargerSokoban.max_actions_per_traj=35 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=35 custom_envs.FrozenLake.max_actions_per_traj=35 agent_proxy.max_actions_per_turn=7 &
925
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-action-count-8 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=40 custom_envs.LargerSokoban.max_actions_per_traj=40 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=40 custom_envs.FrozenLake.max_actions_per_traj=40 agent_proxy.max_actions_per_turn=8 &
926
+ +# wait
927
+
928
+ -# section 6.2 Varying prompt diversity
929
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-prompt-diversity-4 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=4 es_manager.train.group_size=32 es_manager.train.env_configs.n_groups=[4] &
930
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-prompt-diversity-8 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] &
931
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-prompt-diversity-16 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=8 es_manager.train.env_configs.n_groups=[16] &
932
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-prompt-diversity-32 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=32 es_manager.train.group_size=4 es_manager.train.env_configs.n_groups=[32] &
933
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-prompt-diversity-64 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=64 es_manager.train.group_size=2 es_manager.train.env_configs.n_groups=[64] &
934
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-prompt-diversity-128 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=128 es_manager.train.group_size=1 es_manager.train.env_configs.n_groups=[128] &
935
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B &
936
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B &
937
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B &
938
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B &
939
+
940
+ -wait
941
+ +# wait
942
+
943
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-online-2 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[16] trainer.total_training_steps=100 trainer.test_freq=5 &
944
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-7B &
945
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B &
946
+
947
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-online-5 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=40 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[40] trainer.total_training_steps=40 trainer.test_freq=2 &
948
+
949
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-online-10 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=80 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[80] trainer.total_training_steps=80 trainer.test_freq=1 &
950
+ +# wait
951
+
952
+ +# # Section 6.1 varying action count
953
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-action-count-1 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=5 custom_envs.LargerSokoban.max_actions_per_traj=5 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=5 custom_envs.FrozenLake.max_actions_per_traj=5 agent_proxy.max_actions_per_turn=1 &
954
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-action-count-2 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=10 custom_envs.LargerSokoban.max_actions_per_traj=10 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=10 custom_envs.FrozenLake.max_actions_per_traj=10 agent_proxy.max_actions_per_turn=2 &
955
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-action-count-3 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=15 custom_envs.LargerSokoban.max_actions_per_traj=15 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=15 custom_envs.FrozenLake.max_actions_per_traj=15 agent_proxy.max_actions_per_turn=3 &
956
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-action-count-4 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=20 custom_envs.LargerSokoban.max_actions_per_traj=20 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=20 custom_envs.FrozenLake.max_actions_per_traj=20 agent_proxy.max_actions_per_turn=4 &
957
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-action-count-5 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=25 custom_envs.LargerSokoban.max_actions_per_traj=25 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=25 custom_envs.FrozenLake.max_actions_per_traj=25 agent_proxy.max_actions_per_turn=5 &
958
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-action-count-6 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=30 custom_envs.LargerSokoban.max_actions_per_traj=30 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=30 custom_envs.FrozenLake.max_actions_per_traj=30 agent_proxy.max_actions_per_turn=6 &
959
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-action-count-7 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=35 custom_envs.LargerSokoban.max_actions_per_traj=35 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=35 custom_envs.FrozenLake.max_actions_per_traj=35 agent_proxy.max_actions_per_turn=7 &
960
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-action-count-8 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=40 custom_envs.LargerSokoban.max_actions_per_traj=40 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=40 custom_envs.FrozenLake.max_actions_per_traj=40 agent_proxy.max_actions_per_turn=8 &
961
+
962
+ +# # section 6.2 Varying prompt diversity
963
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-prompt-diversity-4 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=4 es_manager.train.group_size=32 es_manager.train.env_configs.n_groups=[4] &
964
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-prompt-diversity-8 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] &
965
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-prompt-diversity-16 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=8 es_manager.train.env_configs.n_groups=[16] &
966
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-prompt-diversity-32 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=32 es_manager.train.group_size=4 es_manager.train.env_configs.n_groups=[32] &
967
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-prompt-diversity-64 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=64 es_manager.train.group_size=2 es_manager.train.env_configs.n_groups=[64] &
968
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-prompt-diversity-128 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=128 es_manager.train.group_size=1 es_manager.train.env_configs.n_groups=[128] &
969
+
970
+ +# wait
971
+
972
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-online-2 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[16] trainer.total_training_steps=100 trainer.test_freq=5 &
973
+
974
+ -# Extension: Training 7B reasoning model
975
+ -SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
976
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct-largescale $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] micro_batch_size_per_gpu=8 ppo_mini_batch_size=64 actor_rollout_ref.rollout.response_length=1024 actor_rollout_ref.rollout.max_model_len=6400 trainer.test_freq=5 actor_rollout_ref.rollout.max_num_batched_tokens=24000 micro_batch_size_per_gpu=2 actor_rollout_ref.rollout.rollout_filter_ratio=1 &
977
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-online-5 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=40 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[40] trainer.total_training_steps=40 trainer.test_freq=2 &
978
+
979
+ -python -m ragen.llm_agent.agent_proxy model_path=Qwen/Qwen2.5-3B-Instruct system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 actor_rollout_ref.rollout.tensor_model_parallel_size=4 actor_rollout_ref.rollout.response_length=2048 actor_rollout_ref.rollout.max_model_len=12800
980
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-online-10 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=80 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[80] trainer.total_training_steps=80 trainer.test_freq=1 &
981
+
982
+ -# trainer.save_freq=50 trainer.default_local_dir=/mnt/local/cache/exp_name
983
+
984
+ -# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
985
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization &
986
+
987
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/bandit-generalization &
988
+
989
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=frozenlake-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/frozenlake-generalization &
990
+
991
+ +# # Extension: Training 7B reasoning model
992
+ +# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
993
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct-largescale $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] micro_batch_size_per_gpu=8 ppo_mini_batch_size=64 actor_rollout_ref.rollout.response_length=1024 actor_rollout_ref.rollout.max_model_len=6400 trainer.test_freq=5 actor_rollout_ref.rollout.max_num_batched_tokens=24000 micro_batch_size_per_gpu=2 actor_rollout_ref.rollout.rollout_filter_ratio=1 &
994
+
995
+ +# python -m ragen.llm_agent.agent_proxy model_path=Qwen/Qwen2.5-3B-Instruct system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 actor_rollout_ref.rollout.tensor_model_parallel_size=4 actor_rollout_ref.rollout.response_length=2048 actor_rollout_ref.rollout.max_model_len=12800
996
+
997
+ +# # trainer.save_freq=50 trainer.default_local_dir=/mnt/local/cache/exp_name
998
+
999
+ -# USE_PPO="algorithm.adv_estimator=gae" # by default.
1000
+ -# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1001
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE ppo_mini_batch_size=64 enable_response_mask=True &
1002
+ +# # USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1003
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization &
1004
+
1005
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/bandit-generalization &
1006
+
1007
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std &
1008
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=frozenlake-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/frozenlake-generalization &
1009
+
1010
+ -# enable_response_mask: False
1011
+ -# grpo_advantage_length_weight: True
1012
+
1013
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo-1-5b algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std agent_proxy.max_actions_per_turn=5 custom_envs.SimpleSokoban.max_actions_per_traj=25 enable_response_mask=True grpo_advantage_length_weight=False model_path=Qwen/Qwen2.5-1.5B-Instruct &
1014
+
1015
+
1016
+ -# extension: 7B with lora. Currently NOT recommended to use lora: within current version of vllm, this could result in rollouts slower than non-lora by 100%
1017
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-7B-Instruct trainer.experiment_name=sokoban_7b_instruct_lora_newversion lora.rank=16
1018
+ +# # USE_PPO="algorithm.adv_estimator=gae" # by default.
1019
+ +# # USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1020
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE ppo_mini_batch_size=64 enable_response_mask=True &
1021
+
1022
+ -# extension: bi-level gae
1023
+ -python train.py trainer.experiment_name=sokoban-bi-level-gae-final \
1024
+ - system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
1025
+ - model_path=Qwen/Qwen2.5-0.5B-Instruct \
1026
+ - algorithm.bi_level_gae=True algorithm.high_level_gamma=0.95 \
1027
+ - agent_proxy.use_turn_scores=True \
1028
+ - actor_rollout_ref.rollout.tp_size_check=False
1029
+
1030
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std &
1031
+
1032
+ -# extension: webshop
1033
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1034
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1035
+ - trainer.experiment_name=webshop-3b-ppo-s $USE_PPO \
1036
+ - trainer.nnodes=1 &
1037
+ +# # enable_response_mask: False
1038
+ +# # grpo_advantage_length_weight: True
1039
+
1040
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo-1-5b algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std agent_proxy.max_actions_per_turn=5 custom_envs.SimpleSokoban.max_actions_per_traj=25 enable_response_mask=True grpo_advantage_length_weight=False model_path=Qwen/Qwen2.5-1.5B-Instruct &
1041
+
1042
+ -USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1043
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1044
+ - trainer.experiment_name=webshop-3b-grpo-s $USE_GRPO \
1045
+ - trainer.nnodes=1 &
1046
+
1047
+ -# StarPO ppo
1048
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1049
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1050
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1051
+ - trainer.experiment_name=webshop-3b-ppo $USE_PPO $USE_BASE \
1052
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1053
+ - trainer.nnodes=1 &
1054
+ +# # extension: 7B with lora. Currently NOT recommended to use lora: within current version of vllm, this could result in rollouts slower than non-lora by 100%
1055
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-7B-Instruct trainer.experiment_name=sokoban_7b_instruct_lora_newversion lora.rank=16
1056
+
1057
+ -# StarPO grpo
1058
+ -USE_GRPO="algorithm.adv_estimator=grpo"
1059
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1060
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1061
+ - trainer.experiment_name=webshop-3b-grpo $USE_GRPO $USE_BASE \
1062
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1063
+ - trainer.nnodes=1 &
1064
+ +# # extension: bi-level gae
1065
+ +# python train.py trainer.experiment_name=sokoban-bi-level-gae-final \
1066
+ +# system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
1067
+ +# model_path=Qwen/Qwen2.5-0.5B-Instruct \
1068
+ +# algorithm.bi_level_gae=True algorithm.high_level_gamma=0.95 \
1069
+ +# agent_proxy.use_turn_scores=True \
1070
+ +# actor_rollout_ref.rollout.tp_size_check=False
1071
+
1072
+
1073
+ -# normal:sokoban
1074
+ -# extension: sokoban
1075
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1076
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1077
+ - trainer.experiment_name=sokoban-3b-ppo-s $USE_PPO \
1078
+ - trainer.nnodes=1 &
1079
+ +# # extension: webshop
1080
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1081
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1082
+ +# trainer.experiment_name=webshop-3b-ppo-s $USE_PPO \
1083
+ +# trainer.nnodes=1 &
1084
+
1085
+
1086
+ -USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1087
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1088
+ - trainer.experiment_name=sokoban-3b-grpo-s $USE_GRPO \
1089
+ - trainer.nnodes=1 &
1090
+ +# USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1091
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1092
+ +# trainer.experiment_name=webshop-3b-grpo-s $USE_GRPO \
1093
+ +# trainer.nnodes=1 &
1094
+
1095
+ -# StarPO ppo
1096
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1097
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1098
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1099
+ - trainer.experiment_name=sokoban-3b-ppo $USE_PPO $USE_BASE \
1100
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1101
+ - trainer.nnodes=1 &
1102
+ +# # StarPO ppo
1103
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1104
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1105
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1106
+ +# trainer.experiment_name=webshop-3b-ppo $USE_PPO $USE_BASE \
1107
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1108
+ +# trainer.nnodes=1 &
1109
+
1110
+ -# StarPO grpo
1111
+ -USE_GRPO="algorithm.adv_estimator=grpo"
1112
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1113
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1114
+ - trainer.experiment_name=sokoban-3b-grpo $USE_GRPO $USE_BASE \
1115
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1116
+ - trainer.nnodes=1 &
1117
+ +# # StarPO grpo
1118
+ +# USE_GRPO="algorithm.adv_estimator=grpo"
1119
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1120
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1121
+ +# trainer.experiment_name=webshop-3b-grpo $USE_GRPO $USE_BASE \
1122
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1123
+ +# trainer.nnodes=1 &
1124
+ +
1125
+ +
1126
+ +# # normal:sokoban
1127
+ +# # extension: sokoban
1128
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1129
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1130
+ +# trainer.experiment_name=sokoban-3b-ppo-s $USE_PPO \
1131
+ +# trainer.nnodes=1 &
1132
+ +
1133
+ +
1134
+ +# USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1135
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1136
+ +# trainer.experiment_name=sokoban-3b-grpo-s $USE_GRPO \
1137
+ +# trainer.nnodes=1 &
1138
+ +
1139
+ +# # StarPO ppo
1140
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1141
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1142
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1143
+ +# trainer.experiment_name=sokoban-3b-ppo $USE_PPO $USE_BASE \
1144
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1145
+ +# trainer.nnodes=1 &
1146
+ +
1147
+ +# # StarPO grpo
1148
+ +# USE_GRPO="algorithm.adv_estimator=grpo"
1149
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1150
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1151
+ +# trainer.experiment_name=sokoban-3b-grpo $USE_GRPO $USE_BASE \
1152
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1153
+ +# trainer.nnodes=1 &
1154
+
1155
+
1156
+
1157
+ -python train.py \
1158
+ - trainer.experiment_name=3b-full-ppo-test system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2
1159
+
1160
+ +# python train.py \
1161
+ +# trainer.experiment_name=3b-full-ppo-test system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2
1162
+
wandb/run-20251218_182448-on6j4c96/files/diff_8d73639b99b38265453f898b8d6af7d4af50d56e.patch ADDED
@@ -0,0 +1,1162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/config/base.yaml b/config/base.yaml
2
+ index a1659e4..9df6250 100644
3
+ --- a/config/base.yaml
4
+ +++ b/config/base.yaml
5
+ @@ -9,15 +9,16 @@ seed:
6
+ train: 10000
7
+ val: 123
8
+
9
+ -micro_batch_size_per_gpu: 4
10
+ +micro_batch_size_per_gpu: 1
11
+ ppo_mini_batch_size: 32
12
+ -model_path: Qwen/Qwen2.5-3B-Instruct
13
+ +model_path: /mnt/general/share/model/Qwen/Qwen2.5-0.5B-Instruct
14
+ +# Qwen/Qwen2.5-0.5B-Instruct
15
+ enable_response_mask: True # Enabling response mask could improve stability of rollout/old_log_prob, as P(st|history) are no longer calculated in loss here. See https://docs.google.com/document/d/1bg7obeiKTExuHHBl5uOiSpec5uLDZ2Tgvxy6li5pHX4/edit?usp=sharing for more details.
16
+ grpo_advantage_length_weight: False # if you do not enable this and critic/advantage_estimator is GRPO, and the critic/advantages/mean is too low, then you can try enabling this to encourage reasoning and forbid collapse
17
+
18
+ lora:
19
+ rank: 0
20
+ - alpha: 64
21
+ + alpha: 16
22
+ target_modules: all-linear
23
+
24
+ actor_rollout_ref:
25
+ @@ -46,10 +47,10 @@ actor_rollout_ref:
26
+ name: vllm
27
+ log_prob_micro_batch_size_per_gpu: ${micro_batch_size_per_gpu} # following micro_batch_size_per_gpu
28
+ tensor_model_parallel_size: 1
29
+ - max_model_len: 3600
30
+ + max_model_len: 7200 #3600 why** 14400
31
+ prompt_length: 1 # useless. Just put it here
32
+ response_length: 400 # single-turn response length
33
+ - gpu_memory_utilization: 0.5
34
+ + gpu_memory_utilization: 0.7
35
+ max_num_batched_tokens: 8192 # set only when enable_chunked_prefill is true
36
+ temperature: 1
37
+ rollout_filter_ratio: 0.25
38
+ @@ -90,26 +91,28 @@ algorithm:
39
+ kl_coef: 0.000
40
+
41
+ trainer:
42
+ - project_name: ragen_latest
43
+ + project_name:
44
+ experiment_name: test
45
+ local_log_dir: "results/"
46
+ - save_freq: 100
47
+ + save_freq: -1
48
+ total_training_steps: 200
49
+ validation_steps: 1 # validation instances = validation_steps * val_env_groups * group_size
50
+ val_before_train: True
51
+ n_gpus_per_node: 1
52
+ test_freq: 10
53
+ generations_to_log_to_wandb:
54
+ + train: 128
55
+ val: 20
56
+ logger: [ 'console', 'wandb' ]
57
+ max_actor_ckpt_to_keep: 1
58
+ max_critic_ckpt_to_keep: 1
59
+ + default_local_dir: /mnt/general/wanghy/RAGEN/saves/
60
+
61
+ agent_proxy:
62
+ max_context_window: -1 # set a value > 0 to enable context window for long trajectory
63
+ - max_turn: 5
64
+ + max_turn: 25 #25 why** 700
65
+ action_sep: "||"
66
+ - max_actions_per_turn: 2 # how many actions can be output at most in a single turn
67
+ + max_actions_per_turn: 1 # how many actions can be output at most in a single turn
68
+ use_turn_scores: False # important to GAE when applying token-level rewards to token-level advantages. If False, will take the sum of scores as the reward for the last turn.
69
+ enable_think: True # False -> no think RL
70
+ reward_normalization:
71
+ @@ -126,11 +129,11 @@ es_manager:
72
+ tags: ["CoordSokoban"]
73
+ n_groups: [8] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
74
+ val:
75
+ - env_groups: 32
76
+ - group_size: 16 # should be set to 1 because when val temperature is set to 0 and group size > 1, there will be repetitive prompts which leads to same trajectory.
77
+ + env_groups: 256
78
+ + group_size: 1 # should be set to 1 because when val temperature is set to 0 and group size > 1, there will be repetitive prompts which leads to same trajectory.
79
+ env_configs:
80
+ tags: ["CoordSokoban"]
81
+ - n_groups: [32] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
82
+ + n_groups: [256] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
83
+
84
+ ctx_manager:
85
+ generation: # go to vllm
86
+ diff --git a/config/envs.yaml b/config/envs.yaml
87
+ index 1002ac8..ba3ac6f 100644
88
+ --- a/config/envs.yaml
89
+ +++ b/config/envs.yaml
90
+ @@ -2,6 +2,7 @@ custom_envs:
91
+ SimpleSokoban:
92
+ env_type: sokoban
93
+ max_actions_per_traj: 10 # used in environment state manager to control the actual max actions executed per trajectory
94
+ + # ORIGNAL env_instruction
95
+ env_instruction: |
96
+ You are solving the Sokoban puzzle.
97
+ You are the player and you need to push all boxes to targets.
98
+ @@ -12,7 +13,7 @@ custom_envs:
99
+ env_config: # keys should be a subset of SokobanConfig
100
+ dim_x: 6
101
+ dim_y: 6
102
+ - num_boxes: 1
103
+ + num_boxes: 2
104
+ max_steps: 100
105
+
106
+ LargerSokoban:
107
+ @@ -65,7 +66,7 @@ custom_envs:
108
+ env_config: # keys should be a subset of SokobanConfig
109
+ dim_x: 6
110
+ dim_y: 6
111
+ - num_boxes: 1
112
+ + num_boxes: 2
113
+ max_steps: 100
114
+ observation_format: "grid_coord"
115
+
116
+ @@ -111,14 +112,14 @@ custom_envs:
117
+
118
+ FrozenLake:
119
+ env_type: frozen_lake
120
+ - max_actions_per_traj: 10
121
+ + max_actions_per_traj: 25
122
+ env_instruction: "You are solving the FrozenLake puzzle. Forbid the whole and go to the target. You may move to the unintended direction due to the slippery ice. Example answer format: <think>To forbid the hole and go to the target, I should go left then go up.</think><answer>Left || Up</answer>"
123
+ max_tokens: 100
124
+ env_config: null
125
+
126
+ CoordFrozenLake:
127
+ env_type: frozen_lake
128
+ - max_actions_per_traj: 10
129
+ + max_actions_per_traj: 25
130
+ env_instruction: |
131
+ You are solving the FrozenLake puzzle. The observation includes both a symbol grid and zero-indexed coordinates for the start, goal, player, and any holes.
132
+ Coordinates range from the top-left corner (0, 0) to the bottom-right corner (5, 5).
133
+ @@ -195,4 +196,80 @@ custom_envs:
134
+ max_actions_per_traj: 30
135
+ env_instruction: "You are a Lean theorem prover. Given a Lean theorem statement, propose a sequence of tactics that completes the proof. Think step by step about which tactics to apply next. Provide tactics separated by '||', for example <answer>intro || simp || rfl</answer>."
136
+ max_tokens: 512
137
+ - env_config: null # Please refer to ragen/env/lean/config.py for a full list of parameters.
138
+
139
+ + env_config: null # Please refer to ragen/env/lean/config.py for a full list of parameters.
140
+ +
141
+ +
142
+ + game_2048:
143
+ + env_type: game_2048
144
+ + max_actions_per_traj: 700
145
+ + env_instruction: |
146
+ + You are playing the 2048 game on a 4x4 grid. Merge equal tiles by sliding Up, Right, Down, or Left.
147
+ + If a move is invalid (no tiles move), a small penalty is applied. Respond with a single action.
148
+ + Example: <answer>Up</answer>
149
+ + max_tokens: 8192
150
+ + env_config: null
151
+ +
152
+ + blackjack:
153
+ + env_type: blackjack
154
+ + max_actions_per_traj: 10
155
+ + env_instruction: |
156
+ + You are playing Blackjack against a dealer. The dealer must hit on 16 or less and stand on 17 or more.
157
+ + Choose either Stick or Hit. Respond with a single action.
158
+ + Example: <answer>Hit</answer>
159
+ + max_tokens: 64
160
+ + env_config: null
161
+ +
162
+ + rubikscube:
163
+ + env_type: rubikscube
164
+ + max_actions_per_traj: 20
165
+ + env_instruction: |
166
+ + You are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.
167
+ + Available actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.
168
+ + - Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).
169
+ + - Modifiers: A letter alone means 90° clockwise (e.g., 'R'). A letter with prime (') means 90° counter-clockwise (e.g., "R'").
170
+ + Respond with a sequence of actions separated by "||".
171
+ + Example: <answer>U</answer>
172
+ + max_tokens: 96
173
+ + env_config:
174
+ + scramble_depth: 1
175
+ + max_steps: 20
176
+ + render_mode: "text"
177
+ +
178
+ + SimpleSudoku:
179
+ + env_type: sudoku
180
+ + max_actions_per_traj: 20
181
+ + env_instruction: |
182
+ + You are solving a Sudoku puzzle. Fill in the grid so that every row, column, and 2x2 box contains the numbers 1-4 without repetition.
183
+ + Initial cells are shown in [brackets] and cannot be modified. Empty cells are shown as dots (.).
184
+ + Place numbers one at a time using the format, for example: <answer>place 1 at row 2 col 3</answer> or <answer>1,2,3</answer>
185
+ + The environment will provide feedback on valid/invalid moves and show conflicts if any occur.
186
+ + max_tokens: 150
187
+ + parallel_friendly: false
188
+ + max_workers: 32
189
+ + env_config:
190
+ + grid_size: 4
191
+ + difficulty: "easy"
192
+ + render_format: "with_feedback"
193
+ + show_conflicts: false
194
+ + show_valid_numbers: false
195
+ + max_steps: 20
196
+ +
197
+ + MediumSudoku:
198
+ + env_type: sudoku
199
+ + max_actions_per_traj: 30
200
+ + env_instruction: |
201
+ + You are solving a Sudoku puzzle. Fill in the grid so that every row, column, and 3x3 box contains the numbers 1-9 without repetition.
202
+ + Initial cells are shown in [brackets] and cannot be modified. Empty cells are shown as dots (.).
203
+ + Place numbers one at a time using the format: <answer>place 5 at row 2 col 3</answer> or <answer>2,3,5</answer>
204
+ + The environment will provide feedback on valid/invalid moves and show conflicts if any occur.
205
+ + max_tokens: 150
206
+ + parallel_friendly: false
207
+ + max_workers: 32
208
+ + env_config:
209
+ + grid_size: 9
210
+ + difficulty: "medium"
211
+ + render_format: "with_feedback"
212
+ + show_conflicts: true
213
+ + show_valid_numbers: true
214
+ + max_steps: 81
215
+ +
216
+ diff --git a/config/eval.yaml b/config/eval.yaml
217
+ index e65f3a5..7775fd1 100644
218
+ --- a/config/eval.yaml
219
+ +++ b/config/eval.yaml
220
+ @@ -1,14 +1,15 @@
221
+ defaults:
222
+ - envs
223
+ -
224
+ +enable_response_mask: True
225
+ system:
226
+ - CUDA_VISIBLE_DEVICES: "0"
227
+ + CUDA_VISIBLE_DEVICES: "0,1,2,3,4,5,6,7"
228
+
229
+ seed:
230
+ train: 10000
231
+ val: 123
232
+
233
+ -model_path: Qwen/Qwen2.5-3B-Instruct
234
+ +model_path: /mnt/general/share/model/openai/gpt-oss-20b
235
+ +# /mnt/general/share/model/tyzhu/SPA-frozenlake-qwen2.5-1.5b-instruct
236
+
237
+ lora:
238
+ rank: 0
239
+ @@ -24,9 +25,9 @@ actor_rollout_ref:
240
+ rollout:
241
+ name: vllm
242
+ log_prob_micro_batch_size_per_gpu: ${micro_batch_size_per_gpu}
243
+ - tensor_model_parallel_size: 1
244
+ + tensor_model_parallel_size: 8
245
+ dtype: bfloat16
246
+ - max_model_len: 3600
247
+ + max_model_len: 7200
248
+ prompt_length: 1
249
+ response_length: 400
250
+ gpu_memory_utilization: 0.9
251
+ @@ -35,6 +36,7 @@ actor_rollout_ref:
252
+ free_cache_engine: True
253
+ enable_chunked_prefill: False
254
+ disable_log_stats: False
255
+ + do_sample: True
256
+ val_kwargs:
257
+ do_sample: True
258
+ temperature: 0.5
259
+ @@ -44,9 +46,9 @@ actor_rollout_ref:
260
+
261
+ agent_proxy:
262
+ max_context_window: -1
263
+ - max_turn: 5
264
+ + max_turn: 25
265
+ action_sep: "||"
266
+ - max_actions_per_turn: 2
267
+ + max_actions_per_turn: 1
268
+ use_turn_scores: False
269
+ enable_think: True
270
+ reward_normalization:
271
+ @@ -59,13 +61,13 @@ es_manager:
272
+ env_groups: 8
273
+ group_size: 16
274
+ env_configs:
275
+ - tags: ["CoordSokoban"]
276
+ + tags: ["BanditTest"]
277
+ n_groups: [8]
278
+ val:
279
+ env_groups: 32
280
+ - group_size: 16
281
+ + group_size: 128
282
+ env_configs:
283
+ - tags: ["CoordSokoban"]
284
+ + tags: ["BanditTest"]
285
+ n_groups: [32]
286
+
287
+ ctx_manager:
288
+ diff --git a/config/evaluate_api_llm.yaml b/config/evaluate_api_llm.yaml
289
+ index b21c95e..e2e6761 100644
290
+ --- a/config/evaluate_api_llm.yaml
291
+ +++ b/config/evaluate_api_llm.yaml
292
+ @@ -1,8 +1,11 @@
293
+ +#export OPENAI_BASE_URL="https://api.ohmygpt.com/v1"
294
+ +#export OPENAI_API_KEY="sk-o4sMxBkN5BB100C4D4a3T3BlBkFJF7791CA39EA14ca98041"
295
+ +#python -m ragen.eval_api hydra.searchpath='[file://./verl/verl/trainer/config]'
296
+ defaults:
297
+ - base # this is a symbolic link to the verl/verl/trainer/config/ppo_trainer.yaml file
298
+
299
+ model_config:
300
+ - model_name: gpt-4o # should be registered in model_info
301
+ + model_name: ark-deepseek-v3-250324 # should be registered in model_info
302
+ max_concurrency: 16
303
+
304
+ model_info:
305
+ @@ -24,9 +27,9 @@ model_info:
306
+ generation_kwargs:
307
+ temperature: 0
308
+ max_tokens: 512 # max_completion_tokens if o1-mini
309
+ - gpt-4o:
310
+ + gpt-4o-mini:
311
+ provider_name: openai
312
+ - model_name: gpt-4o
313
+ + model_name: gpt-4o-mini
314
+ generation_kwargs:
315
+ temperature: 0
316
+ max_tokens: 512 # max_completion_tokens if o1-mini
317
+ @@ -36,21 +39,42 @@ model_info:
318
+ generation_kwargs:
319
+ temperature: 0
320
+ max_completion_tokens: 512
321
+ + ark-deepseek-v3-250324:
322
+ + provider_name: openai
323
+ + model_name: ark-deepseek-v3-250324
324
+ + generation_kwargs:
325
+ + temperature: 0
326
+ + max_completion_tokens: 512
327
+ deepseek-v3:
328
+ provider_name: deepseek
329
+ model_name: deepseek-chat
330
+ generation_kwargs:
331
+ temperature: 0
332
+ max_completion_tokens: 512
333
+ + glm-4.6:
334
+ + provider_name: openai
335
+ + model_name: glm-4.6
336
+ + generation_kwargs:
337
+ + temperature: 0
338
+ + max_completion_tokens: 512
339
+ + TA/openai/gpt-oss-120b:
340
+ + provider_name: openai
341
+ + model_name: TA/openai/gpt-oss-120b
342
+ + generation_kwargs:
343
+ + temperature: 0
344
+ + max_tokens: 8192
345
+ + # max_retries: 5
346
+
347
+ -
348
+ -
349
+ +agent_proxy:
350
+ + max_turn: 5
351
+ es_manager:
352
+ val:
353
+ - env_groups: 256
354
+ + env_groups: 128
355
+ group_size: 1 # should be set to 1 because val temperature is set to 0 and same prompt leads to same output
356
+ env_configs:
357
+ - tags: ["CoordSokoban"]
358
+ - n_groups: [256] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
359
+ + tags: ["rubikscube"]
360
+ + n_groups: [128] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
361
+
362
+
363
+ +rollout:
364
+ + max_model_len: 7200
365
+
366
+ Submodule external/webshop-minimal contains modified content
367
+ diff --git a/external/webshop-minimal/requirements.txt b/external/webshop-minimal/requirements.txt
368
+ index 5a1b04f..238ed5a 100644
369
+ --- a/external/webshop-minimal/requirements.txt
370
+ +++ b/external/webshop-minimal/requirements.txt
371
+ @@ -4,7 +4,7 @@ flask
372
+ html2text
373
+ rank_bm25
374
+ pyserini
375
+ -faiss-cpu
376
+ +faiss-gpu
377
+ thefuzz
378
+ gdown
379
+ spacy
380
+ diff --git a/ragen/env/__init__.py b/ragen/env/__init__.py
381
+ index b0f3461..bc6838e 100644
382
+ --- a/ragen/env/__init__.py
383
+ +++ b/ragen/env/__init__.py
384
+ @@ -12,6 +12,14 @@ from .metamathqa.env import MetaMathQAEnv
385
+ from .metamathqa.config import MetaMathQAEnvConfig
386
+ from .lean.config import LeanEnvConfig
387
+ from .lean.env import LeanEnv
388
+ +from .game_2048.config import Game2048EnvConfig
389
+ +from .game_2048.env import Game2048Env
390
+ +from .blackjack.config import BlackjackEnvConfig
391
+ +from .blackjack.env import BlackjackEnv
392
+ +from .rubikscube.config import RubiksCube2x2Config
393
+ +from .rubikscube.env import RubiksCube2x2Env
394
+ +from .sudoku.config import SudokuEnvConfig
395
+ +from .sudoku.env import SudokuEnv
396
+
397
+
398
+ REGISTERED_ENVS = {
399
+ @@ -22,6 +30,10 @@ REGISTERED_ENVS = {
400
+ # 'alfworld': AlfredTXTEnv,
401
+ 'metamathqa': MetaMathQAEnv,
402
+ 'lean': LeanEnv,
403
+ + 'game_2048': Game2048Env,
404
+ + 'blackjack': BlackjackEnv,
405
+ + 'rubikscube': RubiksCube2x2Env,
406
+ + 'sudoku': SudokuEnv,
407
+ }
408
+
409
+ REGISTERED_ENV_CONFIGS = {
410
+ @@ -32,6 +44,10 @@ REGISTERED_ENV_CONFIGS = {
411
+ # 'alfworld': AlfredEnvConfig,
412
+ 'metamathqa': MetaMathQAEnvConfig,
413
+ 'lean': LeanEnvConfig,
414
+ + 'game_2048': Game2048EnvConfig,
415
+ + 'blackjack': BlackjackEnvConfig,
416
+ + 'rubikscube': RubiksCube2x2Config,
417
+ + 'sudoku': SudokuEnvConfig,
418
+ }
419
+
420
+ try:
421
+ diff --git a/ragen/env/frozen_lake/config.py b/ragen/env/frozen_lake/config.py
422
+ index de054f4..9950c34 100644
423
+ --- a/ragen/env/frozen_lake/config.py
424
+ +++ b/ragen/env/frozen_lake/config.py
425
+ @@ -8,7 +8,7 @@ class FrozenLakeEnvConfig:
426
+ size: int = 4
427
+ p: float = 0.9
428
+ success_rate: float = 0.8
429
+ - is_slippery: bool = True
430
+ + is_slippery: bool = False
431
+ map_seed: Optional[int] = None
432
+ render_mode: str = "text"
433
+ observation_format: str = "grid"
434
+ diff --git a/ragen/env/frozen_lake/env.py b/ragen/env/frozen_lake/env.py
435
+ index 9ee3add..eef11d8 100644
436
+ --- a/ragen/env/frozen_lake/env.py
437
+ +++ b/ragen/env/frozen_lake/env.py
438
+ @@ -13,6 +13,7 @@ from ragen.env.base import BaseDiscreteActionEnv
439
+ class FrozenLakeEnv(BaseDiscreteActionEnv, GymFrozenLakeEnv):
440
+ def __init__(self, config: FrozenLakeEnvConfig = FrozenLakeEnvConfig()):
441
+ # Using mappings directly from config
442
+ + # import pdb;pdb.set_trace()
443
+ self.config = config
444
+ self.GRID_LOOKUP = config.grid_lookup
445
+ self.ACTION_LOOKUP = config.action_lookup
446
+ @@ -95,6 +96,7 @@ class FrozenLakeEnv(BaseDiscreteActionEnv, GymFrozenLakeEnv):
447
+ if __name__ == "__main__":
448
+ import matplotlib.pyplot as plt
449
+ config = FrozenLakeEnvConfig(size=4, is_slippery=True)
450
+ + # import pdb;pdb.set_trace()
451
+ env = FrozenLakeEnv(config)
452
+ print(env.reset())
453
+ while True:
454
+ diff --git a/ragen/env/sokoban/env.py b/ragen/env/sokoban/env.py
455
+ index 17cd636..6922b54 100644
456
+ --- a/ragen/env/sokoban/env.py
457
+ +++ b/ragen/env/sokoban/env.py
458
+ @@ -33,6 +33,7 @@ class SokobanEnv(BaseDiscreteActionEnv, GymSokobanEnv):
459
+ def reset(self, seed=None, mode=None):
460
+ try:
461
+ with all_seed(seed):
462
+ + # import pdb;pdb.set_trace()
463
+ self.room_fixed, self.room_state, self.box_mapping, action_sequence = generate_room(
464
+ dim=self.dim_room,
465
+ num_steps=self.num_gen_steps,
466
+ diff --git a/ragen/llm_agent/agent_proxy.py b/ragen/llm_agent/agent_proxy.py
467
+ index c25b50d..f6c4088 100644
468
+ --- a/ragen/llm_agent/agent_proxy.py
469
+ +++ b/ragen/llm_agent/agent_proxy.py
470
+ @@ -287,6 +287,7 @@ def main(config):
471
+ proxy = LLMAgentProxy(config, actor_wg, tokenizer)
472
+ import time
473
+ start_time = time.time()
474
+ + # import pdb;pdb.set_trace()
475
+ rollouts = proxy.rollout(
476
+ DataProto(
477
+ batch=None,
478
+ diff --git a/ragen/llm_agent/base_llm.py b/ragen/llm_agent/base_llm.py
479
+ index 358a2eb..b6f7797 100644
480
+ --- a/ragen/llm_agent/base_llm.py
481
+ +++ b/ragen/llm_agent/base_llm.py
482
+ @@ -33,6 +33,7 @@ class OpenAIProvider(LLMProvider):
483
+ raise ValueError("OpenAI API key not provided and not found in environment variables")
484
+
485
+ self.client = AsyncOpenAI(api_key=self.api_key)
486
+ + # import pdb;pdb.set_trace()
487
+
488
+ async def generate(self, messages: List[Dict[str, str]], **kwargs) -> LLMResponse:
489
+ if "o1-mini" in self.model_name:
490
+ @@ -46,10 +47,7 @@ class OpenAIProvider(LLMProvider):
491
+ )
492
+ if response.choices[0].finish_reason in ['length', 'content_filter']:
493
+ raise ValueError("Content filtered or length exceeded")
494
+ - return LLMResponse(
495
+ - content=response.choices[0].message.content,
496
+ - model_name=response.model
497
+ - )
498
+ + return LLMResponse(content=response.choices[0].message.content,model_name=response.model)
499
+
500
+ class DeepSeekProvider(LLMProvider):
501
+ """DeepSeek API provider implementation"""
502
+ @@ -199,7 +197,7 @@ class ConcurrentLLM:
503
+
504
+ # Queue to store unfinished or failed tasks
505
+ current_batch = messages_list.copy()
506
+ - max_retries = kwargs.get("max_retries", 100)
507
+ + max_retries = kwargs.get("max_retries", 10)
508
+ retry_count = 0
509
+
510
+ while current_batch and retry_count < max_retries:
511
+ diff --git a/ragen/llm_agent/ctx_manager.py b/ragen/llm_agent/ctx_manager.py
512
+ index 905247a..af20a01 100644
513
+ --- a/ragen/llm_agent/ctx_manager.py
514
+ +++ b/ragen/llm_agent/ctx_manager.py
515
+ @@ -88,6 +88,7 @@ class ContextManager:
516
+ Initialize the ContextManager.
517
+ Processor is used to process the image data.
518
+ """
519
+ + # import pdb;pdb.set_trace()
520
+ self.config = config
521
+ self.tokenizer = tokenizer
522
+ self.processor = processor
523
+ @@ -311,7 +312,7 @@ class ContextManager:
524
+
525
+ llm_input_texts.append(text_with_prompt)
526
+ messages_list.append(messages)
527
+ -
528
+ + # import pdb;pdb.set_trace()
529
+ inputs = self.tokenizer(llm_input_texts, return_tensors="pt", padding=True, padding_side="left", truncation=False) # We have truncated previously, truncation in tokenizer may cause issues.
530
+ input_ids, attention_mask = inputs.input_ids, inputs.attention_mask
531
+ position_ids = (attention_mask.cumsum(dim=-1) - 1).clamp(min=0)
532
+ @@ -353,6 +354,30 @@ class ContextManager:
533
+ key: np.sum(value) / self.env_nums[key.split("/")[0]]
534
+ for key, value in metrics.items()
535
+ }
536
+ + # Derived metrics for wandb logging
537
+ + try:
538
+ + # charts/avg_episode_return: average across all 2048 env groups
539
+ + ep_keys = [k for k in metrics.keys() if k.endswith('/episodic_return')]
540
+ + if len(ep_keys) > 0:
541
+ + ep_vals = []
542
+ + for k in ep_keys:
543
+ + tag = k.split('/')[0]
544
+ + denom = self.env_nums.get(tag, max(1, len(metrics[k])))
545
+ + ep_vals.append(float(np.sum(metrics[k]) / denom))
546
+ + mean_metrics["charts/avg_episode_return"] = float(np.mean(ep_vals))
547
+ + except Exception:
548
+ + pass
549
+ + try:
550
+ + # rollout/max_tile: max over all envs in this batch
551
+ + tile_keys = [k for k in metrics.keys() if k.endswith('/max_tile')]
552
+ + if len(tile_keys) > 0:
553
+ + tile_vals = []
554
+ + for k in tile_keys:
555
+ + tile_vals.extend(metrics[k])
556
+ + if len(tile_vals) > 0:
557
+ + mean_metrics["rollout/max_tile"] = int(np.max(tile_vals))
558
+ + except Exception:
559
+ + pass
560
+ for key, values in metrics.items():
561
+ if not isinstance(values, list):
562
+ continue
563
+ diff --git a/ragen/llm_agent/es_manager.py b/ragen/llm_agent/es_manager.py
564
+ index b87a2b3..1a49d3e 100644
565
+ --- a/ragen/llm_agent/es_manager.py
566
+ +++ b/ragen/llm_agent/es_manager.py
567
+ @@ -128,18 +128,40 @@ class EnvStateManager:
568
+ env_outputs: List[Dict]
569
+ {env_id: int, history: List[Dict][{state: str, actions: List[str], reward: float, info: Dict, llm_response: str, llm_raw_response: str, (Optional)images: List[PIL.Image.Image]}]}
570
+ """
571
+ + # def _execute_actions(env, actions):
572
+ + # acc_reward, turn_info, turn_done = 0, {}, False
573
+ + # executed_actions = []
574
+ + # for action in actions:
575
+ + # _, reward, done, info = env.step(action)
576
+ + # acc_reward += reward
577
+ + # turn_info.update(info) # NOTE: currently use last info for multi-action
578
+ + # executed_actions.append(action)
579
+ + # if done:
580
+ + # turn_done = True
581
+ + # break
582
+ +
583
+ + # return acc_reward, turn_info, turn_done, executed_actions
584
+ def _execute_actions(env, actions):
585
+ - acc_reward, turn_info, turn_done = 0, {}, False
586
+ + acc_reward, turn_info, turn_done = 0.0, {}, False
587
+ + raw_acc_reward = 0.0
588
+ executed_actions = []
589
+ for action in actions:
590
+ _, reward, done, info = env.step(action)
591
+ - acc_reward += reward
592
+ + acc_reward += float(reward)
593
+ + try:
594
+ + raw_acc_reward += float(info.get('raw_reward', 0.0))
595
+ + except Exception:
596
+ + pass
597
+ turn_info.update(info) # NOTE: currently use last info for multi-action
598
+ executed_actions.append(action)
599
+ if done:
600
+ turn_done = True
601
+ break
602
+ -
603
+ + # Overwrite per-turn raw_reward to reflect the sum across all executed actions in this turn
604
+ + try:
605
+ + turn_info['raw_reward'] = float(raw_acc_reward)
606
+ + except Exception:
607
+ + pass
608
+ return acc_reward, turn_info, turn_done, executed_actions
609
+
610
+ def _log_env_state(status, history, cur_obs, max_actions_per_traj, executed_actions, all_actions, acc_reward, turn_done, turn_info, env_input):
611
+ @@ -198,6 +220,18 @@ class EnvStateManager:
612
+ 'success': float(status.terminated and (not status.truncated)),
613
+ 'num_actions': status.num_actions,
614
+ }
615
+ + # Add episodic-level metrics
616
+ + # try:
617
+ + # # Sum of per-turn rewards equals the episodic return (env-shaped reward)
618
+ + # env_metric['episodic_return'] = float(sum(status.rewards))
619
+ + # except Exception:
620
+ + # pass
621
+ + try:
622
+ + # Final max tile on the board at the end of the rollout
623
+ + import numpy as _np
624
+ + env_metric['max_tile'] = int(_np.max(entry['env'].grid))
625
+ + except Exception:
626
+ + pass
627
+ custom_metric = {}
628
+ for turn in cache['history']:
629
+ for k, v in turn.get('info', {}).items():
630
+ @@ -212,6 +246,12 @@ class EnvStateManager:
631
+ "Skipping non-numeric metric '%s' with value %r for env %s.",
632
+ k, v, entry['tag']
633
+ )
634
+ + # Add episodic_return as the SUM of raw_reward across steps (align with CleanRL)
635
+ + try:
636
+ + if 'raw_reward' in custom_metric:
637
+ + env_metric['episodic_return'] = float(np.sum(custom_metric['raw_reward']))
638
+ + except Exception:
639
+ + pass
640
+ for k, v in custom_metric.items():
641
+ # TODO: Move TURN_LVL_METRICS into the environment
642
+ if "webshop" not in cache['tag'].lower() or ("webshop" in cache['tag'].lower() and k in TURN_LVL_METRICS):
643
+ @@ -219,7 +259,12 @@ class EnvStateManager:
644
+ else:
645
+ env_metric['traj_sum/' + k] = np.sum(v)
646
+
647
+ -
648
+ + try:
649
+ + if 'score' in custom_metric and len(custom_metric['score']) > 0:
650
+ + env_metric['final_score'] = float(custom_metric['score'][-1])
651
+ + except Exception:
652
+ + pass
653
+ +
654
+ cache['history'][-1]['metrics'] = custom_metric
655
+ env_metric = {f"{entry['tag']}/{k}": v for k, v in env_metric.items()}
656
+ cache['metrics'] = env_metric
657
+ diff --git a/requirements.txt b/requirements.txt
658
+ index 2fd756e..9b521bf 100644
659
+ --- a/requirements.txt
660
+ +++ b/requirements.txt
661
+ @@ -7,7 +7,6 @@ accelerate
662
+ codetiming
663
+ datasets
664
+ dill
665
+ -flash-attn==2.7.4.post1
666
+ hydra-core
667
+ numpy
668
+ pandas
669
+ @@ -15,19 +14,19 @@ pybind11
670
+ ray>=2.10
671
+ tensordict>=0.8.0,<0.9.0
672
+ transformers
673
+ -vllm==0.8.2
674
+ +vllm==0.8.5
675
+ wandb
676
+ gymnasium
677
+ gymnasium[toy-text]
678
+
679
+ pyarrow>=15.0.0
680
+ pylatexenc
681
+ -torchdata
682
+ +# torchdata
683
+ debugpy
684
+
685
+ together
686
+ anthropic
687
+ -faiss-cpu==1.11.0
688
+ +faiss-gpu
689
+
690
+ # This is optional, but needs to be installed with main requirements if you want to use webshop
691
+ -r external/webshop-minimal/requirements.txt
692
+ diff --git a/scripts/setup_ragen.sh b/scripts/setup_ragen.sh
693
+ index f9a7cd9..85a93c4 100644
694
+ --- a/scripts/setup_ragen.sh
695
+ +++ b/scripts/setup_ragen.sh
696
+ @@ -94,10 +94,10 @@ main() {
697
+ pip install torch==2.5.0 --index-url https://download.pytorch.org/whl/cu124
698
+
699
+ print_step "Installing flash-attention..."
700
+ - pip3 install flash-attn==2.7.4.post1 --no-build-isolation
701
+ + # pip3 install flash-attn==2.7.4.post1 --no-build-isolation
702
+ else
703
+ print_step "Installing PyTorch without CUDA support..."
704
+ - pip install torch==2.5.0
705
+ + pip install torch==2.4.0
706
+ fi
707
+
708
+ # Install remaining requirements
709
+ @@ -137,8 +137,8 @@ main() {
710
+ conda install conda-forge::gdown
711
+ mkdir -p external/webshop-minimal/webshop_minimal/data/full
712
+ cd external/webshop-minimal/webshop_minimal/data/full
713
+ - gdown https://drive.google.com/uc?id=1A2whVgOO0euk5O13n2iYDM0bQRkkRduB # items_shuffle
714
+ - gdown https://drive.google.com/uc?id=1s2j6NgHljiZzQNL3veZaAiyW_qDEgBNi # items_ins_v2
715
+ + # gdown https://drive.google.com/uc?id=1A2whVgOO0euk5O13n2iYDM0bQRkkRduB # items_shuffle
716
+ + # gdown https://drive.google.com/uc?id=1s2j6NgHljiZzQNL3veZaAiyW_qDEgBNi # items_ins_v2
717
+ cd ../../../../..
718
+
719
+ echo -e "${GREEN}Installation completed successfully!${NC}"
720
+ diff --git a/train_all.sh b/train_all.sh
721
+ index 0157306..33035f5 100755
722
+ --- a/train_all.sh
723
+ +++ b/train_all.sh
724
+ @@ -6,246 +6,257 @@ USE_GRPO="algorithm.adv_estimator=grpo"
725
+ USE_PPO="algorithm.adv_estimator=gae" # by default.
726
+ USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
727
+
728
+ +
729
+ +# python train.py --config-name _8_2048 system.CUDA_VISIBLE_DEVICES="'0,1,2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=game_2048 $USE_PPO $USE_BASE
730
+ +
731
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'0,1'" trainer.project_name=ragen_latest_qwen_05B_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=rubikscube-1 $USE_PPO $USE_BASE
732
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-1.5B-Instruct trainer.experiment_name=rubikscube-2 $USE_PPO $USE_BASE
733
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'4,5'" trainer.project_name=ragen_latest_qwen_25_3b_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-3B-Instruct trainer.experiment_name=rubikscube-2 $USE_PPO $USE_BASE
734
+ +python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'6,7'" trainer.project_name=ragen_latest_qwen_05B_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=rubikscube-3 $USE_PPO $USE_BASE
735
+ +
736
+ # Section 3.1&3.2 - General Observations
737
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-ppo $USE_PPO $USE_BASE &
738
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-grpo $USE_GRPO $USE_BASE &
739
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE &
740
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-grpo $USE_GRPO $USE_BASE &
741
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozen_lake-ppo $USE_PPO $USE_BASE &
742
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozen_lake-grpo $USE_GRPO $USE_BASE &
743
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="'6,7'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=bandit-ppo-multitask $USE_PPO $USE_BASE &
744
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="'7'" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-ppo-frommlp $USE_PPO $USE_BASE
745
+
746
+ -# Section 4.1 - Filtering and critic
747
+ -# 0.25
748
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.25 actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
749
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
750
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
751
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
752
+ -
753
+ -wait
754
+ -
755
+ -# 0.5
756
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-ppo-rolloutfilter0.5 actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
757
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
758
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
759
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
760
+ -
761
+ -# 0.75
762
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.75 actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
763
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
764
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
765
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
766
+ -
767
+ -wait
768
+ -
769
+ -# Section 4.2 - Ablation on Critic/ClipHigh/KL. Start from Basic and add more components. The best setting for StarPO in agent is rollout_filter+Critic+Cliphigh+NoKL
770
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
771
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
772
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
773
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
774
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozenlake-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
775
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozenlake-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
776
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozenlake-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
777
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozenlake-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
778
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="'0,1'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=sokoban-ppo-box1-multitask $USE_PPO $USE_BASE
779
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-grpo $USE_GRPO $USE_BASE &
780
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
781
+
782
+ -wait
783
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'4,5,6,7'" trainer.project_name=ragen_latest_qwen_25_3b_it trainer.n_gpus_per_node=4 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_3B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
784
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'4,5,6,7'" trainer.n_gpus_per_node=4 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
785
+
786
+ -# Section 5.1 - Reasoning Helps Generalization
787
+ +# # Section 4.1 - Filtering and critic
788
+ +# # 0.25
789
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.25 actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
790
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
791
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
792
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
793
+
794
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-generalization \
795
+ - custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
796
+ - custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
797
+ - custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
798
+ - custom_envs.BanditTest.env_config.hi_arm_name="Librarian"
799
+ +# wait
800
+
801
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-generalization-nothink \
802
+ - custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
803
+ - custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
804
+ - custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
805
+ - custom_envs.BanditTest.env_config.hi_arm_name="Librarian" \
806
+ - agent_proxy.enable_think=False
807
+ +# # 0.5
808
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-ppo-rolloutfilter0.5 actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
809
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
810
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
811
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
812
+ +
813
+ +# # 0.75
814
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.75 actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
815
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
816
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
817
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
818
+
819
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=bandit-generalization-rev \
820
+ - custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
821
+ - custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
822
+ - custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
823
+ - custom_envs.BanditTest.env_config.hi_arm_name="Trader"
824
+ +# wait
825
+
826
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=bandit-generalization-rev-nothink \
827
+ - custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
828
+ - custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
829
+ - custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
830
+ - custom_envs.BanditTest.env_config.hi_arm_name="Trader" \
831
+ - agent_proxy.enable_think=False
832
+ +# # Section 4.2 - Ablation on Critic/ClipHigh/KL. Start from Basic and add more components. The best setting for StarPO in agent is rollout_filter+Critic+Cliphigh+NoKL
833
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
834
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
835
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
836
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
837
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozenlake-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
838
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozenlake-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
839
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozenlake-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
840
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozenlake-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
841
+
842
+ +# wait
843
+
844
+ -SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
845
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization micro_batch_size_per_gpu=8 model_path=Qwen/Qwen2.5-1.5B-Instruct&
846
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-generalization-nothink $SOKOBAN_GENERALIZATION_CONFIG agent_proxy.enable_think=False &
847
+ +# # Section 5.1 - Reasoning Helps Generalization
848
+
849
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-generalization \
850
+ +# custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
851
+ +# custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
852
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
853
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Librarian"
854
+
855
+ -# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=128 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SokobanDifferentGridVocab] es_manager.val.env_configs.n_groups=[128]"
856
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG &
857
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-generalization-nothink \
858
+ +# custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
859
+ +# custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
860
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
861
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Librarian" \
862
+ +# agent_proxy.enable_think=False
863
+
864
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=bandit-generalization-rev \
865
+ +# custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
866
+ +# custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
867
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
868
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Trader"
869
+
870
+ -# COMPOSITIONALITY_CONFIG="es_manager.train.env_groups=16 es_manager.train.env_configs.tags=[Bandit,SimpleSokoban] es_manager.train.env_configs.n_groups=[8,8] es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[Bandit,SimpleSokoban,LargerSokoban,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128] actor_rollout_ref.rollout.rollout_filter_ratio=1" # NOTE that we don't filter out low-var rollout in this setting
871
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=compositional-generalization $COMPOSITIONALITY_CONFIG &
872
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=compositional-generalization-nothink $COMPOSITIONALITY_CONFIG agent_proxy.enable_think=False &
873
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=bandit-generalization-rev-nothink \
874
+ +# custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
875
+ +# custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
876
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
877
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Trader" \
878
+ +# agent_proxy.enable_think=False
879
+
880
+ -wait
881
+
882
+ -# Section 5.2 - what leads to better reasoning?
883
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B-Instruct &
884
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B-Instruct &
885
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct trainer.n_gpus_per_node=2 &
886
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B-Instruct trainer.n_gpus_per_node=4 &
887
+ +# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
888
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization micro_batch_size_per_gpu=8 model_path=Qwen/Qwen2.5-1.5B-Instruct&
889
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-generalization-nothink $SOKOBAN_GENERALIZATION_CONFIG agent_proxy.enable_think=False &
890
+
891
+ -wait
892
+
893
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B &
894
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B &
895
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B &
896
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B &
897
+ +# # SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=128 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SokobanDifferentGridVocab] es_manager.val.env_configs.n_groups=[128]"
898
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG &
899
+
900
+ -wait
901
+
902
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-7B &
903
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B &
904
+ +# # COMPOSITIONALITY_CONFIG="es_manager.train.env_groups=16 es_manager.train.env_configs.tags=[Bandit,SimpleSokoban] es_manager.train.env_configs.n_groups=[8,8] es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[Bandit,SimpleSokoban,LargerSokoban,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128] actor_rollout_ref.rollout.rollout_filter_ratio=1" # NOTE that we don't filter out low-var rollout in this setting
905
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=compositional-generalization $COMPOSITIONALITY_CONFIG &
906
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=compositional-generalization-nothink $COMPOSITIONALITY_CONFIG agent_proxy.enable_think=False &
907
+
908
+ +# wait
909
+
910
+ -wait
911
+ +# # Section 5.2 - what leads to better reasoning?
912
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B-Instruct &
913
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B-Instruct &
914
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct trainer.n_gpus_per_node=2 &
915
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B-Instruct trainer.n_gpus_per_node=4 &
916
+
917
+ -# Section 6.1 varying action count
918
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-action-count-1 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=5 custom_envs.LargerSokoban.max_actions_per_traj=5 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=5 custom_envs.FrozenLake.max_actions_per_traj=5 agent_proxy.max_actions_per_turn=1 &
919
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-action-count-2 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=10 custom_envs.LargerSokoban.max_actions_per_traj=10 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=10 custom_envs.FrozenLake.max_actions_per_traj=10 agent_proxy.max_actions_per_turn=2 &
920
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-action-count-3 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=15 custom_envs.LargerSokoban.max_actions_per_traj=15 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=15 custom_envs.FrozenLake.max_actions_per_traj=15 agent_proxy.max_actions_per_turn=3 &
921
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-action-count-4 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=20 custom_envs.LargerSokoban.max_actions_per_traj=20 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=20 custom_envs.FrozenLake.max_actions_per_traj=20 agent_proxy.max_actions_per_turn=4 &
922
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-action-count-5 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=25 custom_envs.LargerSokoban.max_actions_per_traj=25 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=25 custom_envs.FrozenLake.max_actions_per_traj=25 agent_proxy.max_actions_per_turn=5 &
923
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-action-count-6 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=30 custom_envs.LargerSokoban.max_actions_per_traj=30 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=30 custom_envs.FrozenLake.max_actions_per_traj=30 agent_proxy.max_actions_per_turn=6 &
924
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-action-count-7 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=35 custom_envs.LargerSokoban.max_actions_per_traj=35 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=35 custom_envs.FrozenLake.max_actions_per_traj=35 agent_proxy.max_actions_per_turn=7 &
925
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-action-count-8 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=40 custom_envs.LargerSokoban.max_actions_per_traj=40 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=40 custom_envs.FrozenLake.max_actions_per_traj=40 agent_proxy.max_actions_per_turn=8 &
926
+ +# wait
927
+
928
+ -# section 6.2 Varying prompt diversity
929
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-prompt-diversity-4 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=4 es_manager.train.group_size=32 es_manager.train.env_configs.n_groups=[4] &
930
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-prompt-diversity-8 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] &
931
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-prompt-diversity-16 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=8 es_manager.train.env_configs.n_groups=[16] &
932
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-prompt-diversity-32 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=32 es_manager.train.group_size=4 es_manager.train.env_configs.n_groups=[32] &
933
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-prompt-diversity-64 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=64 es_manager.train.group_size=2 es_manager.train.env_configs.n_groups=[64] &
934
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-prompt-diversity-128 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=128 es_manager.train.group_size=1 es_manager.train.env_configs.n_groups=[128] &
935
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B &
936
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B &
937
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B &
938
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B &
939
+
940
+ -wait
941
+ +# wait
942
+
943
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-online-2 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[16] trainer.total_training_steps=100 trainer.test_freq=5 &
944
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-7B &
945
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B &
946
+
947
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-online-5 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=40 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[40] trainer.total_training_steps=40 trainer.test_freq=2 &
948
+
949
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-online-10 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=80 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[80] trainer.total_training_steps=80 trainer.test_freq=1 &
950
+ +# wait
951
+
952
+ +# # Section 6.1 varying action count
953
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-action-count-1 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=5 custom_envs.LargerSokoban.max_actions_per_traj=5 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=5 custom_envs.FrozenLake.max_actions_per_traj=5 agent_proxy.max_actions_per_turn=1 &
954
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-action-count-2 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=10 custom_envs.LargerSokoban.max_actions_per_traj=10 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=10 custom_envs.FrozenLake.max_actions_per_traj=10 agent_proxy.max_actions_per_turn=2 &
955
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-action-count-3 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=15 custom_envs.LargerSokoban.max_actions_per_traj=15 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=15 custom_envs.FrozenLake.max_actions_per_traj=15 agent_proxy.max_actions_per_turn=3 &
956
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-action-count-4 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=20 custom_envs.LargerSokoban.max_actions_per_traj=20 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=20 custom_envs.FrozenLake.max_actions_per_traj=20 agent_proxy.max_actions_per_turn=4 &
957
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-action-count-5 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=25 custom_envs.LargerSokoban.max_actions_per_traj=25 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=25 custom_envs.FrozenLake.max_actions_per_traj=25 agent_proxy.max_actions_per_turn=5 &
958
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-action-count-6 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=30 custom_envs.LargerSokoban.max_actions_per_traj=30 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=30 custom_envs.FrozenLake.max_actions_per_traj=30 agent_proxy.max_actions_per_turn=6 &
959
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-action-count-7 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=35 custom_envs.LargerSokoban.max_actions_per_traj=35 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=35 custom_envs.FrozenLake.max_actions_per_traj=35 agent_proxy.max_actions_per_turn=7 &
960
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-action-count-8 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=40 custom_envs.LargerSokoban.max_actions_per_traj=40 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=40 custom_envs.FrozenLake.max_actions_per_traj=40 agent_proxy.max_actions_per_turn=8 &
961
+
962
+ +# # section 6.2 Varying prompt diversity
963
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-prompt-diversity-4 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=4 es_manager.train.group_size=32 es_manager.train.env_configs.n_groups=[4] &
964
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-prompt-diversity-8 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] &
965
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-prompt-diversity-16 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=8 es_manager.train.env_configs.n_groups=[16] &
966
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-prompt-diversity-32 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=32 es_manager.train.group_size=4 es_manager.train.env_configs.n_groups=[32] &
967
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-prompt-diversity-64 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=64 es_manager.train.group_size=2 es_manager.train.env_configs.n_groups=[64] &
968
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-prompt-diversity-128 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=128 es_manager.train.group_size=1 es_manager.train.env_configs.n_groups=[128] &
969
+
970
+ +# wait
971
+
972
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-online-2 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[16] trainer.total_training_steps=100 trainer.test_freq=5 &
973
+
974
+ -# Extension: Training 7B reasoning model
975
+ -SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
976
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct-largescale $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] micro_batch_size_per_gpu=8 ppo_mini_batch_size=64 actor_rollout_ref.rollout.response_length=1024 actor_rollout_ref.rollout.max_model_len=6400 trainer.test_freq=5 actor_rollout_ref.rollout.max_num_batched_tokens=24000 micro_batch_size_per_gpu=2 actor_rollout_ref.rollout.rollout_filter_ratio=1 &
977
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-online-5 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=40 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[40] trainer.total_training_steps=40 trainer.test_freq=2 &
978
+
979
+ -python -m ragen.llm_agent.agent_proxy model_path=Qwen/Qwen2.5-3B-Instruct system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 actor_rollout_ref.rollout.tensor_model_parallel_size=4 actor_rollout_ref.rollout.response_length=2048 actor_rollout_ref.rollout.max_model_len=12800
980
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-online-10 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=80 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[80] trainer.total_training_steps=80 trainer.test_freq=1 &
981
+
982
+ -# trainer.save_freq=50 trainer.default_local_dir=/mnt/local/cache/exp_name
983
+
984
+ -# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
985
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization &
986
+
987
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/bandit-generalization &
988
+
989
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=frozenlake-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/frozenlake-generalization &
990
+
991
+ +# # Extension: Training 7B reasoning model
992
+ +# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
993
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct-largescale $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] micro_batch_size_per_gpu=8 ppo_mini_batch_size=64 actor_rollout_ref.rollout.response_length=1024 actor_rollout_ref.rollout.max_model_len=6400 trainer.test_freq=5 actor_rollout_ref.rollout.max_num_batched_tokens=24000 micro_batch_size_per_gpu=2 actor_rollout_ref.rollout.rollout_filter_ratio=1 &
994
+
995
+ +# python -m ragen.llm_agent.agent_proxy model_path=Qwen/Qwen2.5-3B-Instruct system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 actor_rollout_ref.rollout.tensor_model_parallel_size=4 actor_rollout_ref.rollout.response_length=2048 actor_rollout_ref.rollout.max_model_len=12800
996
+
997
+ +# # trainer.save_freq=50 trainer.default_local_dir=/mnt/local/cache/exp_name
998
+
999
+ -# USE_PPO="algorithm.adv_estimator=gae" # by default.
1000
+ -# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1001
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE ppo_mini_batch_size=64 enable_response_mask=True &
1002
+ +# # USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1003
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization &
1004
+
1005
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/bandit-generalization &
1006
+
1007
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std &
1008
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=frozenlake-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/frozenlake-generalization &
1009
+
1010
+ -# enable_response_mask: False
1011
+ -# grpo_advantage_length_weight: True
1012
+
1013
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo-1-5b algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std agent_proxy.max_actions_per_turn=5 custom_envs.SimpleSokoban.max_actions_per_traj=25 enable_response_mask=True grpo_advantage_length_weight=False model_path=Qwen/Qwen2.5-1.5B-Instruct &
1014
+
1015
+
1016
+ -# extension: 7B with lora. Currently NOT recommended to use lora: within current version of vllm, this could result in rollouts slower than non-lora by 100%
1017
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-7B-Instruct trainer.experiment_name=sokoban_7b_instruct_lora_newversion lora.rank=16
1018
+ +# # USE_PPO="algorithm.adv_estimator=gae" # by default.
1019
+ +# # USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1020
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE ppo_mini_batch_size=64 enable_response_mask=True &
1021
+
1022
+ -# extension: bi-level gae
1023
+ -python train.py trainer.experiment_name=sokoban-bi-level-gae-final \
1024
+ - system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
1025
+ - model_path=Qwen/Qwen2.5-0.5B-Instruct \
1026
+ - algorithm.bi_level_gae=True algorithm.high_level_gamma=0.95 \
1027
+ - agent_proxy.use_turn_scores=True \
1028
+ - actor_rollout_ref.rollout.tp_size_check=False
1029
+
1030
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std &
1031
+
1032
+ -# extension: webshop
1033
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1034
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1035
+ - trainer.experiment_name=webshop-3b-ppo-s $USE_PPO \
1036
+ - trainer.nnodes=1 &
1037
+ +# # enable_response_mask: False
1038
+ +# # grpo_advantage_length_weight: True
1039
+
1040
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo-1-5b algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std agent_proxy.max_actions_per_turn=5 custom_envs.SimpleSokoban.max_actions_per_traj=25 enable_response_mask=True grpo_advantage_length_weight=False model_path=Qwen/Qwen2.5-1.5B-Instruct &
1041
+
1042
+ -USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1043
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1044
+ - trainer.experiment_name=webshop-3b-grpo-s $USE_GRPO \
1045
+ - trainer.nnodes=1 &
1046
+
1047
+ -# StarPO ppo
1048
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1049
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1050
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1051
+ - trainer.experiment_name=webshop-3b-ppo $USE_PPO $USE_BASE \
1052
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1053
+ - trainer.nnodes=1 &
1054
+ +# # extension: 7B with lora. Currently NOT recommended to use lora: within current version of vllm, this could result in rollouts slower than non-lora by 100%
1055
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-7B-Instruct trainer.experiment_name=sokoban_7b_instruct_lora_newversion lora.rank=16
1056
+
1057
+ -# StarPO grpo
1058
+ -USE_GRPO="algorithm.adv_estimator=grpo"
1059
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1060
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1061
+ - trainer.experiment_name=webshop-3b-grpo $USE_GRPO $USE_BASE \
1062
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1063
+ - trainer.nnodes=1 &
1064
+ +# # extension: bi-level gae
1065
+ +# python train.py trainer.experiment_name=sokoban-bi-level-gae-final \
1066
+ +# system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
1067
+ +# model_path=Qwen/Qwen2.5-0.5B-Instruct \
1068
+ +# algorithm.bi_level_gae=True algorithm.high_level_gamma=0.95 \
1069
+ +# agent_proxy.use_turn_scores=True \
1070
+ +# actor_rollout_ref.rollout.tp_size_check=False
1071
+
1072
+
1073
+ -# normal:sokoban
1074
+ -# extension: sokoban
1075
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1076
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1077
+ - trainer.experiment_name=sokoban-3b-ppo-s $USE_PPO \
1078
+ - trainer.nnodes=1 &
1079
+ +# # extension: webshop
1080
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1081
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1082
+ +# trainer.experiment_name=webshop-3b-ppo-s $USE_PPO \
1083
+ +# trainer.nnodes=1 &
1084
+
1085
+
1086
+ -USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1087
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1088
+ - trainer.experiment_name=sokoban-3b-grpo-s $USE_GRPO \
1089
+ - trainer.nnodes=1 &
1090
+ +# USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1091
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1092
+ +# trainer.experiment_name=webshop-3b-grpo-s $USE_GRPO \
1093
+ +# trainer.nnodes=1 &
1094
+
1095
+ -# StarPO ppo
1096
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1097
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1098
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1099
+ - trainer.experiment_name=sokoban-3b-ppo $USE_PPO $USE_BASE \
1100
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1101
+ - trainer.nnodes=1 &
1102
+ +# # StarPO ppo
1103
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1104
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1105
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1106
+ +# trainer.experiment_name=webshop-3b-ppo $USE_PPO $USE_BASE \
1107
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1108
+ +# trainer.nnodes=1 &
1109
+
1110
+ -# StarPO grpo
1111
+ -USE_GRPO="algorithm.adv_estimator=grpo"
1112
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1113
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1114
+ - trainer.experiment_name=sokoban-3b-grpo $USE_GRPO $USE_BASE \
1115
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1116
+ - trainer.nnodes=1 &
1117
+ +# # StarPO grpo
1118
+ +# USE_GRPO="algorithm.adv_estimator=grpo"
1119
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1120
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1121
+ +# trainer.experiment_name=webshop-3b-grpo $USE_GRPO $USE_BASE \
1122
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1123
+ +# trainer.nnodes=1 &
1124
+ +
1125
+ +
1126
+ +# # normal:sokoban
1127
+ +# # extension: sokoban
1128
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1129
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1130
+ +# trainer.experiment_name=sokoban-3b-ppo-s $USE_PPO \
1131
+ +# trainer.nnodes=1 &
1132
+ +
1133
+ +
1134
+ +# USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1135
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1136
+ +# trainer.experiment_name=sokoban-3b-grpo-s $USE_GRPO \
1137
+ +# trainer.nnodes=1 &
1138
+ +
1139
+ +# # StarPO ppo
1140
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1141
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1142
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1143
+ +# trainer.experiment_name=sokoban-3b-ppo $USE_PPO $USE_BASE \
1144
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1145
+ +# trainer.nnodes=1 &
1146
+ +
1147
+ +# # StarPO grpo
1148
+ +# USE_GRPO="algorithm.adv_estimator=grpo"
1149
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1150
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1151
+ +# trainer.experiment_name=sokoban-3b-grpo $USE_GRPO $USE_BASE \
1152
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1153
+ +# trainer.nnodes=1 &
1154
+
1155
+
1156
+
1157
+ -python train.py \
1158
+ - trainer.experiment_name=3b-full-ppo-test system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2
1159
+
1160
+ +# python train.py \
1161
+ +# trainer.experiment_name=3b-full-ppo-test system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2
1162
+
wandb/run-20251218_182448-on6j4c96/files/requirements.txt ADDED
@@ -0,0 +1,315 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ colorama==0.4.6
2
+ psutil==7.1.2
3
+ ragen==0.1
4
+ ragen==0.1
5
+ setuptools==80.9.0
6
+ wheel==0.45.1
7
+ pip==25.3
8
+ ragen==0.1
9
+ pytz==2025.2
10
+ nvidia-cusparselt-cu12==0.6.2
11
+ mpmath==1.3.0
12
+ typing_extensions==4.15.0
13
+ sympy==1.13.1
14
+ pylatexenc==2.10
15
+ nvidia-cusolver-cu12==11.6.1.9
16
+ numpy==1.26.4
17
+ Markdown==3.10
18
+ absl-py==2.3.1
19
+ pyasn1_modules==0.4.2
20
+ Werkzeug==3.1.3
21
+ networkx==3.3
22
+ MarkupSafe==2.1.5
23
+ fsspec==2025.9.0
24
+ filelock==3.19.1
25
+ nvidia-cudnn-cu12==9.1.0.70
26
+ Jinja2==3.1.6
27
+ tensorboard==2.20.0
28
+ triton==3.2.0
29
+ pillow==11.3.0
30
+ xxhash==3.6.0
31
+ nvidia-nvtx-cu12==12.4.127
32
+ nvidia-nvjitlink-cu12==12.4.127
33
+ nvidia-nccl-cu12==2.21.5
34
+ nvidia-curand-cu12==10.3.5.147
35
+ wrapt==2.0.1
36
+ nvidia-cufft-cu12==11.2.1.3
37
+ pyjnius==1.7.0
38
+ nvidia-cuda-runtime-cu12==12.4.127
39
+ nvidia-cuda-nvrtc-cu12==12.4.127
40
+ websockets==15.0.1
41
+ nvidia-cuda-cupti-cu12==12.4.127
42
+ zipp==3.23.0
43
+ nvidia-cublas-cu12==12.4.5.8
44
+ nvidia-cusparse-cu12==12.3.1.170
45
+ flash_attn==2.8.3
46
+ rsa==4.9.1
47
+ einops==0.8.1
48
+ py-cpuinfo==9.0.0
49
+ pure_eval==0.2.3
50
+ ptyprocess==0.7.0
51
+ gym-notices==0.1.0
52
+ flatbuffers==25.9.23
53
+ fastrlock==0.8.3
54
+ Farama-Notifications==0.0.4
55
+ faiss-gpu==1.7.2
56
+ antlr4-python3-runtime==4.9.3
57
+ wcwidth==0.2.14
58
+ wasabi==1.1.3
59
+ uvloop==0.22.1
60
+ urllib3==2.5.0
61
+ tzdata==2025.2
62
+ typing-inspection==0.4.2
63
+ traitlets==5.14.3
64
+ tqdm==4.67.1
65
+ tomli==2.3.0
66
+ threadpoolctl==3.6.0
67
+ tenacity==9.1.2
68
+ tabulate==0.9.0
69
+ spacy-loggers==1.0.5
70
+ spacy-legacy==3.0.12
71
+ soupsieve==2.8
72
+ sniffio==1.3.1
73
+ smmap==5.0.2
74
+ six==1.17.0
75
+ shellingham==1.5.4
76
+ sentencepiece==0.2.1
77
+ scipy==1.15.3
78
+ safetensors==0.6.2
79
+ rpds-py==0.29.0
80
+ rignore==0.7.6
81
+ regex==2025.11.3
82
+ RapidFuzz==3.14.3
83
+ rank-bm25==0.2.2
84
+ pyzmq==27.1.0
85
+ PyYAML==6.0.3
86
+ pytokens==0.3.0
87
+ python-multipart==0.0.20
88
+ python-json-logger==4.0.0
89
+ python-dotenv==1.2.1
90
+ PySocks==1.7.1
91
+ pyparsing==3.2.5
92
+ PyJWT==2.10.1
93
+ Pygments==2.19.2
94
+ pygame==2.6.1
95
+ pydantic_core==2.41.5
96
+ pycparser==2.23
97
+ pycountry==24.6.1
98
+ pybind11==3.0.1
99
+ pyarrow==22.0.0
100
+ psutil==7.1.3
101
+ protobuf==4.25.8
102
+ propcache==0.4.1
103
+ prometheus_client==0.23.1
104
+ platformdirs==4.5.0
105
+ pexpect==4.9.0
106
+ pathspec==0.12.1
107
+ partial-json-parser==0.2.1.1.post6
108
+ parso==0.8.5
109
+ packaging==25.0
110
+ orjson==3.11.4
111
+ opentelemetry-semantic-conventions-ai==0.4.13
112
+ opencv-python-headless==4.12.0.88
113
+ ninja==1.13.0
114
+ nest-asyncio==1.6.0
115
+ mypy_extensions==1.1.0
116
+ murmurhash==1.0.15
117
+ multidict==6.7.0
118
+ msgspec==0.19.0
119
+ msgpack==1.1.2
120
+ mdurl==0.1.2
121
+ loguru==0.7.3
122
+ llvmlite==0.44.0
123
+ llguidance==0.7.30
124
+ lark==1.2.2
125
+ kiwisolver==1.4.9
126
+ joblib==1.5.2
127
+ jiter==0.12.0
128
+ itsdangerous==2.2.0
129
+ interegular==0.3.3
130
+ ImageIO==2.37.2
131
+ idna==3.11
132
+ humanfriendly==10.0
133
+ httpx-sse==0.4.3
134
+ httptools==0.7.1
135
+ html2text==2025.4.15
136
+ hf-xet==1.2.0
137
+ h11==0.16.0
138
+ grpcio==1.76.0
139
+ frozenlist==1.8.0
140
+ fonttools==4.60.1
141
+ executing==2.2.1
142
+ exceptiongroup==1.3.0
143
+ eval_type_backport==0.2.2
144
+ docstring_parser==0.17.0
145
+ dnspython==2.8.0
146
+ distro==1.9.0
147
+ diskcache==5.6.3
148
+ dill==0.4.0
149
+ decorator==5.2.1
150
+ debugpy==1.8.17
151
+ Cython==3.2.1
152
+ cymem==2.0.13
153
+ cycler==0.12.1
154
+ cupy-cuda12x==13.6.0
155
+ contourpy==1.3.2
156
+ colorama==0.4.6
157
+ codetiming==1.4.0
158
+ cloudpickle==3.1.2
159
+ cloudpathlib==0.23.0
160
+ click==8.3.1
161
+ charset-normalizer==3.4.4
162
+ certifi==2025.11.12
163
+ catalogue==2.0.10
164
+ cachetools==6.2.2
165
+ blis==1.3.2
166
+ blinker==1.9.0
167
+ blake3==1.0.8
168
+ attrs==25.4.0
169
+ async-timeout==5.0.1
170
+ asttokens==3.0.1
171
+ astor==0.8.1
172
+ annotated-types==0.7.0
173
+ annotated-doc==0.0.4
174
+ airportsdata==20250909
175
+ aiohappyeyeballs==2.6.1
176
+ yarl==1.22.0
177
+ uvicorn==0.38.0
178
+ typer-slim==0.20.0
179
+ thefuzz==0.22.1
180
+ stack-data==0.6.3
181
+ srsly==2.5.1
182
+ smart_open==7.5.0
183
+ sentry-sdk==2.44.0
184
+ scikit-learn==1.7.2
185
+ requests==2.32.5
186
+ referencing==0.37.0
187
+ python-dateutil==2.9.0.post0
188
+ pydantic==2.12.4
189
+ prompt_toolkit==3.0.52
190
+ preshed==3.0.11
191
+ opentelemetry-proto==1.26.0
192
+ omegaconf==2.3.0
193
+ numba==0.61.2
194
+ nltk==3.9.2
195
+ multiprocess==0.70.18
196
+ matplotlib-inline==0.2.1
197
+ markdown-it-py==4.0.0
198
+ jedi==0.19.2
199
+ importlib_metadata==8.0.0
200
+ httpcore==1.0.9
201
+ gymnasium==1.2.2
202
+ gym==0.26.2
203
+ googleapis-common-protos==1.72.0
204
+ gitdb==4.0.12
205
+ gguf==0.17.1
206
+ Flask==3.1.2
207
+ faiss-cpu==1.13.0
208
+ email-validator==2.3.0
209
+ depyf==0.18.0
210
+ Deprecated==1.3.1
211
+ coloredlogs==15.0.1
212
+ cffi==2.0.0
213
+ black==25.11.0
214
+ beautifulsoup4==4.14.2
215
+ anyio==4.11.0
216
+ aiosignal==1.4.0
217
+ watchfiles==1.1.1
218
+ tiktoken==0.12.0
219
+ starlette==0.49.3
220
+ sse-starlette==3.0.3
221
+ rich==14.2.0
222
+ pydantic-settings==2.12.0
223
+ pydantic-extra-types==2.10.6
224
+ pandas==2.3.3
225
+ opentelemetry-exporter-otlp-proto-common==1.26.0
226
+ onnxruntime==1.23.2
227
+ matplotlib==3.10.7
228
+ lm-format-enforcer==0.10.12
229
+ jsonschema-specifications==2025.9.1
230
+ ipython==8.37.0
231
+ hydra-core==1.3.2
232
+ huggingface-hub==0.36.0
233
+ httpx==0.28.1
234
+ gym-sokoban==0.0.6
235
+ GitPython==3.1.45
236
+ cryptography==46.0.3
237
+ confection==0.1.5
238
+ cleantext==1.1.4
239
+ aiohttp==3.13.2
240
+ weasel==0.4.3
241
+ wandb==0.23.0
242
+ typer==0.19.2
243
+ virtualenv==20.35.4
244
+ pyasn1==0.6.1
245
+ torch==2.6.0
246
+ tokenizers==0.22.1
247
+ thinc==8.3.9
248
+ rich-toolkit==0.15.1
249
+ prometheus-fastapi-instrumentator==7.1.0
250
+ openai==2.8.0
251
+ jsonschema==4.25.1
252
+ gdown==5.2.0
253
+ fastapi==0.121.2
254
+ anthropic==0.73.0
255
+ xformers==0.0.29.post2
256
+ transformers==4.57.1
257
+ proto-plus==1.26.1
258
+ torchvision==0.21.0
259
+ torchdata==0.11.0
260
+ torchaudio==2.6.0
261
+ together==1.5.30
262
+ tensordict==0.8.3
263
+ spacy==3.8.9
264
+ ray==2.51.1
265
+ outlines_core==0.1.26
266
+ mistral_common==1.8.5
267
+ mcp==1.21.1
268
+ fastapi-cloud-cli==0.3.1
269
+ fastapi-cli==0.0.16
270
+ datasets==4.4.1
271
+ accelerate==1.11.0
272
+ xgrammar==0.1.18
273
+ pyserini==1.2.0
274
+ peft==0.18.0
275
+ outlines==0.1.11
276
+ opentelemetry-exporter-otlp-proto-http==1.26.0
277
+ opentelemetry-exporter-otlp-proto-grpc==1.26.0
278
+ kimina-client==0.2.1
279
+ compressed-tensors==0.9.3
280
+ opentelemetry-exporter-otlp==1.26.0
281
+ vllm==0.8.5
282
+ py-spy==0.4.1
283
+ opencensus-context==0.1.3
284
+ distlib==0.4.0
285
+ colorful==0.5.8
286
+ tensorboard-data-server==0.7.2
287
+ google-auth==2.43.0
288
+ google-api-core==2.28.1
289
+ aiohttp-cors==0.8.1
290
+ opentelemetry-exporter-prometheus==0.59b0
291
+ opencensus==0.11.4
292
+ verl==0.5.0.dev0
293
+ opentelemetry-api==1.38.0
294
+ opentelemetry-semantic-conventions==0.59b0
295
+ opentelemetry-sdk==1.38.0
296
+ typeguard==4.4.4
297
+ shtab==1.8.0
298
+ tyro==0.9.35
299
+ verl==0.5.0.dev0
300
+ autocommand==2.2.2
301
+ backports.tarfile==1.2.0
302
+ importlib_metadata==8.0.0
303
+ inflect==7.3.1
304
+ jaraco.collections==5.1.0
305
+ jaraco.context==5.3.0
306
+ jaraco.functools==4.0.1
307
+ jaraco.text==3.12.1
308
+ more-itertools==10.3.0
309
+ packaging==24.2
310
+ platformdirs==4.2.2
311
+ tomli==2.0.1
312
+ typeguard==4.3.0
313
+ typing_extensions==4.12.2
314
+ wheel==0.45.1
315
+ zipp==3.19.2
wandb/run-20251218_182448-on6j4c96/files/wandb-metadata.json ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "os": "Linux-5.14.0-284.25.1.el9_2.x86_64-x86_64-with-glibc2.35",
3
+ "python": "CPython 3.10.19",
4
+ "startedAt": "2025-12-18T10:24:48.379419Z",
5
+ "args": [
6
+ "--track"
7
+ ],
8
+ "program": "/mnt/general/wanghy/RAGEN/cleanrl/cleanrl/ppo_rubikscube.py",
9
+ "codePath": "cleanrl/cleanrl/ppo_rubikscube.py",
10
+ "codePathLocal": "cleanrl/cleanrl/ppo_rubikscube.py",
11
+ "git": {
12
+ "remote": "https://github.com/mll-lab-nu/RAGEN.git",
13
+ "commit": "8d73639b99b38265453f898b8d6af7d4af50d56e"
14
+ },
15
+ "email": "haoyu-wa22@mails.tsinghua.edu.cn",
16
+ "root": "/mnt/general/wanghy/RAGEN",
17
+ "host": "pt-4d654cf4576f4d23ad3d3919f12932fe-worker-0",
18
+ "executable": "/root/local/miniconda3/envs/ragen/bin/python",
19
+ "cpu_count": 64,
20
+ "cpu_count_logical": 128,
21
+ "gpu": "NVIDIA H100 80GB HBM3",
22
+ "gpu_count": 8,
23
+ "disk": {
24
+ "/": {
25
+ "total": "5153960755200",
26
+ "used": "447519776768"
27
+ }
28
+ },
29
+ "memory": {
30
+ "total": "2163642122240"
31
+ },
32
+ "gpu_nvidia": [
33
+ {
34
+ "name": "NVIDIA H100 80GB HBM3",
35
+ "memoryTotal": "85520809984",
36
+ "cudaCores": 16896,
37
+ "architecture": "Hopper",
38
+ "uuid": "GPU-35e2d43d-4067-82ce-90d4-def9e389bf28"
39
+ },
40
+ {
41
+ "name": "NVIDIA H100 80GB HBM3",
42
+ "memoryTotal": "85520809984",
43
+ "cudaCores": 16896,
44
+ "architecture": "Hopper",
45
+ "uuid": "GPU-af4135e3-88f2-e9ac-518d-502c75a85429"
46
+ },
47
+ {
48
+ "name": "NVIDIA H100 80GB HBM3",
49
+ "memoryTotal": "85520809984",
50
+ "cudaCores": 16896,
51
+ "architecture": "Hopper",
52
+ "uuid": "GPU-d7fdeeba-fe9b-ec03-d9f7-6724fe4266b5"
53
+ },
54
+ {
55
+ "name": "NVIDIA H100 80GB HBM3",
56
+ "memoryTotal": "85520809984",
57
+ "cudaCores": 16896,
58
+ "architecture": "Hopper",
59
+ "uuid": "GPU-ccc4f668-3882-5a8e-2c07-c5cd08f6f666"
60
+ },
61
+ {
62
+ "name": "NVIDIA H100 80GB HBM3",
63
+ "memoryTotal": "85520809984",
64
+ "cudaCores": 16896,
65
+ "architecture": "Hopper",
66
+ "uuid": "GPU-7b73c0cf-d3d5-e10c-7176-a43be1e41001"
67
+ },
68
+ {
69
+ "name": "NVIDIA H100 80GB HBM3",
70
+ "memoryTotal": "85520809984",
71
+ "cudaCores": 16896,
72
+ "architecture": "Hopper",
73
+ "uuid": "GPU-81b58d94-5d1f-8ec2-f9d2-fd56172ed177"
74
+ },
75
+ {
76
+ "name": "NVIDIA H100 80GB HBM3",
77
+ "memoryTotal": "85520809984",
78
+ "cudaCores": 16896,
79
+ "architecture": "Hopper",
80
+ "uuid": "GPU-03e8bc66-3b44-6794-49fd-5392fbdda6d1"
81
+ },
82
+ {
83
+ "name": "NVIDIA H100 80GB HBM3",
84
+ "memoryTotal": "85520809984",
85
+ "cudaCores": 16896,
86
+ "architecture": "Hopper",
87
+ "uuid": "GPU-b7cf0ec6-7c29-1179-dceb-09565da51890"
88
+ }
89
+ ],
90
+ "cudaVersion": "12.4",
91
+ "writerId": "ubi6kfhhs7rtnrt9cd5f40pg33djhcqy"
92
+ }
wandb/run-20251218_182448-on6j4c96/files/wandb-summary.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"train/learning_rate":0.00014497950819672133,"charts/avg_value":0.7843058109283447,"_timestamp":1.7660536514345365e+09,"perf/SPS":2659,"charts/SPS":2659,"rollout/success_rate":1,"train/clipfrac":0.010986328125,"losses/explained_variance":0.881138488650322,"losses/value_loss":0.0039942702278494835,"train/entropy":0.663025438785553,"losses/policy_loss":-0.015878867357969284,"train/success_rate":0.959349593495935,"train/old_approx_kl":0.0028039049357175827,"_step":421088,"rollout/ep_len_mean":2,"train/approx_kl":0.004338355734944344,"global_step":421088,"charts/progress":42.11065573770492,"train/policy_loss":-0.015878867357969284,"charts/avg_reward":0.23046875,"train/value_loss":0.0039942702278494835,"charts/train_success_rate":0.959349593495935,"_runtime":161.629565481,"_wandb":{"runtime":161},"rollout/ep_rew_mean":1}
wandb/run-20251218_182448-on6j4c96/run-on6j4c96.wandb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:19130985495cd09911e289e7a029663498c64b2387f18c738806c5dd26572f88
3
+ size 18939904
wandb/run-20251218_182745-ahjkdup0/files/code/cleanrl/cleanrl/ppo_rubikscube.py ADDED
@@ -0,0 +1,517 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PPO with small MLP for RAGEN Rubik's Cube 2x2 using the existing env (no env edits)
2
+ import os
3
+ import random
4
+ import time
5
+ from dataclasses import dataclass
6
+ from pathlib import Path
7
+ from typing import Tuple, Dict, Any, List
8
+ import json
9
+ import re
10
+
11
+ import gymnasium as gym
12
+ import numpy as np
13
+ import torch
14
+ import torch.nn as nn
15
+ import torch.optim as optim
16
+ import tyro
17
+ from torch.distributions.categorical import Categorical
18
+
19
+ import sys
20
+ sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../../'))
21
+
22
+ from ragen.env.rubikscube.env import RubiksCube2x2Env
23
+ from ragen.env.rubikscube.config import RubiksCube2x2Config
24
+
25
+
26
+ class RubiksCubeWrapper(gym.Env):
27
+ """
28
+ Adapter to use ragen RubiksCube2x2Env with Gymnasium vector API.
29
+ - Converts text observation to one-hot vector of 24 stickers x 6 colors.
30
+ - Maps agent actions [0..11] to env actions [1..12].
31
+ - Exposes proper observation_space and action_space.
32
+ """
33
+ metadata = {"render_modes": ["rgb_array", "human", "ansi"]}
34
+
35
+ def __init__(self, env: RubiksCube2x2Env):
36
+ super().__init__()
37
+ self._env = env
38
+ # 24 stickers, 6 colors -> one-hot size 144
39
+ self._colors = ['W', 'O', 'G', 'R', 'B', 'Y']
40
+ self._color_to_idx = {c: i for i, c in enumerate(self._colors)}
41
+ self.observation_space = gym.spaces.Box(low=0.0, high=1.0, shape=(24 * len(self._colors),), dtype=np.float32)
42
+ self.action_space = gym.spaces.Discrete(12)
43
+ # precompile regex to extract 4 letters within [X, X]\n [X, X]
44
+ # Lines look like: "Up (U): [W, W]\n [W, W]"
45
+ self._face_pat = re.compile(r"\[(?:\s*([A-Z])\s*,\s*([A-Z])\s*\])\n\s*\[(?:\s*([A-Z])\s*,\s*([A-Z])\s*\])")
46
+
47
+ def _encode_obs(self, text_obs: str) -> np.ndarray:
48
+ # Extract the six face blocks in the order U, L, F, R, B, D as rendered
49
+ faces_order = ["Up (U):", "Left (L):", "Front (F):", "Right (R):", "Back (B):", "Down (D):"]
50
+ onehots: List[int] = []
51
+ # Build a map from header to its block text
52
+ lines = text_obs.splitlines()
53
+ # Collect blocks starting after header line and including the next line for second row
54
+ i = 0
55
+ blocks: List[str] = []
56
+ while i < len(lines):
57
+ line = lines[i]
58
+ for header in faces_order:
59
+ if line.startswith(header):
60
+ # Join current line's bracketed pair and the next line (which contains the second pair)
61
+ # Remove the "Header:" prefix to keep only the bracket portions
62
+ content = line[len(header):].strip()
63
+ next_line = lines[i + 1] if i + 1 < len(lines) else ""
64
+ block = f"{content}\n{next_line}"
65
+ blocks.append(block)
66
+ break
67
+ i += 1
68
+ # Fallback: if regex fails, return zeros
69
+ if len(blocks) != 6:
70
+ return np.zeros(24 * len(self._colors), dtype=np.float32)
71
+ stickers: List[int] = []
72
+ for blk in blocks:
73
+ m = self._face_pat.search(blk)
74
+ if not m:
75
+ return np.zeros(24 * len(self._colors), dtype=np.float32)
76
+ # order: 0,1,2,3 per render() doc
77
+ c0, c1, c2, c3 = m.group(1), m.group(2), m.group(3), m.group(4)
78
+ stickers.extend([c0, c1, c2, c3])
79
+ # stickers now length 24; convert to one-hot
80
+ grid = np.zeros((24, len(self._colors)), dtype=np.float32)
81
+ for idx, ch in enumerate(stickers):
82
+ cidx = self._color_to_idx.get(ch, None)
83
+ if cidx is not None:
84
+ grid[idx, cidx] = 1.0
85
+ return grid.reshape(-1)
86
+
87
+ def reset(self, *, seed: int | None = None, options: Dict[str, Any] | None = None):
88
+ text_obs = self._env.reset(seed=seed)
89
+ obs = self._encode_obs(text_obs)
90
+ return obs, {}
91
+
92
+ def step(self, action: int):
93
+ mapped = int(action) + 1 # 0..11 -> 1..12
94
+ text_obs, reward, done, info = self._env.step(mapped)
95
+ obs = self._encode_obs(text_obs)
96
+ terminated = bool(done)
97
+ truncated = False
98
+ return obs, float(reward), terminated, truncated, info or {}
99
+
100
+ def render(self):
101
+ return self._env.render()
102
+
103
+ def close(self):
104
+ self._env.close()
105
+
106
+
107
+ @dataclass
108
+ class Args:
109
+ exp_name: str = os.path.basename(__file__)[: -len(".py")]
110
+ seed: int = 1
111
+ torch_deterministic: bool = True
112
+ cuda: bool = True
113
+ track: bool = True
114
+ wandb_project_name: str = "cleanRL"
115
+ wandb_entity: str | None = None
116
+ capture_video: bool = False
117
+
118
+ # Algorithm
119
+ env_id: str = "RubiksCube2x2"
120
+ total_timesteps: int = 1000_000
121
+ learning_rate: float = 2.5e-4
122
+ num_envs: int = 8
123
+ num_steps: int = 128
124
+ anneal_lr: bool = True
125
+ gamma: float = 0.99
126
+ gae_lambda: float = 0.95
127
+ num_minibatches: int = 4
128
+ update_epochs: int = 4
129
+ norm_adv: bool = True
130
+ clip_coef: float = 0.2
131
+ clip_vloss: bool = True
132
+ ent_coef: float = 0.01
133
+ vf_coef: float = 0.5
134
+ max_grad_norm: float = 0.5
135
+ target_kl: float | None = None
136
+
137
+ # Rubik specific
138
+ scramble_depth: int = 3
139
+ max_steps_env: int = 20
140
+
141
+ # runtime filled
142
+ batch_size: int = 0
143
+ minibatch_size: int = 0
144
+ num_iterations: int = 0
145
+ eval_splits: int = 2
146
+ eval_episodes: int = 4000
147
+
148
+
149
+ def make_env(idx, run_name, seed, scramble_depth, max_steps_env, capture_video=False):
150
+ def thunk():
151
+ config = RubiksCube2x2Config(scramble_depth=scramble_depth, max_steps=max_steps_env, render_mode='text')
152
+ env = RubiksCube2x2Env(config)
153
+ env = RubiksCubeWrapper(env)
154
+ env = gym.wrappers.TimeLimit(env, max_episode_steps=max_steps_env)
155
+ env = gym.wrappers.RecordEpisodeStatistics(env)
156
+ if capture_video and idx == 0:
157
+ env = gym.wrappers.RecordVideo(env, f"videos/{run_name}")
158
+ return env
159
+ return thunk
160
+
161
+
162
+ def layer_init(layer, std=np.sqrt(2), bias_const=0.0):
163
+ torch.nn.init.orthogonal_(layer.weight, std)
164
+ torch.nn.init.constant_(layer.bias, bias_const)
165
+ return layer
166
+
167
+
168
+ class Agent(nn.Module):
169
+ def __init__(self, envs):
170
+ super().__init__()
171
+ obs_shape = int(np.array(envs.single_observation_space.shape).prod())
172
+ hidden = 128
173
+ self.critic = nn.Sequential(
174
+ layer_init(nn.Linear(obs_shape, hidden)),
175
+ nn.Tanh(),
176
+ layer_init(nn.Linear(hidden, hidden)),
177
+ nn.Tanh(),
178
+ layer_init(nn.Linear(hidden, 1), std=1.0),
179
+ )
180
+ self.actor = nn.Sequential(
181
+ layer_init(nn.Linear(obs_shape, hidden)),
182
+ nn.Tanh(),
183
+ layer_init(nn.Linear(hidden, hidden)),
184
+ nn.Tanh(),
185
+ layer_init(nn.Linear(hidden, envs.single_action_space.n), std=0.01),
186
+ )
187
+
188
+ def get_value(self, x):
189
+ return self.critic(x)
190
+
191
+ def get_action_and_value(self, x, action=None):
192
+ logits = self.actor(x)
193
+ probs = Categorical(logits=logits)
194
+ if action is None:
195
+ action = probs.sample()
196
+ return action, probs.log_prob(action), probs.entropy(), self.critic(x)
197
+
198
+
199
+ if __name__ == "__main__":
200
+ args = tyro.cli(Args)
201
+ args.batch_size = int(args.num_envs * args.num_steps)
202
+ args.minibatch_size = int(args.batch_size // args.num_minibatches)
203
+ args.num_iterations = args.total_timesteps // args.batch_size
204
+ run_name = f"{args.env_id}__{args.exp_name}__{args.seed}__{int(time.time())}"
205
+
206
+ if args.track:
207
+ import wandb
208
+ wandb.init(
209
+ project=args.wandb_project_name,
210
+ entity=args.wandb_entity,
211
+ config=vars(args),
212
+ name=run_name,
213
+ monitor_gym=True,
214
+ save_code=True,
215
+ )
216
+ try:
217
+ wandb.define_metric("global_step")
218
+ for prefix in ["train/*", "rollout/*", "eval/*", "losses/*", "charts/*", "perf/*"]:
219
+ wandb.define_metric(prefix, step_metric="global_step")
220
+ except Exception:
221
+ pass
222
+
223
+ # seeding
224
+ random.seed(args.seed)
225
+ np.random.seed(args.seed)
226
+ torch.manual_seed(args.seed)
227
+ torch.backends.cudnn.deterministic = args.torch_deterministic
228
+
229
+ device = torch.device("cuda" if torch.cuda.is_available() and args.cuda else "cpu")
230
+
231
+ # envs
232
+ envs = gym.vector.SyncVectorEnv([
233
+ make_env(i, run_name, args.seed, args.scramble_depth, args.max_steps_env, args.capture_video)
234
+ for i in range(args.num_envs)
235
+ ])
236
+ assert isinstance(envs.single_action_space, gym.spaces.Discrete)
237
+
238
+ agent = Agent(envs).to(device)
239
+ optimizer = optim.Adam(agent.parameters(), lr=args.learning_rate, eps=1e-5)
240
+
241
+ # storage
242
+ obs = torch.zeros((args.num_steps, args.num_envs) + envs.single_observation_space.shape).to(device)
243
+ actions = torch.zeros((args.num_steps, args.num_envs) + envs.single_action_space.shape).to(device)
244
+ logprobs = torch.zeros((args.num_steps, args.num_envs)).to(device)
245
+ rewards = torch.zeros((args.num_steps, args.num_envs)).to(device)
246
+ dones = torch.zeros((args.num_steps, args.num_envs)).to(device)
247
+ values = torch.zeros((args.num_steps, args.num_envs)).to(device)
248
+
249
+ # start
250
+ global_step = 0
251
+ start_time = time.time()
252
+ next_obs, _ = envs.reset(seed=args.seed)
253
+ next_obs = torch.Tensor(next_obs).to(device)
254
+ next_done = torch.zeros(args.num_envs).to(device)
255
+
256
+ # eval helper similar to FrozenLake: collect greedy eval trajectories and write metrics.json
257
+ def collect_eval_trajectories(agent_model, make_env_fn, n_episodes, step_tag):
258
+ out_dir = Path(f"runs/{run_name}/trajectories/step_{step_tag}")
259
+ out_dir.mkdir(parents=True, exist_ok=True)
260
+ out_path = out_dir / "trajectories.jsonl"
261
+ env = make_env_fn()
262
+ collected = 0
263
+ summary_returns = []
264
+ summary_success = []
265
+ with out_path.open("w") as f:
266
+ while collected < n_episodes:
267
+ state, _ = env.reset(seed=args.seed + 100000 + collected)
268
+ traj_states = [state.tolist()]
269
+ traj_actions = []
270
+ traj_rewards = []
271
+ traj_dones = []
272
+ traj_success = []
273
+ done = False
274
+ step_count = 0
275
+ max_eval_steps = getattr(env, '_max_episode_steps', None) or int(args.max_steps_env)
276
+ while not done:
277
+ with torch.no_grad():
278
+ logits = agent_model.actor(torch.tensor(state, dtype=torch.float32, device=device).unsqueeze(0))
279
+ action = int(torch.argmax(logits, dim=1).item())
280
+ next_state, reward, terminated, truncated, info = env.step(action)
281
+ traj_actions.append(int(action))
282
+ traj_rewards.append(float(reward))
283
+ step_count += 1
284
+ d = bool(terminated) or bool(truncated) or (step_count >= max_eval_steps)
285
+ traj_dones.append(d)
286
+ traj_success.append(bool((info or {}).get('success', False)))
287
+ state = next_state
288
+ traj_states.append(state.tolist())
289
+ done = d
290
+ ep_ret = float(sum(traj_rewards))
291
+ ep_succ = bool(any(traj_success))
292
+ record = {
293
+ "states": traj_states,
294
+ "actions": traj_actions,
295
+ "rewards": traj_rewards,
296
+ "dones": traj_dones,
297
+ "success": traj_success,
298
+ "episode_return": ep_ret,
299
+ "episode_success": ep_succ,
300
+ }
301
+ f.write(json.dumps(record) + "\n")
302
+ collected += 1
303
+ summary_returns.append(ep_ret)
304
+ summary_success.append(1.0 if ep_succ else 0.0)
305
+ env.close()
306
+ try:
307
+ metrics = {
308
+ "global_step": int(step_tag),
309
+ "episodes": int(n_episodes),
310
+ "success_rate": float(np.mean(summary_success)) if len(summary_success) else 0.0,
311
+ "avg_return": float(np.mean(summary_returns)) if len(summary_returns) else 0.0,
312
+ "std_return": float(np.std(summary_returns)) if len(summary_returns) else 0.0,
313
+ }
314
+ with (out_dir / "metrics.json").open("w") as mf:
315
+ json.dump(metrics, mf)
316
+ except Exception as e:
317
+ print(f"Warning: failed to write eval metrics: {e}")
318
+
319
+ # training loop
320
+ eval_every_iters = max(1, args.num_iterations // args.eval_splits)
321
+ for iteration in range(1, args.num_iterations + 1):
322
+ # Anneal LR
323
+ if args.anneal_lr:
324
+ frac = 1.0 - (iteration - 1.0) / args.num_iterations
325
+ lrnow = frac * args.learning_rate
326
+ optimizer.param_groups[0]["lr"] = lrnow
327
+
328
+ # accumulate per-iteration episode successes
329
+ iter_successes = []
330
+ for step in range(0, args.num_steps):
331
+ global_step += args.num_envs
332
+ obs[step] = next_obs
333
+ dones[step] = next_done
334
+
335
+ with torch.no_grad():
336
+ action, logprob, _, value = agent.get_action_and_value(next_obs)
337
+ values[step] = value.flatten()
338
+ actions[step] = action
339
+ logprobs[step] = logprob
340
+
341
+ next_obs, reward, terminations, truncations, infos = envs.step(action.cpu().numpy())
342
+ next_done = np.logical_or(terminations, truncations)
343
+ rewards[step] = torch.tensor(reward).to(device).view(-1)
344
+ next_obs, next_done = torch.Tensor(next_obs).to(device), torch.Tensor(next_done).to(device)
345
+
346
+ # Episode stats logging similar to FrozenLake
347
+ try:
348
+ mask = None
349
+ if isinstance(infos, dict):
350
+ if "_episode" in infos:
351
+ mask = np.asarray(infos["_episode"]).astype(bool)
352
+ elif "episode" in infos and isinstance(infos["episode"], dict) and "_l" in infos["episode"]:
353
+ mask = np.asarray(infos["episode"]["_l"]).astype(bool)
354
+ if mask is not None and np.any(mask):
355
+ r_arr = np.asarray(infos.get("episode", {}).get("r", np.zeros_like(mask, dtype=float)))
356
+ l_arr = np.asarray(infos.get("episode", {}).get("l", np.zeros_like(mask, dtype=int)))
357
+ # prefer success from info; fallback to ep return > 0
358
+ if "success" in infos:
359
+ succ_arr = np.asarray(infos.get("success", np.zeros_like(mask, dtype=bool))).astype(float)
360
+ else:
361
+ try:
362
+ succ_arr = (np.asarray(r_arr) > 0).astype(float)
363
+ except Exception:
364
+ succ_arr = np.zeros_like(mask, dtype=float)
365
+ # collect iteration successes for training success rate
366
+ try:
367
+ for s in np.asarray(succ_arr)[mask]:
368
+ iter_successes.append(float(s))
369
+ except Exception:
370
+ pass
371
+ if args.track:
372
+ try:
373
+ import wandb
374
+ log_dict = {
375
+ "global_step": int(global_step),
376
+ "rollout/ep_rew_mean": float(np.mean(r_arr[mask])) if np.any(mask) else None,
377
+ "rollout/ep_len_mean": float(np.mean(l_arr[mask])) if np.any(mask) else None,
378
+ "rollout/success_rate": float(np.mean(succ_arr[mask])) if np.any(mask) else None,
379
+ }
380
+ wandb.log(log_dict, step=global_step)
381
+ except Exception:
382
+ pass
383
+ except Exception:
384
+ pass
385
+
386
+ # GAE
387
+ with torch.no_grad():
388
+ next_value = agent.get_value(next_obs).reshape(1, -1)
389
+ advantages = torch.zeros_like(rewards).to(device)
390
+ lastgaelam = 0
391
+ for t in reversed(range(args.num_steps)):
392
+ if t == args.num_steps - 1:
393
+ nextnonterminal = 1.0 - next_done
394
+ nextvalues = next_value
395
+ else:
396
+ nextnonterminal = 1.0 - dones[t + 1]
397
+ nextvalues = values[t + 1]
398
+ delta = rewards[t] + args.gamma * nextvalues * nextnonterminal - values[t]
399
+ advantages[t] = lastgaelam = delta + args.gamma * args.gae_lambda * nextnonterminal * lastgaelam
400
+ returns = advantages + values
401
+
402
+ # flatten batch
403
+ b_obs = obs.reshape((-1,) + envs.single_observation_space.shape)
404
+ b_logprobs = logprobs.reshape(-1)
405
+ b_actions = actions.reshape((-1,) + envs.single_action_space.shape)
406
+ b_advantages = advantages.reshape(-1)
407
+ b_returns = returns.reshape(-1)
408
+ b_values = values.reshape(-1)
409
+
410
+ # update
411
+ b_inds = np.arange(args.batch_size)
412
+ clipfracs = []
413
+ for epoch in range(args.update_epochs):
414
+ np.random.shuffle(b_inds)
415
+ for start in range(0, args.batch_size, args.minibatch_size):
416
+ end = start + args.minibatch_size
417
+ mb_inds = b_inds[start:end]
418
+
419
+ _, newlogprob, entropy, newvalue = agent.get_action_and_value(b_obs[mb_inds], b_actions.long()[mb_inds])
420
+ logratio = newlogprob - b_logprobs[mb_inds]
421
+ ratio = logratio.exp()
422
+
423
+ with torch.no_grad():
424
+ old_approx_kl = (-logratio).mean()
425
+ approx_kl = ((ratio - 1) - logratio).mean()
426
+ clipfracs += [((ratio - 1.0).abs() > args.clip_coef).float().mean().item()]
427
+
428
+ mb_advantages = b_advantages[mb_inds]
429
+ if args.norm_adv:
430
+ mb_advantages = (mb_advantages - mb_advantages.mean()) / (mb_advantages.std() + 1e-8)
431
+
432
+ pg_loss1 = -mb_advantages * ratio
433
+ pg_loss2 = -mb_advantages * torch.clamp(ratio, 1 - args.clip_coef, 1 + args.clip_coef)
434
+ pg_loss = torch.max(pg_loss1, pg_loss2).mean()
435
+
436
+ newvalue = newvalue.view(-1)
437
+ if args.clip_vloss:
438
+ v_loss_unclipped = (newvalue - b_returns[mb_inds]) ** 2
439
+ v_clipped = b_values[mb_inds] + torch.clamp(
440
+ newvalue - b_values[mb_inds], -args.clip_coef, args.clip_coef,
441
+ )
442
+ v_loss_clipped = (v_clipped - b_returns[mb_inds]) ** 2
443
+ v_loss = 0.5 * torch.max(v_loss_unclipped, v_loss_clipped).mean()
444
+ else:
445
+ v_loss = 0.5 * ((newvalue - b_returns[mb_inds]) ** 2).mean()
446
+
447
+ entropy_loss = entropy.mean()
448
+ loss = pg_loss - args.ent_coef * entropy_loss + v_loss * args.vf_coef
449
+
450
+ optimizer.zero_grad()
451
+ loss.backward()
452
+ nn.utils.clip_grad_norm_(agent.parameters(), args.max_grad_norm)
453
+ optimizer.step()
454
+
455
+ if args.target_kl is not None and approx_kl > args.target_kl:
456
+ break
457
+
458
+ # metrics
459
+ y_pred, y_true = b_values.cpu().numpy(), b_returns.cpu().numpy()
460
+ var_y = np.var(y_true)
461
+ explained_var = np.nan if var_y == 0 else 1 - np.var(y_true - y_pred) / var_y
462
+
463
+ sps = int(global_step / (time.time() - start_time))
464
+ train_success_rate = float(np.mean(iter_successes)) if len(iter_successes) else 0.0
465
+ print(f"Iter {iteration:4d}/{args.num_iterations} | SPS: {sps:5d} | R: {rewards.mean().item():6.3f}")
466
+ if args.track:
467
+ try:
468
+ import wandb
469
+ wandb.log({
470
+ "global_step": int(global_step),
471
+ "charts/progress": float(100.0 * iteration / max(1, args.num_iterations)),
472
+ "train/value_loss": float(v_loss.item()),
473
+ "train/policy_loss": float(pg_loss.item()),
474
+ "losses/value_loss": float(v_loss.item()),
475
+ "losses/policy_loss": float(pg_loss.item()),
476
+ "train/entropy": float(entropy_loss.item()),
477
+ "train/old_approx_kl": float(old_approx_kl.item()),
478
+ "train/approx_kl": float(approx_kl.item()),
479
+ "train/clipfrac": float(np.mean(clipfracs)) if len(clipfracs) else 0.0,
480
+ "losses/explained_variance": float(explained_var),
481
+ "charts/avg_reward": float(rewards.mean().item()),
482
+ "charts/avg_value": float(values.mean().item()),
483
+ "perf/SPS": int(sps),
484
+ "charts/SPS": int(sps),
485
+ "train/success_rate": train_success_rate,
486
+ "charts/train_success_rate": train_success_rate,
487
+ "train/learning_rate": float(optimizer.param_groups[0]["lr"]),
488
+ }, step=global_step)
489
+ except Exception:
490
+ pass
491
+
492
+ # periodic evaluation collection
493
+ if iteration % eval_every_iters == 0:
494
+ try:
495
+ eval_thunk = make_env(0, run_name, args.seed + 9999, args.scramble_depth, args.max_steps_env, False)
496
+ collect_eval_trajectories(agent, eval_thunk, n_episodes=args.eval_episodes, step_tag=global_step)
497
+ if args.track:
498
+ try:
499
+ import json as _json
500
+ from pathlib import Path as _Path
501
+ mpath = _Path(f"runs/{run_name}/trajectories/step_{global_step}/metrics.json")
502
+ if mpath.exists():
503
+ with mpath.open("r") as mf:
504
+ metrics = _json.load(mf)
505
+ wandb.log({
506
+ "eval/success_rate": metrics.get("success_rate"),
507
+ "eval/avg_return": metrics.get("avg_return"),
508
+ "eval/std_return": metrics.get("std_return"),
509
+ "eval/episodes": metrics.get("episodes"),
510
+ }, step=global_step)
511
+ except Exception:
512
+ pass
513
+ print(f"Collected {args.eval_episodes} eval trajectories at global_step {global_step}")
514
+ except Exception as e:
515
+ print(f"Warning: eval trajectory collection failed at step {global_step}: {e}")
516
+
517
+ envs.close()
wandb/run-20251218_182745-ahjkdup0/files/config.yaml ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _wandb:
2
+ value:
3
+ cli_version: 0.23.0
4
+ code_path: code/cleanrl/cleanrl/ppo_rubikscube.py
5
+ e:
6
+ fcxjy4miz5x8bvnkek48fociofug1x4f:
7
+ args:
8
+ - --track
9
+ codePath: cleanrl/cleanrl/ppo_rubikscube.py
10
+ codePathLocal: cleanrl/cleanrl/ppo_rubikscube.py
11
+ cpu_count: 64
12
+ cpu_count_logical: 128
13
+ cudaVersion: "12.4"
14
+ disk:
15
+ /:
16
+ total: "5153960755200"
17
+ used: "447457550336"
18
+ email: haoyu-wa22@mails.tsinghua.edu.cn
19
+ executable: /root/local/miniconda3/envs/ragen/bin/python
20
+ git:
21
+ commit: 8d73639b99b38265453f898b8d6af7d4af50d56e
22
+ remote: https://github.com/mll-lab-nu/RAGEN.git
23
+ gpu: NVIDIA H100 80GB HBM3
24
+ gpu_count: 8
25
+ gpu_nvidia:
26
+ - architecture: Hopper
27
+ cudaCores: 16896
28
+ memoryTotal: "85520809984"
29
+ name: NVIDIA H100 80GB HBM3
30
+ uuid: GPU-35e2d43d-4067-82ce-90d4-def9e389bf28
31
+ - architecture: Hopper
32
+ cudaCores: 16896
33
+ memoryTotal: "85520809984"
34
+ name: NVIDIA H100 80GB HBM3
35
+ uuid: GPU-af4135e3-88f2-e9ac-518d-502c75a85429
36
+ - architecture: Hopper
37
+ cudaCores: 16896
38
+ memoryTotal: "85520809984"
39
+ name: NVIDIA H100 80GB HBM3
40
+ uuid: GPU-d7fdeeba-fe9b-ec03-d9f7-6724fe4266b5
41
+ - architecture: Hopper
42
+ cudaCores: 16896
43
+ memoryTotal: "85520809984"
44
+ name: NVIDIA H100 80GB HBM3
45
+ uuid: GPU-ccc4f668-3882-5a8e-2c07-c5cd08f6f666
46
+ - architecture: Hopper
47
+ cudaCores: 16896
48
+ memoryTotal: "85520809984"
49
+ name: NVIDIA H100 80GB HBM3
50
+ uuid: GPU-7b73c0cf-d3d5-e10c-7176-a43be1e41001
51
+ - architecture: Hopper
52
+ cudaCores: 16896
53
+ memoryTotal: "85520809984"
54
+ name: NVIDIA H100 80GB HBM3
55
+ uuid: GPU-81b58d94-5d1f-8ec2-f9d2-fd56172ed177
56
+ - architecture: Hopper
57
+ cudaCores: 16896
58
+ memoryTotal: "85520809984"
59
+ name: NVIDIA H100 80GB HBM3
60
+ uuid: GPU-03e8bc66-3b44-6794-49fd-5392fbdda6d1
61
+ - architecture: Hopper
62
+ cudaCores: 16896
63
+ memoryTotal: "85520809984"
64
+ name: NVIDIA H100 80GB HBM3
65
+ uuid: GPU-b7cf0ec6-7c29-1179-dceb-09565da51890
66
+ host: pt-4d654cf4576f4d23ad3d3919f12932fe-worker-0
67
+ memory:
68
+ total: "2163642122240"
69
+ os: Linux-5.14.0-284.25.1.el9_2.x86_64-x86_64-with-glibc2.35
70
+ program: /mnt/general/wanghy/RAGEN/cleanrl/cleanrl/ppo_rubikscube.py
71
+ python: CPython 3.10.19
72
+ root: /mnt/general/wanghy/RAGEN
73
+ startedAt: "2025-12-18T10:27:45.627440Z"
74
+ writerId: fcxjy4miz5x8bvnkek48fociofug1x4f
75
+ m:
76
+ - "1": global_step
77
+ "6":
78
+ - 3
79
+ "7": []
80
+ - "2": train/*
81
+ "5": 1
82
+ "6":
83
+ - 1
84
+ "7": []
85
+ - "2": rollout/*
86
+ "5": 1
87
+ "6":
88
+ - 1
89
+ "7": []
90
+ - "2": eval/*
91
+ "5": 1
92
+ "6":
93
+ - 1
94
+ "7": []
95
+ - "2": losses/*
96
+ "5": 1
97
+ "6":
98
+ - 1
99
+ "7": []
100
+ - "2": charts/*
101
+ "5": 1
102
+ "6":
103
+ - 1
104
+ "7": []
105
+ - "2": perf/*
106
+ "5": 1
107
+ "6":
108
+ - 1
109
+ "7": []
110
+ python_version: 3.10.19
111
+ t:
112
+ "1":
113
+ - 1
114
+ - 11
115
+ - 30
116
+ - 49
117
+ - 50
118
+ - 51
119
+ - 105
120
+ "2":
121
+ - 1
122
+ - 11
123
+ - 30
124
+ - 49
125
+ - 50
126
+ - 51
127
+ - 105
128
+ "3":
129
+ - 7
130
+ - 13
131
+ - 16
132
+ - 61
133
+ "4": 3.10.19
134
+ "5": 0.23.0
135
+ "6": 4.57.1
136
+ "12": 0.23.0
137
+ "13": linux-x86_64
138
+ anneal_lr:
139
+ value: true
140
+ batch_size:
141
+ value: 1024
142
+ capture_video:
143
+ value: false
144
+ clip_coef:
145
+ value: 0.2
146
+ clip_vloss:
147
+ value: true
148
+ cuda:
149
+ value: true
150
+ ent_coef:
151
+ value: 0.01
152
+ env_id:
153
+ value: RubiksCube2x2
154
+ eval_episodes:
155
+ value: 4000
156
+ eval_splits:
157
+ value: 2
158
+ exp_name:
159
+ value: ppo_rubikscube
160
+ gae_lambda:
161
+ value: 0.95
162
+ gamma:
163
+ value: 0.99
164
+ learning_rate:
165
+ value: 0.00025
166
+ max_grad_norm:
167
+ value: 0.5
168
+ max_steps_env:
169
+ value: 20
170
+ minibatch_size:
171
+ value: 256
172
+ norm_adv:
173
+ value: true
174
+ num_envs:
175
+ value: 8
176
+ num_iterations:
177
+ value: 976
178
+ num_minibatches:
179
+ value: 4
180
+ num_steps:
181
+ value: 128
182
+ scramble_depth:
183
+ value: 3
184
+ seed:
185
+ value: 1
186
+ target_kl:
187
+ value: null
188
+ torch_deterministic:
189
+ value: true
190
+ total_timesteps:
191
+ value: 1000000
192
+ track:
193
+ value: true
194
+ update_epochs:
195
+ value: 4
196
+ vf_coef:
197
+ value: 0.5
198
+ wandb_entity:
199
+ value: null
200
+ wandb_project_name:
201
+ value: cleanRL
wandb/run-20251218_182745-ahjkdup0/files/diff.patch ADDED
@@ -0,0 +1,1162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/config/base.yaml b/config/base.yaml
2
+ index a1659e4..9df6250 100644
3
+ --- a/config/base.yaml
4
+ +++ b/config/base.yaml
5
+ @@ -9,15 +9,16 @@ seed:
6
+ train: 10000
7
+ val: 123
8
+
9
+ -micro_batch_size_per_gpu: 4
10
+ +micro_batch_size_per_gpu: 1
11
+ ppo_mini_batch_size: 32
12
+ -model_path: Qwen/Qwen2.5-3B-Instruct
13
+ +model_path: /mnt/general/share/model/Qwen/Qwen2.5-0.5B-Instruct
14
+ +# Qwen/Qwen2.5-0.5B-Instruct
15
+ enable_response_mask: True # Enabling response mask could improve stability of rollout/old_log_prob, as P(st|history) are no longer calculated in loss here. See https://docs.google.com/document/d/1bg7obeiKTExuHHBl5uOiSpec5uLDZ2Tgvxy6li5pHX4/edit?usp=sharing for more details.
16
+ grpo_advantage_length_weight: False # if you do not enable this and critic/advantage_estimator is GRPO, and the critic/advantages/mean is too low, then you can try enabling this to encourage reasoning and forbid collapse
17
+
18
+ lora:
19
+ rank: 0
20
+ - alpha: 64
21
+ + alpha: 16
22
+ target_modules: all-linear
23
+
24
+ actor_rollout_ref:
25
+ @@ -46,10 +47,10 @@ actor_rollout_ref:
26
+ name: vllm
27
+ log_prob_micro_batch_size_per_gpu: ${micro_batch_size_per_gpu} # following micro_batch_size_per_gpu
28
+ tensor_model_parallel_size: 1
29
+ - max_model_len: 3600
30
+ + max_model_len: 7200 #3600 why** 14400
31
+ prompt_length: 1 # useless. Just put it here
32
+ response_length: 400 # single-turn response length
33
+ - gpu_memory_utilization: 0.5
34
+ + gpu_memory_utilization: 0.7
35
+ max_num_batched_tokens: 8192 # set only when enable_chunked_prefill is true
36
+ temperature: 1
37
+ rollout_filter_ratio: 0.25
38
+ @@ -90,26 +91,28 @@ algorithm:
39
+ kl_coef: 0.000
40
+
41
+ trainer:
42
+ - project_name: ragen_latest
43
+ + project_name:
44
+ experiment_name: test
45
+ local_log_dir: "results/"
46
+ - save_freq: 100
47
+ + save_freq: -1
48
+ total_training_steps: 200
49
+ validation_steps: 1 # validation instances = validation_steps * val_env_groups * group_size
50
+ val_before_train: True
51
+ n_gpus_per_node: 1
52
+ test_freq: 10
53
+ generations_to_log_to_wandb:
54
+ + train: 128
55
+ val: 20
56
+ logger: [ 'console', 'wandb' ]
57
+ max_actor_ckpt_to_keep: 1
58
+ max_critic_ckpt_to_keep: 1
59
+ + default_local_dir: /mnt/general/wanghy/RAGEN/saves/
60
+
61
+ agent_proxy:
62
+ max_context_window: -1 # set a value > 0 to enable context window for long trajectory
63
+ - max_turn: 5
64
+ + max_turn: 25 #25 why** 700
65
+ action_sep: "||"
66
+ - max_actions_per_turn: 2 # how many actions can be output at most in a single turn
67
+ + max_actions_per_turn: 1 # how many actions can be output at most in a single turn
68
+ use_turn_scores: False # important to GAE when applying token-level rewards to token-level advantages. If False, will take the sum of scores as the reward for the last turn.
69
+ enable_think: True # False -> no think RL
70
+ reward_normalization:
71
+ @@ -126,11 +129,11 @@ es_manager:
72
+ tags: ["CoordSokoban"]
73
+ n_groups: [8] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
74
+ val:
75
+ - env_groups: 32
76
+ - group_size: 16 # should be set to 1 because when val temperature is set to 0 and group size > 1, there will be repetitive prompts which leads to same trajectory.
77
+ + env_groups: 256
78
+ + group_size: 1 # should be set to 1 because when val temperature is set to 0 and group size > 1, there will be repetitive prompts which leads to same trajectory.
79
+ env_configs:
80
+ tags: ["CoordSokoban"]
81
+ - n_groups: [32] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
82
+ + n_groups: [256] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
83
+
84
+ ctx_manager:
85
+ generation: # go to vllm
86
+ diff --git a/config/envs.yaml b/config/envs.yaml
87
+ index 1002ac8..ba3ac6f 100644
88
+ --- a/config/envs.yaml
89
+ +++ b/config/envs.yaml
90
+ @@ -2,6 +2,7 @@ custom_envs:
91
+ SimpleSokoban:
92
+ env_type: sokoban
93
+ max_actions_per_traj: 10 # used in environment state manager to control the actual max actions executed per trajectory
94
+ + # ORIGNAL env_instruction
95
+ env_instruction: |
96
+ You are solving the Sokoban puzzle.
97
+ You are the player and you need to push all boxes to targets.
98
+ @@ -12,7 +13,7 @@ custom_envs:
99
+ env_config: # keys should be a subset of SokobanConfig
100
+ dim_x: 6
101
+ dim_y: 6
102
+ - num_boxes: 1
103
+ + num_boxes: 2
104
+ max_steps: 100
105
+
106
+ LargerSokoban:
107
+ @@ -65,7 +66,7 @@ custom_envs:
108
+ env_config: # keys should be a subset of SokobanConfig
109
+ dim_x: 6
110
+ dim_y: 6
111
+ - num_boxes: 1
112
+ + num_boxes: 2
113
+ max_steps: 100
114
+ observation_format: "grid_coord"
115
+
116
+ @@ -111,14 +112,14 @@ custom_envs:
117
+
118
+ FrozenLake:
119
+ env_type: frozen_lake
120
+ - max_actions_per_traj: 10
121
+ + max_actions_per_traj: 25
122
+ env_instruction: "You are solving the FrozenLake puzzle. Forbid the whole and go to the target. You may move to the unintended direction due to the slippery ice. Example answer format: <think>To forbid the hole and go to the target, I should go left then go up.</think><answer>Left || Up</answer>"
123
+ max_tokens: 100
124
+ env_config: null
125
+
126
+ CoordFrozenLake:
127
+ env_type: frozen_lake
128
+ - max_actions_per_traj: 10
129
+ + max_actions_per_traj: 25
130
+ env_instruction: |
131
+ You are solving the FrozenLake puzzle. The observation includes both a symbol grid and zero-indexed coordinates for the start, goal, player, and any holes.
132
+ Coordinates range from the top-left corner (0, 0) to the bottom-right corner (5, 5).
133
+ @@ -195,4 +196,80 @@ custom_envs:
134
+ max_actions_per_traj: 30
135
+ env_instruction: "You are a Lean theorem prover. Given a Lean theorem statement, propose a sequence of tactics that completes the proof. Think step by step about which tactics to apply next. Provide tactics separated by '||', for example <answer>intro || simp || rfl</answer>."
136
+ max_tokens: 512
137
+ - env_config: null # Please refer to ragen/env/lean/config.py for a full list of parameters.
138
+
139
+ + env_config: null # Please refer to ragen/env/lean/config.py for a full list of parameters.
140
+ +
141
+ +
142
+ + game_2048:
143
+ + env_type: game_2048
144
+ + max_actions_per_traj: 700
145
+ + env_instruction: |
146
+ + You are playing the 2048 game on a 4x4 grid. Merge equal tiles by sliding Up, Right, Down, or Left.
147
+ + If a move is invalid (no tiles move), a small penalty is applied. Respond with a single action.
148
+ + Example: <answer>Up</answer>
149
+ + max_tokens: 8192
150
+ + env_config: null
151
+ +
152
+ + blackjack:
153
+ + env_type: blackjack
154
+ + max_actions_per_traj: 10
155
+ + env_instruction: |
156
+ + You are playing Blackjack against a dealer. The dealer must hit on 16 or less and stand on 17 or more.
157
+ + Choose either Stick or Hit. Respond with a single action.
158
+ + Example: <answer>Hit</answer>
159
+ + max_tokens: 64
160
+ + env_config: null
161
+ +
162
+ + rubikscube:
163
+ + env_type: rubikscube
164
+ + max_actions_per_traj: 20
165
+ + env_instruction: |
166
+ + You are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.
167
+ + Available actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.
168
+ + - Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).
169
+ + - Modifiers: A letter alone means 90° clockwise (e.g., 'R'). A letter with prime (') means 90° counter-clockwise (e.g., "R'").
170
+ + Respond with a sequence of actions separated by "||".
171
+ + Example: <answer>U</answer>
172
+ + max_tokens: 96
173
+ + env_config:
174
+ + scramble_depth: 1
175
+ + max_steps: 20
176
+ + render_mode: "text"
177
+ +
178
+ + SimpleSudoku:
179
+ + env_type: sudoku
180
+ + max_actions_per_traj: 20
181
+ + env_instruction: |
182
+ + You are solving a Sudoku puzzle. Fill in the grid so that every row, column, and 2x2 box contains the numbers 1-4 without repetition.
183
+ + Initial cells are shown in [brackets] and cannot be modified. Empty cells are shown as dots (.).
184
+ + Place numbers one at a time using the format, for example: <answer>place 1 at row 2 col 3</answer> or <answer>1,2,3</answer>
185
+ + The environment will provide feedback on valid/invalid moves and show conflicts if any occur.
186
+ + max_tokens: 150
187
+ + parallel_friendly: false
188
+ + max_workers: 32
189
+ + env_config:
190
+ + grid_size: 4
191
+ + difficulty: "easy"
192
+ + render_format: "with_feedback"
193
+ + show_conflicts: false
194
+ + show_valid_numbers: false
195
+ + max_steps: 20
196
+ +
197
+ + MediumSudoku:
198
+ + env_type: sudoku
199
+ + max_actions_per_traj: 30
200
+ + env_instruction: |
201
+ + You are solving a Sudoku puzzle. Fill in the grid so that every row, column, and 3x3 box contains the numbers 1-9 without repetition.
202
+ + Initial cells are shown in [brackets] and cannot be modified. Empty cells are shown as dots (.).
203
+ + Place numbers one at a time using the format: <answer>place 5 at row 2 col 3</answer> or <answer>2,3,5</answer>
204
+ + The environment will provide feedback on valid/invalid moves and show conflicts if any occur.
205
+ + max_tokens: 150
206
+ + parallel_friendly: false
207
+ + max_workers: 32
208
+ + env_config:
209
+ + grid_size: 9
210
+ + difficulty: "medium"
211
+ + render_format: "with_feedback"
212
+ + show_conflicts: true
213
+ + show_valid_numbers: true
214
+ + max_steps: 81
215
+ +
216
+ diff --git a/config/eval.yaml b/config/eval.yaml
217
+ index e65f3a5..7775fd1 100644
218
+ --- a/config/eval.yaml
219
+ +++ b/config/eval.yaml
220
+ @@ -1,14 +1,15 @@
221
+ defaults:
222
+ - envs
223
+ -
224
+ +enable_response_mask: True
225
+ system:
226
+ - CUDA_VISIBLE_DEVICES: "0"
227
+ + CUDA_VISIBLE_DEVICES: "0,1,2,3,4,5,6,7"
228
+
229
+ seed:
230
+ train: 10000
231
+ val: 123
232
+
233
+ -model_path: Qwen/Qwen2.5-3B-Instruct
234
+ +model_path: /mnt/general/share/model/openai/gpt-oss-20b
235
+ +# /mnt/general/share/model/tyzhu/SPA-frozenlake-qwen2.5-1.5b-instruct
236
+
237
+ lora:
238
+ rank: 0
239
+ @@ -24,9 +25,9 @@ actor_rollout_ref:
240
+ rollout:
241
+ name: vllm
242
+ log_prob_micro_batch_size_per_gpu: ${micro_batch_size_per_gpu}
243
+ - tensor_model_parallel_size: 1
244
+ + tensor_model_parallel_size: 8
245
+ dtype: bfloat16
246
+ - max_model_len: 3600
247
+ + max_model_len: 7200
248
+ prompt_length: 1
249
+ response_length: 400
250
+ gpu_memory_utilization: 0.9
251
+ @@ -35,6 +36,7 @@ actor_rollout_ref:
252
+ free_cache_engine: True
253
+ enable_chunked_prefill: False
254
+ disable_log_stats: False
255
+ + do_sample: True
256
+ val_kwargs:
257
+ do_sample: True
258
+ temperature: 0.5
259
+ @@ -44,9 +46,9 @@ actor_rollout_ref:
260
+
261
+ agent_proxy:
262
+ max_context_window: -1
263
+ - max_turn: 5
264
+ + max_turn: 25
265
+ action_sep: "||"
266
+ - max_actions_per_turn: 2
267
+ + max_actions_per_turn: 1
268
+ use_turn_scores: False
269
+ enable_think: True
270
+ reward_normalization:
271
+ @@ -59,13 +61,13 @@ es_manager:
272
+ env_groups: 8
273
+ group_size: 16
274
+ env_configs:
275
+ - tags: ["CoordSokoban"]
276
+ + tags: ["BanditTest"]
277
+ n_groups: [8]
278
+ val:
279
+ env_groups: 32
280
+ - group_size: 16
281
+ + group_size: 128
282
+ env_configs:
283
+ - tags: ["CoordSokoban"]
284
+ + tags: ["BanditTest"]
285
+ n_groups: [32]
286
+
287
+ ctx_manager:
288
+ diff --git a/config/evaluate_api_llm.yaml b/config/evaluate_api_llm.yaml
289
+ index b21c95e..e2e6761 100644
290
+ --- a/config/evaluate_api_llm.yaml
291
+ +++ b/config/evaluate_api_llm.yaml
292
+ @@ -1,8 +1,11 @@
293
+ +#export OPENAI_BASE_URL="https://api.ohmygpt.com/v1"
294
+ +#export OPENAI_API_KEY="sk-o4sMxBkN5BB100C4D4a3T3BlBkFJF7791CA39EA14ca98041"
295
+ +#python -m ragen.eval_api hydra.searchpath='[file://./verl/verl/trainer/config]'
296
+ defaults:
297
+ - base # this is a symbolic link to the verl/verl/trainer/config/ppo_trainer.yaml file
298
+
299
+ model_config:
300
+ - model_name: gpt-4o # should be registered in model_info
301
+ + model_name: ark-deepseek-v3-250324 # should be registered in model_info
302
+ max_concurrency: 16
303
+
304
+ model_info:
305
+ @@ -24,9 +27,9 @@ model_info:
306
+ generation_kwargs:
307
+ temperature: 0
308
+ max_tokens: 512 # max_completion_tokens if o1-mini
309
+ - gpt-4o:
310
+ + gpt-4o-mini:
311
+ provider_name: openai
312
+ - model_name: gpt-4o
313
+ + model_name: gpt-4o-mini
314
+ generation_kwargs:
315
+ temperature: 0
316
+ max_tokens: 512 # max_completion_tokens if o1-mini
317
+ @@ -36,21 +39,42 @@ model_info:
318
+ generation_kwargs:
319
+ temperature: 0
320
+ max_completion_tokens: 512
321
+ + ark-deepseek-v3-250324:
322
+ + provider_name: openai
323
+ + model_name: ark-deepseek-v3-250324
324
+ + generation_kwargs:
325
+ + temperature: 0
326
+ + max_completion_tokens: 512
327
+ deepseek-v3:
328
+ provider_name: deepseek
329
+ model_name: deepseek-chat
330
+ generation_kwargs:
331
+ temperature: 0
332
+ max_completion_tokens: 512
333
+ + glm-4.6:
334
+ + provider_name: openai
335
+ + model_name: glm-4.6
336
+ + generation_kwargs:
337
+ + temperature: 0
338
+ + max_completion_tokens: 512
339
+ + TA/openai/gpt-oss-120b:
340
+ + provider_name: openai
341
+ + model_name: TA/openai/gpt-oss-120b
342
+ + generation_kwargs:
343
+ + temperature: 0
344
+ + max_tokens: 8192
345
+ + # max_retries: 5
346
+
347
+ -
348
+ -
349
+ +agent_proxy:
350
+ + max_turn: 5
351
+ es_manager:
352
+ val:
353
+ - env_groups: 256
354
+ + env_groups: 128
355
+ group_size: 1 # should be set to 1 because val temperature is set to 0 and same prompt leads to same output
356
+ env_configs:
357
+ - tags: ["CoordSokoban"]
358
+ - n_groups: [256] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
359
+ + tags: ["rubikscube"]
360
+ + n_groups: [128] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
361
+
362
+
363
+ +rollout:
364
+ + max_model_len: 7200
365
+
366
+ Submodule external/webshop-minimal contains modified content
367
+ diff --git a/external/webshop-minimal/requirements.txt b/external/webshop-minimal/requirements.txt
368
+ index 5a1b04f..238ed5a 100644
369
+ --- a/external/webshop-minimal/requirements.txt
370
+ +++ b/external/webshop-minimal/requirements.txt
371
+ @@ -4,7 +4,7 @@ flask
372
+ html2text
373
+ rank_bm25
374
+ pyserini
375
+ -faiss-cpu
376
+ +faiss-gpu
377
+ thefuzz
378
+ gdown
379
+ spacy
380
+ diff --git a/ragen/env/__init__.py b/ragen/env/__init__.py
381
+ index b0f3461..bc6838e 100644
382
+ --- a/ragen/env/__init__.py
383
+ +++ b/ragen/env/__init__.py
384
+ @@ -12,6 +12,14 @@ from .metamathqa.env import MetaMathQAEnv
385
+ from .metamathqa.config import MetaMathQAEnvConfig
386
+ from .lean.config import LeanEnvConfig
387
+ from .lean.env import LeanEnv
388
+ +from .game_2048.config import Game2048EnvConfig
389
+ +from .game_2048.env import Game2048Env
390
+ +from .blackjack.config import BlackjackEnvConfig
391
+ +from .blackjack.env import BlackjackEnv
392
+ +from .rubikscube.config import RubiksCube2x2Config
393
+ +from .rubikscube.env import RubiksCube2x2Env
394
+ +from .sudoku.config import SudokuEnvConfig
395
+ +from .sudoku.env import SudokuEnv
396
+
397
+
398
+ REGISTERED_ENVS = {
399
+ @@ -22,6 +30,10 @@ REGISTERED_ENVS = {
400
+ # 'alfworld': AlfredTXTEnv,
401
+ 'metamathqa': MetaMathQAEnv,
402
+ 'lean': LeanEnv,
403
+ + 'game_2048': Game2048Env,
404
+ + 'blackjack': BlackjackEnv,
405
+ + 'rubikscube': RubiksCube2x2Env,
406
+ + 'sudoku': SudokuEnv,
407
+ }
408
+
409
+ REGISTERED_ENV_CONFIGS = {
410
+ @@ -32,6 +44,10 @@ REGISTERED_ENV_CONFIGS = {
411
+ # 'alfworld': AlfredEnvConfig,
412
+ 'metamathqa': MetaMathQAEnvConfig,
413
+ 'lean': LeanEnvConfig,
414
+ + 'game_2048': Game2048EnvConfig,
415
+ + 'blackjack': BlackjackEnvConfig,
416
+ + 'rubikscube': RubiksCube2x2Config,
417
+ + 'sudoku': SudokuEnvConfig,
418
+ }
419
+
420
+ try:
421
+ diff --git a/ragen/env/frozen_lake/config.py b/ragen/env/frozen_lake/config.py
422
+ index de054f4..9950c34 100644
423
+ --- a/ragen/env/frozen_lake/config.py
424
+ +++ b/ragen/env/frozen_lake/config.py
425
+ @@ -8,7 +8,7 @@ class FrozenLakeEnvConfig:
426
+ size: int = 4
427
+ p: float = 0.9
428
+ success_rate: float = 0.8
429
+ - is_slippery: bool = True
430
+ + is_slippery: bool = False
431
+ map_seed: Optional[int] = None
432
+ render_mode: str = "text"
433
+ observation_format: str = "grid"
434
+ diff --git a/ragen/env/frozen_lake/env.py b/ragen/env/frozen_lake/env.py
435
+ index 9ee3add..eef11d8 100644
436
+ --- a/ragen/env/frozen_lake/env.py
437
+ +++ b/ragen/env/frozen_lake/env.py
438
+ @@ -13,6 +13,7 @@ from ragen.env.base import BaseDiscreteActionEnv
439
+ class FrozenLakeEnv(BaseDiscreteActionEnv, GymFrozenLakeEnv):
440
+ def __init__(self, config: FrozenLakeEnvConfig = FrozenLakeEnvConfig()):
441
+ # Using mappings directly from config
442
+ + # import pdb;pdb.set_trace()
443
+ self.config = config
444
+ self.GRID_LOOKUP = config.grid_lookup
445
+ self.ACTION_LOOKUP = config.action_lookup
446
+ @@ -95,6 +96,7 @@ class FrozenLakeEnv(BaseDiscreteActionEnv, GymFrozenLakeEnv):
447
+ if __name__ == "__main__":
448
+ import matplotlib.pyplot as plt
449
+ config = FrozenLakeEnvConfig(size=4, is_slippery=True)
450
+ + # import pdb;pdb.set_trace()
451
+ env = FrozenLakeEnv(config)
452
+ print(env.reset())
453
+ while True:
454
+ diff --git a/ragen/env/sokoban/env.py b/ragen/env/sokoban/env.py
455
+ index 17cd636..6922b54 100644
456
+ --- a/ragen/env/sokoban/env.py
457
+ +++ b/ragen/env/sokoban/env.py
458
+ @@ -33,6 +33,7 @@ class SokobanEnv(BaseDiscreteActionEnv, GymSokobanEnv):
459
+ def reset(self, seed=None, mode=None):
460
+ try:
461
+ with all_seed(seed):
462
+ + # import pdb;pdb.set_trace()
463
+ self.room_fixed, self.room_state, self.box_mapping, action_sequence = generate_room(
464
+ dim=self.dim_room,
465
+ num_steps=self.num_gen_steps,
466
+ diff --git a/ragen/llm_agent/agent_proxy.py b/ragen/llm_agent/agent_proxy.py
467
+ index c25b50d..f6c4088 100644
468
+ --- a/ragen/llm_agent/agent_proxy.py
469
+ +++ b/ragen/llm_agent/agent_proxy.py
470
+ @@ -287,6 +287,7 @@ def main(config):
471
+ proxy = LLMAgentProxy(config, actor_wg, tokenizer)
472
+ import time
473
+ start_time = time.time()
474
+ + # import pdb;pdb.set_trace()
475
+ rollouts = proxy.rollout(
476
+ DataProto(
477
+ batch=None,
478
+ diff --git a/ragen/llm_agent/base_llm.py b/ragen/llm_agent/base_llm.py
479
+ index 358a2eb..b6f7797 100644
480
+ --- a/ragen/llm_agent/base_llm.py
481
+ +++ b/ragen/llm_agent/base_llm.py
482
+ @@ -33,6 +33,7 @@ class OpenAIProvider(LLMProvider):
483
+ raise ValueError("OpenAI API key not provided and not found in environment variables")
484
+
485
+ self.client = AsyncOpenAI(api_key=self.api_key)
486
+ + # import pdb;pdb.set_trace()
487
+
488
+ async def generate(self, messages: List[Dict[str, str]], **kwargs) -> LLMResponse:
489
+ if "o1-mini" in self.model_name:
490
+ @@ -46,10 +47,7 @@ class OpenAIProvider(LLMProvider):
491
+ )
492
+ if response.choices[0].finish_reason in ['length', 'content_filter']:
493
+ raise ValueError("Content filtered or length exceeded")
494
+ - return LLMResponse(
495
+ - content=response.choices[0].message.content,
496
+ - model_name=response.model
497
+ - )
498
+ + return LLMResponse(content=response.choices[0].message.content,model_name=response.model)
499
+
500
+ class DeepSeekProvider(LLMProvider):
501
+ """DeepSeek API provider implementation"""
502
+ @@ -199,7 +197,7 @@ class ConcurrentLLM:
503
+
504
+ # Queue to store unfinished or failed tasks
505
+ current_batch = messages_list.copy()
506
+ - max_retries = kwargs.get("max_retries", 100)
507
+ + max_retries = kwargs.get("max_retries", 10)
508
+ retry_count = 0
509
+
510
+ while current_batch and retry_count < max_retries:
511
+ diff --git a/ragen/llm_agent/ctx_manager.py b/ragen/llm_agent/ctx_manager.py
512
+ index 905247a..af20a01 100644
513
+ --- a/ragen/llm_agent/ctx_manager.py
514
+ +++ b/ragen/llm_agent/ctx_manager.py
515
+ @@ -88,6 +88,7 @@ class ContextManager:
516
+ Initialize the ContextManager.
517
+ Processor is used to process the image data.
518
+ """
519
+ + # import pdb;pdb.set_trace()
520
+ self.config = config
521
+ self.tokenizer = tokenizer
522
+ self.processor = processor
523
+ @@ -311,7 +312,7 @@ class ContextManager:
524
+
525
+ llm_input_texts.append(text_with_prompt)
526
+ messages_list.append(messages)
527
+ -
528
+ + # import pdb;pdb.set_trace()
529
+ inputs = self.tokenizer(llm_input_texts, return_tensors="pt", padding=True, padding_side="left", truncation=False) # We have truncated previously, truncation in tokenizer may cause issues.
530
+ input_ids, attention_mask = inputs.input_ids, inputs.attention_mask
531
+ position_ids = (attention_mask.cumsum(dim=-1) - 1).clamp(min=0)
532
+ @@ -353,6 +354,30 @@ class ContextManager:
533
+ key: np.sum(value) / self.env_nums[key.split("/")[0]]
534
+ for key, value in metrics.items()
535
+ }
536
+ + # Derived metrics for wandb logging
537
+ + try:
538
+ + # charts/avg_episode_return: average across all 2048 env groups
539
+ + ep_keys = [k for k in metrics.keys() if k.endswith('/episodic_return')]
540
+ + if len(ep_keys) > 0:
541
+ + ep_vals = []
542
+ + for k in ep_keys:
543
+ + tag = k.split('/')[0]
544
+ + denom = self.env_nums.get(tag, max(1, len(metrics[k])))
545
+ + ep_vals.append(float(np.sum(metrics[k]) / denom))
546
+ + mean_metrics["charts/avg_episode_return"] = float(np.mean(ep_vals))
547
+ + except Exception:
548
+ + pass
549
+ + try:
550
+ + # rollout/max_tile: max over all envs in this batch
551
+ + tile_keys = [k for k in metrics.keys() if k.endswith('/max_tile')]
552
+ + if len(tile_keys) > 0:
553
+ + tile_vals = []
554
+ + for k in tile_keys:
555
+ + tile_vals.extend(metrics[k])
556
+ + if len(tile_vals) > 0:
557
+ + mean_metrics["rollout/max_tile"] = int(np.max(tile_vals))
558
+ + except Exception:
559
+ + pass
560
+ for key, values in metrics.items():
561
+ if not isinstance(values, list):
562
+ continue
563
+ diff --git a/ragen/llm_agent/es_manager.py b/ragen/llm_agent/es_manager.py
564
+ index b87a2b3..1a49d3e 100644
565
+ --- a/ragen/llm_agent/es_manager.py
566
+ +++ b/ragen/llm_agent/es_manager.py
567
+ @@ -128,18 +128,40 @@ class EnvStateManager:
568
+ env_outputs: List[Dict]
569
+ {env_id: int, history: List[Dict][{state: str, actions: List[str], reward: float, info: Dict, llm_response: str, llm_raw_response: str, (Optional)images: List[PIL.Image.Image]}]}
570
+ """
571
+ + # def _execute_actions(env, actions):
572
+ + # acc_reward, turn_info, turn_done = 0, {}, False
573
+ + # executed_actions = []
574
+ + # for action in actions:
575
+ + # _, reward, done, info = env.step(action)
576
+ + # acc_reward += reward
577
+ + # turn_info.update(info) # NOTE: currently use last info for multi-action
578
+ + # executed_actions.append(action)
579
+ + # if done:
580
+ + # turn_done = True
581
+ + # break
582
+ +
583
+ + # return acc_reward, turn_info, turn_done, executed_actions
584
+ def _execute_actions(env, actions):
585
+ - acc_reward, turn_info, turn_done = 0, {}, False
586
+ + acc_reward, turn_info, turn_done = 0.0, {}, False
587
+ + raw_acc_reward = 0.0
588
+ executed_actions = []
589
+ for action in actions:
590
+ _, reward, done, info = env.step(action)
591
+ - acc_reward += reward
592
+ + acc_reward += float(reward)
593
+ + try:
594
+ + raw_acc_reward += float(info.get('raw_reward', 0.0))
595
+ + except Exception:
596
+ + pass
597
+ turn_info.update(info) # NOTE: currently use last info for multi-action
598
+ executed_actions.append(action)
599
+ if done:
600
+ turn_done = True
601
+ break
602
+ -
603
+ + # Overwrite per-turn raw_reward to reflect the sum across all executed actions in this turn
604
+ + try:
605
+ + turn_info['raw_reward'] = float(raw_acc_reward)
606
+ + except Exception:
607
+ + pass
608
+ return acc_reward, turn_info, turn_done, executed_actions
609
+
610
+ def _log_env_state(status, history, cur_obs, max_actions_per_traj, executed_actions, all_actions, acc_reward, turn_done, turn_info, env_input):
611
+ @@ -198,6 +220,18 @@ class EnvStateManager:
612
+ 'success': float(status.terminated and (not status.truncated)),
613
+ 'num_actions': status.num_actions,
614
+ }
615
+ + # Add episodic-level metrics
616
+ + # try:
617
+ + # # Sum of per-turn rewards equals the episodic return (env-shaped reward)
618
+ + # env_metric['episodic_return'] = float(sum(status.rewards))
619
+ + # except Exception:
620
+ + # pass
621
+ + try:
622
+ + # Final max tile on the board at the end of the rollout
623
+ + import numpy as _np
624
+ + env_metric['max_tile'] = int(_np.max(entry['env'].grid))
625
+ + except Exception:
626
+ + pass
627
+ custom_metric = {}
628
+ for turn in cache['history']:
629
+ for k, v in turn.get('info', {}).items():
630
+ @@ -212,6 +246,12 @@ class EnvStateManager:
631
+ "Skipping non-numeric metric '%s' with value %r for env %s.",
632
+ k, v, entry['tag']
633
+ )
634
+ + # Add episodic_return as the SUM of raw_reward across steps (align with CleanRL)
635
+ + try:
636
+ + if 'raw_reward' in custom_metric:
637
+ + env_metric['episodic_return'] = float(np.sum(custom_metric['raw_reward']))
638
+ + except Exception:
639
+ + pass
640
+ for k, v in custom_metric.items():
641
+ # TODO: Move TURN_LVL_METRICS into the environment
642
+ if "webshop" not in cache['tag'].lower() or ("webshop" in cache['tag'].lower() and k in TURN_LVL_METRICS):
643
+ @@ -219,7 +259,12 @@ class EnvStateManager:
644
+ else:
645
+ env_metric['traj_sum/' + k] = np.sum(v)
646
+
647
+ -
648
+ + try:
649
+ + if 'score' in custom_metric and len(custom_metric['score']) > 0:
650
+ + env_metric['final_score'] = float(custom_metric['score'][-1])
651
+ + except Exception:
652
+ + pass
653
+ +
654
+ cache['history'][-1]['metrics'] = custom_metric
655
+ env_metric = {f"{entry['tag']}/{k}": v for k, v in env_metric.items()}
656
+ cache['metrics'] = env_metric
657
+ diff --git a/requirements.txt b/requirements.txt
658
+ index 2fd756e..9b521bf 100644
659
+ --- a/requirements.txt
660
+ +++ b/requirements.txt
661
+ @@ -7,7 +7,6 @@ accelerate
662
+ codetiming
663
+ datasets
664
+ dill
665
+ -flash-attn==2.7.4.post1
666
+ hydra-core
667
+ numpy
668
+ pandas
669
+ @@ -15,19 +14,19 @@ pybind11
670
+ ray>=2.10
671
+ tensordict>=0.8.0,<0.9.0
672
+ transformers
673
+ -vllm==0.8.2
674
+ +vllm==0.8.5
675
+ wandb
676
+ gymnasium
677
+ gymnasium[toy-text]
678
+
679
+ pyarrow>=15.0.0
680
+ pylatexenc
681
+ -torchdata
682
+ +# torchdata
683
+ debugpy
684
+
685
+ together
686
+ anthropic
687
+ -faiss-cpu==1.11.0
688
+ +faiss-gpu
689
+
690
+ # This is optional, but needs to be installed with main requirements if you want to use webshop
691
+ -r external/webshop-minimal/requirements.txt
692
+ diff --git a/scripts/setup_ragen.sh b/scripts/setup_ragen.sh
693
+ index f9a7cd9..85a93c4 100644
694
+ --- a/scripts/setup_ragen.sh
695
+ +++ b/scripts/setup_ragen.sh
696
+ @@ -94,10 +94,10 @@ main() {
697
+ pip install torch==2.5.0 --index-url https://download.pytorch.org/whl/cu124
698
+
699
+ print_step "Installing flash-attention..."
700
+ - pip3 install flash-attn==2.7.4.post1 --no-build-isolation
701
+ + # pip3 install flash-attn==2.7.4.post1 --no-build-isolation
702
+ else
703
+ print_step "Installing PyTorch without CUDA support..."
704
+ - pip install torch==2.5.0
705
+ + pip install torch==2.4.0
706
+ fi
707
+
708
+ # Install remaining requirements
709
+ @@ -137,8 +137,8 @@ main() {
710
+ conda install conda-forge::gdown
711
+ mkdir -p external/webshop-minimal/webshop_minimal/data/full
712
+ cd external/webshop-minimal/webshop_minimal/data/full
713
+ - gdown https://drive.google.com/uc?id=1A2whVgOO0euk5O13n2iYDM0bQRkkRduB # items_shuffle
714
+ - gdown https://drive.google.com/uc?id=1s2j6NgHljiZzQNL3veZaAiyW_qDEgBNi # items_ins_v2
715
+ + # gdown https://drive.google.com/uc?id=1A2whVgOO0euk5O13n2iYDM0bQRkkRduB # items_shuffle
716
+ + # gdown https://drive.google.com/uc?id=1s2j6NgHljiZzQNL3veZaAiyW_qDEgBNi # items_ins_v2
717
+ cd ../../../../..
718
+
719
+ echo -e "${GREEN}Installation completed successfully!${NC}"
720
+ diff --git a/train_all.sh b/train_all.sh
721
+ index 0157306..33035f5 100755
722
+ --- a/train_all.sh
723
+ +++ b/train_all.sh
724
+ @@ -6,246 +6,257 @@ USE_GRPO="algorithm.adv_estimator=grpo"
725
+ USE_PPO="algorithm.adv_estimator=gae" # by default.
726
+ USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
727
+
728
+ +
729
+ +# python train.py --config-name _8_2048 system.CUDA_VISIBLE_DEVICES="'0,1,2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=game_2048 $USE_PPO $USE_BASE
730
+ +
731
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'0,1'" trainer.project_name=ragen_latest_qwen_05B_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=rubikscube-1 $USE_PPO $USE_BASE
732
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-1.5B-Instruct trainer.experiment_name=rubikscube-2 $USE_PPO $USE_BASE
733
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'4,5'" trainer.project_name=ragen_latest_qwen_25_3b_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-3B-Instruct trainer.experiment_name=rubikscube-2 $USE_PPO $USE_BASE
734
+ +python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'6,7'" trainer.project_name=ragen_latest_qwen_05B_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=rubikscube-3 $USE_PPO $USE_BASE
735
+ +
736
+ # Section 3.1&3.2 - General Observations
737
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-ppo $USE_PPO $USE_BASE &
738
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-grpo $USE_GRPO $USE_BASE &
739
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE &
740
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-grpo $USE_GRPO $USE_BASE &
741
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozen_lake-ppo $USE_PPO $USE_BASE &
742
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozen_lake-grpo $USE_GRPO $USE_BASE &
743
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="'6,7'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=bandit-ppo-multitask $USE_PPO $USE_BASE &
744
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="'7'" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-ppo-frommlp $USE_PPO $USE_BASE
745
+
746
+ -# Section 4.1 - Filtering and critic
747
+ -# 0.25
748
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.25 actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
749
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
750
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
751
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
752
+ -
753
+ -wait
754
+ -
755
+ -# 0.5
756
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-ppo-rolloutfilter0.5 actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
757
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
758
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
759
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
760
+ -
761
+ -# 0.75
762
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.75 actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
763
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
764
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
765
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
766
+ -
767
+ -wait
768
+ -
769
+ -# Section 4.2 - Ablation on Critic/ClipHigh/KL. Start from Basic and add more components. The best setting for StarPO in agent is rollout_filter+Critic+Cliphigh+NoKL
770
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
771
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
772
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
773
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
774
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozenlake-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
775
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozenlake-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
776
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozenlake-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
777
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozenlake-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
778
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="'0,1'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=sokoban-ppo-box1-multitask $USE_PPO $USE_BASE
779
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-grpo $USE_GRPO $USE_BASE &
780
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
781
+
782
+ -wait
783
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'4,5,6,7'" trainer.project_name=ragen_latest_qwen_25_3b_it trainer.n_gpus_per_node=4 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_3B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
784
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'4,5,6,7'" trainer.n_gpus_per_node=4 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
785
+
786
+ -# Section 5.1 - Reasoning Helps Generalization
787
+ +# # Section 4.1 - Filtering and critic
788
+ +# # 0.25
789
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.25 actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
790
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
791
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
792
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
793
+
794
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-generalization \
795
+ - custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
796
+ - custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
797
+ - custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
798
+ - custom_envs.BanditTest.env_config.hi_arm_name="Librarian"
799
+ +# wait
800
+
801
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-generalization-nothink \
802
+ - custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
803
+ - custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
804
+ - custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
805
+ - custom_envs.BanditTest.env_config.hi_arm_name="Librarian" \
806
+ - agent_proxy.enable_think=False
807
+ +# # 0.5
808
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-ppo-rolloutfilter0.5 actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
809
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
810
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
811
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
812
+ +
813
+ +# # 0.75
814
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.75 actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
815
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
816
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
817
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
818
+
819
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=bandit-generalization-rev \
820
+ - custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
821
+ - custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
822
+ - custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
823
+ - custom_envs.BanditTest.env_config.hi_arm_name="Trader"
824
+ +# wait
825
+
826
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=bandit-generalization-rev-nothink \
827
+ - custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
828
+ - custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
829
+ - custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
830
+ - custom_envs.BanditTest.env_config.hi_arm_name="Trader" \
831
+ - agent_proxy.enable_think=False
832
+ +# # Section 4.2 - Ablation on Critic/ClipHigh/KL. Start from Basic and add more components. The best setting for StarPO in agent is rollout_filter+Critic+Cliphigh+NoKL
833
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
834
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
835
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
836
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
837
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozenlake-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
838
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozenlake-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
839
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozenlake-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
840
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozenlake-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
841
+
842
+ +# wait
843
+
844
+ -SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
845
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization micro_batch_size_per_gpu=8 model_path=Qwen/Qwen2.5-1.5B-Instruct&
846
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-generalization-nothink $SOKOBAN_GENERALIZATION_CONFIG agent_proxy.enable_think=False &
847
+ +# # Section 5.1 - Reasoning Helps Generalization
848
+
849
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-generalization \
850
+ +# custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
851
+ +# custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
852
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
853
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Librarian"
854
+
855
+ -# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=128 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SokobanDifferentGridVocab] es_manager.val.env_configs.n_groups=[128]"
856
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG &
857
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-generalization-nothink \
858
+ +# custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
859
+ +# custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
860
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
861
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Librarian" \
862
+ +# agent_proxy.enable_think=False
863
+
864
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=bandit-generalization-rev \
865
+ +# custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
866
+ +# custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
867
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
868
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Trader"
869
+
870
+ -# COMPOSITIONALITY_CONFIG="es_manager.train.env_groups=16 es_manager.train.env_configs.tags=[Bandit,SimpleSokoban] es_manager.train.env_configs.n_groups=[8,8] es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[Bandit,SimpleSokoban,LargerSokoban,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128] actor_rollout_ref.rollout.rollout_filter_ratio=1" # NOTE that we don't filter out low-var rollout in this setting
871
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=compositional-generalization $COMPOSITIONALITY_CONFIG &
872
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=compositional-generalization-nothink $COMPOSITIONALITY_CONFIG agent_proxy.enable_think=False &
873
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=bandit-generalization-rev-nothink \
874
+ +# custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
875
+ +# custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
876
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
877
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Trader" \
878
+ +# agent_proxy.enable_think=False
879
+
880
+ -wait
881
+
882
+ -# Section 5.2 - what leads to better reasoning?
883
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B-Instruct &
884
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B-Instruct &
885
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct trainer.n_gpus_per_node=2 &
886
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B-Instruct trainer.n_gpus_per_node=4 &
887
+ +# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
888
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization micro_batch_size_per_gpu=8 model_path=Qwen/Qwen2.5-1.5B-Instruct&
889
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-generalization-nothink $SOKOBAN_GENERALIZATION_CONFIG agent_proxy.enable_think=False &
890
+
891
+ -wait
892
+
893
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B &
894
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B &
895
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B &
896
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B &
897
+ +# # SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=128 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SokobanDifferentGridVocab] es_manager.val.env_configs.n_groups=[128]"
898
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG &
899
+
900
+ -wait
901
+
902
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-7B &
903
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B &
904
+ +# # COMPOSITIONALITY_CONFIG="es_manager.train.env_groups=16 es_manager.train.env_configs.tags=[Bandit,SimpleSokoban] es_manager.train.env_configs.n_groups=[8,8] es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[Bandit,SimpleSokoban,LargerSokoban,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128] actor_rollout_ref.rollout.rollout_filter_ratio=1" # NOTE that we don't filter out low-var rollout in this setting
905
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=compositional-generalization $COMPOSITIONALITY_CONFIG &
906
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=compositional-generalization-nothink $COMPOSITIONALITY_CONFIG agent_proxy.enable_think=False &
907
+
908
+ +# wait
909
+
910
+ -wait
911
+ +# # Section 5.2 - what leads to better reasoning?
912
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B-Instruct &
913
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B-Instruct &
914
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct trainer.n_gpus_per_node=2 &
915
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B-Instruct trainer.n_gpus_per_node=4 &
916
+
917
+ -# Section 6.1 varying action count
918
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-action-count-1 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=5 custom_envs.LargerSokoban.max_actions_per_traj=5 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=5 custom_envs.FrozenLake.max_actions_per_traj=5 agent_proxy.max_actions_per_turn=1 &
919
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-action-count-2 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=10 custom_envs.LargerSokoban.max_actions_per_traj=10 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=10 custom_envs.FrozenLake.max_actions_per_traj=10 agent_proxy.max_actions_per_turn=2 &
920
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-action-count-3 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=15 custom_envs.LargerSokoban.max_actions_per_traj=15 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=15 custom_envs.FrozenLake.max_actions_per_traj=15 agent_proxy.max_actions_per_turn=3 &
921
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-action-count-4 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=20 custom_envs.LargerSokoban.max_actions_per_traj=20 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=20 custom_envs.FrozenLake.max_actions_per_traj=20 agent_proxy.max_actions_per_turn=4 &
922
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-action-count-5 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=25 custom_envs.LargerSokoban.max_actions_per_traj=25 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=25 custom_envs.FrozenLake.max_actions_per_traj=25 agent_proxy.max_actions_per_turn=5 &
923
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-action-count-6 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=30 custom_envs.LargerSokoban.max_actions_per_traj=30 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=30 custom_envs.FrozenLake.max_actions_per_traj=30 agent_proxy.max_actions_per_turn=6 &
924
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-action-count-7 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=35 custom_envs.LargerSokoban.max_actions_per_traj=35 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=35 custom_envs.FrozenLake.max_actions_per_traj=35 agent_proxy.max_actions_per_turn=7 &
925
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-action-count-8 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=40 custom_envs.LargerSokoban.max_actions_per_traj=40 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=40 custom_envs.FrozenLake.max_actions_per_traj=40 agent_proxy.max_actions_per_turn=8 &
926
+ +# wait
927
+
928
+ -# section 6.2 Varying prompt diversity
929
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-prompt-diversity-4 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=4 es_manager.train.group_size=32 es_manager.train.env_configs.n_groups=[4] &
930
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-prompt-diversity-8 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] &
931
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-prompt-diversity-16 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=8 es_manager.train.env_configs.n_groups=[16] &
932
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-prompt-diversity-32 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=32 es_manager.train.group_size=4 es_manager.train.env_configs.n_groups=[32] &
933
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-prompt-diversity-64 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=64 es_manager.train.group_size=2 es_manager.train.env_configs.n_groups=[64] &
934
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-prompt-diversity-128 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=128 es_manager.train.group_size=1 es_manager.train.env_configs.n_groups=[128] &
935
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B &
936
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B &
937
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B &
938
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B &
939
+
940
+ -wait
941
+ +# wait
942
+
943
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-online-2 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[16] trainer.total_training_steps=100 trainer.test_freq=5 &
944
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-7B &
945
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B &
946
+
947
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-online-5 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=40 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[40] trainer.total_training_steps=40 trainer.test_freq=2 &
948
+
949
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-online-10 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=80 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[80] trainer.total_training_steps=80 trainer.test_freq=1 &
950
+ +# wait
951
+
952
+ +# # Section 6.1 varying action count
953
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-action-count-1 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=5 custom_envs.LargerSokoban.max_actions_per_traj=5 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=5 custom_envs.FrozenLake.max_actions_per_traj=5 agent_proxy.max_actions_per_turn=1 &
954
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-action-count-2 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=10 custom_envs.LargerSokoban.max_actions_per_traj=10 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=10 custom_envs.FrozenLake.max_actions_per_traj=10 agent_proxy.max_actions_per_turn=2 &
955
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-action-count-3 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=15 custom_envs.LargerSokoban.max_actions_per_traj=15 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=15 custom_envs.FrozenLake.max_actions_per_traj=15 agent_proxy.max_actions_per_turn=3 &
956
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-action-count-4 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=20 custom_envs.LargerSokoban.max_actions_per_traj=20 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=20 custom_envs.FrozenLake.max_actions_per_traj=20 agent_proxy.max_actions_per_turn=4 &
957
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-action-count-5 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=25 custom_envs.LargerSokoban.max_actions_per_traj=25 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=25 custom_envs.FrozenLake.max_actions_per_traj=25 agent_proxy.max_actions_per_turn=5 &
958
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-action-count-6 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=30 custom_envs.LargerSokoban.max_actions_per_traj=30 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=30 custom_envs.FrozenLake.max_actions_per_traj=30 agent_proxy.max_actions_per_turn=6 &
959
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-action-count-7 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=35 custom_envs.LargerSokoban.max_actions_per_traj=35 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=35 custom_envs.FrozenLake.max_actions_per_traj=35 agent_proxy.max_actions_per_turn=7 &
960
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-action-count-8 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=40 custom_envs.LargerSokoban.max_actions_per_traj=40 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=40 custom_envs.FrozenLake.max_actions_per_traj=40 agent_proxy.max_actions_per_turn=8 &
961
+
962
+ +# # section 6.2 Varying prompt diversity
963
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-prompt-diversity-4 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=4 es_manager.train.group_size=32 es_manager.train.env_configs.n_groups=[4] &
964
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-prompt-diversity-8 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] &
965
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-prompt-diversity-16 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=8 es_manager.train.env_configs.n_groups=[16] &
966
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-prompt-diversity-32 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=32 es_manager.train.group_size=4 es_manager.train.env_configs.n_groups=[32] &
967
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-prompt-diversity-64 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=64 es_manager.train.group_size=2 es_manager.train.env_configs.n_groups=[64] &
968
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-prompt-diversity-128 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=128 es_manager.train.group_size=1 es_manager.train.env_configs.n_groups=[128] &
969
+
970
+ +# wait
971
+
972
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-online-2 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[16] trainer.total_training_steps=100 trainer.test_freq=5 &
973
+
974
+ -# Extension: Training 7B reasoning model
975
+ -SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
976
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct-largescale $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] micro_batch_size_per_gpu=8 ppo_mini_batch_size=64 actor_rollout_ref.rollout.response_length=1024 actor_rollout_ref.rollout.max_model_len=6400 trainer.test_freq=5 actor_rollout_ref.rollout.max_num_batched_tokens=24000 micro_batch_size_per_gpu=2 actor_rollout_ref.rollout.rollout_filter_ratio=1 &
977
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-online-5 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=40 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[40] trainer.total_training_steps=40 trainer.test_freq=2 &
978
+
979
+ -python -m ragen.llm_agent.agent_proxy model_path=Qwen/Qwen2.5-3B-Instruct system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 actor_rollout_ref.rollout.tensor_model_parallel_size=4 actor_rollout_ref.rollout.response_length=2048 actor_rollout_ref.rollout.max_model_len=12800
980
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-online-10 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=80 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[80] trainer.total_training_steps=80 trainer.test_freq=1 &
981
+
982
+ -# trainer.save_freq=50 trainer.default_local_dir=/mnt/local/cache/exp_name
983
+
984
+ -# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
985
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization &
986
+
987
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/bandit-generalization &
988
+
989
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=frozenlake-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/frozenlake-generalization &
990
+
991
+ +# # Extension: Training 7B reasoning model
992
+ +# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
993
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct-largescale $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] micro_batch_size_per_gpu=8 ppo_mini_batch_size=64 actor_rollout_ref.rollout.response_length=1024 actor_rollout_ref.rollout.max_model_len=6400 trainer.test_freq=5 actor_rollout_ref.rollout.max_num_batched_tokens=24000 micro_batch_size_per_gpu=2 actor_rollout_ref.rollout.rollout_filter_ratio=1 &
994
+
995
+ +# python -m ragen.llm_agent.agent_proxy model_path=Qwen/Qwen2.5-3B-Instruct system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 actor_rollout_ref.rollout.tensor_model_parallel_size=4 actor_rollout_ref.rollout.response_length=2048 actor_rollout_ref.rollout.max_model_len=12800
996
+
997
+ +# # trainer.save_freq=50 trainer.default_local_dir=/mnt/local/cache/exp_name
998
+
999
+ -# USE_PPO="algorithm.adv_estimator=gae" # by default.
1000
+ -# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1001
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE ppo_mini_batch_size=64 enable_response_mask=True &
1002
+ +# # USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1003
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization &
1004
+
1005
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/bandit-generalization &
1006
+
1007
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std &
1008
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=frozenlake-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/frozenlake-generalization &
1009
+
1010
+ -# enable_response_mask: False
1011
+ -# grpo_advantage_length_weight: True
1012
+
1013
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo-1-5b algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std agent_proxy.max_actions_per_turn=5 custom_envs.SimpleSokoban.max_actions_per_traj=25 enable_response_mask=True grpo_advantage_length_weight=False model_path=Qwen/Qwen2.5-1.5B-Instruct &
1014
+
1015
+
1016
+ -# extension: 7B with lora. Currently NOT recommended to use lora: within current version of vllm, this could result in rollouts slower than non-lora by 100%
1017
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-7B-Instruct trainer.experiment_name=sokoban_7b_instruct_lora_newversion lora.rank=16
1018
+ +# # USE_PPO="algorithm.adv_estimator=gae" # by default.
1019
+ +# # USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1020
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE ppo_mini_batch_size=64 enable_response_mask=True &
1021
+
1022
+ -# extension: bi-level gae
1023
+ -python train.py trainer.experiment_name=sokoban-bi-level-gae-final \
1024
+ - system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
1025
+ - model_path=Qwen/Qwen2.5-0.5B-Instruct \
1026
+ - algorithm.bi_level_gae=True algorithm.high_level_gamma=0.95 \
1027
+ - agent_proxy.use_turn_scores=True \
1028
+ - actor_rollout_ref.rollout.tp_size_check=False
1029
+
1030
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std &
1031
+
1032
+ -# extension: webshop
1033
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1034
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1035
+ - trainer.experiment_name=webshop-3b-ppo-s $USE_PPO \
1036
+ - trainer.nnodes=1 &
1037
+ +# # enable_response_mask: False
1038
+ +# # grpo_advantage_length_weight: True
1039
+
1040
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo-1-5b algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std agent_proxy.max_actions_per_turn=5 custom_envs.SimpleSokoban.max_actions_per_traj=25 enable_response_mask=True grpo_advantage_length_weight=False model_path=Qwen/Qwen2.5-1.5B-Instruct &
1041
+
1042
+ -USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1043
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1044
+ - trainer.experiment_name=webshop-3b-grpo-s $USE_GRPO \
1045
+ - trainer.nnodes=1 &
1046
+
1047
+ -# StarPO ppo
1048
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1049
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1050
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1051
+ - trainer.experiment_name=webshop-3b-ppo $USE_PPO $USE_BASE \
1052
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1053
+ - trainer.nnodes=1 &
1054
+ +# # extension: 7B with lora. Currently NOT recommended to use lora: within current version of vllm, this could result in rollouts slower than non-lora by 100%
1055
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-7B-Instruct trainer.experiment_name=sokoban_7b_instruct_lora_newversion lora.rank=16
1056
+
1057
+ -# StarPO grpo
1058
+ -USE_GRPO="algorithm.adv_estimator=grpo"
1059
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1060
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1061
+ - trainer.experiment_name=webshop-3b-grpo $USE_GRPO $USE_BASE \
1062
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1063
+ - trainer.nnodes=1 &
1064
+ +# # extension: bi-level gae
1065
+ +# python train.py trainer.experiment_name=sokoban-bi-level-gae-final \
1066
+ +# system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
1067
+ +# model_path=Qwen/Qwen2.5-0.5B-Instruct \
1068
+ +# algorithm.bi_level_gae=True algorithm.high_level_gamma=0.95 \
1069
+ +# agent_proxy.use_turn_scores=True \
1070
+ +# actor_rollout_ref.rollout.tp_size_check=False
1071
+
1072
+
1073
+ -# normal:sokoban
1074
+ -# extension: sokoban
1075
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1076
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1077
+ - trainer.experiment_name=sokoban-3b-ppo-s $USE_PPO \
1078
+ - trainer.nnodes=1 &
1079
+ +# # extension: webshop
1080
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1081
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1082
+ +# trainer.experiment_name=webshop-3b-ppo-s $USE_PPO \
1083
+ +# trainer.nnodes=1 &
1084
+
1085
+
1086
+ -USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1087
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1088
+ - trainer.experiment_name=sokoban-3b-grpo-s $USE_GRPO \
1089
+ - trainer.nnodes=1 &
1090
+ +# USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1091
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1092
+ +# trainer.experiment_name=webshop-3b-grpo-s $USE_GRPO \
1093
+ +# trainer.nnodes=1 &
1094
+
1095
+ -# StarPO ppo
1096
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1097
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1098
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1099
+ - trainer.experiment_name=sokoban-3b-ppo $USE_PPO $USE_BASE \
1100
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1101
+ - trainer.nnodes=1 &
1102
+ +# # StarPO ppo
1103
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1104
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1105
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1106
+ +# trainer.experiment_name=webshop-3b-ppo $USE_PPO $USE_BASE \
1107
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1108
+ +# trainer.nnodes=1 &
1109
+
1110
+ -# StarPO grpo
1111
+ -USE_GRPO="algorithm.adv_estimator=grpo"
1112
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1113
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1114
+ - trainer.experiment_name=sokoban-3b-grpo $USE_GRPO $USE_BASE \
1115
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1116
+ - trainer.nnodes=1 &
1117
+ +# # StarPO grpo
1118
+ +# USE_GRPO="algorithm.adv_estimator=grpo"
1119
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1120
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1121
+ +# trainer.experiment_name=webshop-3b-grpo $USE_GRPO $USE_BASE \
1122
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1123
+ +# trainer.nnodes=1 &
1124
+ +
1125
+ +
1126
+ +# # normal:sokoban
1127
+ +# # extension: sokoban
1128
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1129
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1130
+ +# trainer.experiment_name=sokoban-3b-ppo-s $USE_PPO \
1131
+ +# trainer.nnodes=1 &
1132
+ +
1133
+ +
1134
+ +# USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1135
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1136
+ +# trainer.experiment_name=sokoban-3b-grpo-s $USE_GRPO \
1137
+ +# trainer.nnodes=1 &
1138
+ +
1139
+ +# # StarPO ppo
1140
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1141
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1142
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1143
+ +# trainer.experiment_name=sokoban-3b-ppo $USE_PPO $USE_BASE \
1144
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1145
+ +# trainer.nnodes=1 &
1146
+ +
1147
+ +# # StarPO grpo
1148
+ +# USE_GRPO="algorithm.adv_estimator=grpo"
1149
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1150
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1151
+ +# trainer.experiment_name=sokoban-3b-grpo $USE_GRPO $USE_BASE \
1152
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1153
+ +# trainer.nnodes=1 &
1154
+
1155
+
1156
+
1157
+ -python train.py \
1158
+ - trainer.experiment_name=3b-full-ppo-test system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2
1159
+
1160
+ +# python train.py \
1161
+ +# trainer.experiment_name=3b-full-ppo-test system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2
1162
+
wandb/run-20251218_182745-ahjkdup0/files/diff_8d73639b99b38265453f898b8d6af7d4af50d56e.patch ADDED
@@ -0,0 +1,1162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/config/base.yaml b/config/base.yaml
2
+ index a1659e4..9df6250 100644
3
+ --- a/config/base.yaml
4
+ +++ b/config/base.yaml
5
+ @@ -9,15 +9,16 @@ seed:
6
+ train: 10000
7
+ val: 123
8
+
9
+ -micro_batch_size_per_gpu: 4
10
+ +micro_batch_size_per_gpu: 1
11
+ ppo_mini_batch_size: 32
12
+ -model_path: Qwen/Qwen2.5-3B-Instruct
13
+ +model_path: /mnt/general/share/model/Qwen/Qwen2.5-0.5B-Instruct
14
+ +# Qwen/Qwen2.5-0.5B-Instruct
15
+ enable_response_mask: True # Enabling response mask could improve stability of rollout/old_log_prob, as P(st|history) are no longer calculated in loss here. See https://docs.google.com/document/d/1bg7obeiKTExuHHBl5uOiSpec5uLDZ2Tgvxy6li5pHX4/edit?usp=sharing for more details.
16
+ grpo_advantage_length_weight: False # if you do not enable this and critic/advantage_estimator is GRPO, and the critic/advantages/mean is too low, then you can try enabling this to encourage reasoning and forbid collapse
17
+
18
+ lora:
19
+ rank: 0
20
+ - alpha: 64
21
+ + alpha: 16
22
+ target_modules: all-linear
23
+
24
+ actor_rollout_ref:
25
+ @@ -46,10 +47,10 @@ actor_rollout_ref:
26
+ name: vllm
27
+ log_prob_micro_batch_size_per_gpu: ${micro_batch_size_per_gpu} # following micro_batch_size_per_gpu
28
+ tensor_model_parallel_size: 1
29
+ - max_model_len: 3600
30
+ + max_model_len: 7200 #3600 why** 14400
31
+ prompt_length: 1 # useless. Just put it here
32
+ response_length: 400 # single-turn response length
33
+ - gpu_memory_utilization: 0.5
34
+ + gpu_memory_utilization: 0.7
35
+ max_num_batched_tokens: 8192 # set only when enable_chunked_prefill is true
36
+ temperature: 1
37
+ rollout_filter_ratio: 0.25
38
+ @@ -90,26 +91,28 @@ algorithm:
39
+ kl_coef: 0.000
40
+
41
+ trainer:
42
+ - project_name: ragen_latest
43
+ + project_name:
44
+ experiment_name: test
45
+ local_log_dir: "results/"
46
+ - save_freq: 100
47
+ + save_freq: -1
48
+ total_training_steps: 200
49
+ validation_steps: 1 # validation instances = validation_steps * val_env_groups * group_size
50
+ val_before_train: True
51
+ n_gpus_per_node: 1
52
+ test_freq: 10
53
+ generations_to_log_to_wandb:
54
+ + train: 128
55
+ val: 20
56
+ logger: [ 'console', 'wandb' ]
57
+ max_actor_ckpt_to_keep: 1
58
+ max_critic_ckpt_to_keep: 1
59
+ + default_local_dir: /mnt/general/wanghy/RAGEN/saves/
60
+
61
+ agent_proxy:
62
+ max_context_window: -1 # set a value > 0 to enable context window for long trajectory
63
+ - max_turn: 5
64
+ + max_turn: 25 #25 why** 700
65
+ action_sep: "||"
66
+ - max_actions_per_turn: 2 # how many actions can be output at most in a single turn
67
+ + max_actions_per_turn: 1 # how many actions can be output at most in a single turn
68
+ use_turn_scores: False # important to GAE when applying token-level rewards to token-level advantages. If False, will take the sum of scores as the reward for the last turn.
69
+ enable_think: True # False -> no think RL
70
+ reward_normalization:
71
+ @@ -126,11 +129,11 @@ es_manager:
72
+ tags: ["CoordSokoban"]
73
+ n_groups: [8] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
74
+ val:
75
+ - env_groups: 32
76
+ - group_size: 16 # should be set to 1 because when val temperature is set to 0 and group size > 1, there will be repetitive prompts which leads to same trajectory.
77
+ + env_groups: 256
78
+ + group_size: 1 # should be set to 1 because when val temperature is set to 0 and group size > 1, there will be repetitive prompts which leads to same trajectory.
79
+ env_configs:
80
+ tags: ["CoordSokoban"]
81
+ - n_groups: [32] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
82
+ + n_groups: [256] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
83
+
84
+ ctx_manager:
85
+ generation: # go to vllm
86
+ diff --git a/config/envs.yaml b/config/envs.yaml
87
+ index 1002ac8..ba3ac6f 100644
88
+ --- a/config/envs.yaml
89
+ +++ b/config/envs.yaml
90
+ @@ -2,6 +2,7 @@ custom_envs:
91
+ SimpleSokoban:
92
+ env_type: sokoban
93
+ max_actions_per_traj: 10 # used in environment state manager to control the actual max actions executed per trajectory
94
+ + # ORIGNAL env_instruction
95
+ env_instruction: |
96
+ You are solving the Sokoban puzzle.
97
+ You are the player and you need to push all boxes to targets.
98
+ @@ -12,7 +13,7 @@ custom_envs:
99
+ env_config: # keys should be a subset of SokobanConfig
100
+ dim_x: 6
101
+ dim_y: 6
102
+ - num_boxes: 1
103
+ + num_boxes: 2
104
+ max_steps: 100
105
+
106
+ LargerSokoban:
107
+ @@ -65,7 +66,7 @@ custom_envs:
108
+ env_config: # keys should be a subset of SokobanConfig
109
+ dim_x: 6
110
+ dim_y: 6
111
+ - num_boxes: 1
112
+ + num_boxes: 2
113
+ max_steps: 100
114
+ observation_format: "grid_coord"
115
+
116
+ @@ -111,14 +112,14 @@ custom_envs:
117
+
118
+ FrozenLake:
119
+ env_type: frozen_lake
120
+ - max_actions_per_traj: 10
121
+ + max_actions_per_traj: 25
122
+ env_instruction: "You are solving the FrozenLake puzzle. Forbid the whole and go to the target. You may move to the unintended direction due to the slippery ice. Example answer format: <think>To forbid the hole and go to the target, I should go left then go up.</think><answer>Left || Up</answer>"
123
+ max_tokens: 100
124
+ env_config: null
125
+
126
+ CoordFrozenLake:
127
+ env_type: frozen_lake
128
+ - max_actions_per_traj: 10
129
+ + max_actions_per_traj: 25
130
+ env_instruction: |
131
+ You are solving the FrozenLake puzzle. The observation includes both a symbol grid and zero-indexed coordinates for the start, goal, player, and any holes.
132
+ Coordinates range from the top-left corner (0, 0) to the bottom-right corner (5, 5).
133
+ @@ -195,4 +196,80 @@ custom_envs:
134
+ max_actions_per_traj: 30
135
+ env_instruction: "You are a Lean theorem prover. Given a Lean theorem statement, propose a sequence of tactics that completes the proof. Think step by step about which tactics to apply next. Provide tactics separated by '||', for example <answer>intro || simp || rfl</answer>."
136
+ max_tokens: 512
137
+ - env_config: null # Please refer to ragen/env/lean/config.py for a full list of parameters.
138
+
139
+ + env_config: null # Please refer to ragen/env/lean/config.py for a full list of parameters.
140
+ +
141
+ +
142
+ + game_2048:
143
+ + env_type: game_2048
144
+ + max_actions_per_traj: 700
145
+ + env_instruction: |
146
+ + You are playing the 2048 game on a 4x4 grid. Merge equal tiles by sliding Up, Right, Down, or Left.
147
+ + If a move is invalid (no tiles move), a small penalty is applied. Respond with a single action.
148
+ + Example: <answer>Up</answer>
149
+ + max_tokens: 8192
150
+ + env_config: null
151
+ +
152
+ + blackjack:
153
+ + env_type: blackjack
154
+ + max_actions_per_traj: 10
155
+ + env_instruction: |
156
+ + You are playing Blackjack against a dealer. The dealer must hit on 16 or less and stand on 17 or more.
157
+ + Choose either Stick or Hit. Respond with a single action.
158
+ + Example: <answer>Hit</answer>
159
+ + max_tokens: 64
160
+ + env_config: null
161
+ +
162
+ + rubikscube:
163
+ + env_type: rubikscube
164
+ + max_actions_per_traj: 20
165
+ + env_instruction: |
166
+ + You are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.
167
+ + Available actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.
168
+ + - Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).
169
+ + - Modifiers: A letter alone means 90° clockwise (e.g., 'R'). A letter with prime (') means 90° counter-clockwise (e.g., "R'").
170
+ + Respond with a sequence of actions separated by "||".
171
+ + Example: <answer>U</answer>
172
+ + max_tokens: 96
173
+ + env_config:
174
+ + scramble_depth: 1
175
+ + max_steps: 20
176
+ + render_mode: "text"
177
+ +
178
+ + SimpleSudoku:
179
+ + env_type: sudoku
180
+ + max_actions_per_traj: 20
181
+ + env_instruction: |
182
+ + You are solving a Sudoku puzzle. Fill in the grid so that every row, column, and 2x2 box contains the numbers 1-4 without repetition.
183
+ + Initial cells are shown in [brackets] and cannot be modified. Empty cells are shown as dots (.).
184
+ + Place numbers one at a time using the format, for example: <answer>place 1 at row 2 col 3</answer> or <answer>1,2,3</answer>
185
+ + The environment will provide feedback on valid/invalid moves and show conflicts if any occur.
186
+ + max_tokens: 150
187
+ + parallel_friendly: false
188
+ + max_workers: 32
189
+ + env_config:
190
+ + grid_size: 4
191
+ + difficulty: "easy"
192
+ + render_format: "with_feedback"
193
+ + show_conflicts: false
194
+ + show_valid_numbers: false
195
+ + max_steps: 20
196
+ +
197
+ + MediumSudoku:
198
+ + env_type: sudoku
199
+ + max_actions_per_traj: 30
200
+ + env_instruction: |
201
+ + You are solving a Sudoku puzzle. Fill in the grid so that every row, column, and 3x3 box contains the numbers 1-9 without repetition.
202
+ + Initial cells are shown in [brackets] and cannot be modified. Empty cells are shown as dots (.).
203
+ + Place numbers one at a time using the format: <answer>place 5 at row 2 col 3</answer> or <answer>2,3,5</answer>
204
+ + The environment will provide feedback on valid/invalid moves and show conflicts if any occur.
205
+ + max_tokens: 150
206
+ + parallel_friendly: false
207
+ + max_workers: 32
208
+ + env_config:
209
+ + grid_size: 9
210
+ + difficulty: "medium"
211
+ + render_format: "with_feedback"
212
+ + show_conflicts: true
213
+ + show_valid_numbers: true
214
+ + max_steps: 81
215
+ +
216
+ diff --git a/config/eval.yaml b/config/eval.yaml
217
+ index e65f3a5..7775fd1 100644
218
+ --- a/config/eval.yaml
219
+ +++ b/config/eval.yaml
220
+ @@ -1,14 +1,15 @@
221
+ defaults:
222
+ - envs
223
+ -
224
+ +enable_response_mask: True
225
+ system:
226
+ - CUDA_VISIBLE_DEVICES: "0"
227
+ + CUDA_VISIBLE_DEVICES: "0,1,2,3,4,5,6,7"
228
+
229
+ seed:
230
+ train: 10000
231
+ val: 123
232
+
233
+ -model_path: Qwen/Qwen2.5-3B-Instruct
234
+ +model_path: /mnt/general/share/model/openai/gpt-oss-20b
235
+ +# /mnt/general/share/model/tyzhu/SPA-frozenlake-qwen2.5-1.5b-instruct
236
+
237
+ lora:
238
+ rank: 0
239
+ @@ -24,9 +25,9 @@ actor_rollout_ref:
240
+ rollout:
241
+ name: vllm
242
+ log_prob_micro_batch_size_per_gpu: ${micro_batch_size_per_gpu}
243
+ - tensor_model_parallel_size: 1
244
+ + tensor_model_parallel_size: 8
245
+ dtype: bfloat16
246
+ - max_model_len: 3600
247
+ + max_model_len: 7200
248
+ prompt_length: 1
249
+ response_length: 400
250
+ gpu_memory_utilization: 0.9
251
+ @@ -35,6 +36,7 @@ actor_rollout_ref:
252
+ free_cache_engine: True
253
+ enable_chunked_prefill: False
254
+ disable_log_stats: False
255
+ + do_sample: True
256
+ val_kwargs:
257
+ do_sample: True
258
+ temperature: 0.5
259
+ @@ -44,9 +46,9 @@ actor_rollout_ref:
260
+
261
+ agent_proxy:
262
+ max_context_window: -1
263
+ - max_turn: 5
264
+ + max_turn: 25
265
+ action_sep: "||"
266
+ - max_actions_per_turn: 2
267
+ + max_actions_per_turn: 1
268
+ use_turn_scores: False
269
+ enable_think: True
270
+ reward_normalization:
271
+ @@ -59,13 +61,13 @@ es_manager:
272
+ env_groups: 8
273
+ group_size: 16
274
+ env_configs:
275
+ - tags: ["CoordSokoban"]
276
+ + tags: ["BanditTest"]
277
+ n_groups: [8]
278
+ val:
279
+ env_groups: 32
280
+ - group_size: 16
281
+ + group_size: 128
282
+ env_configs:
283
+ - tags: ["CoordSokoban"]
284
+ + tags: ["BanditTest"]
285
+ n_groups: [32]
286
+
287
+ ctx_manager:
288
+ diff --git a/config/evaluate_api_llm.yaml b/config/evaluate_api_llm.yaml
289
+ index b21c95e..e2e6761 100644
290
+ --- a/config/evaluate_api_llm.yaml
291
+ +++ b/config/evaluate_api_llm.yaml
292
+ @@ -1,8 +1,11 @@
293
+ +#export OPENAI_BASE_URL="https://api.ohmygpt.com/v1"
294
+ +#export OPENAI_API_KEY="sk-o4sMxBkN5BB100C4D4a3T3BlBkFJF7791CA39EA14ca98041"
295
+ +#python -m ragen.eval_api hydra.searchpath='[file://./verl/verl/trainer/config]'
296
+ defaults:
297
+ - base # this is a symbolic link to the verl/verl/trainer/config/ppo_trainer.yaml file
298
+
299
+ model_config:
300
+ - model_name: gpt-4o # should be registered in model_info
301
+ + model_name: ark-deepseek-v3-250324 # should be registered in model_info
302
+ max_concurrency: 16
303
+
304
+ model_info:
305
+ @@ -24,9 +27,9 @@ model_info:
306
+ generation_kwargs:
307
+ temperature: 0
308
+ max_tokens: 512 # max_completion_tokens if o1-mini
309
+ - gpt-4o:
310
+ + gpt-4o-mini:
311
+ provider_name: openai
312
+ - model_name: gpt-4o
313
+ + model_name: gpt-4o-mini
314
+ generation_kwargs:
315
+ temperature: 0
316
+ max_tokens: 512 # max_completion_tokens if o1-mini
317
+ @@ -36,21 +39,42 @@ model_info:
318
+ generation_kwargs:
319
+ temperature: 0
320
+ max_completion_tokens: 512
321
+ + ark-deepseek-v3-250324:
322
+ + provider_name: openai
323
+ + model_name: ark-deepseek-v3-250324
324
+ + generation_kwargs:
325
+ + temperature: 0
326
+ + max_completion_tokens: 512
327
+ deepseek-v3:
328
+ provider_name: deepseek
329
+ model_name: deepseek-chat
330
+ generation_kwargs:
331
+ temperature: 0
332
+ max_completion_tokens: 512
333
+ + glm-4.6:
334
+ + provider_name: openai
335
+ + model_name: glm-4.6
336
+ + generation_kwargs:
337
+ + temperature: 0
338
+ + max_completion_tokens: 512
339
+ + TA/openai/gpt-oss-120b:
340
+ + provider_name: openai
341
+ + model_name: TA/openai/gpt-oss-120b
342
+ + generation_kwargs:
343
+ + temperature: 0
344
+ + max_tokens: 8192
345
+ + # max_retries: 5
346
+
347
+ -
348
+ -
349
+ +agent_proxy:
350
+ + max_turn: 5
351
+ es_manager:
352
+ val:
353
+ - env_groups: 256
354
+ + env_groups: 128
355
+ group_size: 1 # should be set to 1 because val temperature is set to 0 and same prompt leads to same output
356
+ env_configs:
357
+ - tags: ["CoordSokoban"]
358
+ - n_groups: [256] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
359
+ + tags: ["rubikscube"]
360
+ + n_groups: [128] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
361
+
362
+
363
+ +rollout:
364
+ + max_model_len: 7200
365
+
366
+ Submodule external/webshop-minimal contains modified content
367
+ diff --git a/external/webshop-minimal/requirements.txt b/external/webshop-minimal/requirements.txt
368
+ index 5a1b04f..238ed5a 100644
369
+ --- a/external/webshop-minimal/requirements.txt
370
+ +++ b/external/webshop-minimal/requirements.txt
371
+ @@ -4,7 +4,7 @@ flask
372
+ html2text
373
+ rank_bm25
374
+ pyserini
375
+ -faiss-cpu
376
+ +faiss-gpu
377
+ thefuzz
378
+ gdown
379
+ spacy
380
+ diff --git a/ragen/env/__init__.py b/ragen/env/__init__.py
381
+ index b0f3461..bc6838e 100644
382
+ --- a/ragen/env/__init__.py
383
+ +++ b/ragen/env/__init__.py
384
+ @@ -12,6 +12,14 @@ from .metamathqa.env import MetaMathQAEnv
385
+ from .metamathqa.config import MetaMathQAEnvConfig
386
+ from .lean.config import LeanEnvConfig
387
+ from .lean.env import LeanEnv
388
+ +from .game_2048.config import Game2048EnvConfig
389
+ +from .game_2048.env import Game2048Env
390
+ +from .blackjack.config import BlackjackEnvConfig
391
+ +from .blackjack.env import BlackjackEnv
392
+ +from .rubikscube.config import RubiksCube2x2Config
393
+ +from .rubikscube.env import RubiksCube2x2Env
394
+ +from .sudoku.config import SudokuEnvConfig
395
+ +from .sudoku.env import SudokuEnv
396
+
397
+
398
+ REGISTERED_ENVS = {
399
+ @@ -22,6 +30,10 @@ REGISTERED_ENVS = {
400
+ # 'alfworld': AlfredTXTEnv,
401
+ 'metamathqa': MetaMathQAEnv,
402
+ 'lean': LeanEnv,
403
+ + 'game_2048': Game2048Env,
404
+ + 'blackjack': BlackjackEnv,
405
+ + 'rubikscube': RubiksCube2x2Env,
406
+ + 'sudoku': SudokuEnv,
407
+ }
408
+
409
+ REGISTERED_ENV_CONFIGS = {
410
+ @@ -32,6 +44,10 @@ REGISTERED_ENV_CONFIGS = {
411
+ # 'alfworld': AlfredEnvConfig,
412
+ 'metamathqa': MetaMathQAEnvConfig,
413
+ 'lean': LeanEnvConfig,
414
+ + 'game_2048': Game2048EnvConfig,
415
+ + 'blackjack': BlackjackEnvConfig,
416
+ + 'rubikscube': RubiksCube2x2Config,
417
+ + 'sudoku': SudokuEnvConfig,
418
+ }
419
+
420
+ try:
421
+ diff --git a/ragen/env/frozen_lake/config.py b/ragen/env/frozen_lake/config.py
422
+ index de054f4..9950c34 100644
423
+ --- a/ragen/env/frozen_lake/config.py
424
+ +++ b/ragen/env/frozen_lake/config.py
425
+ @@ -8,7 +8,7 @@ class FrozenLakeEnvConfig:
426
+ size: int = 4
427
+ p: float = 0.9
428
+ success_rate: float = 0.8
429
+ - is_slippery: bool = True
430
+ + is_slippery: bool = False
431
+ map_seed: Optional[int] = None
432
+ render_mode: str = "text"
433
+ observation_format: str = "grid"
434
+ diff --git a/ragen/env/frozen_lake/env.py b/ragen/env/frozen_lake/env.py
435
+ index 9ee3add..eef11d8 100644
436
+ --- a/ragen/env/frozen_lake/env.py
437
+ +++ b/ragen/env/frozen_lake/env.py
438
+ @@ -13,6 +13,7 @@ from ragen.env.base import BaseDiscreteActionEnv
439
+ class FrozenLakeEnv(BaseDiscreteActionEnv, GymFrozenLakeEnv):
440
+ def __init__(self, config: FrozenLakeEnvConfig = FrozenLakeEnvConfig()):
441
+ # Using mappings directly from config
442
+ + # import pdb;pdb.set_trace()
443
+ self.config = config
444
+ self.GRID_LOOKUP = config.grid_lookup
445
+ self.ACTION_LOOKUP = config.action_lookup
446
+ @@ -95,6 +96,7 @@ class FrozenLakeEnv(BaseDiscreteActionEnv, GymFrozenLakeEnv):
447
+ if __name__ == "__main__":
448
+ import matplotlib.pyplot as plt
449
+ config = FrozenLakeEnvConfig(size=4, is_slippery=True)
450
+ + # import pdb;pdb.set_trace()
451
+ env = FrozenLakeEnv(config)
452
+ print(env.reset())
453
+ while True:
454
+ diff --git a/ragen/env/sokoban/env.py b/ragen/env/sokoban/env.py
455
+ index 17cd636..6922b54 100644
456
+ --- a/ragen/env/sokoban/env.py
457
+ +++ b/ragen/env/sokoban/env.py
458
+ @@ -33,6 +33,7 @@ class SokobanEnv(BaseDiscreteActionEnv, GymSokobanEnv):
459
+ def reset(self, seed=None, mode=None):
460
+ try:
461
+ with all_seed(seed):
462
+ + # import pdb;pdb.set_trace()
463
+ self.room_fixed, self.room_state, self.box_mapping, action_sequence = generate_room(
464
+ dim=self.dim_room,
465
+ num_steps=self.num_gen_steps,
466
+ diff --git a/ragen/llm_agent/agent_proxy.py b/ragen/llm_agent/agent_proxy.py
467
+ index c25b50d..f6c4088 100644
468
+ --- a/ragen/llm_agent/agent_proxy.py
469
+ +++ b/ragen/llm_agent/agent_proxy.py
470
+ @@ -287,6 +287,7 @@ def main(config):
471
+ proxy = LLMAgentProxy(config, actor_wg, tokenizer)
472
+ import time
473
+ start_time = time.time()
474
+ + # import pdb;pdb.set_trace()
475
+ rollouts = proxy.rollout(
476
+ DataProto(
477
+ batch=None,
478
+ diff --git a/ragen/llm_agent/base_llm.py b/ragen/llm_agent/base_llm.py
479
+ index 358a2eb..b6f7797 100644
480
+ --- a/ragen/llm_agent/base_llm.py
481
+ +++ b/ragen/llm_agent/base_llm.py
482
+ @@ -33,6 +33,7 @@ class OpenAIProvider(LLMProvider):
483
+ raise ValueError("OpenAI API key not provided and not found in environment variables")
484
+
485
+ self.client = AsyncOpenAI(api_key=self.api_key)
486
+ + # import pdb;pdb.set_trace()
487
+
488
+ async def generate(self, messages: List[Dict[str, str]], **kwargs) -> LLMResponse:
489
+ if "o1-mini" in self.model_name:
490
+ @@ -46,10 +47,7 @@ class OpenAIProvider(LLMProvider):
491
+ )
492
+ if response.choices[0].finish_reason in ['length', 'content_filter']:
493
+ raise ValueError("Content filtered or length exceeded")
494
+ - return LLMResponse(
495
+ - content=response.choices[0].message.content,
496
+ - model_name=response.model
497
+ - )
498
+ + return LLMResponse(content=response.choices[0].message.content,model_name=response.model)
499
+
500
+ class DeepSeekProvider(LLMProvider):
501
+ """DeepSeek API provider implementation"""
502
+ @@ -199,7 +197,7 @@ class ConcurrentLLM:
503
+
504
+ # Queue to store unfinished or failed tasks
505
+ current_batch = messages_list.copy()
506
+ - max_retries = kwargs.get("max_retries", 100)
507
+ + max_retries = kwargs.get("max_retries", 10)
508
+ retry_count = 0
509
+
510
+ while current_batch and retry_count < max_retries:
511
+ diff --git a/ragen/llm_agent/ctx_manager.py b/ragen/llm_agent/ctx_manager.py
512
+ index 905247a..af20a01 100644
513
+ --- a/ragen/llm_agent/ctx_manager.py
514
+ +++ b/ragen/llm_agent/ctx_manager.py
515
+ @@ -88,6 +88,7 @@ class ContextManager:
516
+ Initialize the ContextManager.
517
+ Processor is used to process the image data.
518
+ """
519
+ + # import pdb;pdb.set_trace()
520
+ self.config = config
521
+ self.tokenizer = tokenizer
522
+ self.processor = processor
523
+ @@ -311,7 +312,7 @@ class ContextManager:
524
+
525
+ llm_input_texts.append(text_with_prompt)
526
+ messages_list.append(messages)
527
+ -
528
+ + # import pdb;pdb.set_trace()
529
+ inputs = self.tokenizer(llm_input_texts, return_tensors="pt", padding=True, padding_side="left", truncation=False) # We have truncated previously, truncation in tokenizer may cause issues.
530
+ input_ids, attention_mask = inputs.input_ids, inputs.attention_mask
531
+ position_ids = (attention_mask.cumsum(dim=-1) - 1).clamp(min=0)
532
+ @@ -353,6 +354,30 @@ class ContextManager:
533
+ key: np.sum(value) / self.env_nums[key.split("/")[0]]
534
+ for key, value in metrics.items()
535
+ }
536
+ + # Derived metrics for wandb logging
537
+ + try:
538
+ + # charts/avg_episode_return: average across all 2048 env groups
539
+ + ep_keys = [k for k in metrics.keys() if k.endswith('/episodic_return')]
540
+ + if len(ep_keys) > 0:
541
+ + ep_vals = []
542
+ + for k in ep_keys:
543
+ + tag = k.split('/')[0]
544
+ + denom = self.env_nums.get(tag, max(1, len(metrics[k])))
545
+ + ep_vals.append(float(np.sum(metrics[k]) / denom))
546
+ + mean_metrics["charts/avg_episode_return"] = float(np.mean(ep_vals))
547
+ + except Exception:
548
+ + pass
549
+ + try:
550
+ + # rollout/max_tile: max over all envs in this batch
551
+ + tile_keys = [k for k in metrics.keys() if k.endswith('/max_tile')]
552
+ + if len(tile_keys) > 0:
553
+ + tile_vals = []
554
+ + for k in tile_keys:
555
+ + tile_vals.extend(metrics[k])
556
+ + if len(tile_vals) > 0:
557
+ + mean_metrics["rollout/max_tile"] = int(np.max(tile_vals))
558
+ + except Exception:
559
+ + pass
560
+ for key, values in metrics.items():
561
+ if not isinstance(values, list):
562
+ continue
563
+ diff --git a/ragen/llm_agent/es_manager.py b/ragen/llm_agent/es_manager.py
564
+ index b87a2b3..1a49d3e 100644
565
+ --- a/ragen/llm_agent/es_manager.py
566
+ +++ b/ragen/llm_agent/es_manager.py
567
+ @@ -128,18 +128,40 @@ class EnvStateManager:
568
+ env_outputs: List[Dict]
569
+ {env_id: int, history: List[Dict][{state: str, actions: List[str], reward: float, info: Dict, llm_response: str, llm_raw_response: str, (Optional)images: List[PIL.Image.Image]}]}
570
+ """
571
+ + # def _execute_actions(env, actions):
572
+ + # acc_reward, turn_info, turn_done = 0, {}, False
573
+ + # executed_actions = []
574
+ + # for action in actions:
575
+ + # _, reward, done, info = env.step(action)
576
+ + # acc_reward += reward
577
+ + # turn_info.update(info) # NOTE: currently use last info for multi-action
578
+ + # executed_actions.append(action)
579
+ + # if done:
580
+ + # turn_done = True
581
+ + # break
582
+ +
583
+ + # return acc_reward, turn_info, turn_done, executed_actions
584
+ def _execute_actions(env, actions):
585
+ - acc_reward, turn_info, turn_done = 0, {}, False
586
+ + acc_reward, turn_info, turn_done = 0.0, {}, False
587
+ + raw_acc_reward = 0.0
588
+ executed_actions = []
589
+ for action in actions:
590
+ _, reward, done, info = env.step(action)
591
+ - acc_reward += reward
592
+ + acc_reward += float(reward)
593
+ + try:
594
+ + raw_acc_reward += float(info.get('raw_reward', 0.0))
595
+ + except Exception:
596
+ + pass
597
+ turn_info.update(info) # NOTE: currently use last info for multi-action
598
+ executed_actions.append(action)
599
+ if done:
600
+ turn_done = True
601
+ break
602
+ -
603
+ + # Overwrite per-turn raw_reward to reflect the sum across all executed actions in this turn
604
+ + try:
605
+ + turn_info['raw_reward'] = float(raw_acc_reward)
606
+ + except Exception:
607
+ + pass
608
+ return acc_reward, turn_info, turn_done, executed_actions
609
+
610
+ def _log_env_state(status, history, cur_obs, max_actions_per_traj, executed_actions, all_actions, acc_reward, turn_done, turn_info, env_input):
611
+ @@ -198,6 +220,18 @@ class EnvStateManager:
612
+ 'success': float(status.terminated and (not status.truncated)),
613
+ 'num_actions': status.num_actions,
614
+ }
615
+ + # Add episodic-level metrics
616
+ + # try:
617
+ + # # Sum of per-turn rewards equals the episodic return (env-shaped reward)
618
+ + # env_metric['episodic_return'] = float(sum(status.rewards))
619
+ + # except Exception:
620
+ + # pass
621
+ + try:
622
+ + # Final max tile on the board at the end of the rollout
623
+ + import numpy as _np
624
+ + env_metric['max_tile'] = int(_np.max(entry['env'].grid))
625
+ + except Exception:
626
+ + pass
627
+ custom_metric = {}
628
+ for turn in cache['history']:
629
+ for k, v in turn.get('info', {}).items():
630
+ @@ -212,6 +246,12 @@ class EnvStateManager:
631
+ "Skipping non-numeric metric '%s' with value %r for env %s.",
632
+ k, v, entry['tag']
633
+ )
634
+ + # Add episodic_return as the SUM of raw_reward across steps (align with CleanRL)
635
+ + try:
636
+ + if 'raw_reward' in custom_metric:
637
+ + env_metric['episodic_return'] = float(np.sum(custom_metric['raw_reward']))
638
+ + except Exception:
639
+ + pass
640
+ for k, v in custom_metric.items():
641
+ # TODO: Move TURN_LVL_METRICS into the environment
642
+ if "webshop" not in cache['tag'].lower() or ("webshop" in cache['tag'].lower() and k in TURN_LVL_METRICS):
643
+ @@ -219,7 +259,12 @@ class EnvStateManager:
644
+ else:
645
+ env_metric['traj_sum/' + k] = np.sum(v)
646
+
647
+ -
648
+ + try:
649
+ + if 'score' in custom_metric and len(custom_metric['score']) > 0:
650
+ + env_metric['final_score'] = float(custom_metric['score'][-1])
651
+ + except Exception:
652
+ + pass
653
+ +
654
+ cache['history'][-1]['metrics'] = custom_metric
655
+ env_metric = {f"{entry['tag']}/{k}": v for k, v in env_metric.items()}
656
+ cache['metrics'] = env_metric
657
+ diff --git a/requirements.txt b/requirements.txt
658
+ index 2fd756e..9b521bf 100644
659
+ --- a/requirements.txt
660
+ +++ b/requirements.txt
661
+ @@ -7,7 +7,6 @@ accelerate
662
+ codetiming
663
+ datasets
664
+ dill
665
+ -flash-attn==2.7.4.post1
666
+ hydra-core
667
+ numpy
668
+ pandas
669
+ @@ -15,19 +14,19 @@ pybind11
670
+ ray>=2.10
671
+ tensordict>=0.8.0,<0.9.0
672
+ transformers
673
+ -vllm==0.8.2
674
+ +vllm==0.8.5
675
+ wandb
676
+ gymnasium
677
+ gymnasium[toy-text]
678
+
679
+ pyarrow>=15.0.0
680
+ pylatexenc
681
+ -torchdata
682
+ +# torchdata
683
+ debugpy
684
+
685
+ together
686
+ anthropic
687
+ -faiss-cpu==1.11.0
688
+ +faiss-gpu
689
+
690
+ # This is optional, but needs to be installed with main requirements if you want to use webshop
691
+ -r external/webshop-minimal/requirements.txt
692
+ diff --git a/scripts/setup_ragen.sh b/scripts/setup_ragen.sh
693
+ index f9a7cd9..85a93c4 100644
694
+ --- a/scripts/setup_ragen.sh
695
+ +++ b/scripts/setup_ragen.sh
696
+ @@ -94,10 +94,10 @@ main() {
697
+ pip install torch==2.5.0 --index-url https://download.pytorch.org/whl/cu124
698
+
699
+ print_step "Installing flash-attention..."
700
+ - pip3 install flash-attn==2.7.4.post1 --no-build-isolation
701
+ + # pip3 install flash-attn==2.7.4.post1 --no-build-isolation
702
+ else
703
+ print_step "Installing PyTorch without CUDA support..."
704
+ - pip install torch==2.5.0
705
+ + pip install torch==2.4.0
706
+ fi
707
+
708
+ # Install remaining requirements
709
+ @@ -137,8 +137,8 @@ main() {
710
+ conda install conda-forge::gdown
711
+ mkdir -p external/webshop-minimal/webshop_minimal/data/full
712
+ cd external/webshop-minimal/webshop_minimal/data/full
713
+ - gdown https://drive.google.com/uc?id=1A2whVgOO0euk5O13n2iYDM0bQRkkRduB # items_shuffle
714
+ - gdown https://drive.google.com/uc?id=1s2j6NgHljiZzQNL3veZaAiyW_qDEgBNi # items_ins_v2
715
+ + # gdown https://drive.google.com/uc?id=1A2whVgOO0euk5O13n2iYDM0bQRkkRduB # items_shuffle
716
+ + # gdown https://drive.google.com/uc?id=1s2j6NgHljiZzQNL3veZaAiyW_qDEgBNi # items_ins_v2
717
+ cd ../../../../..
718
+
719
+ echo -e "${GREEN}Installation completed successfully!${NC}"
720
+ diff --git a/train_all.sh b/train_all.sh
721
+ index 0157306..33035f5 100755
722
+ --- a/train_all.sh
723
+ +++ b/train_all.sh
724
+ @@ -6,246 +6,257 @@ USE_GRPO="algorithm.adv_estimator=grpo"
725
+ USE_PPO="algorithm.adv_estimator=gae" # by default.
726
+ USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
727
+
728
+ +
729
+ +# python train.py --config-name _8_2048 system.CUDA_VISIBLE_DEVICES="'0,1,2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=game_2048 $USE_PPO $USE_BASE
730
+ +
731
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'0,1'" trainer.project_name=ragen_latest_qwen_05B_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=rubikscube-1 $USE_PPO $USE_BASE
732
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-1.5B-Instruct trainer.experiment_name=rubikscube-2 $USE_PPO $USE_BASE
733
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'4,5'" trainer.project_name=ragen_latest_qwen_25_3b_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-3B-Instruct trainer.experiment_name=rubikscube-2 $USE_PPO $USE_BASE
734
+ +python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'6,7'" trainer.project_name=ragen_latest_qwen_05B_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=rubikscube-3 $USE_PPO $USE_BASE
735
+ +
736
+ # Section 3.1&3.2 - General Observations
737
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-ppo $USE_PPO $USE_BASE &
738
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-grpo $USE_GRPO $USE_BASE &
739
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE &
740
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-grpo $USE_GRPO $USE_BASE &
741
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozen_lake-ppo $USE_PPO $USE_BASE &
742
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozen_lake-grpo $USE_GRPO $USE_BASE &
743
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="'6,7'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=bandit-ppo-multitask $USE_PPO $USE_BASE &
744
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="'7'" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-ppo-frommlp $USE_PPO $USE_BASE
745
+
746
+ -# Section 4.1 - Filtering and critic
747
+ -# 0.25
748
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.25 actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
749
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
750
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
751
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
752
+ -
753
+ -wait
754
+ -
755
+ -# 0.5
756
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-ppo-rolloutfilter0.5 actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
757
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
758
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
759
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
760
+ -
761
+ -# 0.75
762
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.75 actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
763
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
764
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
765
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
766
+ -
767
+ -wait
768
+ -
769
+ -# Section 4.2 - Ablation on Critic/ClipHigh/KL. Start from Basic and add more components. The best setting for StarPO in agent is rollout_filter+Critic+Cliphigh+NoKL
770
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
771
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
772
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
773
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
774
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozenlake-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
775
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozenlake-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
776
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozenlake-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
777
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozenlake-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
778
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="'0,1'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=sokoban-ppo-box1-multitask $USE_PPO $USE_BASE
779
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-grpo $USE_GRPO $USE_BASE &
780
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
781
+
782
+ -wait
783
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'4,5,6,7'" trainer.project_name=ragen_latest_qwen_25_3b_it trainer.n_gpus_per_node=4 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_3B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
784
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'4,5,6,7'" trainer.n_gpus_per_node=4 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
785
+
786
+ -# Section 5.1 - Reasoning Helps Generalization
787
+ +# # Section 4.1 - Filtering and critic
788
+ +# # 0.25
789
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.25 actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
790
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
791
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
792
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
793
+
794
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-generalization \
795
+ - custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
796
+ - custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
797
+ - custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
798
+ - custom_envs.BanditTest.env_config.hi_arm_name="Librarian"
799
+ +# wait
800
+
801
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-generalization-nothink \
802
+ - custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
803
+ - custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
804
+ - custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
805
+ - custom_envs.BanditTest.env_config.hi_arm_name="Librarian" \
806
+ - agent_proxy.enable_think=False
807
+ +# # 0.5
808
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-ppo-rolloutfilter0.5 actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
809
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
810
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
811
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
812
+ +
813
+ +# # 0.75
814
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.75 actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
815
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
816
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
817
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
818
+
819
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=bandit-generalization-rev \
820
+ - custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
821
+ - custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
822
+ - custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
823
+ - custom_envs.BanditTest.env_config.hi_arm_name="Trader"
824
+ +# wait
825
+
826
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=bandit-generalization-rev-nothink \
827
+ - custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
828
+ - custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
829
+ - custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
830
+ - custom_envs.BanditTest.env_config.hi_arm_name="Trader" \
831
+ - agent_proxy.enable_think=False
832
+ +# # Section 4.2 - Ablation on Critic/ClipHigh/KL. Start from Basic and add more components. The best setting for StarPO in agent is rollout_filter+Critic+Cliphigh+NoKL
833
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
834
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
835
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
836
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
837
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozenlake-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
838
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozenlake-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
839
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozenlake-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
840
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozenlake-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
841
+
842
+ +# wait
843
+
844
+ -SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
845
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization micro_batch_size_per_gpu=8 model_path=Qwen/Qwen2.5-1.5B-Instruct&
846
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-generalization-nothink $SOKOBAN_GENERALIZATION_CONFIG agent_proxy.enable_think=False &
847
+ +# # Section 5.1 - Reasoning Helps Generalization
848
+
849
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-generalization \
850
+ +# custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
851
+ +# custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
852
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
853
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Librarian"
854
+
855
+ -# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=128 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SokobanDifferentGridVocab] es_manager.val.env_configs.n_groups=[128]"
856
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG &
857
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-generalization-nothink \
858
+ +# custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
859
+ +# custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
860
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
861
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Librarian" \
862
+ +# agent_proxy.enable_think=False
863
+
864
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=bandit-generalization-rev \
865
+ +# custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
866
+ +# custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
867
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
868
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Trader"
869
+
870
+ -# COMPOSITIONALITY_CONFIG="es_manager.train.env_groups=16 es_manager.train.env_configs.tags=[Bandit,SimpleSokoban] es_manager.train.env_configs.n_groups=[8,8] es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[Bandit,SimpleSokoban,LargerSokoban,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128] actor_rollout_ref.rollout.rollout_filter_ratio=1" # NOTE that we don't filter out low-var rollout in this setting
871
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=compositional-generalization $COMPOSITIONALITY_CONFIG &
872
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=compositional-generalization-nothink $COMPOSITIONALITY_CONFIG agent_proxy.enable_think=False &
873
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=bandit-generalization-rev-nothink \
874
+ +# custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
875
+ +# custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
876
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
877
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Trader" \
878
+ +# agent_proxy.enable_think=False
879
+
880
+ -wait
881
+
882
+ -# Section 5.2 - what leads to better reasoning?
883
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B-Instruct &
884
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B-Instruct &
885
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct trainer.n_gpus_per_node=2 &
886
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B-Instruct trainer.n_gpus_per_node=4 &
887
+ +# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
888
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization micro_batch_size_per_gpu=8 model_path=Qwen/Qwen2.5-1.5B-Instruct&
889
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-generalization-nothink $SOKOBAN_GENERALIZATION_CONFIG agent_proxy.enable_think=False &
890
+
891
+ -wait
892
+
893
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B &
894
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B &
895
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B &
896
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B &
897
+ +# # SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=128 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SokobanDifferentGridVocab] es_manager.val.env_configs.n_groups=[128]"
898
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG &
899
+
900
+ -wait
901
+
902
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-7B &
903
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B &
904
+ +# # COMPOSITIONALITY_CONFIG="es_manager.train.env_groups=16 es_manager.train.env_configs.tags=[Bandit,SimpleSokoban] es_manager.train.env_configs.n_groups=[8,8] es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[Bandit,SimpleSokoban,LargerSokoban,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128] actor_rollout_ref.rollout.rollout_filter_ratio=1" # NOTE that we don't filter out low-var rollout in this setting
905
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=compositional-generalization $COMPOSITIONALITY_CONFIG &
906
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=compositional-generalization-nothink $COMPOSITIONALITY_CONFIG agent_proxy.enable_think=False &
907
+
908
+ +# wait
909
+
910
+ -wait
911
+ +# # Section 5.2 - what leads to better reasoning?
912
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B-Instruct &
913
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B-Instruct &
914
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct trainer.n_gpus_per_node=2 &
915
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B-Instruct trainer.n_gpus_per_node=4 &
916
+
917
+ -# Section 6.1 varying action count
918
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-action-count-1 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=5 custom_envs.LargerSokoban.max_actions_per_traj=5 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=5 custom_envs.FrozenLake.max_actions_per_traj=5 agent_proxy.max_actions_per_turn=1 &
919
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-action-count-2 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=10 custom_envs.LargerSokoban.max_actions_per_traj=10 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=10 custom_envs.FrozenLake.max_actions_per_traj=10 agent_proxy.max_actions_per_turn=2 &
920
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-action-count-3 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=15 custom_envs.LargerSokoban.max_actions_per_traj=15 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=15 custom_envs.FrozenLake.max_actions_per_traj=15 agent_proxy.max_actions_per_turn=3 &
921
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-action-count-4 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=20 custom_envs.LargerSokoban.max_actions_per_traj=20 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=20 custom_envs.FrozenLake.max_actions_per_traj=20 agent_proxy.max_actions_per_turn=4 &
922
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-action-count-5 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=25 custom_envs.LargerSokoban.max_actions_per_traj=25 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=25 custom_envs.FrozenLake.max_actions_per_traj=25 agent_proxy.max_actions_per_turn=5 &
923
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-action-count-6 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=30 custom_envs.LargerSokoban.max_actions_per_traj=30 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=30 custom_envs.FrozenLake.max_actions_per_traj=30 agent_proxy.max_actions_per_turn=6 &
924
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-action-count-7 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=35 custom_envs.LargerSokoban.max_actions_per_traj=35 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=35 custom_envs.FrozenLake.max_actions_per_traj=35 agent_proxy.max_actions_per_turn=7 &
925
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-action-count-8 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=40 custom_envs.LargerSokoban.max_actions_per_traj=40 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=40 custom_envs.FrozenLake.max_actions_per_traj=40 agent_proxy.max_actions_per_turn=8 &
926
+ +# wait
927
+
928
+ -# section 6.2 Varying prompt diversity
929
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-prompt-diversity-4 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=4 es_manager.train.group_size=32 es_manager.train.env_configs.n_groups=[4] &
930
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-prompt-diversity-8 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] &
931
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-prompt-diversity-16 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=8 es_manager.train.env_configs.n_groups=[16] &
932
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-prompt-diversity-32 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=32 es_manager.train.group_size=4 es_manager.train.env_configs.n_groups=[32] &
933
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-prompt-diversity-64 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=64 es_manager.train.group_size=2 es_manager.train.env_configs.n_groups=[64] &
934
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-prompt-diversity-128 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=128 es_manager.train.group_size=1 es_manager.train.env_configs.n_groups=[128] &
935
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B &
936
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B &
937
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B &
938
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B &
939
+
940
+ -wait
941
+ +# wait
942
+
943
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-online-2 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[16] trainer.total_training_steps=100 trainer.test_freq=5 &
944
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-7B &
945
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B &
946
+
947
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-online-5 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=40 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[40] trainer.total_training_steps=40 trainer.test_freq=2 &
948
+
949
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-online-10 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=80 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[80] trainer.total_training_steps=80 trainer.test_freq=1 &
950
+ +# wait
951
+
952
+ +# # Section 6.1 varying action count
953
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-action-count-1 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=5 custom_envs.LargerSokoban.max_actions_per_traj=5 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=5 custom_envs.FrozenLake.max_actions_per_traj=5 agent_proxy.max_actions_per_turn=1 &
954
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-action-count-2 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=10 custom_envs.LargerSokoban.max_actions_per_traj=10 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=10 custom_envs.FrozenLake.max_actions_per_traj=10 agent_proxy.max_actions_per_turn=2 &
955
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-action-count-3 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=15 custom_envs.LargerSokoban.max_actions_per_traj=15 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=15 custom_envs.FrozenLake.max_actions_per_traj=15 agent_proxy.max_actions_per_turn=3 &
956
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-action-count-4 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=20 custom_envs.LargerSokoban.max_actions_per_traj=20 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=20 custom_envs.FrozenLake.max_actions_per_traj=20 agent_proxy.max_actions_per_turn=4 &
957
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-action-count-5 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=25 custom_envs.LargerSokoban.max_actions_per_traj=25 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=25 custom_envs.FrozenLake.max_actions_per_traj=25 agent_proxy.max_actions_per_turn=5 &
958
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-action-count-6 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=30 custom_envs.LargerSokoban.max_actions_per_traj=30 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=30 custom_envs.FrozenLake.max_actions_per_traj=30 agent_proxy.max_actions_per_turn=6 &
959
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-action-count-7 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=35 custom_envs.LargerSokoban.max_actions_per_traj=35 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=35 custom_envs.FrozenLake.max_actions_per_traj=35 agent_proxy.max_actions_per_turn=7 &
960
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-action-count-8 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=40 custom_envs.LargerSokoban.max_actions_per_traj=40 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=40 custom_envs.FrozenLake.max_actions_per_traj=40 agent_proxy.max_actions_per_turn=8 &
961
+
962
+ +# # section 6.2 Varying prompt diversity
963
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-prompt-diversity-4 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=4 es_manager.train.group_size=32 es_manager.train.env_configs.n_groups=[4] &
964
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-prompt-diversity-8 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] &
965
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-prompt-diversity-16 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=8 es_manager.train.env_configs.n_groups=[16] &
966
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-prompt-diversity-32 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=32 es_manager.train.group_size=4 es_manager.train.env_configs.n_groups=[32] &
967
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-prompt-diversity-64 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=64 es_manager.train.group_size=2 es_manager.train.env_configs.n_groups=[64] &
968
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-prompt-diversity-128 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=128 es_manager.train.group_size=1 es_manager.train.env_configs.n_groups=[128] &
969
+
970
+ +# wait
971
+
972
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-online-2 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[16] trainer.total_training_steps=100 trainer.test_freq=5 &
973
+
974
+ -# Extension: Training 7B reasoning model
975
+ -SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
976
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct-largescale $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] micro_batch_size_per_gpu=8 ppo_mini_batch_size=64 actor_rollout_ref.rollout.response_length=1024 actor_rollout_ref.rollout.max_model_len=6400 trainer.test_freq=5 actor_rollout_ref.rollout.max_num_batched_tokens=24000 micro_batch_size_per_gpu=2 actor_rollout_ref.rollout.rollout_filter_ratio=1 &
977
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-online-5 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=40 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[40] trainer.total_training_steps=40 trainer.test_freq=2 &
978
+
979
+ -python -m ragen.llm_agent.agent_proxy model_path=Qwen/Qwen2.5-3B-Instruct system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 actor_rollout_ref.rollout.tensor_model_parallel_size=4 actor_rollout_ref.rollout.response_length=2048 actor_rollout_ref.rollout.max_model_len=12800
980
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-online-10 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=80 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[80] trainer.total_training_steps=80 trainer.test_freq=1 &
981
+
982
+ -# trainer.save_freq=50 trainer.default_local_dir=/mnt/local/cache/exp_name
983
+
984
+ -# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
985
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization &
986
+
987
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/bandit-generalization &
988
+
989
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=frozenlake-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/frozenlake-generalization &
990
+
991
+ +# # Extension: Training 7B reasoning model
992
+ +# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
993
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct-largescale $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] micro_batch_size_per_gpu=8 ppo_mini_batch_size=64 actor_rollout_ref.rollout.response_length=1024 actor_rollout_ref.rollout.max_model_len=6400 trainer.test_freq=5 actor_rollout_ref.rollout.max_num_batched_tokens=24000 micro_batch_size_per_gpu=2 actor_rollout_ref.rollout.rollout_filter_ratio=1 &
994
+
995
+ +# python -m ragen.llm_agent.agent_proxy model_path=Qwen/Qwen2.5-3B-Instruct system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 actor_rollout_ref.rollout.tensor_model_parallel_size=4 actor_rollout_ref.rollout.response_length=2048 actor_rollout_ref.rollout.max_model_len=12800
996
+
997
+ +# # trainer.save_freq=50 trainer.default_local_dir=/mnt/local/cache/exp_name
998
+
999
+ -# USE_PPO="algorithm.adv_estimator=gae" # by default.
1000
+ -# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1001
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE ppo_mini_batch_size=64 enable_response_mask=True &
1002
+ +# # USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1003
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization &
1004
+
1005
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/bandit-generalization &
1006
+
1007
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std &
1008
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=frozenlake-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/frozenlake-generalization &
1009
+
1010
+ -# enable_response_mask: False
1011
+ -# grpo_advantage_length_weight: True
1012
+
1013
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo-1-5b algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std agent_proxy.max_actions_per_turn=5 custom_envs.SimpleSokoban.max_actions_per_traj=25 enable_response_mask=True grpo_advantage_length_weight=False model_path=Qwen/Qwen2.5-1.5B-Instruct &
1014
+
1015
+
1016
+ -# extension: 7B with lora. Currently NOT recommended to use lora: within current version of vllm, this could result in rollouts slower than non-lora by 100%
1017
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-7B-Instruct trainer.experiment_name=sokoban_7b_instruct_lora_newversion lora.rank=16
1018
+ +# # USE_PPO="algorithm.adv_estimator=gae" # by default.
1019
+ +# # USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1020
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE ppo_mini_batch_size=64 enable_response_mask=True &
1021
+
1022
+ -# extension: bi-level gae
1023
+ -python train.py trainer.experiment_name=sokoban-bi-level-gae-final \
1024
+ - system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
1025
+ - model_path=Qwen/Qwen2.5-0.5B-Instruct \
1026
+ - algorithm.bi_level_gae=True algorithm.high_level_gamma=0.95 \
1027
+ - agent_proxy.use_turn_scores=True \
1028
+ - actor_rollout_ref.rollout.tp_size_check=False
1029
+
1030
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std &
1031
+
1032
+ -# extension: webshop
1033
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1034
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1035
+ - trainer.experiment_name=webshop-3b-ppo-s $USE_PPO \
1036
+ - trainer.nnodes=1 &
1037
+ +# # enable_response_mask: False
1038
+ +# # grpo_advantage_length_weight: True
1039
+
1040
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo-1-5b algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std agent_proxy.max_actions_per_turn=5 custom_envs.SimpleSokoban.max_actions_per_traj=25 enable_response_mask=True grpo_advantage_length_weight=False model_path=Qwen/Qwen2.5-1.5B-Instruct &
1041
+
1042
+ -USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1043
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1044
+ - trainer.experiment_name=webshop-3b-grpo-s $USE_GRPO \
1045
+ - trainer.nnodes=1 &
1046
+
1047
+ -# StarPO ppo
1048
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1049
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1050
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1051
+ - trainer.experiment_name=webshop-3b-ppo $USE_PPO $USE_BASE \
1052
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1053
+ - trainer.nnodes=1 &
1054
+ +# # extension: 7B with lora. Currently NOT recommended to use lora: within current version of vllm, this could result in rollouts slower than non-lora by 100%
1055
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-7B-Instruct trainer.experiment_name=sokoban_7b_instruct_lora_newversion lora.rank=16
1056
+
1057
+ -# StarPO grpo
1058
+ -USE_GRPO="algorithm.adv_estimator=grpo"
1059
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1060
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1061
+ - trainer.experiment_name=webshop-3b-grpo $USE_GRPO $USE_BASE \
1062
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1063
+ - trainer.nnodes=1 &
1064
+ +# # extension: bi-level gae
1065
+ +# python train.py trainer.experiment_name=sokoban-bi-level-gae-final \
1066
+ +# system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
1067
+ +# model_path=Qwen/Qwen2.5-0.5B-Instruct \
1068
+ +# algorithm.bi_level_gae=True algorithm.high_level_gamma=0.95 \
1069
+ +# agent_proxy.use_turn_scores=True \
1070
+ +# actor_rollout_ref.rollout.tp_size_check=False
1071
+
1072
+
1073
+ -# normal:sokoban
1074
+ -# extension: sokoban
1075
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1076
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1077
+ - trainer.experiment_name=sokoban-3b-ppo-s $USE_PPO \
1078
+ - trainer.nnodes=1 &
1079
+ +# # extension: webshop
1080
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1081
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1082
+ +# trainer.experiment_name=webshop-3b-ppo-s $USE_PPO \
1083
+ +# trainer.nnodes=1 &
1084
+
1085
+
1086
+ -USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1087
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1088
+ - trainer.experiment_name=sokoban-3b-grpo-s $USE_GRPO \
1089
+ - trainer.nnodes=1 &
1090
+ +# USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1091
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1092
+ +# trainer.experiment_name=webshop-3b-grpo-s $USE_GRPO \
1093
+ +# trainer.nnodes=1 &
1094
+
1095
+ -# StarPO ppo
1096
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1097
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1098
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1099
+ - trainer.experiment_name=sokoban-3b-ppo $USE_PPO $USE_BASE \
1100
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1101
+ - trainer.nnodes=1 &
1102
+ +# # StarPO ppo
1103
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1104
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1105
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1106
+ +# trainer.experiment_name=webshop-3b-ppo $USE_PPO $USE_BASE \
1107
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1108
+ +# trainer.nnodes=1 &
1109
+
1110
+ -# StarPO grpo
1111
+ -USE_GRPO="algorithm.adv_estimator=grpo"
1112
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1113
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1114
+ - trainer.experiment_name=sokoban-3b-grpo $USE_GRPO $USE_BASE \
1115
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1116
+ - trainer.nnodes=1 &
1117
+ +# # StarPO grpo
1118
+ +# USE_GRPO="algorithm.adv_estimator=grpo"
1119
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1120
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1121
+ +# trainer.experiment_name=webshop-3b-grpo $USE_GRPO $USE_BASE \
1122
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1123
+ +# trainer.nnodes=1 &
1124
+ +
1125
+ +
1126
+ +# # normal:sokoban
1127
+ +# # extension: sokoban
1128
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1129
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1130
+ +# trainer.experiment_name=sokoban-3b-ppo-s $USE_PPO \
1131
+ +# trainer.nnodes=1 &
1132
+ +
1133
+ +
1134
+ +# USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1135
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1136
+ +# trainer.experiment_name=sokoban-3b-grpo-s $USE_GRPO \
1137
+ +# trainer.nnodes=1 &
1138
+ +
1139
+ +# # StarPO ppo
1140
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1141
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1142
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1143
+ +# trainer.experiment_name=sokoban-3b-ppo $USE_PPO $USE_BASE \
1144
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1145
+ +# trainer.nnodes=1 &
1146
+ +
1147
+ +# # StarPO grpo
1148
+ +# USE_GRPO="algorithm.adv_estimator=grpo"
1149
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1150
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1151
+ +# trainer.experiment_name=sokoban-3b-grpo $USE_GRPO $USE_BASE \
1152
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1153
+ +# trainer.nnodes=1 &
1154
+
1155
+
1156
+
1157
+ -python train.py \
1158
+ - trainer.experiment_name=3b-full-ppo-test system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2
1159
+
1160
+ +# python train.py \
1161
+ +# trainer.experiment_name=3b-full-ppo-test system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2
1162
+
wandb/run-20251218_182745-ahjkdup0/files/requirements.txt ADDED
@@ -0,0 +1,315 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ colorama==0.4.6
2
+ psutil==7.1.2
3
+ ragen==0.1
4
+ ragen==0.1
5
+ setuptools==80.9.0
6
+ wheel==0.45.1
7
+ pip==25.3
8
+ ragen==0.1
9
+ pytz==2025.2
10
+ nvidia-cusparselt-cu12==0.6.2
11
+ mpmath==1.3.0
12
+ typing_extensions==4.15.0
13
+ sympy==1.13.1
14
+ pylatexenc==2.10
15
+ nvidia-cusolver-cu12==11.6.1.9
16
+ numpy==1.26.4
17
+ Markdown==3.10
18
+ absl-py==2.3.1
19
+ pyasn1_modules==0.4.2
20
+ Werkzeug==3.1.3
21
+ networkx==3.3
22
+ MarkupSafe==2.1.5
23
+ fsspec==2025.9.0
24
+ filelock==3.19.1
25
+ nvidia-cudnn-cu12==9.1.0.70
26
+ Jinja2==3.1.6
27
+ tensorboard==2.20.0
28
+ triton==3.2.0
29
+ pillow==11.3.0
30
+ xxhash==3.6.0
31
+ nvidia-nvtx-cu12==12.4.127
32
+ nvidia-nvjitlink-cu12==12.4.127
33
+ nvidia-nccl-cu12==2.21.5
34
+ nvidia-curand-cu12==10.3.5.147
35
+ wrapt==2.0.1
36
+ nvidia-cufft-cu12==11.2.1.3
37
+ pyjnius==1.7.0
38
+ nvidia-cuda-runtime-cu12==12.4.127
39
+ nvidia-cuda-nvrtc-cu12==12.4.127
40
+ websockets==15.0.1
41
+ nvidia-cuda-cupti-cu12==12.4.127
42
+ zipp==3.23.0
43
+ nvidia-cublas-cu12==12.4.5.8
44
+ nvidia-cusparse-cu12==12.3.1.170
45
+ flash_attn==2.8.3
46
+ rsa==4.9.1
47
+ einops==0.8.1
48
+ py-cpuinfo==9.0.0
49
+ pure_eval==0.2.3
50
+ ptyprocess==0.7.0
51
+ gym-notices==0.1.0
52
+ flatbuffers==25.9.23
53
+ fastrlock==0.8.3
54
+ Farama-Notifications==0.0.4
55
+ faiss-gpu==1.7.2
56
+ antlr4-python3-runtime==4.9.3
57
+ wcwidth==0.2.14
58
+ wasabi==1.1.3
59
+ uvloop==0.22.1
60
+ urllib3==2.5.0
61
+ tzdata==2025.2
62
+ typing-inspection==0.4.2
63
+ traitlets==5.14.3
64
+ tqdm==4.67.1
65
+ tomli==2.3.0
66
+ threadpoolctl==3.6.0
67
+ tenacity==9.1.2
68
+ tabulate==0.9.0
69
+ spacy-loggers==1.0.5
70
+ spacy-legacy==3.0.12
71
+ soupsieve==2.8
72
+ sniffio==1.3.1
73
+ smmap==5.0.2
74
+ six==1.17.0
75
+ shellingham==1.5.4
76
+ sentencepiece==0.2.1
77
+ scipy==1.15.3
78
+ safetensors==0.6.2
79
+ rpds-py==0.29.0
80
+ rignore==0.7.6
81
+ regex==2025.11.3
82
+ RapidFuzz==3.14.3
83
+ rank-bm25==0.2.2
84
+ pyzmq==27.1.0
85
+ PyYAML==6.0.3
86
+ pytokens==0.3.0
87
+ python-multipart==0.0.20
88
+ python-json-logger==4.0.0
89
+ python-dotenv==1.2.1
90
+ PySocks==1.7.1
91
+ pyparsing==3.2.5
92
+ PyJWT==2.10.1
93
+ Pygments==2.19.2
94
+ pygame==2.6.1
95
+ pydantic_core==2.41.5
96
+ pycparser==2.23
97
+ pycountry==24.6.1
98
+ pybind11==3.0.1
99
+ pyarrow==22.0.0
100
+ psutil==7.1.3
101
+ protobuf==4.25.8
102
+ propcache==0.4.1
103
+ prometheus_client==0.23.1
104
+ platformdirs==4.5.0
105
+ pexpect==4.9.0
106
+ pathspec==0.12.1
107
+ partial-json-parser==0.2.1.1.post6
108
+ parso==0.8.5
109
+ packaging==25.0
110
+ orjson==3.11.4
111
+ opentelemetry-semantic-conventions-ai==0.4.13
112
+ opencv-python-headless==4.12.0.88
113
+ ninja==1.13.0
114
+ nest-asyncio==1.6.0
115
+ mypy_extensions==1.1.0
116
+ murmurhash==1.0.15
117
+ multidict==6.7.0
118
+ msgspec==0.19.0
119
+ msgpack==1.1.2
120
+ mdurl==0.1.2
121
+ loguru==0.7.3
122
+ llvmlite==0.44.0
123
+ llguidance==0.7.30
124
+ lark==1.2.2
125
+ kiwisolver==1.4.9
126
+ joblib==1.5.2
127
+ jiter==0.12.0
128
+ itsdangerous==2.2.0
129
+ interegular==0.3.3
130
+ ImageIO==2.37.2
131
+ idna==3.11
132
+ humanfriendly==10.0
133
+ httpx-sse==0.4.3
134
+ httptools==0.7.1
135
+ html2text==2025.4.15
136
+ hf-xet==1.2.0
137
+ h11==0.16.0
138
+ grpcio==1.76.0
139
+ frozenlist==1.8.0
140
+ fonttools==4.60.1
141
+ executing==2.2.1
142
+ exceptiongroup==1.3.0
143
+ eval_type_backport==0.2.2
144
+ docstring_parser==0.17.0
145
+ dnspython==2.8.0
146
+ distro==1.9.0
147
+ diskcache==5.6.3
148
+ dill==0.4.0
149
+ decorator==5.2.1
150
+ debugpy==1.8.17
151
+ Cython==3.2.1
152
+ cymem==2.0.13
153
+ cycler==0.12.1
154
+ cupy-cuda12x==13.6.0
155
+ contourpy==1.3.2
156
+ colorama==0.4.6
157
+ codetiming==1.4.0
158
+ cloudpickle==3.1.2
159
+ cloudpathlib==0.23.0
160
+ click==8.3.1
161
+ charset-normalizer==3.4.4
162
+ certifi==2025.11.12
163
+ catalogue==2.0.10
164
+ cachetools==6.2.2
165
+ blis==1.3.2
166
+ blinker==1.9.0
167
+ blake3==1.0.8
168
+ attrs==25.4.0
169
+ async-timeout==5.0.1
170
+ asttokens==3.0.1
171
+ astor==0.8.1
172
+ annotated-types==0.7.0
173
+ annotated-doc==0.0.4
174
+ airportsdata==20250909
175
+ aiohappyeyeballs==2.6.1
176
+ yarl==1.22.0
177
+ uvicorn==0.38.0
178
+ typer-slim==0.20.0
179
+ thefuzz==0.22.1
180
+ stack-data==0.6.3
181
+ srsly==2.5.1
182
+ smart_open==7.5.0
183
+ sentry-sdk==2.44.0
184
+ scikit-learn==1.7.2
185
+ requests==2.32.5
186
+ referencing==0.37.0
187
+ python-dateutil==2.9.0.post0
188
+ pydantic==2.12.4
189
+ prompt_toolkit==3.0.52
190
+ preshed==3.0.11
191
+ opentelemetry-proto==1.26.0
192
+ omegaconf==2.3.0
193
+ numba==0.61.2
194
+ nltk==3.9.2
195
+ multiprocess==0.70.18
196
+ matplotlib-inline==0.2.1
197
+ markdown-it-py==4.0.0
198
+ jedi==0.19.2
199
+ importlib_metadata==8.0.0
200
+ httpcore==1.0.9
201
+ gymnasium==1.2.2
202
+ gym==0.26.2
203
+ googleapis-common-protos==1.72.0
204
+ gitdb==4.0.12
205
+ gguf==0.17.1
206
+ Flask==3.1.2
207
+ faiss-cpu==1.13.0
208
+ email-validator==2.3.0
209
+ depyf==0.18.0
210
+ Deprecated==1.3.1
211
+ coloredlogs==15.0.1
212
+ cffi==2.0.0
213
+ black==25.11.0
214
+ beautifulsoup4==4.14.2
215
+ anyio==4.11.0
216
+ aiosignal==1.4.0
217
+ watchfiles==1.1.1
218
+ tiktoken==0.12.0
219
+ starlette==0.49.3
220
+ sse-starlette==3.0.3
221
+ rich==14.2.0
222
+ pydantic-settings==2.12.0
223
+ pydantic-extra-types==2.10.6
224
+ pandas==2.3.3
225
+ opentelemetry-exporter-otlp-proto-common==1.26.0
226
+ onnxruntime==1.23.2
227
+ matplotlib==3.10.7
228
+ lm-format-enforcer==0.10.12
229
+ jsonschema-specifications==2025.9.1
230
+ ipython==8.37.0
231
+ hydra-core==1.3.2
232
+ huggingface-hub==0.36.0
233
+ httpx==0.28.1
234
+ gym-sokoban==0.0.6
235
+ GitPython==3.1.45
236
+ cryptography==46.0.3
237
+ confection==0.1.5
238
+ cleantext==1.1.4
239
+ aiohttp==3.13.2
240
+ weasel==0.4.3
241
+ wandb==0.23.0
242
+ typer==0.19.2
243
+ virtualenv==20.35.4
244
+ pyasn1==0.6.1
245
+ torch==2.6.0
246
+ tokenizers==0.22.1
247
+ thinc==8.3.9
248
+ rich-toolkit==0.15.1
249
+ prometheus-fastapi-instrumentator==7.1.0
250
+ openai==2.8.0
251
+ jsonschema==4.25.1
252
+ gdown==5.2.0
253
+ fastapi==0.121.2
254
+ anthropic==0.73.0
255
+ xformers==0.0.29.post2
256
+ transformers==4.57.1
257
+ proto-plus==1.26.1
258
+ torchvision==0.21.0
259
+ torchdata==0.11.0
260
+ torchaudio==2.6.0
261
+ together==1.5.30
262
+ tensordict==0.8.3
263
+ spacy==3.8.9
264
+ ray==2.51.1
265
+ outlines_core==0.1.26
266
+ mistral_common==1.8.5
267
+ mcp==1.21.1
268
+ fastapi-cloud-cli==0.3.1
269
+ fastapi-cli==0.0.16
270
+ datasets==4.4.1
271
+ accelerate==1.11.0
272
+ xgrammar==0.1.18
273
+ pyserini==1.2.0
274
+ peft==0.18.0
275
+ outlines==0.1.11
276
+ opentelemetry-exporter-otlp-proto-http==1.26.0
277
+ opentelemetry-exporter-otlp-proto-grpc==1.26.0
278
+ kimina-client==0.2.1
279
+ compressed-tensors==0.9.3
280
+ opentelemetry-exporter-otlp==1.26.0
281
+ vllm==0.8.5
282
+ py-spy==0.4.1
283
+ opencensus-context==0.1.3
284
+ distlib==0.4.0
285
+ colorful==0.5.8
286
+ tensorboard-data-server==0.7.2
287
+ google-auth==2.43.0
288
+ google-api-core==2.28.1
289
+ aiohttp-cors==0.8.1
290
+ opentelemetry-exporter-prometheus==0.59b0
291
+ opencensus==0.11.4
292
+ verl==0.5.0.dev0
293
+ opentelemetry-api==1.38.0
294
+ opentelemetry-semantic-conventions==0.59b0
295
+ opentelemetry-sdk==1.38.0
296
+ typeguard==4.4.4
297
+ shtab==1.8.0
298
+ tyro==0.9.35
299
+ verl==0.5.0.dev0
300
+ autocommand==2.2.2
301
+ backports.tarfile==1.2.0
302
+ importlib_metadata==8.0.0
303
+ inflect==7.3.1
304
+ jaraco.collections==5.1.0
305
+ jaraco.context==5.3.0
306
+ jaraco.functools==4.0.1
307
+ jaraco.text==3.12.1
308
+ more-itertools==10.3.0
309
+ packaging==24.2
310
+ platformdirs==4.2.2
311
+ tomli==2.0.1
312
+ typeguard==4.3.0
313
+ typing_extensions==4.12.2
314
+ wheel==0.45.1
315
+ zipp==3.19.2
wandb/run-20251218_182745-ahjkdup0/files/wandb-metadata.json ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "os": "Linux-5.14.0-284.25.1.el9_2.x86_64-x86_64-with-glibc2.35",
3
+ "python": "CPython 3.10.19",
4
+ "startedAt": "2025-12-18T10:27:45.627440Z",
5
+ "args": [
6
+ "--track"
7
+ ],
8
+ "program": "/mnt/general/wanghy/RAGEN/cleanrl/cleanrl/ppo_rubikscube.py",
9
+ "codePath": "cleanrl/cleanrl/ppo_rubikscube.py",
10
+ "codePathLocal": "cleanrl/cleanrl/ppo_rubikscube.py",
11
+ "git": {
12
+ "remote": "https://github.com/mll-lab-nu/RAGEN.git",
13
+ "commit": "8d73639b99b38265453f898b8d6af7d4af50d56e"
14
+ },
15
+ "email": "haoyu-wa22@mails.tsinghua.edu.cn",
16
+ "root": "/mnt/general/wanghy/RAGEN",
17
+ "host": "pt-4d654cf4576f4d23ad3d3919f12932fe-worker-0",
18
+ "executable": "/root/local/miniconda3/envs/ragen/bin/python",
19
+ "cpu_count": 64,
20
+ "cpu_count_logical": 128,
21
+ "gpu": "NVIDIA H100 80GB HBM3",
22
+ "gpu_count": 8,
23
+ "disk": {
24
+ "/": {
25
+ "total": "5153960755200",
26
+ "used": "447457550336"
27
+ }
28
+ },
29
+ "memory": {
30
+ "total": "2163642122240"
31
+ },
32
+ "gpu_nvidia": [
33
+ {
34
+ "name": "NVIDIA H100 80GB HBM3",
35
+ "memoryTotal": "85520809984",
36
+ "cudaCores": 16896,
37
+ "architecture": "Hopper",
38
+ "uuid": "GPU-35e2d43d-4067-82ce-90d4-def9e389bf28"
39
+ },
40
+ {
41
+ "name": "NVIDIA H100 80GB HBM3",
42
+ "memoryTotal": "85520809984",
43
+ "cudaCores": 16896,
44
+ "architecture": "Hopper",
45
+ "uuid": "GPU-af4135e3-88f2-e9ac-518d-502c75a85429"
46
+ },
47
+ {
48
+ "name": "NVIDIA H100 80GB HBM3",
49
+ "memoryTotal": "85520809984",
50
+ "cudaCores": 16896,
51
+ "architecture": "Hopper",
52
+ "uuid": "GPU-d7fdeeba-fe9b-ec03-d9f7-6724fe4266b5"
53
+ },
54
+ {
55
+ "name": "NVIDIA H100 80GB HBM3",
56
+ "memoryTotal": "85520809984",
57
+ "cudaCores": 16896,
58
+ "architecture": "Hopper",
59
+ "uuid": "GPU-ccc4f668-3882-5a8e-2c07-c5cd08f6f666"
60
+ },
61
+ {
62
+ "name": "NVIDIA H100 80GB HBM3",
63
+ "memoryTotal": "85520809984",
64
+ "cudaCores": 16896,
65
+ "architecture": "Hopper",
66
+ "uuid": "GPU-7b73c0cf-d3d5-e10c-7176-a43be1e41001"
67
+ },
68
+ {
69
+ "name": "NVIDIA H100 80GB HBM3",
70
+ "memoryTotal": "85520809984",
71
+ "cudaCores": 16896,
72
+ "architecture": "Hopper",
73
+ "uuid": "GPU-81b58d94-5d1f-8ec2-f9d2-fd56172ed177"
74
+ },
75
+ {
76
+ "name": "NVIDIA H100 80GB HBM3",
77
+ "memoryTotal": "85520809984",
78
+ "cudaCores": 16896,
79
+ "architecture": "Hopper",
80
+ "uuid": "GPU-03e8bc66-3b44-6794-49fd-5392fbdda6d1"
81
+ },
82
+ {
83
+ "name": "NVIDIA H100 80GB HBM3",
84
+ "memoryTotal": "85520809984",
85
+ "cudaCores": 16896,
86
+ "architecture": "Hopper",
87
+ "uuid": "GPU-b7cf0ec6-7c29-1179-dceb-09565da51890"
88
+ }
89
+ ],
90
+ "cudaVersion": "12.4",
91
+ "writerId": "fcxjy4miz5x8bvnkek48fociofug1x4f"
92
+ }
wandb/run-20251218_182745-ahjkdup0/files/wandb-summary.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"eval/std_return":0.40424860853192807,"train/clipfrac":0,"charts/avg_value":0.4239591956138611,"losses/policy_loss":-8.033588528633118e-05,"train/success_rate":0.7542372881355932,"train/approx_kl":4.377216100692749e-08,"train/learning_rate":2.561475409836034e-07,"perf/SPS":2950,"train/policy_loss":-8.033588528633118e-05,"losses/explained_variance":0.6958094239234924,"rollout/ep_len_mean":11,"rollout/success_rate":1,"charts/train_success_rate":0.7542372881355932,"train/old_approx_kl":-4.877801984548569e-06,"losses/value_loss":0.03050171211361885,"global_step":999424,"train/value_loss":0.03050171211361885,"charts/progress":100,"train/entropy":0.6172537803649902,"_step":999424,"_runtime":348.911415774,"_wandb":{"runtime":348},"rollout/ep_rew_mean":1,"charts/SPS":2950,"_timestamp":1.7660540160092895e+09,"charts/avg_reward":0.0869140625,"eval/success_rate":0.79425,"eval/avg_return":0.79425,"eval/episodes":4000}
wandb/run-20251218_182745-ahjkdup0/run-ahjkdup0.wandb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:67d1c39f73bb838164f076d7389ae3af053f360a183c4ecef8eeaffc6cb81c2b
3
+ size 35153374
wandb/run-20251218_183419-wvypkl8w/files/code/cleanrl/cleanrl/ppo_rubikscube.py ADDED
@@ -0,0 +1,517 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PPO with small MLP for RAGEN Rubik's Cube 2x2 using the existing env (no env edits)
2
+ import os
3
+ import random
4
+ import time
5
+ from dataclasses import dataclass
6
+ from pathlib import Path
7
+ from typing import Tuple, Dict, Any, List
8
+ import json
9
+ import re
10
+
11
+ import gymnasium as gym
12
+ import numpy as np
13
+ import torch
14
+ import torch.nn as nn
15
+ import torch.optim as optim
16
+ import tyro
17
+ from torch.distributions.categorical import Categorical
18
+
19
+ import sys
20
+ sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../../'))
21
+
22
+ from ragen.env.rubikscube.env import RubiksCube2x2Env
23
+ from ragen.env.rubikscube.config import RubiksCube2x2Config
24
+
25
+
26
+ class RubiksCubeWrapper(gym.Env):
27
+ """
28
+ Adapter to use ragen RubiksCube2x2Env with Gymnasium vector API.
29
+ - Converts text observation to one-hot vector of 24 stickers x 6 colors.
30
+ - Maps agent actions [0..11] to env actions [1..12].
31
+ - Exposes proper observation_space and action_space.
32
+ """
33
+ metadata = {"render_modes": ["rgb_array", "human", "ansi"]}
34
+
35
+ def __init__(self, env: RubiksCube2x2Env):
36
+ super().__init__()
37
+ self._env = env
38
+ # 24 stickers, 6 colors -> one-hot size 144
39
+ self._colors = ['W', 'O', 'G', 'R', 'B', 'Y']
40
+ self._color_to_idx = {c: i for i, c in enumerate(self._colors)}
41
+ self.observation_space = gym.spaces.Box(low=0.0, high=1.0, shape=(24 * len(self._colors),), dtype=np.float32)
42
+ self.action_space = gym.spaces.Discrete(12)
43
+ # precompile regex to extract 4 letters within [X, X]\n [X, X]
44
+ # Lines look like: "Up (U): [W, W]\n [W, W]"
45
+ self._face_pat = re.compile(r"\[(?:\s*([A-Z])\s*,\s*([A-Z])\s*\])\n\s*\[(?:\s*([A-Z])\s*,\s*([A-Z])\s*\])")
46
+
47
+ def _encode_obs(self, text_obs: str) -> np.ndarray:
48
+ # Extract the six face blocks in the order U, L, F, R, B, D as rendered
49
+ faces_order = ["Up (U):", "Left (L):", "Front (F):", "Right (R):", "Back (B):", "Down (D):"]
50
+ onehots: List[int] = []
51
+ # Build a map from header to its block text
52
+ lines = text_obs.splitlines()
53
+ # Collect blocks starting after header line and including the next line for second row
54
+ i = 0
55
+ blocks: List[str] = []
56
+ while i < len(lines):
57
+ line = lines[i]
58
+ for header in faces_order:
59
+ if line.startswith(header):
60
+ # Join current line's bracketed pair and the next line (which contains the second pair)
61
+ # Remove the "Header:" prefix to keep only the bracket portions
62
+ content = line[len(header):].strip()
63
+ next_line = lines[i + 1] if i + 1 < len(lines) else ""
64
+ block = f"{content}\n{next_line}"
65
+ blocks.append(block)
66
+ break
67
+ i += 1
68
+ # Fallback: if regex fails, return zeros
69
+ if len(blocks) != 6:
70
+ return np.zeros(24 * len(self._colors), dtype=np.float32)
71
+ stickers: List[int] = []
72
+ for blk in blocks:
73
+ m = self._face_pat.search(blk)
74
+ if not m:
75
+ return np.zeros(24 * len(self._colors), dtype=np.float32)
76
+ # order: 0,1,2,3 per render() doc
77
+ c0, c1, c2, c3 = m.group(1), m.group(2), m.group(3), m.group(4)
78
+ stickers.extend([c0, c1, c2, c3])
79
+ # stickers now length 24; convert to one-hot
80
+ grid = np.zeros((24, len(self._colors)), dtype=np.float32)
81
+ for idx, ch in enumerate(stickers):
82
+ cidx = self._color_to_idx.get(ch, None)
83
+ if cidx is not None:
84
+ grid[idx, cidx] = 1.0
85
+ return grid.reshape(-1)
86
+
87
+ def reset(self, *, seed: int | None = None, options: Dict[str, Any] | None = None):
88
+ text_obs = self._env.reset(seed=seed)
89
+ obs = self._encode_obs(text_obs)
90
+ return obs, {}
91
+
92
+ def step(self, action: int):
93
+ mapped = int(action) + 1 # 0..11 -> 1..12
94
+ text_obs, reward, done, info = self._env.step(mapped)
95
+ obs = self._encode_obs(text_obs)
96
+ terminated = bool(done)
97
+ truncated = False
98
+ return obs, float(reward), terminated, truncated, info or {}
99
+
100
+ def render(self):
101
+ return self._env.render()
102
+
103
+ def close(self):
104
+ self._env.close()
105
+
106
+
107
+ @dataclass
108
+ class Args:
109
+ exp_name: str = os.path.basename(__file__)[: -len(".py")]
110
+ seed: int = 1
111
+ torch_deterministic: bool = True
112
+ cuda: bool = True
113
+ track: bool = True
114
+ wandb_project_name: str = "cleanRL"
115
+ wandb_entity: str | None = None
116
+ capture_video: bool = False
117
+
118
+ # Algorithm
119
+ env_id: str = "RubiksCube2x2"
120
+ total_timesteps: int = 1000_000
121
+ learning_rate: float = 2.5e-4
122
+ num_envs: int = 8
123
+ num_steps: int = 128
124
+ anneal_lr: bool = True
125
+ gamma: float = 0.99
126
+ gae_lambda: float = 0.95
127
+ num_minibatches: int = 4
128
+ update_epochs: int = 4
129
+ norm_adv: bool = True
130
+ clip_coef: float = 0.2
131
+ clip_vloss: bool = True
132
+ ent_coef: float = 0.01
133
+ vf_coef: float = 0.5
134
+ max_grad_norm: float = 0.5
135
+ target_kl: float | None = None
136
+
137
+ # Rubik specific
138
+ scramble_depth: int = 4
139
+ max_steps_env: int = 20
140
+
141
+ # runtime filled
142
+ batch_size: int = 0
143
+ minibatch_size: int = 0
144
+ num_iterations: int = 0
145
+ eval_splits: int = 2
146
+ eval_episodes: int = 4000
147
+
148
+
149
+ def make_env(idx, run_name, seed, scramble_depth, max_steps_env, capture_video=False):
150
+ def thunk():
151
+ config = RubiksCube2x2Config(scramble_depth=scramble_depth, max_steps=max_steps_env, render_mode='text')
152
+ env = RubiksCube2x2Env(config)
153
+ env = RubiksCubeWrapper(env)
154
+ env = gym.wrappers.TimeLimit(env, max_episode_steps=max_steps_env)
155
+ env = gym.wrappers.RecordEpisodeStatistics(env)
156
+ if capture_video and idx == 0:
157
+ env = gym.wrappers.RecordVideo(env, f"videos/{run_name}")
158
+ return env
159
+ return thunk
160
+
161
+
162
+ def layer_init(layer, std=np.sqrt(2), bias_const=0.0):
163
+ torch.nn.init.orthogonal_(layer.weight, std)
164
+ torch.nn.init.constant_(layer.bias, bias_const)
165
+ return layer
166
+
167
+
168
+ class Agent(nn.Module):
169
+ def __init__(self, envs):
170
+ super().__init__()
171
+ obs_shape = int(np.array(envs.single_observation_space.shape).prod())
172
+ hidden = 128
173
+ self.critic = nn.Sequential(
174
+ layer_init(nn.Linear(obs_shape, hidden)),
175
+ nn.Tanh(),
176
+ layer_init(nn.Linear(hidden, hidden)),
177
+ nn.Tanh(),
178
+ layer_init(nn.Linear(hidden, 1), std=1.0),
179
+ )
180
+ self.actor = nn.Sequential(
181
+ layer_init(nn.Linear(obs_shape, hidden)),
182
+ nn.Tanh(),
183
+ layer_init(nn.Linear(hidden, hidden)),
184
+ nn.Tanh(),
185
+ layer_init(nn.Linear(hidden, envs.single_action_space.n), std=0.01),
186
+ )
187
+
188
+ def get_value(self, x):
189
+ return self.critic(x)
190
+
191
+ def get_action_and_value(self, x, action=None):
192
+ logits = self.actor(x)
193
+ probs = Categorical(logits=logits)
194
+ if action is None:
195
+ action = probs.sample()
196
+ return action, probs.log_prob(action), probs.entropy(), self.critic(x)
197
+
198
+
199
+ if __name__ == "__main__":
200
+ args = tyro.cli(Args)
201
+ args.batch_size = int(args.num_envs * args.num_steps)
202
+ args.minibatch_size = int(args.batch_size // args.num_minibatches)
203
+ args.num_iterations = args.total_timesteps // args.batch_size
204
+ run_name = f"{args.env_id}__{args.exp_name}__{args.seed}__{int(time.time())}"
205
+
206
+ if args.track:
207
+ import wandb
208
+ wandb.init(
209
+ project=args.wandb_project_name,
210
+ entity=args.wandb_entity,
211
+ config=vars(args),
212
+ name=run_name,
213
+ monitor_gym=True,
214
+ save_code=True,
215
+ )
216
+ try:
217
+ wandb.define_metric("global_step")
218
+ for prefix in ["train/*", "rollout/*", "eval/*", "losses/*", "charts/*", "perf/*"]:
219
+ wandb.define_metric(prefix, step_metric="global_step")
220
+ except Exception:
221
+ pass
222
+
223
+ # seeding
224
+ random.seed(args.seed)
225
+ np.random.seed(args.seed)
226
+ torch.manual_seed(args.seed)
227
+ torch.backends.cudnn.deterministic = args.torch_deterministic
228
+
229
+ device = torch.device("cuda" if torch.cuda.is_available() and args.cuda else "cpu")
230
+
231
+ # envs
232
+ envs = gym.vector.SyncVectorEnv([
233
+ make_env(i, run_name, args.seed, args.scramble_depth, args.max_steps_env, args.capture_video)
234
+ for i in range(args.num_envs)
235
+ ])
236
+ assert isinstance(envs.single_action_space, gym.spaces.Discrete)
237
+
238
+ agent = Agent(envs).to(device)
239
+ optimizer = optim.Adam(agent.parameters(), lr=args.learning_rate, eps=1e-5)
240
+
241
+ # storage
242
+ obs = torch.zeros((args.num_steps, args.num_envs) + envs.single_observation_space.shape).to(device)
243
+ actions = torch.zeros((args.num_steps, args.num_envs) + envs.single_action_space.shape).to(device)
244
+ logprobs = torch.zeros((args.num_steps, args.num_envs)).to(device)
245
+ rewards = torch.zeros((args.num_steps, args.num_envs)).to(device)
246
+ dones = torch.zeros((args.num_steps, args.num_envs)).to(device)
247
+ values = torch.zeros((args.num_steps, args.num_envs)).to(device)
248
+
249
+ # start
250
+ global_step = 0
251
+ start_time = time.time()
252
+ next_obs, _ = envs.reset(seed=args.seed)
253
+ next_obs = torch.Tensor(next_obs).to(device)
254
+ next_done = torch.zeros(args.num_envs).to(device)
255
+
256
+ # eval helper similar to FrozenLake: collect greedy eval trajectories and write metrics.json
257
+ def collect_eval_trajectories(agent_model, make_env_fn, n_episodes, step_tag):
258
+ out_dir = Path(f"runs/{run_name}/trajectories/step_{step_tag}")
259
+ out_dir.mkdir(parents=True, exist_ok=True)
260
+ out_path = out_dir / "trajectories.jsonl"
261
+ env = make_env_fn()
262
+ collected = 0
263
+ summary_returns = []
264
+ summary_success = []
265
+ with out_path.open("w") as f:
266
+ while collected < n_episodes:
267
+ state, _ = env.reset(seed=args.seed + 100000 + collected)
268
+ traj_states = [state.tolist()]
269
+ traj_actions = []
270
+ traj_rewards = []
271
+ traj_dones = []
272
+ traj_success = []
273
+ done = False
274
+ step_count = 0
275
+ max_eval_steps = getattr(env, '_max_episode_steps', None) or int(args.max_steps_env)
276
+ while not done:
277
+ with torch.no_grad():
278
+ logits = agent_model.actor(torch.tensor(state, dtype=torch.float32, device=device).unsqueeze(0))
279
+ action = int(torch.argmax(logits, dim=1).item())
280
+ next_state, reward, terminated, truncated, info = env.step(action)
281
+ traj_actions.append(int(action))
282
+ traj_rewards.append(float(reward))
283
+ step_count += 1
284
+ d = bool(terminated) or bool(truncated) or (step_count >= max_eval_steps)
285
+ traj_dones.append(d)
286
+ traj_success.append(bool((info or {}).get('success', False)))
287
+ state = next_state
288
+ traj_states.append(state.tolist())
289
+ done = d
290
+ ep_ret = float(sum(traj_rewards))
291
+ ep_succ = bool(any(traj_success))
292
+ record = {
293
+ "states": traj_states,
294
+ "actions": traj_actions,
295
+ "rewards": traj_rewards,
296
+ "dones": traj_dones,
297
+ "success": traj_success,
298
+ "episode_return": ep_ret,
299
+ "episode_success": ep_succ,
300
+ }
301
+ f.write(json.dumps(record) + "\n")
302
+ collected += 1
303
+ summary_returns.append(ep_ret)
304
+ summary_success.append(1.0 if ep_succ else 0.0)
305
+ env.close()
306
+ try:
307
+ metrics = {
308
+ "global_step": int(step_tag),
309
+ "episodes": int(n_episodes),
310
+ "success_rate": float(np.mean(summary_success)) if len(summary_success) else 0.0,
311
+ "avg_return": float(np.mean(summary_returns)) if len(summary_returns) else 0.0,
312
+ "std_return": float(np.std(summary_returns)) if len(summary_returns) else 0.0,
313
+ }
314
+ with (out_dir / "metrics.json").open("w") as mf:
315
+ json.dump(metrics, mf)
316
+ except Exception as e:
317
+ print(f"Warning: failed to write eval metrics: {e}")
318
+
319
+ # training loop
320
+ eval_every_iters = max(1, args.num_iterations // args.eval_splits)
321
+ for iteration in range(1, args.num_iterations + 1):
322
+ # Anneal LR
323
+ if args.anneal_lr:
324
+ frac = 1.0 - (iteration - 1.0) / args.num_iterations
325
+ lrnow = frac * args.learning_rate
326
+ optimizer.param_groups[0]["lr"] = lrnow
327
+
328
+ # accumulate per-iteration episode successes
329
+ iter_successes = []
330
+ for step in range(0, args.num_steps):
331
+ global_step += args.num_envs
332
+ obs[step] = next_obs
333
+ dones[step] = next_done
334
+
335
+ with torch.no_grad():
336
+ action, logprob, _, value = agent.get_action_and_value(next_obs)
337
+ values[step] = value.flatten()
338
+ actions[step] = action
339
+ logprobs[step] = logprob
340
+
341
+ next_obs, reward, terminations, truncations, infos = envs.step(action.cpu().numpy())
342
+ next_done = np.logical_or(terminations, truncations)
343
+ rewards[step] = torch.tensor(reward).to(device).view(-1)
344
+ next_obs, next_done = torch.Tensor(next_obs).to(device), torch.Tensor(next_done).to(device)
345
+
346
+ # Episode stats logging similar to FrozenLake
347
+ try:
348
+ mask = None
349
+ if isinstance(infos, dict):
350
+ if "_episode" in infos:
351
+ mask = np.asarray(infos["_episode"]).astype(bool)
352
+ elif "episode" in infos and isinstance(infos["episode"], dict) and "_l" in infos["episode"]:
353
+ mask = np.asarray(infos["episode"]["_l"]).astype(bool)
354
+ if mask is not None and np.any(mask):
355
+ r_arr = np.asarray(infos.get("episode", {}).get("r", np.zeros_like(mask, dtype=float)))
356
+ l_arr = np.asarray(infos.get("episode", {}).get("l", np.zeros_like(mask, dtype=int)))
357
+ # prefer success from info; fallback to ep return > 0
358
+ if "success" in infos:
359
+ succ_arr = np.asarray(infos.get("success", np.zeros_like(mask, dtype=bool))).astype(float)
360
+ else:
361
+ try:
362
+ succ_arr = (np.asarray(r_arr) > 0).astype(float)
363
+ except Exception:
364
+ succ_arr = np.zeros_like(mask, dtype=float)
365
+ # collect iteration successes for training success rate
366
+ try:
367
+ for s in np.asarray(succ_arr)[mask]:
368
+ iter_successes.append(float(s))
369
+ except Exception:
370
+ pass
371
+ if args.track:
372
+ try:
373
+ import wandb
374
+ log_dict = {
375
+ "global_step": int(global_step),
376
+ "rollout/ep_rew_mean": float(np.mean(r_arr[mask])) if np.any(mask) else None,
377
+ "rollout/ep_len_mean": float(np.mean(l_arr[mask])) if np.any(mask) else None,
378
+ "rollout/success_rate": float(np.mean(succ_arr[mask])) if np.any(mask) else None,
379
+ }
380
+ wandb.log(log_dict, step=global_step)
381
+ except Exception:
382
+ pass
383
+ except Exception:
384
+ pass
385
+
386
+ # GAE
387
+ with torch.no_grad():
388
+ next_value = agent.get_value(next_obs).reshape(1, -1)
389
+ advantages = torch.zeros_like(rewards).to(device)
390
+ lastgaelam = 0
391
+ for t in reversed(range(args.num_steps)):
392
+ if t == args.num_steps - 1:
393
+ nextnonterminal = 1.0 - next_done
394
+ nextvalues = next_value
395
+ else:
396
+ nextnonterminal = 1.0 - dones[t + 1]
397
+ nextvalues = values[t + 1]
398
+ delta = rewards[t] + args.gamma * nextvalues * nextnonterminal - values[t]
399
+ advantages[t] = lastgaelam = delta + args.gamma * args.gae_lambda * nextnonterminal * lastgaelam
400
+ returns = advantages + values
401
+
402
+ # flatten batch
403
+ b_obs = obs.reshape((-1,) + envs.single_observation_space.shape)
404
+ b_logprobs = logprobs.reshape(-1)
405
+ b_actions = actions.reshape((-1,) + envs.single_action_space.shape)
406
+ b_advantages = advantages.reshape(-1)
407
+ b_returns = returns.reshape(-1)
408
+ b_values = values.reshape(-1)
409
+
410
+ # update
411
+ b_inds = np.arange(args.batch_size)
412
+ clipfracs = []
413
+ for epoch in range(args.update_epochs):
414
+ np.random.shuffle(b_inds)
415
+ for start in range(0, args.batch_size, args.minibatch_size):
416
+ end = start + args.minibatch_size
417
+ mb_inds = b_inds[start:end]
418
+
419
+ _, newlogprob, entropy, newvalue = agent.get_action_and_value(b_obs[mb_inds], b_actions.long()[mb_inds])
420
+ logratio = newlogprob - b_logprobs[mb_inds]
421
+ ratio = logratio.exp()
422
+
423
+ with torch.no_grad():
424
+ old_approx_kl = (-logratio).mean()
425
+ approx_kl = ((ratio - 1) - logratio).mean()
426
+ clipfracs += [((ratio - 1.0).abs() > args.clip_coef).float().mean().item()]
427
+
428
+ mb_advantages = b_advantages[mb_inds]
429
+ if args.norm_adv:
430
+ mb_advantages = (mb_advantages - mb_advantages.mean()) / (mb_advantages.std() + 1e-8)
431
+
432
+ pg_loss1 = -mb_advantages * ratio
433
+ pg_loss2 = -mb_advantages * torch.clamp(ratio, 1 - args.clip_coef, 1 + args.clip_coef)
434
+ pg_loss = torch.max(pg_loss1, pg_loss2).mean()
435
+
436
+ newvalue = newvalue.view(-1)
437
+ if args.clip_vloss:
438
+ v_loss_unclipped = (newvalue - b_returns[mb_inds]) ** 2
439
+ v_clipped = b_values[mb_inds] + torch.clamp(
440
+ newvalue - b_values[mb_inds], -args.clip_coef, args.clip_coef,
441
+ )
442
+ v_loss_clipped = (v_clipped - b_returns[mb_inds]) ** 2
443
+ v_loss = 0.5 * torch.max(v_loss_unclipped, v_loss_clipped).mean()
444
+ else:
445
+ v_loss = 0.5 * ((newvalue - b_returns[mb_inds]) ** 2).mean()
446
+
447
+ entropy_loss = entropy.mean()
448
+ loss = pg_loss - args.ent_coef * entropy_loss + v_loss * args.vf_coef
449
+
450
+ optimizer.zero_grad()
451
+ loss.backward()
452
+ nn.utils.clip_grad_norm_(agent.parameters(), args.max_grad_norm)
453
+ optimizer.step()
454
+
455
+ if args.target_kl is not None and approx_kl > args.target_kl:
456
+ break
457
+
458
+ # metrics
459
+ y_pred, y_true = b_values.cpu().numpy(), b_returns.cpu().numpy()
460
+ var_y = np.var(y_true)
461
+ explained_var = np.nan if var_y == 0 else 1 - np.var(y_true - y_pred) / var_y
462
+
463
+ sps = int(global_step / (time.time() - start_time))
464
+ train_success_rate = float(np.mean(iter_successes)) if len(iter_successes) else 0.0
465
+ print(f"Iter {iteration:4d}/{args.num_iterations} | SPS: {sps:5d} | R: {rewards.mean().item():6.3f}")
466
+ if args.track:
467
+ try:
468
+ import wandb
469
+ wandb.log({
470
+ "global_step": int(global_step),
471
+ "charts/progress": float(100.0 * iteration / max(1, args.num_iterations)),
472
+ "train/value_loss": float(v_loss.item()),
473
+ "train/policy_loss": float(pg_loss.item()),
474
+ "losses/value_loss": float(v_loss.item()),
475
+ "losses/policy_loss": float(pg_loss.item()),
476
+ "train/entropy": float(entropy_loss.item()),
477
+ "train/old_approx_kl": float(old_approx_kl.item()),
478
+ "train/approx_kl": float(approx_kl.item()),
479
+ "train/clipfrac": float(np.mean(clipfracs)) if len(clipfracs) else 0.0,
480
+ "losses/explained_variance": float(explained_var),
481
+ "charts/avg_reward": float(rewards.mean().item()),
482
+ "charts/avg_value": float(values.mean().item()),
483
+ "perf/SPS": int(sps),
484
+ "charts/SPS": int(sps),
485
+ "train/success_rate": train_success_rate,
486
+ "charts/train_success_rate": train_success_rate,
487
+ "train/learning_rate": float(optimizer.param_groups[0]["lr"]),
488
+ }, step=global_step)
489
+ except Exception:
490
+ pass
491
+
492
+ # periodic evaluation collection
493
+ if iteration % eval_every_iters == 0:
494
+ try:
495
+ eval_thunk = make_env(0, run_name, args.seed + 9999, args.scramble_depth, args.max_steps_env, False)
496
+ collect_eval_trajectories(agent, eval_thunk, n_episodes=args.eval_episodes, step_tag=global_step)
497
+ if args.track:
498
+ try:
499
+ import json as _json
500
+ from pathlib import Path as _Path
501
+ mpath = _Path(f"runs/{run_name}/trajectories/step_{global_step}/metrics.json")
502
+ if mpath.exists():
503
+ with mpath.open("r") as mf:
504
+ metrics = _json.load(mf)
505
+ wandb.log({
506
+ "eval/success_rate": metrics.get("success_rate"),
507
+ "eval/avg_return": metrics.get("avg_return"),
508
+ "eval/std_return": metrics.get("std_return"),
509
+ "eval/episodes": metrics.get("episodes"),
510
+ }, step=global_step)
511
+ except Exception:
512
+ pass
513
+ print(f"Collected {args.eval_episodes} eval trajectories at global_step {global_step}")
514
+ except Exception as e:
515
+ print(f"Warning: eval trajectory collection failed at step {global_step}: {e}")
516
+
517
+ envs.close()
wandb/run-20251218_183419-wvypkl8w/files/config.yaml ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _wandb:
2
+ value:
3
+ cli_version: 0.23.0
4
+ code_path: code/cleanrl/cleanrl/ppo_rubikscube.py
5
+ e:
6
+ bay0zucrvgh0budvh5sfo6odu02gecuh:
7
+ args:
8
+ - --track
9
+ codePath: cleanrl/cleanrl/ppo_rubikscube.py
10
+ codePathLocal: cleanrl/cleanrl/ppo_rubikscube.py
11
+ cpu_count: 64
12
+ cpu_count_logical: 128
13
+ cudaVersion: "12.4"
14
+ disk:
15
+ /:
16
+ total: "5153960755200"
17
+ used: "447541800960"
18
+ email: haoyu-wa22@mails.tsinghua.edu.cn
19
+ executable: /root/local/miniconda3/envs/ragen/bin/python
20
+ git:
21
+ commit: 8d73639b99b38265453f898b8d6af7d4af50d56e
22
+ remote: https://github.com/mll-lab-nu/RAGEN.git
23
+ gpu: NVIDIA H100 80GB HBM3
24
+ gpu_count: 8
25
+ gpu_nvidia:
26
+ - architecture: Hopper
27
+ cudaCores: 16896
28
+ memoryTotal: "85520809984"
29
+ name: NVIDIA H100 80GB HBM3
30
+ uuid: GPU-35e2d43d-4067-82ce-90d4-def9e389bf28
31
+ - architecture: Hopper
32
+ cudaCores: 16896
33
+ memoryTotal: "85520809984"
34
+ name: NVIDIA H100 80GB HBM3
35
+ uuid: GPU-af4135e3-88f2-e9ac-518d-502c75a85429
36
+ - architecture: Hopper
37
+ cudaCores: 16896
38
+ memoryTotal: "85520809984"
39
+ name: NVIDIA H100 80GB HBM3
40
+ uuid: GPU-d7fdeeba-fe9b-ec03-d9f7-6724fe4266b5
41
+ - architecture: Hopper
42
+ cudaCores: 16896
43
+ memoryTotal: "85520809984"
44
+ name: NVIDIA H100 80GB HBM3
45
+ uuid: GPU-ccc4f668-3882-5a8e-2c07-c5cd08f6f666
46
+ - architecture: Hopper
47
+ cudaCores: 16896
48
+ memoryTotal: "85520809984"
49
+ name: NVIDIA H100 80GB HBM3
50
+ uuid: GPU-7b73c0cf-d3d5-e10c-7176-a43be1e41001
51
+ - architecture: Hopper
52
+ cudaCores: 16896
53
+ memoryTotal: "85520809984"
54
+ name: NVIDIA H100 80GB HBM3
55
+ uuid: GPU-81b58d94-5d1f-8ec2-f9d2-fd56172ed177
56
+ - architecture: Hopper
57
+ cudaCores: 16896
58
+ memoryTotal: "85520809984"
59
+ name: NVIDIA H100 80GB HBM3
60
+ uuid: GPU-03e8bc66-3b44-6794-49fd-5392fbdda6d1
61
+ - architecture: Hopper
62
+ cudaCores: 16896
63
+ memoryTotal: "85520809984"
64
+ name: NVIDIA H100 80GB HBM3
65
+ uuid: GPU-b7cf0ec6-7c29-1179-dceb-09565da51890
66
+ host: pt-4d654cf4576f4d23ad3d3919f12932fe-worker-0
67
+ memory:
68
+ total: "2163642122240"
69
+ os: Linux-5.14.0-284.25.1.el9_2.x86_64-x86_64-with-glibc2.35
70
+ program: /mnt/general/wanghy/RAGEN/cleanrl/cleanrl/ppo_rubikscube.py
71
+ python: CPython 3.10.19
72
+ root: /mnt/general/wanghy/RAGEN
73
+ startedAt: "2025-12-18T10:34:19.463187Z"
74
+ writerId: bay0zucrvgh0budvh5sfo6odu02gecuh
75
+ m:
76
+ - "1": global_step
77
+ "6":
78
+ - 3
79
+ "7": []
80
+ - "2": losses/*
81
+ "5": 1
82
+ "6":
83
+ - 1
84
+ "7": []
85
+ - "2": charts/*
86
+ "5": 1
87
+ "6":
88
+ - 1
89
+ "7": []
90
+ - "2": perf/*
91
+ "5": 1
92
+ "6":
93
+ - 1
94
+ "7": []
95
+ - "2": train/*
96
+ "5": 1
97
+ "6":
98
+ - 1
99
+ "7": []
100
+ - "2": rollout/*
101
+ "5": 1
102
+ "6":
103
+ - 1
104
+ "7": []
105
+ - "2": eval/*
106
+ "5": 1
107
+ "6":
108
+ - 1
109
+ "7": []
110
+ python_version: 3.10.19
111
+ t:
112
+ "1":
113
+ - 1
114
+ - 11
115
+ - 30
116
+ - 49
117
+ - 50
118
+ - 51
119
+ - 105
120
+ "2":
121
+ - 1
122
+ - 11
123
+ - 30
124
+ - 49
125
+ - 50
126
+ - 51
127
+ - 105
128
+ "3":
129
+ - 7
130
+ - 13
131
+ - 16
132
+ - 61
133
+ "4": 3.10.19
134
+ "5": 0.23.0
135
+ "6": 4.57.1
136
+ "12": 0.23.0
137
+ "13": linux-x86_64
138
+ anneal_lr:
139
+ value: true
140
+ batch_size:
141
+ value: 1024
142
+ capture_video:
143
+ value: false
144
+ clip_coef:
145
+ value: 0.2
146
+ clip_vloss:
147
+ value: true
148
+ cuda:
149
+ value: true
150
+ ent_coef:
151
+ value: 0.01
152
+ env_id:
153
+ value: RubiksCube2x2
154
+ eval_episodes:
155
+ value: 4000
156
+ eval_splits:
157
+ value: 2
158
+ exp_name:
159
+ value: ppo_rubikscube
160
+ gae_lambda:
161
+ value: 0.95
162
+ gamma:
163
+ value: 0.99
164
+ learning_rate:
165
+ value: 0.00025
166
+ max_grad_norm:
167
+ value: 0.5
168
+ max_steps_env:
169
+ value: 20
170
+ minibatch_size:
171
+ value: 256
172
+ norm_adv:
173
+ value: true
174
+ num_envs:
175
+ value: 8
176
+ num_iterations:
177
+ value: 976
178
+ num_minibatches:
179
+ value: 4
180
+ num_steps:
181
+ value: 128
182
+ scramble_depth:
183
+ value: 4
184
+ seed:
185
+ value: 1
186
+ target_kl:
187
+ value: null
188
+ torch_deterministic:
189
+ value: true
190
+ total_timesteps:
191
+ value: 1000000
192
+ track:
193
+ value: true
194
+ update_epochs:
195
+ value: 4
196
+ vf_coef:
197
+ value: 0.5
198
+ wandb_entity:
199
+ value: null
200
+ wandb_project_name:
201
+ value: cleanRL
wandb/run-20251218_183419-wvypkl8w/files/diff.patch ADDED
@@ -0,0 +1,1162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/config/base.yaml b/config/base.yaml
2
+ index a1659e4..9df6250 100644
3
+ --- a/config/base.yaml
4
+ +++ b/config/base.yaml
5
+ @@ -9,15 +9,16 @@ seed:
6
+ train: 10000
7
+ val: 123
8
+
9
+ -micro_batch_size_per_gpu: 4
10
+ +micro_batch_size_per_gpu: 1
11
+ ppo_mini_batch_size: 32
12
+ -model_path: Qwen/Qwen2.5-3B-Instruct
13
+ +model_path: /mnt/general/share/model/Qwen/Qwen2.5-0.5B-Instruct
14
+ +# Qwen/Qwen2.5-0.5B-Instruct
15
+ enable_response_mask: True # Enabling response mask could improve stability of rollout/old_log_prob, as P(st|history) are no longer calculated in loss here. See https://docs.google.com/document/d/1bg7obeiKTExuHHBl5uOiSpec5uLDZ2Tgvxy6li5pHX4/edit?usp=sharing for more details.
16
+ grpo_advantage_length_weight: False # if you do not enable this and critic/advantage_estimator is GRPO, and the critic/advantages/mean is too low, then you can try enabling this to encourage reasoning and forbid collapse
17
+
18
+ lora:
19
+ rank: 0
20
+ - alpha: 64
21
+ + alpha: 16
22
+ target_modules: all-linear
23
+
24
+ actor_rollout_ref:
25
+ @@ -46,10 +47,10 @@ actor_rollout_ref:
26
+ name: vllm
27
+ log_prob_micro_batch_size_per_gpu: ${micro_batch_size_per_gpu} # following micro_batch_size_per_gpu
28
+ tensor_model_parallel_size: 1
29
+ - max_model_len: 3600
30
+ + max_model_len: 7200 #3600 why** 14400
31
+ prompt_length: 1 # useless. Just put it here
32
+ response_length: 400 # single-turn response length
33
+ - gpu_memory_utilization: 0.5
34
+ + gpu_memory_utilization: 0.7
35
+ max_num_batched_tokens: 8192 # set only when enable_chunked_prefill is true
36
+ temperature: 1
37
+ rollout_filter_ratio: 0.25
38
+ @@ -90,26 +91,28 @@ algorithm:
39
+ kl_coef: 0.000
40
+
41
+ trainer:
42
+ - project_name: ragen_latest
43
+ + project_name:
44
+ experiment_name: test
45
+ local_log_dir: "results/"
46
+ - save_freq: 100
47
+ + save_freq: -1
48
+ total_training_steps: 200
49
+ validation_steps: 1 # validation instances = validation_steps * val_env_groups * group_size
50
+ val_before_train: True
51
+ n_gpus_per_node: 1
52
+ test_freq: 10
53
+ generations_to_log_to_wandb:
54
+ + train: 128
55
+ val: 20
56
+ logger: [ 'console', 'wandb' ]
57
+ max_actor_ckpt_to_keep: 1
58
+ max_critic_ckpt_to_keep: 1
59
+ + default_local_dir: /mnt/general/wanghy/RAGEN/saves/
60
+
61
+ agent_proxy:
62
+ max_context_window: -1 # set a value > 0 to enable context window for long trajectory
63
+ - max_turn: 5
64
+ + max_turn: 25 #25 why** 700
65
+ action_sep: "||"
66
+ - max_actions_per_turn: 2 # how many actions can be output at most in a single turn
67
+ + max_actions_per_turn: 1 # how many actions can be output at most in a single turn
68
+ use_turn_scores: False # important to GAE when applying token-level rewards to token-level advantages. If False, will take the sum of scores as the reward for the last turn.
69
+ enable_think: True # False -> no think RL
70
+ reward_normalization:
71
+ @@ -126,11 +129,11 @@ es_manager:
72
+ tags: ["CoordSokoban"]
73
+ n_groups: [8] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
74
+ val:
75
+ - env_groups: 32
76
+ - group_size: 16 # should be set to 1 because when val temperature is set to 0 and group size > 1, there will be repetitive prompts which leads to same trajectory.
77
+ + env_groups: 256
78
+ + group_size: 1 # should be set to 1 because when val temperature is set to 0 and group size > 1, there will be repetitive prompts which leads to same trajectory.
79
+ env_configs:
80
+ tags: ["CoordSokoban"]
81
+ - n_groups: [32] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
82
+ + n_groups: [256] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
83
+
84
+ ctx_manager:
85
+ generation: # go to vllm
86
+ diff --git a/config/envs.yaml b/config/envs.yaml
87
+ index 1002ac8..ba3ac6f 100644
88
+ --- a/config/envs.yaml
89
+ +++ b/config/envs.yaml
90
+ @@ -2,6 +2,7 @@ custom_envs:
91
+ SimpleSokoban:
92
+ env_type: sokoban
93
+ max_actions_per_traj: 10 # used in environment state manager to control the actual max actions executed per trajectory
94
+ + # ORIGNAL env_instruction
95
+ env_instruction: |
96
+ You are solving the Sokoban puzzle.
97
+ You are the player and you need to push all boxes to targets.
98
+ @@ -12,7 +13,7 @@ custom_envs:
99
+ env_config: # keys should be a subset of SokobanConfig
100
+ dim_x: 6
101
+ dim_y: 6
102
+ - num_boxes: 1
103
+ + num_boxes: 2
104
+ max_steps: 100
105
+
106
+ LargerSokoban:
107
+ @@ -65,7 +66,7 @@ custom_envs:
108
+ env_config: # keys should be a subset of SokobanConfig
109
+ dim_x: 6
110
+ dim_y: 6
111
+ - num_boxes: 1
112
+ + num_boxes: 2
113
+ max_steps: 100
114
+ observation_format: "grid_coord"
115
+
116
+ @@ -111,14 +112,14 @@ custom_envs:
117
+
118
+ FrozenLake:
119
+ env_type: frozen_lake
120
+ - max_actions_per_traj: 10
121
+ + max_actions_per_traj: 25
122
+ env_instruction: "You are solving the FrozenLake puzzle. Forbid the whole and go to the target. You may move to the unintended direction due to the slippery ice. Example answer format: <think>To forbid the hole and go to the target, I should go left then go up.</think><answer>Left || Up</answer>"
123
+ max_tokens: 100
124
+ env_config: null
125
+
126
+ CoordFrozenLake:
127
+ env_type: frozen_lake
128
+ - max_actions_per_traj: 10
129
+ + max_actions_per_traj: 25
130
+ env_instruction: |
131
+ You are solving the FrozenLake puzzle. The observation includes both a symbol grid and zero-indexed coordinates for the start, goal, player, and any holes.
132
+ Coordinates range from the top-left corner (0, 0) to the bottom-right corner (5, 5).
133
+ @@ -195,4 +196,80 @@ custom_envs:
134
+ max_actions_per_traj: 30
135
+ env_instruction: "You are a Lean theorem prover. Given a Lean theorem statement, propose a sequence of tactics that completes the proof. Think step by step about which tactics to apply next. Provide tactics separated by '||', for example <answer>intro || simp || rfl</answer>."
136
+ max_tokens: 512
137
+ - env_config: null # Please refer to ragen/env/lean/config.py for a full list of parameters.
138
+
139
+ + env_config: null # Please refer to ragen/env/lean/config.py for a full list of parameters.
140
+ +
141
+ +
142
+ + game_2048:
143
+ + env_type: game_2048
144
+ + max_actions_per_traj: 700
145
+ + env_instruction: |
146
+ + You are playing the 2048 game on a 4x4 grid. Merge equal tiles by sliding Up, Right, Down, or Left.
147
+ + If a move is invalid (no tiles move), a small penalty is applied. Respond with a single action.
148
+ + Example: <answer>Up</answer>
149
+ + max_tokens: 8192
150
+ + env_config: null
151
+ +
152
+ + blackjack:
153
+ + env_type: blackjack
154
+ + max_actions_per_traj: 10
155
+ + env_instruction: |
156
+ + You are playing Blackjack against a dealer. The dealer must hit on 16 or less and stand on 17 or more.
157
+ + Choose either Stick or Hit. Respond with a single action.
158
+ + Example: <answer>Hit</answer>
159
+ + max_tokens: 64
160
+ + env_config: null
161
+ +
162
+ + rubikscube:
163
+ + env_type: rubikscube
164
+ + max_actions_per_traj: 20
165
+ + env_instruction: |
166
+ + You are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.
167
+ + Available actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.
168
+ + - Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).
169
+ + - Modifiers: A letter alone means 90° clockwise (e.g., 'R'). A letter with prime (') means 90° counter-clockwise (e.g., "R'").
170
+ + Respond with a sequence of actions separated by "||".
171
+ + Example: <answer>U</answer>
172
+ + max_tokens: 96
173
+ + env_config:
174
+ + scramble_depth: 1
175
+ + max_steps: 20
176
+ + render_mode: "text"
177
+ +
178
+ + SimpleSudoku:
179
+ + env_type: sudoku
180
+ + max_actions_per_traj: 20
181
+ + env_instruction: |
182
+ + You are solving a Sudoku puzzle. Fill in the grid so that every row, column, and 2x2 box contains the numbers 1-4 without repetition.
183
+ + Initial cells are shown in [brackets] and cannot be modified. Empty cells are shown as dots (.).
184
+ + Place numbers one at a time using the format, for example: <answer>place 1 at row 2 col 3</answer> or <answer>1,2,3</answer>
185
+ + The environment will provide feedback on valid/invalid moves and show conflicts if any occur.
186
+ + max_tokens: 150
187
+ + parallel_friendly: false
188
+ + max_workers: 32
189
+ + env_config:
190
+ + grid_size: 4
191
+ + difficulty: "easy"
192
+ + render_format: "with_feedback"
193
+ + show_conflicts: false
194
+ + show_valid_numbers: false
195
+ + max_steps: 20
196
+ +
197
+ + MediumSudoku:
198
+ + env_type: sudoku
199
+ + max_actions_per_traj: 30
200
+ + env_instruction: |
201
+ + You are solving a Sudoku puzzle. Fill in the grid so that every row, column, and 3x3 box contains the numbers 1-9 without repetition.
202
+ + Initial cells are shown in [brackets] and cannot be modified. Empty cells are shown as dots (.).
203
+ + Place numbers one at a time using the format: <answer>place 5 at row 2 col 3</answer> or <answer>2,3,5</answer>
204
+ + The environment will provide feedback on valid/invalid moves and show conflicts if any occur.
205
+ + max_tokens: 150
206
+ + parallel_friendly: false
207
+ + max_workers: 32
208
+ + env_config:
209
+ + grid_size: 9
210
+ + difficulty: "medium"
211
+ + render_format: "with_feedback"
212
+ + show_conflicts: true
213
+ + show_valid_numbers: true
214
+ + max_steps: 81
215
+ +
216
+ diff --git a/config/eval.yaml b/config/eval.yaml
217
+ index e65f3a5..7775fd1 100644
218
+ --- a/config/eval.yaml
219
+ +++ b/config/eval.yaml
220
+ @@ -1,14 +1,15 @@
221
+ defaults:
222
+ - envs
223
+ -
224
+ +enable_response_mask: True
225
+ system:
226
+ - CUDA_VISIBLE_DEVICES: "0"
227
+ + CUDA_VISIBLE_DEVICES: "0,1,2,3,4,5,6,7"
228
+
229
+ seed:
230
+ train: 10000
231
+ val: 123
232
+
233
+ -model_path: Qwen/Qwen2.5-3B-Instruct
234
+ +model_path: /mnt/general/share/model/openai/gpt-oss-20b
235
+ +# /mnt/general/share/model/tyzhu/SPA-frozenlake-qwen2.5-1.5b-instruct
236
+
237
+ lora:
238
+ rank: 0
239
+ @@ -24,9 +25,9 @@ actor_rollout_ref:
240
+ rollout:
241
+ name: vllm
242
+ log_prob_micro_batch_size_per_gpu: ${micro_batch_size_per_gpu}
243
+ - tensor_model_parallel_size: 1
244
+ + tensor_model_parallel_size: 8
245
+ dtype: bfloat16
246
+ - max_model_len: 3600
247
+ + max_model_len: 7200
248
+ prompt_length: 1
249
+ response_length: 400
250
+ gpu_memory_utilization: 0.9
251
+ @@ -35,6 +36,7 @@ actor_rollout_ref:
252
+ free_cache_engine: True
253
+ enable_chunked_prefill: False
254
+ disable_log_stats: False
255
+ + do_sample: True
256
+ val_kwargs:
257
+ do_sample: True
258
+ temperature: 0.5
259
+ @@ -44,9 +46,9 @@ actor_rollout_ref:
260
+
261
+ agent_proxy:
262
+ max_context_window: -1
263
+ - max_turn: 5
264
+ + max_turn: 25
265
+ action_sep: "||"
266
+ - max_actions_per_turn: 2
267
+ + max_actions_per_turn: 1
268
+ use_turn_scores: False
269
+ enable_think: True
270
+ reward_normalization:
271
+ @@ -59,13 +61,13 @@ es_manager:
272
+ env_groups: 8
273
+ group_size: 16
274
+ env_configs:
275
+ - tags: ["CoordSokoban"]
276
+ + tags: ["BanditTest"]
277
+ n_groups: [8]
278
+ val:
279
+ env_groups: 32
280
+ - group_size: 16
281
+ + group_size: 128
282
+ env_configs:
283
+ - tags: ["CoordSokoban"]
284
+ + tags: ["BanditTest"]
285
+ n_groups: [32]
286
+
287
+ ctx_manager:
288
+ diff --git a/config/evaluate_api_llm.yaml b/config/evaluate_api_llm.yaml
289
+ index b21c95e..e2e6761 100644
290
+ --- a/config/evaluate_api_llm.yaml
291
+ +++ b/config/evaluate_api_llm.yaml
292
+ @@ -1,8 +1,11 @@
293
+ +#export OPENAI_BASE_URL="https://api.ohmygpt.com/v1"
294
+ +#export OPENAI_API_KEY="sk-o4sMxBkN5BB100C4D4a3T3BlBkFJF7791CA39EA14ca98041"
295
+ +#python -m ragen.eval_api hydra.searchpath='[file://./verl/verl/trainer/config]'
296
+ defaults:
297
+ - base # this is a symbolic link to the verl/verl/trainer/config/ppo_trainer.yaml file
298
+
299
+ model_config:
300
+ - model_name: gpt-4o # should be registered in model_info
301
+ + model_name: ark-deepseek-v3-250324 # should be registered in model_info
302
+ max_concurrency: 16
303
+
304
+ model_info:
305
+ @@ -24,9 +27,9 @@ model_info:
306
+ generation_kwargs:
307
+ temperature: 0
308
+ max_tokens: 512 # max_completion_tokens if o1-mini
309
+ - gpt-4o:
310
+ + gpt-4o-mini:
311
+ provider_name: openai
312
+ - model_name: gpt-4o
313
+ + model_name: gpt-4o-mini
314
+ generation_kwargs:
315
+ temperature: 0
316
+ max_tokens: 512 # max_completion_tokens if o1-mini
317
+ @@ -36,21 +39,42 @@ model_info:
318
+ generation_kwargs:
319
+ temperature: 0
320
+ max_completion_tokens: 512
321
+ + ark-deepseek-v3-250324:
322
+ + provider_name: openai
323
+ + model_name: ark-deepseek-v3-250324
324
+ + generation_kwargs:
325
+ + temperature: 0
326
+ + max_completion_tokens: 512
327
+ deepseek-v3:
328
+ provider_name: deepseek
329
+ model_name: deepseek-chat
330
+ generation_kwargs:
331
+ temperature: 0
332
+ max_completion_tokens: 512
333
+ + glm-4.6:
334
+ + provider_name: openai
335
+ + model_name: glm-4.6
336
+ + generation_kwargs:
337
+ + temperature: 0
338
+ + max_completion_tokens: 512
339
+ + TA/openai/gpt-oss-120b:
340
+ + provider_name: openai
341
+ + model_name: TA/openai/gpt-oss-120b
342
+ + generation_kwargs:
343
+ + temperature: 0
344
+ + max_tokens: 8192
345
+ + # max_retries: 5
346
+
347
+ -
348
+ -
349
+ +agent_proxy:
350
+ + max_turn: 5
351
+ es_manager:
352
+ val:
353
+ - env_groups: 256
354
+ + env_groups: 128
355
+ group_size: 1 # should be set to 1 because val temperature is set to 0 and same prompt leads to same output
356
+ env_configs:
357
+ - tags: ["CoordSokoban"]
358
+ - n_groups: [256] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
359
+ + tags: ["rubikscube"]
360
+ + n_groups: [128] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
361
+
362
+
363
+ +rollout:
364
+ + max_model_len: 7200
365
+
366
+ Submodule external/webshop-minimal contains modified content
367
+ diff --git a/external/webshop-minimal/requirements.txt b/external/webshop-minimal/requirements.txt
368
+ index 5a1b04f..238ed5a 100644
369
+ --- a/external/webshop-minimal/requirements.txt
370
+ +++ b/external/webshop-minimal/requirements.txt
371
+ @@ -4,7 +4,7 @@ flask
372
+ html2text
373
+ rank_bm25
374
+ pyserini
375
+ -faiss-cpu
376
+ +faiss-gpu
377
+ thefuzz
378
+ gdown
379
+ spacy
380
+ diff --git a/ragen/env/__init__.py b/ragen/env/__init__.py
381
+ index b0f3461..bc6838e 100644
382
+ --- a/ragen/env/__init__.py
383
+ +++ b/ragen/env/__init__.py
384
+ @@ -12,6 +12,14 @@ from .metamathqa.env import MetaMathQAEnv
385
+ from .metamathqa.config import MetaMathQAEnvConfig
386
+ from .lean.config import LeanEnvConfig
387
+ from .lean.env import LeanEnv
388
+ +from .game_2048.config import Game2048EnvConfig
389
+ +from .game_2048.env import Game2048Env
390
+ +from .blackjack.config import BlackjackEnvConfig
391
+ +from .blackjack.env import BlackjackEnv
392
+ +from .rubikscube.config import RubiksCube2x2Config
393
+ +from .rubikscube.env import RubiksCube2x2Env
394
+ +from .sudoku.config import SudokuEnvConfig
395
+ +from .sudoku.env import SudokuEnv
396
+
397
+
398
+ REGISTERED_ENVS = {
399
+ @@ -22,6 +30,10 @@ REGISTERED_ENVS = {
400
+ # 'alfworld': AlfredTXTEnv,
401
+ 'metamathqa': MetaMathQAEnv,
402
+ 'lean': LeanEnv,
403
+ + 'game_2048': Game2048Env,
404
+ + 'blackjack': BlackjackEnv,
405
+ + 'rubikscube': RubiksCube2x2Env,
406
+ + 'sudoku': SudokuEnv,
407
+ }
408
+
409
+ REGISTERED_ENV_CONFIGS = {
410
+ @@ -32,6 +44,10 @@ REGISTERED_ENV_CONFIGS = {
411
+ # 'alfworld': AlfredEnvConfig,
412
+ 'metamathqa': MetaMathQAEnvConfig,
413
+ 'lean': LeanEnvConfig,
414
+ + 'game_2048': Game2048EnvConfig,
415
+ + 'blackjack': BlackjackEnvConfig,
416
+ + 'rubikscube': RubiksCube2x2Config,
417
+ + 'sudoku': SudokuEnvConfig,
418
+ }
419
+
420
+ try:
421
+ diff --git a/ragen/env/frozen_lake/config.py b/ragen/env/frozen_lake/config.py
422
+ index de054f4..9950c34 100644
423
+ --- a/ragen/env/frozen_lake/config.py
424
+ +++ b/ragen/env/frozen_lake/config.py
425
+ @@ -8,7 +8,7 @@ class FrozenLakeEnvConfig:
426
+ size: int = 4
427
+ p: float = 0.9
428
+ success_rate: float = 0.8
429
+ - is_slippery: bool = True
430
+ + is_slippery: bool = False
431
+ map_seed: Optional[int] = None
432
+ render_mode: str = "text"
433
+ observation_format: str = "grid"
434
+ diff --git a/ragen/env/frozen_lake/env.py b/ragen/env/frozen_lake/env.py
435
+ index 9ee3add..eef11d8 100644
436
+ --- a/ragen/env/frozen_lake/env.py
437
+ +++ b/ragen/env/frozen_lake/env.py
438
+ @@ -13,6 +13,7 @@ from ragen.env.base import BaseDiscreteActionEnv
439
+ class FrozenLakeEnv(BaseDiscreteActionEnv, GymFrozenLakeEnv):
440
+ def __init__(self, config: FrozenLakeEnvConfig = FrozenLakeEnvConfig()):
441
+ # Using mappings directly from config
442
+ + # import pdb;pdb.set_trace()
443
+ self.config = config
444
+ self.GRID_LOOKUP = config.grid_lookup
445
+ self.ACTION_LOOKUP = config.action_lookup
446
+ @@ -95,6 +96,7 @@ class FrozenLakeEnv(BaseDiscreteActionEnv, GymFrozenLakeEnv):
447
+ if __name__ == "__main__":
448
+ import matplotlib.pyplot as plt
449
+ config = FrozenLakeEnvConfig(size=4, is_slippery=True)
450
+ + # import pdb;pdb.set_trace()
451
+ env = FrozenLakeEnv(config)
452
+ print(env.reset())
453
+ while True:
454
+ diff --git a/ragen/env/sokoban/env.py b/ragen/env/sokoban/env.py
455
+ index 17cd636..6922b54 100644
456
+ --- a/ragen/env/sokoban/env.py
457
+ +++ b/ragen/env/sokoban/env.py
458
+ @@ -33,6 +33,7 @@ class SokobanEnv(BaseDiscreteActionEnv, GymSokobanEnv):
459
+ def reset(self, seed=None, mode=None):
460
+ try:
461
+ with all_seed(seed):
462
+ + # import pdb;pdb.set_trace()
463
+ self.room_fixed, self.room_state, self.box_mapping, action_sequence = generate_room(
464
+ dim=self.dim_room,
465
+ num_steps=self.num_gen_steps,
466
+ diff --git a/ragen/llm_agent/agent_proxy.py b/ragen/llm_agent/agent_proxy.py
467
+ index c25b50d..f6c4088 100644
468
+ --- a/ragen/llm_agent/agent_proxy.py
469
+ +++ b/ragen/llm_agent/agent_proxy.py
470
+ @@ -287,6 +287,7 @@ def main(config):
471
+ proxy = LLMAgentProxy(config, actor_wg, tokenizer)
472
+ import time
473
+ start_time = time.time()
474
+ + # import pdb;pdb.set_trace()
475
+ rollouts = proxy.rollout(
476
+ DataProto(
477
+ batch=None,
478
+ diff --git a/ragen/llm_agent/base_llm.py b/ragen/llm_agent/base_llm.py
479
+ index 358a2eb..b6f7797 100644
480
+ --- a/ragen/llm_agent/base_llm.py
481
+ +++ b/ragen/llm_agent/base_llm.py
482
+ @@ -33,6 +33,7 @@ class OpenAIProvider(LLMProvider):
483
+ raise ValueError("OpenAI API key not provided and not found in environment variables")
484
+
485
+ self.client = AsyncOpenAI(api_key=self.api_key)
486
+ + # import pdb;pdb.set_trace()
487
+
488
+ async def generate(self, messages: List[Dict[str, str]], **kwargs) -> LLMResponse:
489
+ if "o1-mini" in self.model_name:
490
+ @@ -46,10 +47,7 @@ class OpenAIProvider(LLMProvider):
491
+ )
492
+ if response.choices[0].finish_reason in ['length', 'content_filter']:
493
+ raise ValueError("Content filtered or length exceeded")
494
+ - return LLMResponse(
495
+ - content=response.choices[0].message.content,
496
+ - model_name=response.model
497
+ - )
498
+ + return LLMResponse(content=response.choices[0].message.content,model_name=response.model)
499
+
500
+ class DeepSeekProvider(LLMProvider):
501
+ """DeepSeek API provider implementation"""
502
+ @@ -199,7 +197,7 @@ class ConcurrentLLM:
503
+
504
+ # Queue to store unfinished or failed tasks
505
+ current_batch = messages_list.copy()
506
+ - max_retries = kwargs.get("max_retries", 100)
507
+ + max_retries = kwargs.get("max_retries", 10)
508
+ retry_count = 0
509
+
510
+ while current_batch and retry_count < max_retries:
511
+ diff --git a/ragen/llm_agent/ctx_manager.py b/ragen/llm_agent/ctx_manager.py
512
+ index 905247a..af20a01 100644
513
+ --- a/ragen/llm_agent/ctx_manager.py
514
+ +++ b/ragen/llm_agent/ctx_manager.py
515
+ @@ -88,6 +88,7 @@ class ContextManager:
516
+ Initialize the ContextManager.
517
+ Processor is used to process the image data.
518
+ """
519
+ + # import pdb;pdb.set_trace()
520
+ self.config = config
521
+ self.tokenizer = tokenizer
522
+ self.processor = processor
523
+ @@ -311,7 +312,7 @@ class ContextManager:
524
+
525
+ llm_input_texts.append(text_with_prompt)
526
+ messages_list.append(messages)
527
+ -
528
+ + # import pdb;pdb.set_trace()
529
+ inputs = self.tokenizer(llm_input_texts, return_tensors="pt", padding=True, padding_side="left", truncation=False) # We have truncated previously, truncation in tokenizer may cause issues.
530
+ input_ids, attention_mask = inputs.input_ids, inputs.attention_mask
531
+ position_ids = (attention_mask.cumsum(dim=-1) - 1).clamp(min=0)
532
+ @@ -353,6 +354,30 @@ class ContextManager:
533
+ key: np.sum(value) / self.env_nums[key.split("/")[0]]
534
+ for key, value in metrics.items()
535
+ }
536
+ + # Derived metrics for wandb logging
537
+ + try:
538
+ + # charts/avg_episode_return: average across all 2048 env groups
539
+ + ep_keys = [k for k in metrics.keys() if k.endswith('/episodic_return')]
540
+ + if len(ep_keys) > 0:
541
+ + ep_vals = []
542
+ + for k in ep_keys:
543
+ + tag = k.split('/')[0]
544
+ + denom = self.env_nums.get(tag, max(1, len(metrics[k])))
545
+ + ep_vals.append(float(np.sum(metrics[k]) / denom))
546
+ + mean_metrics["charts/avg_episode_return"] = float(np.mean(ep_vals))
547
+ + except Exception:
548
+ + pass
549
+ + try:
550
+ + # rollout/max_tile: max over all envs in this batch
551
+ + tile_keys = [k for k in metrics.keys() if k.endswith('/max_tile')]
552
+ + if len(tile_keys) > 0:
553
+ + tile_vals = []
554
+ + for k in tile_keys:
555
+ + tile_vals.extend(metrics[k])
556
+ + if len(tile_vals) > 0:
557
+ + mean_metrics["rollout/max_tile"] = int(np.max(tile_vals))
558
+ + except Exception:
559
+ + pass
560
+ for key, values in metrics.items():
561
+ if not isinstance(values, list):
562
+ continue
563
+ diff --git a/ragen/llm_agent/es_manager.py b/ragen/llm_agent/es_manager.py
564
+ index b87a2b3..1a49d3e 100644
565
+ --- a/ragen/llm_agent/es_manager.py
566
+ +++ b/ragen/llm_agent/es_manager.py
567
+ @@ -128,18 +128,40 @@ class EnvStateManager:
568
+ env_outputs: List[Dict]
569
+ {env_id: int, history: List[Dict][{state: str, actions: List[str], reward: float, info: Dict, llm_response: str, llm_raw_response: str, (Optional)images: List[PIL.Image.Image]}]}
570
+ """
571
+ + # def _execute_actions(env, actions):
572
+ + # acc_reward, turn_info, turn_done = 0, {}, False
573
+ + # executed_actions = []
574
+ + # for action in actions:
575
+ + # _, reward, done, info = env.step(action)
576
+ + # acc_reward += reward
577
+ + # turn_info.update(info) # NOTE: currently use last info for multi-action
578
+ + # executed_actions.append(action)
579
+ + # if done:
580
+ + # turn_done = True
581
+ + # break
582
+ +
583
+ + # return acc_reward, turn_info, turn_done, executed_actions
584
+ def _execute_actions(env, actions):
585
+ - acc_reward, turn_info, turn_done = 0, {}, False
586
+ + acc_reward, turn_info, turn_done = 0.0, {}, False
587
+ + raw_acc_reward = 0.0
588
+ executed_actions = []
589
+ for action in actions:
590
+ _, reward, done, info = env.step(action)
591
+ - acc_reward += reward
592
+ + acc_reward += float(reward)
593
+ + try:
594
+ + raw_acc_reward += float(info.get('raw_reward', 0.0))
595
+ + except Exception:
596
+ + pass
597
+ turn_info.update(info) # NOTE: currently use last info for multi-action
598
+ executed_actions.append(action)
599
+ if done:
600
+ turn_done = True
601
+ break
602
+ -
603
+ + # Overwrite per-turn raw_reward to reflect the sum across all executed actions in this turn
604
+ + try:
605
+ + turn_info['raw_reward'] = float(raw_acc_reward)
606
+ + except Exception:
607
+ + pass
608
+ return acc_reward, turn_info, turn_done, executed_actions
609
+
610
+ def _log_env_state(status, history, cur_obs, max_actions_per_traj, executed_actions, all_actions, acc_reward, turn_done, turn_info, env_input):
611
+ @@ -198,6 +220,18 @@ class EnvStateManager:
612
+ 'success': float(status.terminated and (not status.truncated)),
613
+ 'num_actions': status.num_actions,
614
+ }
615
+ + # Add episodic-level metrics
616
+ + # try:
617
+ + # # Sum of per-turn rewards equals the episodic return (env-shaped reward)
618
+ + # env_metric['episodic_return'] = float(sum(status.rewards))
619
+ + # except Exception:
620
+ + # pass
621
+ + try:
622
+ + # Final max tile on the board at the end of the rollout
623
+ + import numpy as _np
624
+ + env_metric['max_tile'] = int(_np.max(entry['env'].grid))
625
+ + except Exception:
626
+ + pass
627
+ custom_metric = {}
628
+ for turn in cache['history']:
629
+ for k, v in turn.get('info', {}).items():
630
+ @@ -212,6 +246,12 @@ class EnvStateManager:
631
+ "Skipping non-numeric metric '%s' with value %r for env %s.",
632
+ k, v, entry['tag']
633
+ )
634
+ + # Add episodic_return as the SUM of raw_reward across steps (align with CleanRL)
635
+ + try:
636
+ + if 'raw_reward' in custom_metric:
637
+ + env_metric['episodic_return'] = float(np.sum(custom_metric['raw_reward']))
638
+ + except Exception:
639
+ + pass
640
+ for k, v in custom_metric.items():
641
+ # TODO: Move TURN_LVL_METRICS into the environment
642
+ if "webshop" not in cache['tag'].lower() or ("webshop" in cache['tag'].lower() and k in TURN_LVL_METRICS):
643
+ @@ -219,7 +259,12 @@ class EnvStateManager:
644
+ else:
645
+ env_metric['traj_sum/' + k] = np.sum(v)
646
+
647
+ -
648
+ + try:
649
+ + if 'score' in custom_metric and len(custom_metric['score']) > 0:
650
+ + env_metric['final_score'] = float(custom_metric['score'][-1])
651
+ + except Exception:
652
+ + pass
653
+ +
654
+ cache['history'][-1]['metrics'] = custom_metric
655
+ env_metric = {f"{entry['tag']}/{k}": v for k, v in env_metric.items()}
656
+ cache['metrics'] = env_metric
657
+ diff --git a/requirements.txt b/requirements.txt
658
+ index 2fd756e..9b521bf 100644
659
+ --- a/requirements.txt
660
+ +++ b/requirements.txt
661
+ @@ -7,7 +7,6 @@ accelerate
662
+ codetiming
663
+ datasets
664
+ dill
665
+ -flash-attn==2.7.4.post1
666
+ hydra-core
667
+ numpy
668
+ pandas
669
+ @@ -15,19 +14,19 @@ pybind11
670
+ ray>=2.10
671
+ tensordict>=0.8.0,<0.9.0
672
+ transformers
673
+ -vllm==0.8.2
674
+ +vllm==0.8.5
675
+ wandb
676
+ gymnasium
677
+ gymnasium[toy-text]
678
+
679
+ pyarrow>=15.0.0
680
+ pylatexenc
681
+ -torchdata
682
+ +# torchdata
683
+ debugpy
684
+
685
+ together
686
+ anthropic
687
+ -faiss-cpu==1.11.0
688
+ +faiss-gpu
689
+
690
+ # This is optional, but needs to be installed with main requirements if you want to use webshop
691
+ -r external/webshop-minimal/requirements.txt
692
+ diff --git a/scripts/setup_ragen.sh b/scripts/setup_ragen.sh
693
+ index f9a7cd9..85a93c4 100644
694
+ --- a/scripts/setup_ragen.sh
695
+ +++ b/scripts/setup_ragen.sh
696
+ @@ -94,10 +94,10 @@ main() {
697
+ pip install torch==2.5.0 --index-url https://download.pytorch.org/whl/cu124
698
+
699
+ print_step "Installing flash-attention..."
700
+ - pip3 install flash-attn==2.7.4.post1 --no-build-isolation
701
+ + # pip3 install flash-attn==2.7.4.post1 --no-build-isolation
702
+ else
703
+ print_step "Installing PyTorch without CUDA support..."
704
+ - pip install torch==2.5.0
705
+ + pip install torch==2.4.0
706
+ fi
707
+
708
+ # Install remaining requirements
709
+ @@ -137,8 +137,8 @@ main() {
710
+ conda install conda-forge::gdown
711
+ mkdir -p external/webshop-minimal/webshop_minimal/data/full
712
+ cd external/webshop-minimal/webshop_minimal/data/full
713
+ - gdown https://drive.google.com/uc?id=1A2whVgOO0euk5O13n2iYDM0bQRkkRduB # items_shuffle
714
+ - gdown https://drive.google.com/uc?id=1s2j6NgHljiZzQNL3veZaAiyW_qDEgBNi # items_ins_v2
715
+ + # gdown https://drive.google.com/uc?id=1A2whVgOO0euk5O13n2iYDM0bQRkkRduB # items_shuffle
716
+ + # gdown https://drive.google.com/uc?id=1s2j6NgHljiZzQNL3veZaAiyW_qDEgBNi # items_ins_v2
717
+ cd ../../../../..
718
+
719
+ echo -e "${GREEN}Installation completed successfully!${NC}"
720
+ diff --git a/train_all.sh b/train_all.sh
721
+ index 0157306..33035f5 100755
722
+ --- a/train_all.sh
723
+ +++ b/train_all.sh
724
+ @@ -6,246 +6,257 @@ USE_GRPO="algorithm.adv_estimator=grpo"
725
+ USE_PPO="algorithm.adv_estimator=gae" # by default.
726
+ USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
727
+
728
+ +
729
+ +# python train.py --config-name _8_2048 system.CUDA_VISIBLE_DEVICES="'0,1,2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=game_2048 $USE_PPO $USE_BASE
730
+ +
731
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'0,1'" trainer.project_name=ragen_latest_qwen_05B_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=rubikscube-1 $USE_PPO $USE_BASE
732
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-1.5B-Instruct trainer.experiment_name=rubikscube-2 $USE_PPO $USE_BASE
733
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'4,5'" trainer.project_name=ragen_latest_qwen_25_3b_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-3B-Instruct trainer.experiment_name=rubikscube-2 $USE_PPO $USE_BASE
734
+ +python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'6,7'" trainer.project_name=ragen_latest_qwen_05B_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=rubikscube-3 $USE_PPO $USE_BASE
735
+ +
736
+ # Section 3.1&3.2 - General Observations
737
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-ppo $USE_PPO $USE_BASE &
738
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-grpo $USE_GRPO $USE_BASE &
739
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE &
740
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-grpo $USE_GRPO $USE_BASE &
741
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozen_lake-ppo $USE_PPO $USE_BASE &
742
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozen_lake-grpo $USE_GRPO $USE_BASE &
743
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="'6,7'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=bandit-ppo-multitask $USE_PPO $USE_BASE &
744
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="'7'" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-ppo-frommlp $USE_PPO $USE_BASE
745
+
746
+ -# Section 4.1 - Filtering and critic
747
+ -# 0.25
748
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.25 actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
749
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
750
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
751
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
752
+ -
753
+ -wait
754
+ -
755
+ -# 0.5
756
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-ppo-rolloutfilter0.5 actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
757
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
758
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
759
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
760
+ -
761
+ -# 0.75
762
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.75 actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
763
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
764
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
765
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
766
+ -
767
+ -wait
768
+ -
769
+ -# Section 4.2 - Ablation on Critic/ClipHigh/KL. Start from Basic and add more components. The best setting for StarPO in agent is rollout_filter+Critic+Cliphigh+NoKL
770
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
771
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
772
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
773
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
774
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozenlake-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
775
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozenlake-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
776
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozenlake-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
777
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozenlake-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
778
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="'0,1'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=sokoban-ppo-box1-multitask $USE_PPO $USE_BASE
779
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-grpo $USE_GRPO $USE_BASE &
780
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
781
+
782
+ -wait
783
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'4,5,6,7'" trainer.project_name=ragen_latest_qwen_25_3b_it trainer.n_gpus_per_node=4 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_3B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
784
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'4,5,6,7'" trainer.n_gpus_per_node=4 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
785
+
786
+ -# Section 5.1 - Reasoning Helps Generalization
787
+ +# # Section 4.1 - Filtering and critic
788
+ +# # 0.25
789
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.25 actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
790
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
791
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
792
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
793
+
794
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-generalization \
795
+ - custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
796
+ - custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
797
+ - custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
798
+ - custom_envs.BanditTest.env_config.hi_arm_name="Librarian"
799
+ +# wait
800
+
801
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-generalization-nothink \
802
+ - custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
803
+ - custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
804
+ - custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
805
+ - custom_envs.BanditTest.env_config.hi_arm_name="Librarian" \
806
+ - agent_proxy.enable_think=False
807
+ +# # 0.5
808
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-ppo-rolloutfilter0.5 actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
809
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
810
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
811
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
812
+ +
813
+ +# # 0.75
814
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.75 actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
815
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
816
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
817
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
818
+
819
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=bandit-generalization-rev \
820
+ - custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
821
+ - custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
822
+ - custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
823
+ - custom_envs.BanditTest.env_config.hi_arm_name="Trader"
824
+ +# wait
825
+
826
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=bandit-generalization-rev-nothink \
827
+ - custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
828
+ - custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
829
+ - custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
830
+ - custom_envs.BanditTest.env_config.hi_arm_name="Trader" \
831
+ - agent_proxy.enable_think=False
832
+ +# # Section 4.2 - Ablation on Critic/ClipHigh/KL. Start from Basic and add more components. The best setting for StarPO in agent is rollout_filter+Critic+Cliphigh+NoKL
833
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
834
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
835
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
836
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
837
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozenlake-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
838
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozenlake-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
839
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozenlake-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
840
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozenlake-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
841
+
842
+ +# wait
843
+
844
+ -SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
845
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization micro_batch_size_per_gpu=8 model_path=Qwen/Qwen2.5-1.5B-Instruct&
846
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-generalization-nothink $SOKOBAN_GENERALIZATION_CONFIG agent_proxy.enable_think=False &
847
+ +# # Section 5.1 - Reasoning Helps Generalization
848
+
849
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-generalization \
850
+ +# custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
851
+ +# custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
852
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
853
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Librarian"
854
+
855
+ -# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=128 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SokobanDifferentGridVocab] es_manager.val.env_configs.n_groups=[128]"
856
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG &
857
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-generalization-nothink \
858
+ +# custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
859
+ +# custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
860
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
861
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Librarian" \
862
+ +# agent_proxy.enable_think=False
863
+
864
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=bandit-generalization-rev \
865
+ +# custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
866
+ +# custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
867
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
868
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Trader"
869
+
870
+ -# COMPOSITIONALITY_CONFIG="es_manager.train.env_groups=16 es_manager.train.env_configs.tags=[Bandit,SimpleSokoban] es_manager.train.env_configs.n_groups=[8,8] es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[Bandit,SimpleSokoban,LargerSokoban,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128] actor_rollout_ref.rollout.rollout_filter_ratio=1" # NOTE that we don't filter out low-var rollout in this setting
871
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=compositional-generalization $COMPOSITIONALITY_CONFIG &
872
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=compositional-generalization-nothink $COMPOSITIONALITY_CONFIG agent_proxy.enable_think=False &
873
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=bandit-generalization-rev-nothink \
874
+ +# custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
875
+ +# custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
876
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
877
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Trader" \
878
+ +# agent_proxy.enable_think=False
879
+
880
+ -wait
881
+
882
+ -# Section 5.2 - what leads to better reasoning?
883
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B-Instruct &
884
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B-Instruct &
885
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct trainer.n_gpus_per_node=2 &
886
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B-Instruct trainer.n_gpus_per_node=4 &
887
+ +# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
888
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization micro_batch_size_per_gpu=8 model_path=Qwen/Qwen2.5-1.5B-Instruct&
889
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-generalization-nothink $SOKOBAN_GENERALIZATION_CONFIG agent_proxy.enable_think=False &
890
+
891
+ -wait
892
+
893
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B &
894
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B &
895
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B &
896
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B &
897
+ +# # SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=128 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SokobanDifferentGridVocab] es_manager.val.env_configs.n_groups=[128]"
898
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG &
899
+
900
+ -wait
901
+
902
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-7B &
903
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B &
904
+ +# # COMPOSITIONALITY_CONFIG="es_manager.train.env_groups=16 es_manager.train.env_configs.tags=[Bandit,SimpleSokoban] es_manager.train.env_configs.n_groups=[8,8] es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[Bandit,SimpleSokoban,LargerSokoban,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128] actor_rollout_ref.rollout.rollout_filter_ratio=1" # NOTE that we don't filter out low-var rollout in this setting
905
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=compositional-generalization $COMPOSITIONALITY_CONFIG &
906
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=compositional-generalization-nothink $COMPOSITIONALITY_CONFIG agent_proxy.enable_think=False &
907
+
908
+ +# wait
909
+
910
+ -wait
911
+ +# # Section 5.2 - what leads to better reasoning?
912
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B-Instruct &
913
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B-Instruct &
914
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct trainer.n_gpus_per_node=2 &
915
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B-Instruct trainer.n_gpus_per_node=4 &
916
+
917
+ -# Section 6.1 varying action count
918
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-action-count-1 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=5 custom_envs.LargerSokoban.max_actions_per_traj=5 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=5 custom_envs.FrozenLake.max_actions_per_traj=5 agent_proxy.max_actions_per_turn=1 &
919
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-action-count-2 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=10 custom_envs.LargerSokoban.max_actions_per_traj=10 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=10 custom_envs.FrozenLake.max_actions_per_traj=10 agent_proxy.max_actions_per_turn=2 &
920
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-action-count-3 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=15 custom_envs.LargerSokoban.max_actions_per_traj=15 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=15 custom_envs.FrozenLake.max_actions_per_traj=15 agent_proxy.max_actions_per_turn=3 &
921
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-action-count-4 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=20 custom_envs.LargerSokoban.max_actions_per_traj=20 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=20 custom_envs.FrozenLake.max_actions_per_traj=20 agent_proxy.max_actions_per_turn=4 &
922
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-action-count-5 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=25 custom_envs.LargerSokoban.max_actions_per_traj=25 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=25 custom_envs.FrozenLake.max_actions_per_traj=25 agent_proxy.max_actions_per_turn=5 &
923
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-action-count-6 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=30 custom_envs.LargerSokoban.max_actions_per_traj=30 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=30 custom_envs.FrozenLake.max_actions_per_traj=30 agent_proxy.max_actions_per_turn=6 &
924
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-action-count-7 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=35 custom_envs.LargerSokoban.max_actions_per_traj=35 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=35 custom_envs.FrozenLake.max_actions_per_traj=35 agent_proxy.max_actions_per_turn=7 &
925
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-action-count-8 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=40 custom_envs.LargerSokoban.max_actions_per_traj=40 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=40 custom_envs.FrozenLake.max_actions_per_traj=40 agent_proxy.max_actions_per_turn=8 &
926
+ +# wait
927
+
928
+ -# section 6.2 Varying prompt diversity
929
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-prompt-diversity-4 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=4 es_manager.train.group_size=32 es_manager.train.env_configs.n_groups=[4] &
930
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-prompt-diversity-8 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] &
931
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-prompt-diversity-16 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=8 es_manager.train.env_configs.n_groups=[16] &
932
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-prompt-diversity-32 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=32 es_manager.train.group_size=4 es_manager.train.env_configs.n_groups=[32] &
933
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-prompt-diversity-64 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=64 es_manager.train.group_size=2 es_manager.train.env_configs.n_groups=[64] &
934
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-prompt-diversity-128 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=128 es_manager.train.group_size=1 es_manager.train.env_configs.n_groups=[128] &
935
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B &
936
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B &
937
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B &
938
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B &
939
+
940
+ -wait
941
+ +# wait
942
+
943
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-online-2 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[16] trainer.total_training_steps=100 trainer.test_freq=5 &
944
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-7B &
945
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B &
946
+
947
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-online-5 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=40 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[40] trainer.total_training_steps=40 trainer.test_freq=2 &
948
+
949
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-online-10 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=80 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[80] trainer.total_training_steps=80 trainer.test_freq=1 &
950
+ +# wait
951
+
952
+ +# # Section 6.1 varying action count
953
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-action-count-1 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=5 custom_envs.LargerSokoban.max_actions_per_traj=5 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=5 custom_envs.FrozenLake.max_actions_per_traj=5 agent_proxy.max_actions_per_turn=1 &
954
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-action-count-2 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=10 custom_envs.LargerSokoban.max_actions_per_traj=10 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=10 custom_envs.FrozenLake.max_actions_per_traj=10 agent_proxy.max_actions_per_turn=2 &
955
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-action-count-3 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=15 custom_envs.LargerSokoban.max_actions_per_traj=15 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=15 custom_envs.FrozenLake.max_actions_per_traj=15 agent_proxy.max_actions_per_turn=3 &
956
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-action-count-4 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=20 custom_envs.LargerSokoban.max_actions_per_traj=20 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=20 custom_envs.FrozenLake.max_actions_per_traj=20 agent_proxy.max_actions_per_turn=4 &
957
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-action-count-5 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=25 custom_envs.LargerSokoban.max_actions_per_traj=25 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=25 custom_envs.FrozenLake.max_actions_per_traj=25 agent_proxy.max_actions_per_turn=5 &
958
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-action-count-6 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=30 custom_envs.LargerSokoban.max_actions_per_traj=30 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=30 custom_envs.FrozenLake.max_actions_per_traj=30 agent_proxy.max_actions_per_turn=6 &
959
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-action-count-7 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=35 custom_envs.LargerSokoban.max_actions_per_traj=35 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=35 custom_envs.FrozenLake.max_actions_per_traj=35 agent_proxy.max_actions_per_turn=7 &
960
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-action-count-8 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=40 custom_envs.LargerSokoban.max_actions_per_traj=40 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=40 custom_envs.FrozenLake.max_actions_per_traj=40 agent_proxy.max_actions_per_turn=8 &
961
+
962
+ +# # section 6.2 Varying prompt diversity
963
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-prompt-diversity-4 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=4 es_manager.train.group_size=32 es_manager.train.env_configs.n_groups=[4] &
964
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-prompt-diversity-8 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] &
965
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-prompt-diversity-16 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=8 es_manager.train.env_configs.n_groups=[16] &
966
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-prompt-diversity-32 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=32 es_manager.train.group_size=4 es_manager.train.env_configs.n_groups=[32] &
967
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-prompt-diversity-64 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=64 es_manager.train.group_size=2 es_manager.train.env_configs.n_groups=[64] &
968
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-prompt-diversity-128 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=128 es_manager.train.group_size=1 es_manager.train.env_configs.n_groups=[128] &
969
+
970
+ +# wait
971
+
972
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-online-2 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[16] trainer.total_training_steps=100 trainer.test_freq=5 &
973
+
974
+ -# Extension: Training 7B reasoning model
975
+ -SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
976
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct-largescale $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] micro_batch_size_per_gpu=8 ppo_mini_batch_size=64 actor_rollout_ref.rollout.response_length=1024 actor_rollout_ref.rollout.max_model_len=6400 trainer.test_freq=5 actor_rollout_ref.rollout.max_num_batched_tokens=24000 micro_batch_size_per_gpu=2 actor_rollout_ref.rollout.rollout_filter_ratio=1 &
977
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-online-5 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=40 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[40] trainer.total_training_steps=40 trainer.test_freq=2 &
978
+
979
+ -python -m ragen.llm_agent.agent_proxy model_path=Qwen/Qwen2.5-3B-Instruct system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 actor_rollout_ref.rollout.tensor_model_parallel_size=4 actor_rollout_ref.rollout.response_length=2048 actor_rollout_ref.rollout.max_model_len=12800
980
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-online-10 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=80 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[80] trainer.total_training_steps=80 trainer.test_freq=1 &
981
+
982
+ -# trainer.save_freq=50 trainer.default_local_dir=/mnt/local/cache/exp_name
983
+
984
+ -# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
985
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization &
986
+
987
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/bandit-generalization &
988
+
989
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=frozenlake-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/frozenlake-generalization &
990
+
991
+ +# # Extension: Training 7B reasoning model
992
+ +# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
993
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct-largescale $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] micro_batch_size_per_gpu=8 ppo_mini_batch_size=64 actor_rollout_ref.rollout.response_length=1024 actor_rollout_ref.rollout.max_model_len=6400 trainer.test_freq=5 actor_rollout_ref.rollout.max_num_batched_tokens=24000 micro_batch_size_per_gpu=2 actor_rollout_ref.rollout.rollout_filter_ratio=1 &
994
+
995
+ +# python -m ragen.llm_agent.agent_proxy model_path=Qwen/Qwen2.5-3B-Instruct system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 actor_rollout_ref.rollout.tensor_model_parallel_size=4 actor_rollout_ref.rollout.response_length=2048 actor_rollout_ref.rollout.max_model_len=12800
996
+
997
+ +# # trainer.save_freq=50 trainer.default_local_dir=/mnt/local/cache/exp_name
998
+
999
+ -# USE_PPO="algorithm.adv_estimator=gae" # by default.
1000
+ -# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1001
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE ppo_mini_batch_size=64 enable_response_mask=True &
1002
+ +# # USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1003
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization &
1004
+
1005
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/bandit-generalization &
1006
+
1007
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std &
1008
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=frozenlake-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/frozenlake-generalization &
1009
+
1010
+ -# enable_response_mask: False
1011
+ -# grpo_advantage_length_weight: True
1012
+
1013
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo-1-5b algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std agent_proxy.max_actions_per_turn=5 custom_envs.SimpleSokoban.max_actions_per_traj=25 enable_response_mask=True grpo_advantage_length_weight=False model_path=Qwen/Qwen2.5-1.5B-Instruct &
1014
+
1015
+
1016
+ -# extension: 7B with lora. Currently NOT recommended to use lora: within current version of vllm, this could result in rollouts slower than non-lora by 100%
1017
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-7B-Instruct trainer.experiment_name=sokoban_7b_instruct_lora_newversion lora.rank=16
1018
+ +# # USE_PPO="algorithm.adv_estimator=gae" # by default.
1019
+ +# # USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1020
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE ppo_mini_batch_size=64 enable_response_mask=True &
1021
+
1022
+ -# extension: bi-level gae
1023
+ -python train.py trainer.experiment_name=sokoban-bi-level-gae-final \
1024
+ - system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
1025
+ - model_path=Qwen/Qwen2.5-0.5B-Instruct \
1026
+ - algorithm.bi_level_gae=True algorithm.high_level_gamma=0.95 \
1027
+ - agent_proxy.use_turn_scores=True \
1028
+ - actor_rollout_ref.rollout.tp_size_check=False
1029
+
1030
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std &
1031
+
1032
+ -# extension: webshop
1033
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1034
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1035
+ - trainer.experiment_name=webshop-3b-ppo-s $USE_PPO \
1036
+ - trainer.nnodes=1 &
1037
+ +# # enable_response_mask: False
1038
+ +# # grpo_advantage_length_weight: True
1039
+
1040
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo-1-5b algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std agent_proxy.max_actions_per_turn=5 custom_envs.SimpleSokoban.max_actions_per_traj=25 enable_response_mask=True grpo_advantage_length_weight=False model_path=Qwen/Qwen2.5-1.5B-Instruct &
1041
+
1042
+ -USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1043
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1044
+ - trainer.experiment_name=webshop-3b-grpo-s $USE_GRPO \
1045
+ - trainer.nnodes=1 &
1046
+
1047
+ -# StarPO ppo
1048
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1049
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1050
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1051
+ - trainer.experiment_name=webshop-3b-ppo $USE_PPO $USE_BASE \
1052
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1053
+ - trainer.nnodes=1 &
1054
+ +# # extension: 7B with lora. Currently NOT recommended to use lora: within current version of vllm, this could result in rollouts slower than non-lora by 100%
1055
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-7B-Instruct trainer.experiment_name=sokoban_7b_instruct_lora_newversion lora.rank=16
1056
+
1057
+ -# StarPO grpo
1058
+ -USE_GRPO="algorithm.adv_estimator=grpo"
1059
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1060
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1061
+ - trainer.experiment_name=webshop-3b-grpo $USE_GRPO $USE_BASE \
1062
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1063
+ - trainer.nnodes=1 &
1064
+ +# # extension: bi-level gae
1065
+ +# python train.py trainer.experiment_name=sokoban-bi-level-gae-final \
1066
+ +# system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
1067
+ +# model_path=Qwen/Qwen2.5-0.5B-Instruct \
1068
+ +# algorithm.bi_level_gae=True algorithm.high_level_gamma=0.95 \
1069
+ +# agent_proxy.use_turn_scores=True \
1070
+ +# actor_rollout_ref.rollout.tp_size_check=False
1071
+
1072
+
1073
+ -# normal:sokoban
1074
+ -# extension: sokoban
1075
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1076
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1077
+ - trainer.experiment_name=sokoban-3b-ppo-s $USE_PPO \
1078
+ - trainer.nnodes=1 &
1079
+ +# # extension: webshop
1080
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1081
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1082
+ +# trainer.experiment_name=webshop-3b-ppo-s $USE_PPO \
1083
+ +# trainer.nnodes=1 &
1084
+
1085
+
1086
+ -USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1087
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1088
+ - trainer.experiment_name=sokoban-3b-grpo-s $USE_GRPO \
1089
+ - trainer.nnodes=1 &
1090
+ +# USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1091
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1092
+ +# trainer.experiment_name=webshop-3b-grpo-s $USE_GRPO \
1093
+ +# trainer.nnodes=1 &
1094
+
1095
+ -# StarPO ppo
1096
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1097
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1098
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1099
+ - trainer.experiment_name=sokoban-3b-ppo $USE_PPO $USE_BASE \
1100
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1101
+ - trainer.nnodes=1 &
1102
+ +# # StarPO ppo
1103
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1104
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1105
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1106
+ +# trainer.experiment_name=webshop-3b-ppo $USE_PPO $USE_BASE \
1107
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1108
+ +# trainer.nnodes=1 &
1109
+
1110
+ -# StarPO grpo
1111
+ -USE_GRPO="algorithm.adv_estimator=grpo"
1112
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1113
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1114
+ - trainer.experiment_name=sokoban-3b-grpo $USE_GRPO $USE_BASE \
1115
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1116
+ - trainer.nnodes=1 &
1117
+ +# # StarPO grpo
1118
+ +# USE_GRPO="algorithm.adv_estimator=grpo"
1119
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1120
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1121
+ +# trainer.experiment_name=webshop-3b-grpo $USE_GRPO $USE_BASE \
1122
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1123
+ +# trainer.nnodes=1 &
1124
+ +
1125
+ +
1126
+ +# # normal:sokoban
1127
+ +# # extension: sokoban
1128
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1129
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1130
+ +# trainer.experiment_name=sokoban-3b-ppo-s $USE_PPO \
1131
+ +# trainer.nnodes=1 &
1132
+ +
1133
+ +
1134
+ +# USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1135
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1136
+ +# trainer.experiment_name=sokoban-3b-grpo-s $USE_GRPO \
1137
+ +# trainer.nnodes=1 &
1138
+ +
1139
+ +# # StarPO ppo
1140
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1141
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1142
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1143
+ +# trainer.experiment_name=sokoban-3b-ppo $USE_PPO $USE_BASE \
1144
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1145
+ +# trainer.nnodes=1 &
1146
+ +
1147
+ +# # StarPO grpo
1148
+ +# USE_GRPO="algorithm.adv_estimator=grpo"
1149
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1150
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1151
+ +# trainer.experiment_name=sokoban-3b-grpo $USE_GRPO $USE_BASE \
1152
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1153
+ +# trainer.nnodes=1 &
1154
+
1155
+
1156
+
1157
+ -python train.py \
1158
+ - trainer.experiment_name=3b-full-ppo-test system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2
1159
+
1160
+ +# python train.py \
1161
+ +# trainer.experiment_name=3b-full-ppo-test system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2
1162
+
wandb/run-20251218_183419-wvypkl8w/files/diff_8d73639b99b38265453f898b8d6af7d4af50d56e.patch ADDED
@@ -0,0 +1,1162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/config/base.yaml b/config/base.yaml
2
+ index a1659e4..9df6250 100644
3
+ --- a/config/base.yaml
4
+ +++ b/config/base.yaml
5
+ @@ -9,15 +9,16 @@ seed:
6
+ train: 10000
7
+ val: 123
8
+
9
+ -micro_batch_size_per_gpu: 4
10
+ +micro_batch_size_per_gpu: 1
11
+ ppo_mini_batch_size: 32
12
+ -model_path: Qwen/Qwen2.5-3B-Instruct
13
+ +model_path: /mnt/general/share/model/Qwen/Qwen2.5-0.5B-Instruct
14
+ +# Qwen/Qwen2.5-0.5B-Instruct
15
+ enable_response_mask: True # Enabling response mask could improve stability of rollout/old_log_prob, as P(st|history) are no longer calculated in loss here. See https://docs.google.com/document/d/1bg7obeiKTExuHHBl5uOiSpec5uLDZ2Tgvxy6li5pHX4/edit?usp=sharing for more details.
16
+ grpo_advantage_length_weight: False # if you do not enable this and critic/advantage_estimator is GRPO, and the critic/advantages/mean is too low, then you can try enabling this to encourage reasoning and forbid collapse
17
+
18
+ lora:
19
+ rank: 0
20
+ - alpha: 64
21
+ + alpha: 16
22
+ target_modules: all-linear
23
+
24
+ actor_rollout_ref:
25
+ @@ -46,10 +47,10 @@ actor_rollout_ref:
26
+ name: vllm
27
+ log_prob_micro_batch_size_per_gpu: ${micro_batch_size_per_gpu} # following micro_batch_size_per_gpu
28
+ tensor_model_parallel_size: 1
29
+ - max_model_len: 3600
30
+ + max_model_len: 7200 #3600 why** 14400
31
+ prompt_length: 1 # useless. Just put it here
32
+ response_length: 400 # single-turn response length
33
+ - gpu_memory_utilization: 0.5
34
+ + gpu_memory_utilization: 0.7
35
+ max_num_batched_tokens: 8192 # set only when enable_chunked_prefill is true
36
+ temperature: 1
37
+ rollout_filter_ratio: 0.25
38
+ @@ -90,26 +91,28 @@ algorithm:
39
+ kl_coef: 0.000
40
+
41
+ trainer:
42
+ - project_name: ragen_latest
43
+ + project_name:
44
+ experiment_name: test
45
+ local_log_dir: "results/"
46
+ - save_freq: 100
47
+ + save_freq: -1
48
+ total_training_steps: 200
49
+ validation_steps: 1 # validation instances = validation_steps * val_env_groups * group_size
50
+ val_before_train: True
51
+ n_gpus_per_node: 1
52
+ test_freq: 10
53
+ generations_to_log_to_wandb:
54
+ + train: 128
55
+ val: 20
56
+ logger: [ 'console', 'wandb' ]
57
+ max_actor_ckpt_to_keep: 1
58
+ max_critic_ckpt_to_keep: 1
59
+ + default_local_dir: /mnt/general/wanghy/RAGEN/saves/
60
+
61
+ agent_proxy:
62
+ max_context_window: -1 # set a value > 0 to enable context window for long trajectory
63
+ - max_turn: 5
64
+ + max_turn: 25 #25 why** 700
65
+ action_sep: "||"
66
+ - max_actions_per_turn: 2 # how many actions can be output at most in a single turn
67
+ + max_actions_per_turn: 1 # how many actions can be output at most in a single turn
68
+ use_turn_scores: False # important to GAE when applying token-level rewards to token-level advantages. If False, will take the sum of scores as the reward for the last turn.
69
+ enable_think: True # False -> no think RL
70
+ reward_normalization:
71
+ @@ -126,11 +129,11 @@ es_manager:
72
+ tags: ["CoordSokoban"]
73
+ n_groups: [8] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
74
+ val:
75
+ - env_groups: 32
76
+ - group_size: 16 # should be set to 1 because when val temperature is set to 0 and group size > 1, there will be repetitive prompts which leads to same trajectory.
77
+ + env_groups: 256
78
+ + group_size: 1 # should be set to 1 because when val temperature is set to 0 and group size > 1, there will be repetitive prompts which leads to same trajectory.
79
+ env_configs:
80
+ tags: ["CoordSokoban"]
81
+ - n_groups: [32] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
82
+ + n_groups: [256] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
83
+
84
+ ctx_manager:
85
+ generation: # go to vllm
86
+ diff --git a/config/envs.yaml b/config/envs.yaml
87
+ index 1002ac8..ba3ac6f 100644
88
+ --- a/config/envs.yaml
89
+ +++ b/config/envs.yaml
90
+ @@ -2,6 +2,7 @@ custom_envs:
91
+ SimpleSokoban:
92
+ env_type: sokoban
93
+ max_actions_per_traj: 10 # used in environment state manager to control the actual max actions executed per trajectory
94
+ + # ORIGNAL env_instruction
95
+ env_instruction: |
96
+ You are solving the Sokoban puzzle.
97
+ You are the player and you need to push all boxes to targets.
98
+ @@ -12,7 +13,7 @@ custom_envs:
99
+ env_config: # keys should be a subset of SokobanConfig
100
+ dim_x: 6
101
+ dim_y: 6
102
+ - num_boxes: 1
103
+ + num_boxes: 2
104
+ max_steps: 100
105
+
106
+ LargerSokoban:
107
+ @@ -65,7 +66,7 @@ custom_envs:
108
+ env_config: # keys should be a subset of SokobanConfig
109
+ dim_x: 6
110
+ dim_y: 6
111
+ - num_boxes: 1
112
+ + num_boxes: 2
113
+ max_steps: 100
114
+ observation_format: "grid_coord"
115
+
116
+ @@ -111,14 +112,14 @@ custom_envs:
117
+
118
+ FrozenLake:
119
+ env_type: frozen_lake
120
+ - max_actions_per_traj: 10
121
+ + max_actions_per_traj: 25
122
+ env_instruction: "You are solving the FrozenLake puzzle. Forbid the whole and go to the target. You may move to the unintended direction due to the slippery ice. Example answer format: <think>To forbid the hole and go to the target, I should go left then go up.</think><answer>Left || Up</answer>"
123
+ max_tokens: 100
124
+ env_config: null
125
+
126
+ CoordFrozenLake:
127
+ env_type: frozen_lake
128
+ - max_actions_per_traj: 10
129
+ + max_actions_per_traj: 25
130
+ env_instruction: |
131
+ You are solving the FrozenLake puzzle. The observation includes both a symbol grid and zero-indexed coordinates for the start, goal, player, and any holes.
132
+ Coordinates range from the top-left corner (0, 0) to the bottom-right corner (5, 5).
133
+ @@ -195,4 +196,80 @@ custom_envs:
134
+ max_actions_per_traj: 30
135
+ env_instruction: "You are a Lean theorem prover. Given a Lean theorem statement, propose a sequence of tactics that completes the proof. Think step by step about which tactics to apply next. Provide tactics separated by '||', for example <answer>intro || simp || rfl</answer>."
136
+ max_tokens: 512
137
+ - env_config: null # Please refer to ragen/env/lean/config.py for a full list of parameters.
138
+
139
+ + env_config: null # Please refer to ragen/env/lean/config.py for a full list of parameters.
140
+ +
141
+ +
142
+ + game_2048:
143
+ + env_type: game_2048
144
+ + max_actions_per_traj: 700
145
+ + env_instruction: |
146
+ + You are playing the 2048 game on a 4x4 grid. Merge equal tiles by sliding Up, Right, Down, or Left.
147
+ + If a move is invalid (no tiles move), a small penalty is applied. Respond with a single action.
148
+ + Example: <answer>Up</answer>
149
+ + max_tokens: 8192
150
+ + env_config: null
151
+ +
152
+ + blackjack:
153
+ + env_type: blackjack
154
+ + max_actions_per_traj: 10
155
+ + env_instruction: |
156
+ + You are playing Blackjack against a dealer. The dealer must hit on 16 or less and stand on 17 or more.
157
+ + Choose either Stick or Hit. Respond with a single action.
158
+ + Example: <answer>Hit</answer>
159
+ + max_tokens: 64
160
+ + env_config: null
161
+ +
162
+ + rubikscube:
163
+ + env_type: rubikscube
164
+ + max_actions_per_traj: 20
165
+ + env_instruction: |
166
+ + You are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.
167
+ + Available actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.
168
+ + - Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).
169
+ + - Modifiers: A letter alone means 90° clockwise (e.g., 'R'). A letter with prime (') means 90° counter-clockwise (e.g., "R'").
170
+ + Respond with a sequence of actions separated by "||".
171
+ + Example: <answer>U</answer>
172
+ + max_tokens: 96
173
+ + env_config:
174
+ + scramble_depth: 1
175
+ + max_steps: 20
176
+ + render_mode: "text"
177
+ +
178
+ + SimpleSudoku:
179
+ + env_type: sudoku
180
+ + max_actions_per_traj: 20
181
+ + env_instruction: |
182
+ + You are solving a Sudoku puzzle. Fill in the grid so that every row, column, and 2x2 box contains the numbers 1-4 without repetition.
183
+ + Initial cells are shown in [brackets] and cannot be modified. Empty cells are shown as dots (.).
184
+ + Place numbers one at a time using the format, for example: <answer>place 1 at row 2 col 3</answer> or <answer>1,2,3</answer>
185
+ + The environment will provide feedback on valid/invalid moves and show conflicts if any occur.
186
+ + max_tokens: 150
187
+ + parallel_friendly: false
188
+ + max_workers: 32
189
+ + env_config:
190
+ + grid_size: 4
191
+ + difficulty: "easy"
192
+ + render_format: "with_feedback"
193
+ + show_conflicts: false
194
+ + show_valid_numbers: false
195
+ + max_steps: 20
196
+ +
197
+ + MediumSudoku:
198
+ + env_type: sudoku
199
+ + max_actions_per_traj: 30
200
+ + env_instruction: |
201
+ + You are solving a Sudoku puzzle. Fill in the grid so that every row, column, and 3x3 box contains the numbers 1-9 without repetition.
202
+ + Initial cells are shown in [brackets] and cannot be modified. Empty cells are shown as dots (.).
203
+ + Place numbers one at a time using the format: <answer>place 5 at row 2 col 3</answer> or <answer>2,3,5</answer>
204
+ + The environment will provide feedback on valid/invalid moves and show conflicts if any occur.
205
+ + max_tokens: 150
206
+ + parallel_friendly: false
207
+ + max_workers: 32
208
+ + env_config:
209
+ + grid_size: 9
210
+ + difficulty: "medium"
211
+ + render_format: "with_feedback"
212
+ + show_conflicts: true
213
+ + show_valid_numbers: true
214
+ + max_steps: 81
215
+ +
216
+ diff --git a/config/eval.yaml b/config/eval.yaml
217
+ index e65f3a5..7775fd1 100644
218
+ --- a/config/eval.yaml
219
+ +++ b/config/eval.yaml
220
+ @@ -1,14 +1,15 @@
221
+ defaults:
222
+ - envs
223
+ -
224
+ +enable_response_mask: True
225
+ system:
226
+ - CUDA_VISIBLE_DEVICES: "0"
227
+ + CUDA_VISIBLE_DEVICES: "0,1,2,3,4,5,6,7"
228
+
229
+ seed:
230
+ train: 10000
231
+ val: 123
232
+
233
+ -model_path: Qwen/Qwen2.5-3B-Instruct
234
+ +model_path: /mnt/general/share/model/openai/gpt-oss-20b
235
+ +# /mnt/general/share/model/tyzhu/SPA-frozenlake-qwen2.5-1.5b-instruct
236
+
237
+ lora:
238
+ rank: 0
239
+ @@ -24,9 +25,9 @@ actor_rollout_ref:
240
+ rollout:
241
+ name: vllm
242
+ log_prob_micro_batch_size_per_gpu: ${micro_batch_size_per_gpu}
243
+ - tensor_model_parallel_size: 1
244
+ + tensor_model_parallel_size: 8
245
+ dtype: bfloat16
246
+ - max_model_len: 3600
247
+ + max_model_len: 7200
248
+ prompt_length: 1
249
+ response_length: 400
250
+ gpu_memory_utilization: 0.9
251
+ @@ -35,6 +36,7 @@ actor_rollout_ref:
252
+ free_cache_engine: True
253
+ enable_chunked_prefill: False
254
+ disable_log_stats: False
255
+ + do_sample: True
256
+ val_kwargs:
257
+ do_sample: True
258
+ temperature: 0.5
259
+ @@ -44,9 +46,9 @@ actor_rollout_ref:
260
+
261
+ agent_proxy:
262
+ max_context_window: -1
263
+ - max_turn: 5
264
+ + max_turn: 25
265
+ action_sep: "||"
266
+ - max_actions_per_turn: 2
267
+ + max_actions_per_turn: 1
268
+ use_turn_scores: False
269
+ enable_think: True
270
+ reward_normalization:
271
+ @@ -59,13 +61,13 @@ es_manager:
272
+ env_groups: 8
273
+ group_size: 16
274
+ env_configs:
275
+ - tags: ["CoordSokoban"]
276
+ + tags: ["BanditTest"]
277
+ n_groups: [8]
278
+ val:
279
+ env_groups: 32
280
+ - group_size: 16
281
+ + group_size: 128
282
+ env_configs:
283
+ - tags: ["CoordSokoban"]
284
+ + tags: ["BanditTest"]
285
+ n_groups: [32]
286
+
287
+ ctx_manager:
288
+ diff --git a/config/evaluate_api_llm.yaml b/config/evaluate_api_llm.yaml
289
+ index b21c95e..e2e6761 100644
290
+ --- a/config/evaluate_api_llm.yaml
291
+ +++ b/config/evaluate_api_llm.yaml
292
+ @@ -1,8 +1,11 @@
293
+ +#export OPENAI_BASE_URL="https://api.ohmygpt.com/v1"
294
+ +#export OPENAI_API_KEY="sk-o4sMxBkN5BB100C4D4a3T3BlBkFJF7791CA39EA14ca98041"
295
+ +#python -m ragen.eval_api hydra.searchpath='[file://./verl/verl/trainer/config]'
296
+ defaults:
297
+ - base # this is a symbolic link to the verl/verl/trainer/config/ppo_trainer.yaml file
298
+
299
+ model_config:
300
+ - model_name: gpt-4o # should be registered in model_info
301
+ + model_name: ark-deepseek-v3-250324 # should be registered in model_info
302
+ max_concurrency: 16
303
+
304
+ model_info:
305
+ @@ -24,9 +27,9 @@ model_info:
306
+ generation_kwargs:
307
+ temperature: 0
308
+ max_tokens: 512 # max_completion_tokens if o1-mini
309
+ - gpt-4o:
310
+ + gpt-4o-mini:
311
+ provider_name: openai
312
+ - model_name: gpt-4o
313
+ + model_name: gpt-4o-mini
314
+ generation_kwargs:
315
+ temperature: 0
316
+ max_tokens: 512 # max_completion_tokens if o1-mini
317
+ @@ -36,21 +39,42 @@ model_info:
318
+ generation_kwargs:
319
+ temperature: 0
320
+ max_completion_tokens: 512
321
+ + ark-deepseek-v3-250324:
322
+ + provider_name: openai
323
+ + model_name: ark-deepseek-v3-250324
324
+ + generation_kwargs:
325
+ + temperature: 0
326
+ + max_completion_tokens: 512
327
+ deepseek-v3:
328
+ provider_name: deepseek
329
+ model_name: deepseek-chat
330
+ generation_kwargs:
331
+ temperature: 0
332
+ max_completion_tokens: 512
333
+ + glm-4.6:
334
+ + provider_name: openai
335
+ + model_name: glm-4.6
336
+ + generation_kwargs:
337
+ + temperature: 0
338
+ + max_completion_tokens: 512
339
+ + TA/openai/gpt-oss-120b:
340
+ + provider_name: openai
341
+ + model_name: TA/openai/gpt-oss-120b
342
+ + generation_kwargs:
343
+ + temperature: 0
344
+ + max_tokens: 8192
345
+ + # max_retries: 5
346
+
347
+ -
348
+ -
349
+ +agent_proxy:
350
+ + max_turn: 5
351
+ es_manager:
352
+ val:
353
+ - env_groups: 256
354
+ + env_groups: 128
355
+ group_size: 1 # should be set to 1 because val temperature is set to 0 and same prompt leads to same output
356
+ env_configs:
357
+ - tags: ["CoordSokoban"]
358
+ - n_groups: [256] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
359
+ + tags: ["rubikscube"]
360
+ + n_groups: [128] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
361
+
362
+
363
+ +rollout:
364
+ + max_model_len: 7200
365
+
366
+ Submodule external/webshop-minimal contains modified content
367
+ diff --git a/external/webshop-minimal/requirements.txt b/external/webshop-minimal/requirements.txt
368
+ index 5a1b04f..238ed5a 100644
369
+ --- a/external/webshop-minimal/requirements.txt
370
+ +++ b/external/webshop-minimal/requirements.txt
371
+ @@ -4,7 +4,7 @@ flask
372
+ html2text
373
+ rank_bm25
374
+ pyserini
375
+ -faiss-cpu
376
+ +faiss-gpu
377
+ thefuzz
378
+ gdown
379
+ spacy
380
+ diff --git a/ragen/env/__init__.py b/ragen/env/__init__.py
381
+ index b0f3461..bc6838e 100644
382
+ --- a/ragen/env/__init__.py
383
+ +++ b/ragen/env/__init__.py
384
+ @@ -12,6 +12,14 @@ from .metamathqa.env import MetaMathQAEnv
385
+ from .metamathqa.config import MetaMathQAEnvConfig
386
+ from .lean.config import LeanEnvConfig
387
+ from .lean.env import LeanEnv
388
+ +from .game_2048.config import Game2048EnvConfig
389
+ +from .game_2048.env import Game2048Env
390
+ +from .blackjack.config import BlackjackEnvConfig
391
+ +from .blackjack.env import BlackjackEnv
392
+ +from .rubikscube.config import RubiksCube2x2Config
393
+ +from .rubikscube.env import RubiksCube2x2Env
394
+ +from .sudoku.config import SudokuEnvConfig
395
+ +from .sudoku.env import SudokuEnv
396
+
397
+
398
+ REGISTERED_ENVS = {
399
+ @@ -22,6 +30,10 @@ REGISTERED_ENVS = {
400
+ # 'alfworld': AlfredTXTEnv,
401
+ 'metamathqa': MetaMathQAEnv,
402
+ 'lean': LeanEnv,
403
+ + 'game_2048': Game2048Env,
404
+ + 'blackjack': BlackjackEnv,
405
+ + 'rubikscube': RubiksCube2x2Env,
406
+ + 'sudoku': SudokuEnv,
407
+ }
408
+
409
+ REGISTERED_ENV_CONFIGS = {
410
+ @@ -32,6 +44,10 @@ REGISTERED_ENV_CONFIGS = {
411
+ # 'alfworld': AlfredEnvConfig,
412
+ 'metamathqa': MetaMathQAEnvConfig,
413
+ 'lean': LeanEnvConfig,
414
+ + 'game_2048': Game2048EnvConfig,
415
+ + 'blackjack': BlackjackEnvConfig,
416
+ + 'rubikscube': RubiksCube2x2Config,
417
+ + 'sudoku': SudokuEnvConfig,
418
+ }
419
+
420
+ try:
421
+ diff --git a/ragen/env/frozen_lake/config.py b/ragen/env/frozen_lake/config.py
422
+ index de054f4..9950c34 100644
423
+ --- a/ragen/env/frozen_lake/config.py
424
+ +++ b/ragen/env/frozen_lake/config.py
425
+ @@ -8,7 +8,7 @@ class FrozenLakeEnvConfig:
426
+ size: int = 4
427
+ p: float = 0.9
428
+ success_rate: float = 0.8
429
+ - is_slippery: bool = True
430
+ + is_slippery: bool = False
431
+ map_seed: Optional[int] = None
432
+ render_mode: str = "text"
433
+ observation_format: str = "grid"
434
+ diff --git a/ragen/env/frozen_lake/env.py b/ragen/env/frozen_lake/env.py
435
+ index 9ee3add..eef11d8 100644
436
+ --- a/ragen/env/frozen_lake/env.py
437
+ +++ b/ragen/env/frozen_lake/env.py
438
+ @@ -13,6 +13,7 @@ from ragen.env.base import BaseDiscreteActionEnv
439
+ class FrozenLakeEnv(BaseDiscreteActionEnv, GymFrozenLakeEnv):
440
+ def __init__(self, config: FrozenLakeEnvConfig = FrozenLakeEnvConfig()):
441
+ # Using mappings directly from config
442
+ + # import pdb;pdb.set_trace()
443
+ self.config = config
444
+ self.GRID_LOOKUP = config.grid_lookup
445
+ self.ACTION_LOOKUP = config.action_lookup
446
+ @@ -95,6 +96,7 @@ class FrozenLakeEnv(BaseDiscreteActionEnv, GymFrozenLakeEnv):
447
+ if __name__ == "__main__":
448
+ import matplotlib.pyplot as plt
449
+ config = FrozenLakeEnvConfig(size=4, is_slippery=True)
450
+ + # import pdb;pdb.set_trace()
451
+ env = FrozenLakeEnv(config)
452
+ print(env.reset())
453
+ while True:
454
+ diff --git a/ragen/env/sokoban/env.py b/ragen/env/sokoban/env.py
455
+ index 17cd636..6922b54 100644
456
+ --- a/ragen/env/sokoban/env.py
457
+ +++ b/ragen/env/sokoban/env.py
458
+ @@ -33,6 +33,7 @@ class SokobanEnv(BaseDiscreteActionEnv, GymSokobanEnv):
459
+ def reset(self, seed=None, mode=None):
460
+ try:
461
+ with all_seed(seed):
462
+ + # import pdb;pdb.set_trace()
463
+ self.room_fixed, self.room_state, self.box_mapping, action_sequence = generate_room(
464
+ dim=self.dim_room,
465
+ num_steps=self.num_gen_steps,
466
+ diff --git a/ragen/llm_agent/agent_proxy.py b/ragen/llm_agent/agent_proxy.py
467
+ index c25b50d..f6c4088 100644
468
+ --- a/ragen/llm_agent/agent_proxy.py
469
+ +++ b/ragen/llm_agent/agent_proxy.py
470
+ @@ -287,6 +287,7 @@ def main(config):
471
+ proxy = LLMAgentProxy(config, actor_wg, tokenizer)
472
+ import time
473
+ start_time = time.time()
474
+ + # import pdb;pdb.set_trace()
475
+ rollouts = proxy.rollout(
476
+ DataProto(
477
+ batch=None,
478
+ diff --git a/ragen/llm_agent/base_llm.py b/ragen/llm_agent/base_llm.py
479
+ index 358a2eb..b6f7797 100644
480
+ --- a/ragen/llm_agent/base_llm.py
481
+ +++ b/ragen/llm_agent/base_llm.py
482
+ @@ -33,6 +33,7 @@ class OpenAIProvider(LLMProvider):
483
+ raise ValueError("OpenAI API key not provided and not found in environment variables")
484
+
485
+ self.client = AsyncOpenAI(api_key=self.api_key)
486
+ + # import pdb;pdb.set_trace()
487
+
488
+ async def generate(self, messages: List[Dict[str, str]], **kwargs) -> LLMResponse:
489
+ if "o1-mini" in self.model_name:
490
+ @@ -46,10 +47,7 @@ class OpenAIProvider(LLMProvider):
491
+ )
492
+ if response.choices[0].finish_reason in ['length', 'content_filter']:
493
+ raise ValueError("Content filtered or length exceeded")
494
+ - return LLMResponse(
495
+ - content=response.choices[0].message.content,
496
+ - model_name=response.model
497
+ - )
498
+ + return LLMResponse(content=response.choices[0].message.content,model_name=response.model)
499
+
500
+ class DeepSeekProvider(LLMProvider):
501
+ """DeepSeek API provider implementation"""
502
+ @@ -199,7 +197,7 @@ class ConcurrentLLM:
503
+
504
+ # Queue to store unfinished or failed tasks
505
+ current_batch = messages_list.copy()
506
+ - max_retries = kwargs.get("max_retries", 100)
507
+ + max_retries = kwargs.get("max_retries", 10)
508
+ retry_count = 0
509
+
510
+ while current_batch and retry_count < max_retries:
511
+ diff --git a/ragen/llm_agent/ctx_manager.py b/ragen/llm_agent/ctx_manager.py
512
+ index 905247a..af20a01 100644
513
+ --- a/ragen/llm_agent/ctx_manager.py
514
+ +++ b/ragen/llm_agent/ctx_manager.py
515
+ @@ -88,6 +88,7 @@ class ContextManager:
516
+ Initialize the ContextManager.
517
+ Processor is used to process the image data.
518
+ """
519
+ + # import pdb;pdb.set_trace()
520
+ self.config = config
521
+ self.tokenizer = tokenizer
522
+ self.processor = processor
523
+ @@ -311,7 +312,7 @@ class ContextManager:
524
+
525
+ llm_input_texts.append(text_with_prompt)
526
+ messages_list.append(messages)
527
+ -
528
+ + # import pdb;pdb.set_trace()
529
+ inputs = self.tokenizer(llm_input_texts, return_tensors="pt", padding=True, padding_side="left", truncation=False) # We have truncated previously, truncation in tokenizer may cause issues.
530
+ input_ids, attention_mask = inputs.input_ids, inputs.attention_mask
531
+ position_ids = (attention_mask.cumsum(dim=-1) - 1).clamp(min=0)
532
+ @@ -353,6 +354,30 @@ class ContextManager:
533
+ key: np.sum(value) / self.env_nums[key.split("/")[0]]
534
+ for key, value in metrics.items()
535
+ }
536
+ + # Derived metrics for wandb logging
537
+ + try:
538
+ + # charts/avg_episode_return: average across all 2048 env groups
539
+ + ep_keys = [k for k in metrics.keys() if k.endswith('/episodic_return')]
540
+ + if len(ep_keys) > 0:
541
+ + ep_vals = []
542
+ + for k in ep_keys:
543
+ + tag = k.split('/')[0]
544
+ + denom = self.env_nums.get(tag, max(1, len(metrics[k])))
545
+ + ep_vals.append(float(np.sum(metrics[k]) / denom))
546
+ + mean_metrics["charts/avg_episode_return"] = float(np.mean(ep_vals))
547
+ + except Exception:
548
+ + pass
549
+ + try:
550
+ + # rollout/max_tile: max over all envs in this batch
551
+ + tile_keys = [k for k in metrics.keys() if k.endswith('/max_tile')]
552
+ + if len(tile_keys) > 0:
553
+ + tile_vals = []
554
+ + for k in tile_keys:
555
+ + tile_vals.extend(metrics[k])
556
+ + if len(tile_vals) > 0:
557
+ + mean_metrics["rollout/max_tile"] = int(np.max(tile_vals))
558
+ + except Exception:
559
+ + pass
560
+ for key, values in metrics.items():
561
+ if not isinstance(values, list):
562
+ continue
563
+ diff --git a/ragen/llm_agent/es_manager.py b/ragen/llm_agent/es_manager.py
564
+ index b87a2b3..1a49d3e 100644
565
+ --- a/ragen/llm_agent/es_manager.py
566
+ +++ b/ragen/llm_agent/es_manager.py
567
+ @@ -128,18 +128,40 @@ class EnvStateManager:
568
+ env_outputs: List[Dict]
569
+ {env_id: int, history: List[Dict][{state: str, actions: List[str], reward: float, info: Dict, llm_response: str, llm_raw_response: str, (Optional)images: List[PIL.Image.Image]}]}
570
+ """
571
+ + # def _execute_actions(env, actions):
572
+ + # acc_reward, turn_info, turn_done = 0, {}, False
573
+ + # executed_actions = []
574
+ + # for action in actions:
575
+ + # _, reward, done, info = env.step(action)
576
+ + # acc_reward += reward
577
+ + # turn_info.update(info) # NOTE: currently use last info for multi-action
578
+ + # executed_actions.append(action)
579
+ + # if done:
580
+ + # turn_done = True
581
+ + # break
582
+ +
583
+ + # return acc_reward, turn_info, turn_done, executed_actions
584
+ def _execute_actions(env, actions):
585
+ - acc_reward, turn_info, turn_done = 0, {}, False
586
+ + acc_reward, turn_info, turn_done = 0.0, {}, False
587
+ + raw_acc_reward = 0.0
588
+ executed_actions = []
589
+ for action in actions:
590
+ _, reward, done, info = env.step(action)
591
+ - acc_reward += reward
592
+ + acc_reward += float(reward)
593
+ + try:
594
+ + raw_acc_reward += float(info.get('raw_reward', 0.0))
595
+ + except Exception:
596
+ + pass
597
+ turn_info.update(info) # NOTE: currently use last info for multi-action
598
+ executed_actions.append(action)
599
+ if done:
600
+ turn_done = True
601
+ break
602
+ -
603
+ + # Overwrite per-turn raw_reward to reflect the sum across all executed actions in this turn
604
+ + try:
605
+ + turn_info['raw_reward'] = float(raw_acc_reward)
606
+ + except Exception:
607
+ + pass
608
+ return acc_reward, turn_info, turn_done, executed_actions
609
+
610
+ def _log_env_state(status, history, cur_obs, max_actions_per_traj, executed_actions, all_actions, acc_reward, turn_done, turn_info, env_input):
611
+ @@ -198,6 +220,18 @@ class EnvStateManager:
612
+ 'success': float(status.terminated and (not status.truncated)),
613
+ 'num_actions': status.num_actions,
614
+ }
615
+ + # Add episodic-level metrics
616
+ + # try:
617
+ + # # Sum of per-turn rewards equals the episodic return (env-shaped reward)
618
+ + # env_metric['episodic_return'] = float(sum(status.rewards))
619
+ + # except Exception:
620
+ + # pass
621
+ + try:
622
+ + # Final max tile on the board at the end of the rollout
623
+ + import numpy as _np
624
+ + env_metric['max_tile'] = int(_np.max(entry['env'].grid))
625
+ + except Exception:
626
+ + pass
627
+ custom_metric = {}
628
+ for turn in cache['history']:
629
+ for k, v in turn.get('info', {}).items():
630
+ @@ -212,6 +246,12 @@ class EnvStateManager:
631
+ "Skipping non-numeric metric '%s' with value %r for env %s.",
632
+ k, v, entry['tag']
633
+ )
634
+ + # Add episodic_return as the SUM of raw_reward across steps (align with CleanRL)
635
+ + try:
636
+ + if 'raw_reward' in custom_metric:
637
+ + env_metric['episodic_return'] = float(np.sum(custom_metric['raw_reward']))
638
+ + except Exception:
639
+ + pass
640
+ for k, v in custom_metric.items():
641
+ # TODO: Move TURN_LVL_METRICS into the environment
642
+ if "webshop" not in cache['tag'].lower() or ("webshop" in cache['tag'].lower() and k in TURN_LVL_METRICS):
643
+ @@ -219,7 +259,12 @@ class EnvStateManager:
644
+ else:
645
+ env_metric['traj_sum/' + k] = np.sum(v)
646
+
647
+ -
648
+ + try:
649
+ + if 'score' in custom_metric and len(custom_metric['score']) > 0:
650
+ + env_metric['final_score'] = float(custom_metric['score'][-1])
651
+ + except Exception:
652
+ + pass
653
+ +
654
+ cache['history'][-1]['metrics'] = custom_metric
655
+ env_metric = {f"{entry['tag']}/{k}": v for k, v in env_metric.items()}
656
+ cache['metrics'] = env_metric
657
+ diff --git a/requirements.txt b/requirements.txt
658
+ index 2fd756e..9b521bf 100644
659
+ --- a/requirements.txt
660
+ +++ b/requirements.txt
661
+ @@ -7,7 +7,6 @@ accelerate
662
+ codetiming
663
+ datasets
664
+ dill
665
+ -flash-attn==2.7.4.post1
666
+ hydra-core
667
+ numpy
668
+ pandas
669
+ @@ -15,19 +14,19 @@ pybind11
670
+ ray>=2.10
671
+ tensordict>=0.8.0,<0.9.0
672
+ transformers
673
+ -vllm==0.8.2
674
+ +vllm==0.8.5
675
+ wandb
676
+ gymnasium
677
+ gymnasium[toy-text]
678
+
679
+ pyarrow>=15.0.0
680
+ pylatexenc
681
+ -torchdata
682
+ +# torchdata
683
+ debugpy
684
+
685
+ together
686
+ anthropic
687
+ -faiss-cpu==1.11.0
688
+ +faiss-gpu
689
+
690
+ # This is optional, but needs to be installed with main requirements if you want to use webshop
691
+ -r external/webshop-minimal/requirements.txt
692
+ diff --git a/scripts/setup_ragen.sh b/scripts/setup_ragen.sh
693
+ index f9a7cd9..85a93c4 100644
694
+ --- a/scripts/setup_ragen.sh
695
+ +++ b/scripts/setup_ragen.sh
696
+ @@ -94,10 +94,10 @@ main() {
697
+ pip install torch==2.5.0 --index-url https://download.pytorch.org/whl/cu124
698
+
699
+ print_step "Installing flash-attention..."
700
+ - pip3 install flash-attn==2.7.4.post1 --no-build-isolation
701
+ + # pip3 install flash-attn==2.7.4.post1 --no-build-isolation
702
+ else
703
+ print_step "Installing PyTorch without CUDA support..."
704
+ - pip install torch==2.5.0
705
+ + pip install torch==2.4.0
706
+ fi
707
+
708
+ # Install remaining requirements
709
+ @@ -137,8 +137,8 @@ main() {
710
+ conda install conda-forge::gdown
711
+ mkdir -p external/webshop-minimal/webshop_minimal/data/full
712
+ cd external/webshop-minimal/webshop_minimal/data/full
713
+ - gdown https://drive.google.com/uc?id=1A2whVgOO0euk5O13n2iYDM0bQRkkRduB # items_shuffle
714
+ - gdown https://drive.google.com/uc?id=1s2j6NgHljiZzQNL3veZaAiyW_qDEgBNi # items_ins_v2
715
+ + # gdown https://drive.google.com/uc?id=1A2whVgOO0euk5O13n2iYDM0bQRkkRduB # items_shuffle
716
+ + # gdown https://drive.google.com/uc?id=1s2j6NgHljiZzQNL3veZaAiyW_qDEgBNi # items_ins_v2
717
+ cd ../../../../..
718
+
719
+ echo -e "${GREEN}Installation completed successfully!${NC}"
720
+ diff --git a/train_all.sh b/train_all.sh
721
+ index 0157306..33035f5 100755
722
+ --- a/train_all.sh
723
+ +++ b/train_all.sh
724
+ @@ -6,246 +6,257 @@ USE_GRPO="algorithm.adv_estimator=grpo"
725
+ USE_PPO="algorithm.adv_estimator=gae" # by default.
726
+ USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
727
+
728
+ +
729
+ +# python train.py --config-name _8_2048 system.CUDA_VISIBLE_DEVICES="'0,1,2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=game_2048 $USE_PPO $USE_BASE
730
+ +
731
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'0,1'" trainer.project_name=ragen_latest_qwen_05B_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=rubikscube-1 $USE_PPO $USE_BASE
732
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-1.5B-Instruct trainer.experiment_name=rubikscube-2 $USE_PPO $USE_BASE
733
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'4,5'" trainer.project_name=ragen_latest_qwen_25_3b_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-3B-Instruct trainer.experiment_name=rubikscube-2 $USE_PPO $USE_BASE
734
+ +python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'6,7'" trainer.project_name=ragen_latest_qwen_05B_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=rubikscube-3 $USE_PPO $USE_BASE
735
+ +
736
+ # Section 3.1&3.2 - General Observations
737
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-ppo $USE_PPO $USE_BASE &
738
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-grpo $USE_GRPO $USE_BASE &
739
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE &
740
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-grpo $USE_GRPO $USE_BASE &
741
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozen_lake-ppo $USE_PPO $USE_BASE &
742
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozen_lake-grpo $USE_GRPO $USE_BASE &
743
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="'6,7'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=bandit-ppo-multitask $USE_PPO $USE_BASE &
744
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="'7'" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-ppo-frommlp $USE_PPO $USE_BASE
745
+
746
+ -# Section 4.1 - Filtering and critic
747
+ -# 0.25
748
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.25 actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
749
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
750
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
751
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
752
+ -
753
+ -wait
754
+ -
755
+ -# 0.5
756
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-ppo-rolloutfilter0.5 actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
757
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
758
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
759
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
760
+ -
761
+ -# 0.75
762
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.75 actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
763
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
764
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
765
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
766
+ -
767
+ -wait
768
+ -
769
+ -# Section 4.2 - Ablation on Critic/ClipHigh/KL. Start from Basic and add more components. The best setting for StarPO in agent is rollout_filter+Critic+Cliphigh+NoKL
770
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
771
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
772
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
773
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
774
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozenlake-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
775
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozenlake-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
776
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozenlake-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
777
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozenlake-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
778
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="'0,1'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=sokoban-ppo-box1-multitask $USE_PPO $USE_BASE
779
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-grpo $USE_GRPO $USE_BASE &
780
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
781
+
782
+ -wait
783
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'4,5,6,7'" trainer.project_name=ragen_latest_qwen_25_3b_it trainer.n_gpus_per_node=4 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_3B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
784
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'4,5,6,7'" trainer.n_gpus_per_node=4 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
785
+
786
+ -# Section 5.1 - Reasoning Helps Generalization
787
+ +# # Section 4.1 - Filtering and critic
788
+ +# # 0.25
789
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.25 actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
790
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
791
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
792
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
793
+
794
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-generalization \
795
+ - custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
796
+ - custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
797
+ - custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
798
+ - custom_envs.BanditTest.env_config.hi_arm_name="Librarian"
799
+ +# wait
800
+
801
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-generalization-nothink \
802
+ - custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
803
+ - custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
804
+ - custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
805
+ - custom_envs.BanditTest.env_config.hi_arm_name="Librarian" \
806
+ - agent_proxy.enable_think=False
807
+ +# # 0.5
808
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-ppo-rolloutfilter0.5 actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
809
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
810
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
811
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
812
+ +
813
+ +# # 0.75
814
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.75 actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
815
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
816
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
817
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
818
+
819
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=bandit-generalization-rev \
820
+ - custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
821
+ - custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
822
+ - custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
823
+ - custom_envs.BanditTest.env_config.hi_arm_name="Trader"
824
+ +# wait
825
+
826
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=bandit-generalization-rev-nothink \
827
+ - custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
828
+ - custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
829
+ - custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
830
+ - custom_envs.BanditTest.env_config.hi_arm_name="Trader" \
831
+ - agent_proxy.enable_think=False
832
+ +# # Section 4.2 - Ablation on Critic/ClipHigh/KL. Start from Basic and add more components. The best setting for StarPO in agent is rollout_filter+Critic+Cliphigh+NoKL
833
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
834
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
835
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
836
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
837
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozenlake-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
838
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozenlake-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
839
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozenlake-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
840
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozenlake-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
841
+
842
+ +# wait
843
+
844
+ -SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
845
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization micro_batch_size_per_gpu=8 model_path=Qwen/Qwen2.5-1.5B-Instruct&
846
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-generalization-nothink $SOKOBAN_GENERALIZATION_CONFIG agent_proxy.enable_think=False &
847
+ +# # Section 5.1 - Reasoning Helps Generalization
848
+
849
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-generalization \
850
+ +# custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
851
+ +# custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
852
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
853
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Librarian"
854
+
855
+ -# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=128 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SokobanDifferentGridVocab] es_manager.val.env_configs.n_groups=[128]"
856
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG &
857
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-generalization-nothink \
858
+ +# custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
859
+ +# custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
860
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
861
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Librarian" \
862
+ +# agent_proxy.enable_think=False
863
+
864
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=bandit-generalization-rev \
865
+ +# custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
866
+ +# custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
867
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
868
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Trader"
869
+
870
+ -# COMPOSITIONALITY_CONFIG="es_manager.train.env_groups=16 es_manager.train.env_configs.tags=[Bandit,SimpleSokoban] es_manager.train.env_configs.n_groups=[8,8] es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[Bandit,SimpleSokoban,LargerSokoban,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128] actor_rollout_ref.rollout.rollout_filter_ratio=1" # NOTE that we don't filter out low-var rollout in this setting
871
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=compositional-generalization $COMPOSITIONALITY_CONFIG &
872
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=compositional-generalization-nothink $COMPOSITIONALITY_CONFIG agent_proxy.enable_think=False &
873
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=bandit-generalization-rev-nothink \
874
+ +# custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
875
+ +# custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
876
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
877
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Trader" \
878
+ +# agent_proxy.enable_think=False
879
+
880
+ -wait
881
+
882
+ -# Section 5.2 - what leads to better reasoning?
883
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B-Instruct &
884
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B-Instruct &
885
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct trainer.n_gpus_per_node=2 &
886
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B-Instruct trainer.n_gpus_per_node=4 &
887
+ +# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
888
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization micro_batch_size_per_gpu=8 model_path=Qwen/Qwen2.5-1.5B-Instruct&
889
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-generalization-nothink $SOKOBAN_GENERALIZATION_CONFIG agent_proxy.enable_think=False &
890
+
891
+ -wait
892
+
893
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B &
894
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B &
895
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B &
896
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B &
897
+ +# # SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=128 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SokobanDifferentGridVocab] es_manager.val.env_configs.n_groups=[128]"
898
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG &
899
+
900
+ -wait
901
+
902
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-7B &
903
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B &
904
+ +# # COMPOSITIONALITY_CONFIG="es_manager.train.env_groups=16 es_manager.train.env_configs.tags=[Bandit,SimpleSokoban] es_manager.train.env_configs.n_groups=[8,8] es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[Bandit,SimpleSokoban,LargerSokoban,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128] actor_rollout_ref.rollout.rollout_filter_ratio=1" # NOTE that we don't filter out low-var rollout in this setting
905
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=compositional-generalization $COMPOSITIONALITY_CONFIG &
906
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=compositional-generalization-nothink $COMPOSITIONALITY_CONFIG agent_proxy.enable_think=False &
907
+
908
+ +# wait
909
+
910
+ -wait
911
+ +# # Section 5.2 - what leads to better reasoning?
912
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B-Instruct &
913
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B-Instruct &
914
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct trainer.n_gpus_per_node=2 &
915
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B-Instruct trainer.n_gpus_per_node=4 &
916
+
917
+ -# Section 6.1 varying action count
918
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-action-count-1 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=5 custom_envs.LargerSokoban.max_actions_per_traj=5 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=5 custom_envs.FrozenLake.max_actions_per_traj=5 agent_proxy.max_actions_per_turn=1 &
919
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-action-count-2 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=10 custom_envs.LargerSokoban.max_actions_per_traj=10 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=10 custom_envs.FrozenLake.max_actions_per_traj=10 agent_proxy.max_actions_per_turn=2 &
920
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-action-count-3 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=15 custom_envs.LargerSokoban.max_actions_per_traj=15 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=15 custom_envs.FrozenLake.max_actions_per_traj=15 agent_proxy.max_actions_per_turn=3 &
921
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-action-count-4 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=20 custom_envs.LargerSokoban.max_actions_per_traj=20 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=20 custom_envs.FrozenLake.max_actions_per_traj=20 agent_proxy.max_actions_per_turn=4 &
922
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-action-count-5 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=25 custom_envs.LargerSokoban.max_actions_per_traj=25 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=25 custom_envs.FrozenLake.max_actions_per_traj=25 agent_proxy.max_actions_per_turn=5 &
923
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-action-count-6 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=30 custom_envs.LargerSokoban.max_actions_per_traj=30 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=30 custom_envs.FrozenLake.max_actions_per_traj=30 agent_proxy.max_actions_per_turn=6 &
924
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-action-count-7 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=35 custom_envs.LargerSokoban.max_actions_per_traj=35 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=35 custom_envs.FrozenLake.max_actions_per_traj=35 agent_proxy.max_actions_per_turn=7 &
925
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-action-count-8 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=40 custom_envs.LargerSokoban.max_actions_per_traj=40 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=40 custom_envs.FrozenLake.max_actions_per_traj=40 agent_proxy.max_actions_per_turn=8 &
926
+ +# wait
927
+
928
+ -# section 6.2 Varying prompt diversity
929
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-prompt-diversity-4 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=4 es_manager.train.group_size=32 es_manager.train.env_configs.n_groups=[4] &
930
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-prompt-diversity-8 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] &
931
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-prompt-diversity-16 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=8 es_manager.train.env_configs.n_groups=[16] &
932
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-prompt-diversity-32 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=32 es_manager.train.group_size=4 es_manager.train.env_configs.n_groups=[32] &
933
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-prompt-diversity-64 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=64 es_manager.train.group_size=2 es_manager.train.env_configs.n_groups=[64] &
934
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-prompt-diversity-128 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=128 es_manager.train.group_size=1 es_manager.train.env_configs.n_groups=[128] &
935
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B &
936
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B &
937
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B &
938
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B &
939
+
940
+ -wait
941
+ +# wait
942
+
943
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-online-2 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[16] trainer.total_training_steps=100 trainer.test_freq=5 &
944
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-7B &
945
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B &
946
+
947
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-online-5 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=40 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[40] trainer.total_training_steps=40 trainer.test_freq=2 &
948
+
949
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-online-10 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=80 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[80] trainer.total_training_steps=80 trainer.test_freq=1 &
950
+ +# wait
951
+
952
+ +# # Section 6.1 varying action count
953
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-action-count-1 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=5 custom_envs.LargerSokoban.max_actions_per_traj=5 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=5 custom_envs.FrozenLake.max_actions_per_traj=5 agent_proxy.max_actions_per_turn=1 &
954
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-action-count-2 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=10 custom_envs.LargerSokoban.max_actions_per_traj=10 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=10 custom_envs.FrozenLake.max_actions_per_traj=10 agent_proxy.max_actions_per_turn=2 &
955
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-action-count-3 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=15 custom_envs.LargerSokoban.max_actions_per_traj=15 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=15 custom_envs.FrozenLake.max_actions_per_traj=15 agent_proxy.max_actions_per_turn=3 &
956
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-action-count-4 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=20 custom_envs.LargerSokoban.max_actions_per_traj=20 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=20 custom_envs.FrozenLake.max_actions_per_traj=20 agent_proxy.max_actions_per_turn=4 &
957
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-action-count-5 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=25 custom_envs.LargerSokoban.max_actions_per_traj=25 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=25 custom_envs.FrozenLake.max_actions_per_traj=25 agent_proxy.max_actions_per_turn=5 &
958
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-action-count-6 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=30 custom_envs.LargerSokoban.max_actions_per_traj=30 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=30 custom_envs.FrozenLake.max_actions_per_traj=30 agent_proxy.max_actions_per_turn=6 &
959
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-action-count-7 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=35 custom_envs.LargerSokoban.max_actions_per_traj=35 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=35 custom_envs.FrozenLake.max_actions_per_traj=35 agent_proxy.max_actions_per_turn=7 &
960
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-action-count-8 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=40 custom_envs.LargerSokoban.max_actions_per_traj=40 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=40 custom_envs.FrozenLake.max_actions_per_traj=40 agent_proxy.max_actions_per_turn=8 &
961
+
962
+ +# # section 6.2 Varying prompt diversity
963
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-prompt-diversity-4 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=4 es_manager.train.group_size=32 es_manager.train.env_configs.n_groups=[4] &
964
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-prompt-diversity-8 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] &
965
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-prompt-diversity-16 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=8 es_manager.train.env_configs.n_groups=[16] &
966
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-prompt-diversity-32 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=32 es_manager.train.group_size=4 es_manager.train.env_configs.n_groups=[32] &
967
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-prompt-diversity-64 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=64 es_manager.train.group_size=2 es_manager.train.env_configs.n_groups=[64] &
968
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-prompt-diversity-128 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=128 es_manager.train.group_size=1 es_manager.train.env_configs.n_groups=[128] &
969
+
970
+ +# wait
971
+
972
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-online-2 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[16] trainer.total_training_steps=100 trainer.test_freq=5 &
973
+
974
+ -# Extension: Training 7B reasoning model
975
+ -SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
976
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct-largescale $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] micro_batch_size_per_gpu=8 ppo_mini_batch_size=64 actor_rollout_ref.rollout.response_length=1024 actor_rollout_ref.rollout.max_model_len=6400 trainer.test_freq=5 actor_rollout_ref.rollout.max_num_batched_tokens=24000 micro_batch_size_per_gpu=2 actor_rollout_ref.rollout.rollout_filter_ratio=1 &
977
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-online-5 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=40 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[40] trainer.total_training_steps=40 trainer.test_freq=2 &
978
+
979
+ -python -m ragen.llm_agent.agent_proxy model_path=Qwen/Qwen2.5-3B-Instruct system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 actor_rollout_ref.rollout.tensor_model_parallel_size=4 actor_rollout_ref.rollout.response_length=2048 actor_rollout_ref.rollout.max_model_len=12800
980
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-online-10 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=80 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[80] trainer.total_training_steps=80 trainer.test_freq=1 &
981
+
982
+ -# trainer.save_freq=50 trainer.default_local_dir=/mnt/local/cache/exp_name
983
+
984
+ -# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
985
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization &
986
+
987
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/bandit-generalization &
988
+
989
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=frozenlake-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/frozenlake-generalization &
990
+
991
+ +# # Extension: Training 7B reasoning model
992
+ +# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
993
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct-largescale $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] micro_batch_size_per_gpu=8 ppo_mini_batch_size=64 actor_rollout_ref.rollout.response_length=1024 actor_rollout_ref.rollout.max_model_len=6400 trainer.test_freq=5 actor_rollout_ref.rollout.max_num_batched_tokens=24000 micro_batch_size_per_gpu=2 actor_rollout_ref.rollout.rollout_filter_ratio=1 &
994
+
995
+ +# python -m ragen.llm_agent.agent_proxy model_path=Qwen/Qwen2.5-3B-Instruct system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 actor_rollout_ref.rollout.tensor_model_parallel_size=4 actor_rollout_ref.rollout.response_length=2048 actor_rollout_ref.rollout.max_model_len=12800
996
+
997
+ +# # trainer.save_freq=50 trainer.default_local_dir=/mnt/local/cache/exp_name
998
+
999
+ -# USE_PPO="algorithm.adv_estimator=gae" # by default.
1000
+ -# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1001
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE ppo_mini_batch_size=64 enable_response_mask=True &
1002
+ +# # USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1003
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization &
1004
+
1005
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/bandit-generalization &
1006
+
1007
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std &
1008
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=frozenlake-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/frozenlake-generalization &
1009
+
1010
+ -# enable_response_mask: False
1011
+ -# grpo_advantage_length_weight: True
1012
+
1013
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo-1-5b algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std agent_proxy.max_actions_per_turn=5 custom_envs.SimpleSokoban.max_actions_per_traj=25 enable_response_mask=True grpo_advantage_length_weight=False model_path=Qwen/Qwen2.5-1.5B-Instruct &
1014
+
1015
+
1016
+ -# extension: 7B with lora. Currently NOT recommended to use lora: within current version of vllm, this could result in rollouts slower than non-lora by 100%
1017
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-7B-Instruct trainer.experiment_name=sokoban_7b_instruct_lora_newversion lora.rank=16
1018
+ +# # USE_PPO="algorithm.adv_estimator=gae" # by default.
1019
+ +# # USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1020
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE ppo_mini_batch_size=64 enable_response_mask=True &
1021
+
1022
+ -# extension: bi-level gae
1023
+ -python train.py trainer.experiment_name=sokoban-bi-level-gae-final \
1024
+ - system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
1025
+ - model_path=Qwen/Qwen2.5-0.5B-Instruct \
1026
+ - algorithm.bi_level_gae=True algorithm.high_level_gamma=0.95 \
1027
+ - agent_proxy.use_turn_scores=True \
1028
+ - actor_rollout_ref.rollout.tp_size_check=False
1029
+
1030
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std &
1031
+
1032
+ -# extension: webshop
1033
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1034
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1035
+ - trainer.experiment_name=webshop-3b-ppo-s $USE_PPO \
1036
+ - trainer.nnodes=1 &
1037
+ +# # enable_response_mask: False
1038
+ +# # grpo_advantage_length_weight: True
1039
+
1040
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo-1-5b algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std agent_proxy.max_actions_per_turn=5 custom_envs.SimpleSokoban.max_actions_per_traj=25 enable_response_mask=True grpo_advantage_length_weight=False model_path=Qwen/Qwen2.5-1.5B-Instruct &
1041
+
1042
+ -USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1043
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1044
+ - trainer.experiment_name=webshop-3b-grpo-s $USE_GRPO \
1045
+ - trainer.nnodes=1 &
1046
+
1047
+ -# StarPO ppo
1048
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1049
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1050
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1051
+ - trainer.experiment_name=webshop-3b-ppo $USE_PPO $USE_BASE \
1052
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1053
+ - trainer.nnodes=1 &
1054
+ +# # extension: 7B with lora. Currently NOT recommended to use lora: within current version of vllm, this could result in rollouts slower than non-lora by 100%
1055
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-7B-Instruct trainer.experiment_name=sokoban_7b_instruct_lora_newversion lora.rank=16
1056
+
1057
+ -# StarPO grpo
1058
+ -USE_GRPO="algorithm.adv_estimator=grpo"
1059
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1060
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1061
+ - trainer.experiment_name=webshop-3b-grpo $USE_GRPO $USE_BASE \
1062
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1063
+ - trainer.nnodes=1 &
1064
+ +# # extension: bi-level gae
1065
+ +# python train.py trainer.experiment_name=sokoban-bi-level-gae-final \
1066
+ +# system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
1067
+ +# model_path=Qwen/Qwen2.5-0.5B-Instruct \
1068
+ +# algorithm.bi_level_gae=True algorithm.high_level_gamma=0.95 \
1069
+ +# agent_proxy.use_turn_scores=True \
1070
+ +# actor_rollout_ref.rollout.tp_size_check=False
1071
+
1072
+
1073
+ -# normal:sokoban
1074
+ -# extension: sokoban
1075
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1076
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1077
+ - trainer.experiment_name=sokoban-3b-ppo-s $USE_PPO \
1078
+ - trainer.nnodes=1 &
1079
+ +# # extension: webshop
1080
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1081
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1082
+ +# trainer.experiment_name=webshop-3b-ppo-s $USE_PPO \
1083
+ +# trainer.nnodes=1 &
1084
+
1085
+
1086
+ -USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1087
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1088
+ - trainer.experiment_name=sokoban-3b-grpo-s $USE_GRPO \
1089
+ - trainer.nnodes=1 &
1090
+ +# USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1091
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1092
+ +# trainer.experiment_name=webshop-3b-grpo-s $USE_GRPO \
1093
+ +# trainer.nnodes=1 &
1094
+
1095
+ -# StarPO ppo
1096
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1097
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1098
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1099
+ - trainer.experiment_name=sokoban-3b-ppo $USE_PPO $USE_BASE \
1100
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1101
+ - trainer.nnodes=1 &
1102
+ +# # StarPO ppo
1103
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1104
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1105
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1106
+ +# trainer.experiment_name=webshop-3b-ppo $USE_PPO $USE_BASE \
1107
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1108
+ +# trainer.nnodes=1 &
1109
+
1110
+ -# StarPO grpo
1111
+ -USE_GRPO="algorithm.adv_estimator=grpo"
1112
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1113
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1114
+ - trainer.experiment_name=sokoban-3b-grpo $USE_GRPO $USE_BASE \
1115
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1116
+ - trainer.nnodes=1 &
1117
+ +# # StarPO grpo
1118
+ +# USE_GRPO="algorithm.adv_estimator=grpo"
1119
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1120
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1121
+ +# trainer.experiment_name=webshop-3b-grpo $USE_GRPO $USE_BASE \
1122
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1123
+ +# trainer.nnodes=1 &
1124
+ +
1125
+ +
1126
+ +# # normal:sokoban
1127
+ +# # extension: sokoban
1128
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1129
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1130
+ +# trainer.experiment_name=sokoban-3b-ppo-s $USE_PPO \
1131
+ +# trainer.nnodes=1 &
1132
+ +
1133
+ +
1134
+ +# USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1135
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1136
+ +# trainer.experiment_name=sokoban-3b-grpo-s $USE_GRPO \
1137
+ +# trainer.nnodes=1 &
1138
+ +
1139
+ +# # StarPO ppo
1140
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1141
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1142
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1143
+ +# trainer.experiment_name=sokoban-3b-ppo $USE_PPO $USE_BASE \
1144
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1145
+ +# trainer.nnodes=1 &
1146
+ +
1147
+ +# # StarPO grpo
1148
+ +# USE_GRPO="algorithm.adv_estimator=grpo"
1149
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1150
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1151
+ +# trainer.experiment_name=sokoban-3b-grpo $USE_GRPO $USE_BASE \
1152
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1153
+ +# trainer.nnodes=1 &
1154
+
1155
+
1156
+
1157
+ -python train.py \
1158
+ - trainer.experiment_name=3b-full-ppo-test system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2
1159
+
1160
+ +# python train.py \
1161
+ +# trainer.experiment_name=3b-full-ppo-test system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2
1162
+
wandb/run-20251218_183419-wvypkl8w/files/requirements.txt ADDED
@@ -0,0 +1,315 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ colorama==0.4.6
2
+ psutil==7.1.2
3
+ ragen==0.1
4
+ ragen==0.1
5
+ setuptools==80.9.0
6
+ wheel==0.45.1
7
+ pip==25.3
8
+ ragen==0.1
9
+ pytz==2025.2
10
+ nvidia-cusparselt-cu12==0.6.2
11
+ mpmath==1.3.0
12
+ typing_extensions==4.15.0
13
+ sympy==1.13.1
14
+ pylatexenc==2.10
15
+ nvidia-cusolver-cu12==11.6.1.9
16
+ numpy==1.26.4
17
+ Markdown==3.10
18
+ absl-py==2.3.1
19
+ pyasn1_modules==0.4.2
20
+ Werkzeug==3.1.3
21
+ networkx==3.3
22
+ MarkupSafe==2.1.5
23
+ fsspec==2025.9.0
24
+ filelock==3.19.1
25
+ nvidia-cudnn-cu12==9.1.0.70
26
+ Jinja2==3.1.6
27
+ tensorboard==2.20.0
28
+ triton==3.2.0
29
+ pillow==11.3.0
30
+ xxhash==3.6.0
31
+ nvidia-nvtx-cu12==12.4.127
32
+ nvidia-nvjitlink-cu12==12.4.127
33
+ nvidia-nccl-cu12==2.21.5
34
+ nvidia-curand-cu12==10.3.5.147
35
+ wrapt==2.0.1
36
+ nvidia-cufft-cu12==11.2.1.3
37
+ pyjnius==1.7.0
38
+ nvidia-cuda-runtime-cu12==12.4.127
39
+ nvidia-cuda-nvrtc-cu12==12.4.127
40
+ websockets==15.0.1
41
+ nvidia-cuda-cupti-cu12==12.4.127
42
+ zipp==3.23.0
43
+ nvidia-cublas-cu12==12.4.5.8
44
+ nvidia-cusparse-cu12==12.3.1.170
45
+ flash_attn==2.8.3
46
+ rsa==4.9.1
47
+ einops==0.8.1
48
+ py-cpuinfo==9.0.0
49
+ pure_eval==0.2.3
50
+ ptyprocess==0.7.0
51
+ gym-notices==0.1.0
52
+ flatbuffers==25.9.23
53
+ fastrlock==0.8.3
54
+ Farama-Notifications==0.0.4
55
+ faiss-gpu==1.7.2
56
+ antlr4-python3-runtime==4.9.3
57
+ wcwidth==0.2.14
58
+ wasabi==1.1.3
59
+ uvloop==0.22.1
60
+ urllib3==2.5.0
61
+ tzdata==2025.2
62
+ typing-inspection==0.4.2
63
+ traitlets==5.14.3
64
+ tqdm==4.67.1
65
+ tomli==2.3.0
66
+ threadpoolctl==3.6.0
67
+ tenacity==9.1.2
68
+ tabulate==0.9.0
69
+ spacy-loggers==1.0.5
70
+ spacy-legacy==3.0.12
71
+ soupsieve==2.8
72
+ sniffio==1.3.1
73
+ smmap==5.0.2
74
+ six==1.17.0
75
+ shellingham==1.5.4
76
+ sentencepiece==0.2.1
77
+ scipy==1.15.3
78
+ safetensors==0.6.2
79
+ rpds-py==0.29.0
80
+ rignore==0.7.6
81
+ regex==2025.11.3
82
+ RapidFuzz==3.14.3
83
+ rank-bm25==0.2.2
84
+ pyzmq==27.1.0
85
+ PyYAML==6.0.3
86
+ pytokens==0.3.0
87
+ python-multipart==0.0.20
88
+ python-json-logger==4.0.0
89
+ python-dotenv==1.2.1
90
+ PySocks==1.7.1
91
+ pyparsing==3.2.5
92
+ PyJWT==2.10.1
93
+ Pygments==2.19.2
94
+ pygame==2.6.1
95
+ pydantic_core==2.41.5
96
+ pycparser==2.23
97
+ pycountry==24.6.1
98
+ pybind11==3.0.1
99
+ pyarrow==22.0.0
100
+ psutil==7.1.3
101
+ protobuf==4.25.8
102
+ propcache==0.4.1
103
+ prometheus_client==0.23.1
104
+ platformdirs==4.5.0
105
+ pexpect==4.9.0
106
+ pathspec==0.12.1
107
+ partial-json-parser==0.2.1.1.post6
108
+ parso==0.8.5
109
+ packaging==25.0
110
+ orjson==3.11.4
111
+ opentelemetry-semantic-conventions-ai==0.4.13
112
+ opencv-python-headless==4.12.0.88
113
+ ninja==1.13.0
114
+ nest-asyncio==1.6.0
115
+ mypy_extensions==1.1.0
116
+ murmurhash==1.0.15
117
+ multidict==6.7.0
118
+ msgspec==0.19.0
119
+ msgpack==1.1.2
120
+ mdurl==0.1.2
121
+ loguru==0.7.3
122
+ llvmlite==0.44.0
123
+ llguidance==0.7.30
124
+ lark==1.2.2
125
+ kiwisolver==1.4.9
126
+ joblib==1.5.2
127
+ jiter==0.12.0
128
+ itsdangerous==2.2.0
129
+ interegular==0.3.3
130
+ ImageIO==2.37.2
131
+ idna==3.11
132
+ humanfriendly==10.0
133
+ httpx-sse==0.4.3
134
+ httptools==0.7.1
135
+ html2text==2025.4.15
136
+ hf-xet==1.2.0
137
+ h11==0.16.0
138
+ grpcio==1.76.0
139
+ frozenlist==1.8.0
140
+ fonttools==4.60.1
141
+ executing==2.2.1
142
+ exceptiongroup==1.3.0
143
+ eval_type_backport==0.2.2
144
+ docstring_parser==0.17.0
145
+ dnspython==2.8.0
146
+ distro==1.9.0
147
+ diskcache==5.6.3
148
+ dill==0.4.0
149
+ decorator==5.2.1
150
+ debugpy==1.8.17
151
+ Cython==3.2.1
152
+ cymem==2.0.13
153
+ cycler==0.12.1
154
+ cupy-cuda12x==13.6.0
155
+ contourpy==1.3.2
156
+ colorama==0.4.6
157
+ codetiming==1.4.0
158
+ cloudpickle==3.1.2
159
+ cloudpathlib==0.23.0
160
+ click==8.3.1
161
+ charset-normalizer==3.4.4
162
+ certifi==2025.11.12
163
+ catalogue==2.0.10
164
+ cachetools==6.2.2
165
+ blis==1.3.2
166
+ blinker==1.9.0
167
+ blake3==1.0.8
168
+ attrs==25.4.0
169
+ async-timeout==5.0.1
170
+ asttokens==3.0.1
171
+ astor==0.8.1
172
+ annotated-types==0.7.0
173
+ annotated-doc==0.0.4
174
+ airportsdata==20250909
175
+ aiohappyeyeballs==2.6.1
176
+ yarl==1.22.0
177
+ uvicorn==0.38.0
178
+ typer-slim==0.20.0
179
+ thefuzz==0.22.1
180
+ stack-data==0.6.3
181
+ srsly==2.5.1
182
+ smart_open==7.5.0
183
+ sentry-sdk==2.44.0
184
+ scikit-learn==1.7.2
185
+ requests==2.32.5
186
+ referencing==0.37.0
187
+ python-dateutil==2.9.0.post0
188
+ pydantic==2.12.4
189
+ prompt_toolkit==3.0.52
190
+ preshed==3.0.11
191
+ opentelemetry-proto==1.26.0
192
+ omegaconf==2.3.0
193
+ numba==0.61.2
194
+ nltk==3.9.2
195
+ multiprocess==0.70.18
196
+ matplotlib-inline==0.2.1
197
+ markdown-it-py==4.0.0
198
+ jedi==0.19.2
199
+ importlib_metadata==8.0.0
200
+ httpcore==1.0.9
201
+ gymnasium==1.2.2
202
+ gym==0.26.2
203
+ googleapis-common-protos==1.72.0
204
+ gitdb==4.0.12
205
+ gguf==0.17.1
206
+ Flask==3.1.2
207
+ faiss-cpu==1.13.0
208
+ email-validator==2.3.0
209
+ depyf==0.18.0
210
+ Deprecated==1.3.1
211
+ coloredlogs==15.0.1
212
+ cffi==2.0.0
213
+ black==25.11.0
214
+ beautifulsoup4==4.14.2
215
+ anyio==4.11.0
216
+ aiosignal==1.4.0
217
+ watchfiles==1.1.1
218
+ tiktoken==0.12.0
219
+ starlette==0.49.3
220
+ sse-starlette==3.0.3
221
+ rich==14.2.0
222
+ pydantic-settings==2.12.0
223
+ pydantic-extra-types==2.10.6
224
+ pandas==2.3.3
225
+ opentelemetry-exporter-otlp-proto-common==1.26.0
226
+ onnxruntime==1.23.2
227
+ matplotlib==3.10.7
228
+ lm-format-enforcer==0.10.12
229
+ jsonschema-specifications==2025.9.1
230
+ ipython==8.37.0
231
+ hydra-core==1.3.2
232
+ huggingface-hub==0.36.0
233
+ httpx==0.28.1
234
+ gym-sokoban==0.0.6
235
+ GitPython==3.1.45
236
+ cryptography==46.0.3
237
+ confection==0.1.5
238
+ cleantext==1.1.4
239
+ aiohttp==3.13.2
240
+ weasel==0.4.3
241
+ wandb==0.23.0
242
+ typer==0.19.2
243
+ virtualenv==20.35.4
244
+ pyasn1==0.6.1
245
+ torch==2.6.0
246
+ tokenizers==0.22.1
247
+ thinc==8.3.9
248
+ rich-toolkit==0.15.1
249
+ prometheus-fastapi-instrumentator==7.1.0
250
+ openai==2.8.0
251
+ jsonschema==4.25.1
252
+ gdown==5.2.0
253
+ fastapi==0.121.2
254
+ anthropic==0.73.0
255
+ xformers==0.0.29.post2
256
+ transformers==4.57.1
257
+ proto-plus==1.26.1
258
+ torchvision==0.21.0
259
+ torchdata==0.11.0
260
+ torchaudio==2.6.0
261
+ together==1.5.30
262
+ tensordict==0.8.3
263
+ spacy==3.8.9
264
+ ray==2.51.1
265
+ outlines_core==0.1.26
266
+ mistral_common==1.8.5
267
+ mcp==1.21.1
268
+ fastapi-cloud-cli==0.3.1
269
+ fastapi-cli==0.0.16
270
+ datasets==4.4.1
271
+ accelerate==1.11.0
272
+ xgrammar==0.1.18
273
+ pyserini==1.2.0
274
+ peft==0.18.0
275
+ outlines==0.1.11
276
+ opentelemetry-exporter-otlp-proto-http==1.26.0
277
+ opentelemetry-exporter-otlp-proto-grpc==1.26.0
278
+ kimina-client==0.2.1
279
+ compressed-tensors==0.9.3
280
+ opentelemetry-exporter-otlp==1.26.0
281
+ vllm==0.8.5
282
+ py-spy==0.4.1
283
+ opencensus-context==0.1.3
284
+ distlib==0.4.0
285
+ colorful==0.5.8
286
+ tensorboard-data-server==0.7.2
287
+ google-auth==2.43.0
288
+ google-api-core==2.28.1
289
+ aiohttp-cors==0.8.1
290
+ opentelemetry-exporter-prometheus==0.59b0
291
+ opencensus==0.11.4
292
+ verl==0.5.0.dev0
293
+ opentelemetry-api==1.38.0
294
+ opentelemetry-semantic-conventions==0.59b0
295
+ opentelemetry-sdk==1.38.0
296
+ typeguard==4.4.4
297
+ shtab==1.8.0
298
+ tyro==0.9.35
299
+ verl==0.5.0.dev0
300
+ autocommand==2.2.2
301
+ backports.tarfile==1.2.0
302
+ importlib_metadata==8.0.0
303
+ inflect==7.3.1
304
+ jaraco.collections==5.1.0
305
+ jaraco.context==5.3.0
306
+ jaraco.functools==4.0.1
307
+ jaraco.text==3.12.1
308
+ more-itertools==10.3.0
309
+ packaging==24.2
310
+ platformdirs==4.2.2
311
+ tomli==2.0.1
312
+ typeguard==4.3.0
313
+ typing_extensions==4.12.2
314
+ wheel==0.45.1
315
+ zipp==3.19.2
wandb/run-20251218_183419-wvypkl8w/files/wandb-metadata.json ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "os": "Linux-5.14.0-284.25.1.el9_2.x86_64-x86_64-with-glibc2.35",
3
+ "python": "CPython 3.10.19",
4
+ "startedAt": "2025-12-18T10:34:19.463187Z",
5
+ "args": [
6
+ "--track"
7
+ ],
8
+ "program": "/mnt/general/wanghy/RAGEN/cleanrl/cleanrl/ppo_rubikscube.py",
9
+ "codePath": "cleanrl/cleanrl/ppo_rubikscube.py",
10
+ "codePathLocal": "cleanrl/cleanrl/ppo_rubikscube.py",
11
+ "git": {
12
+ "remote": "https://github.com/mll-lab-nu/RAGEN.git",
13
+ "commit": "8d73639b99b38265453f898b8d6af7d4af50d56e"
14
+ },
15
+ "email": "haoyu-wa22@mails.tsinghua.edu.cn",
16
+ "root": "/mnt/general/wanghy/RAGEN",
17
+ "host": "pt-4d654cf4576f4d23ad3d3919f12932fe-worker-0",
18
+ "executable": "/root/local/miniconda3/envs/ragen/bin/python",
19
+ "cpu_count": 64,
20
+ "cpu_count_logical": 128,
21
+ "gpu": "NVIDIA H100 80GB HBM3",
22
+ "gpu_count": 8,
23
+ "disk": {
24
+ "/": {
25
+ "total": "5153960755200",
26
+ "used": "447541800960"
27
+ }
28
+ },
29
+ "memory": {
30
+ "total": "2163642122240"
31
+ },
32
+ "gpu_nvidia": [
33
+ {
34
+ "name": "NVIDIA H100 80GB HBM3",
35
+ "memoryTotal": "85520809984",
36
+ "cudaCores": 16896,
37
+ "architecture": "Hopper",
38
+ "uuid": "GPU-35e2d43d-4067-82ce-90d4-def9e389bf28"
39
+ },
40
+ {
41
+ "name": "NVIDIA H100 80GB HBM3",
42
+ "memoryTotal": "85520809984",
43
+ "cudaCores": 16896,
44
+ "architecture": "Hopper",
45
+ "uuid": "GPU-af4135e3-88f2-e9ac-518d-502c75a85429"
46
+ },
47
+ {
48
+ "name": "NVIDIA H100 80GB HBM3",
49
+ "memoryTotal": "85520809984",
50
+ "cudaCores": 16896,
51
+ "architecture": "Hopper",
52
+ "uuid": "GPU-d7fdeeba-fe9b-ec03-d9f7-6724fe4266b5"
53
+ },
54
+ {
55
+ "name": "NVIDIA H100 80GB HBM3",
56
+ "memoryTotal": "85520809984",
57
+ "cudaCores": 16896,
58
+ "architecture": "Hopper",
59
+ "uuid": "GPU-ccc4f668-3882-5a8e-2c07-c5cd08f6f666"
60
+ },
61
+ {
62
+ "name": "NVIDIA H100 80GB HBM3",
63
+ "memoryTotal": "85520809984",
64
+ "cudaCores": 16896,
65
+ "architecture": "Hopper",
66
+ "uuid": "GPU-7b73c0cf-d3d5-e10c-7176-a43be1e41001"
67
+ },
68
+ {
69
+ "name": "NVIDIA H100 80GB HBM3",
70
+ "memoryTotal": "85520809984",
71
+ "cudaCores": 16896,
72
+ "architecture": "Hopper",
73
+ "uuid": "GPU-81b58d94-5d1f-8ec2-f9d2-fd56172ed177"
74
+ },
75
+ {
76
+ "name": "NVIDIA H100 80GB HBM3",
77
+ "memoryTotal": "85520809984",
78
+ "cudaCores": 16896,
79
+ "architecture": "Hopper",
80
+ "uuid": "GPU-03e8bc66-3b44-6794-49fd-5392fbdda6d1"
81
+ },
82
+ {
83
+ "name": "NVIDIA H100 80GB HBM3",
84
+ "memoryTotal": "85520809984",
85
+ "cudaCores": 16896,
86
+ "architecture": "Hopper",
87
+ "uuid": "GPU-b7cf0ec6-7c29-1179-dceb-09565da51890"
88
+ }
89
+ ],
90
+ "cudaVersion": "12.4",
91
+ "writerId": "bay0zucrvgh0budvh5sfo6odu02gecuh"
92
+ }
wandb/run-20251218_183419-wvypkl8w/files/wandb-summary.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"_timestamp":1.7660543920527563e+09,"train/old_approx_kl":8.68411734700203e-06,"losses/explained_variance":0.5622017085552216,"losses/policy_loss":-3.0249357223510742e-05,"train/clipfrac":0,"eval/std_return":0.4994821693514194,"train/policy_loss":-3.0249357223510742e-05,"eval/episodes":4000,"rollout/ep_rew_mean":0,"train/value_loss":0.029777294024825096,"eval/avg_return":0.52275,"global_step":999424,"train/learning_rate":2.561475409836034e-07,"charts/SPS":3145,"charts/progress":100,"rollout/ep_len_mean":20,"charts/avg_value":0.21519102156162262,"charts/avg_reward":0.0439453125,"rollout/success_rate":0,"train/success_rate":0.5421686746987951,"train/approx_kl":4.7730281949043274e-08,"losses/value_loss":0.029777294024825096,"train/entropy":0.8965780735015869,"_runtime":331.418744783,"_step":999424,"charts/train_success_rate":0.5421686746987951,"_wandb":{"runtime":331},"perf/SPS":3145,"eval/success_rate":0.52275}
wandb/run-20251218_183419-wvypkl8w/run-wvypkl8w.wandb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:86f0fd4887e69f34f8ff351b143fb12ef67fe287e45a910a42d951c480b15664
3
+ size 26717484
wandb/run-20251218_184253-g8kppnjh/files/code/cleanrl/cleanrl/ppo_rubikscube.py ADDED
@@ -0,0 +1,517 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PPO with small MLP for RAGEN Rubik's Cube 2x2 using the existing env (no env edits)
2
+ import os
3
+ import random
4
+ import time
5
+ from dataclasses import dataclass
6
+ from pathlib import Path
7
+ from typing import Tuple, Dict, Any, List
8
+ import json
9
+ import re
10
+
11
+ import gymnasium as gym
12
+ import numpy as np
13
+ import torch
14
+ import torch.nn as nn
15
+ import torch.optim as optim
16
+ import tyro
17
+ from torch.distributions.categorical import Categorical
18
+
19
+ import sys
20
+ sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../../'))
21
+
22
+ from ragen.env.rubikscube.env import RubiksCube2x2Env
23
+ from ragen.env.rubikscube.config import RubiksCube2x2Config
24
+
25
+
26
+ class RubiksCubeWrapper(gym.Env):
27
+ """
28
+ Adapter to use ragen RubiksCube2x2Env with Gymnasium vector API.
29
+ - Converts text observation to one-hot vector of 24 stickers x 6 colors.
30
+ - Maps agent actions [0..11] to env actions [1..12].
31
+ - Exposes proper observation_space and action_space.
32
+ """
33
+ metadata = {"render_modes": ["rgb_array", "human", "ansi"]}
34
+
35
+ def __init__(self, env: RubiksCube2x2Env):
36
+ super().__init__()
37
+ self._env = env
38
+ # 24 stickers, 6 colors -> one-hot size 144
39
+ self._colors = ['W', 'O', 'G', 'R', 'B', 'Y']
40
+ self._color_to_idx = {c: i for i, c in enumerate(self._colors)}
41
+ self.observation_space = gym.spaces.Box(low=0.0, high=1.0, shape=(24 * len(self._colors),), dtype=np.float32)
42
+ self.action_space = gym.spaces.Discrete(12)
43
+ # precompile regex to extract 4 letters within [X, X]\n [X, X]
44
+ # Lines look like: "Up (U): [W, W]\n [W, W]"
45
+ self._face_pat = re.compile(r"\[(?:\s*([A-Z])\s*,\s*([A-Z])\s*\])\n\s*\[(?:\s*([A-Z])\s*,\s*([A-Z])\s*\])")
46
+
47
+ def _encode_obs(self, text_obs: str) -> np.ndarray:
48
+ # Extract the six face blocks in the order U, L, F, R, B, D as rendered
49
+ faces_order = ["Up (U):", "Left (L):", "Front (F):", "Right (R):", "Back (B):", "Down (D):"]
50
+ onehots: List[int] = []
51
+ # Build a map from header to its block text
52
+ lines = text_obs.splitlines()
53
+ # Collect blocks starting after header line and including the next line for second row
54
+ i = 0
55
+ blocks: List[str] = []
56
+ while i < len(lines):
57
+ line = lines[i]
58
+ for header in faces_order:
59
+ if line.startswith(header):
60
+ # Join current line's bracketed pair and the next line (which contains the second pair)
61
+ # Remove the "Header:" prefix to keep only the bracket portions
62
+ content = line[len(header):].strip()
63
+ next_line = lines[i + 1] if i + 1 < len(lines) else ""
64
+ block = f"{content}\n{next_line}"
65
+ blocks.append(block)
66
+ break
67
+ i += 1
68
+ # Fallback: if regex fails, return zeros
69
+ if len(blocks) != 6:
70
+ return np.zeros(24 * len(self._colors), dtype=np.float32)
71
+ stickers: List[int] = []
72
+ for blk in blocks:
73
+ m = self._face_pat.search(blk)
74
+ if not m:
75
+ return np.zeros(24 * len(self._colors), dtype=np.float32)
76
+ # order: 0,1,2,3 per render() doc
77
+ c0, c1, c2, c3 = m.group(1), m.group(2), m.group(3), m.group(4)
78
+ stickers.extend([c0, c1, c2, c3])
79
+ # stickers now length 24; convert to one-hot
80
+ grid = np.zeros((24, len(self._colors)), dtype=np.float32)
81
+ for idx, ch in enumerate(stickers):
82
+ cidx = self._color_to_idx.get(ch, None)
83
+ if cidx is not None:
84
+ grid[idx, cidx] = 1.0
85
+ return grid.reshape(-1)
86
+
87
+ def reset(self, *, seed: int | None = None, options: Dict[str, Any] | None = None):
88
+ text_obs = self._env.reset(seed=seed)
89
+ obs = self._encode_obs(text_obs)
90
+ return obs, {}
91
+
92
+ def step(self, action: int):
93
+ mapped = int(action) + 1 # 0..11 -> 1..12
94
+ text_obs, reward, done, info = self._env.step(mapped)
95
+ obs = self._encode_obs(text_obs)
96
+ terminated = bool(done)
97
+ truncated = False
98
+ return obs, float(reward), terminated, truncated, info or {}
99
+
100
+ def render(self):
101
+ return self._env.render()
102
+
103
+ def close(self):
104
+ self._env.close()
105
+
106
+
107
+ @dataclass
108
+ class Args:
109
+ exp_name: str = os.path.basename(__file__)[: -len(".py")]
110
+ seed: int = 1
111
+ torch_deterministic: bool = True
112
+ cuda: bool = True
113
+ track: bool = True
114
+ wandb_project_name: str = "cleanRL"
115
+ wandb_entity: str | None = None
116
+ capture_video: bool = False
117
+
118
+ # Algorithm
119
+ env_id: str = "RubiksCube2x2"
120
+ total_timesteps: int = 1000_000
121
+ learning_rate: float = 2.5e-4
122
+ num_envs: int = 8
123
+ num_steps: int = 128
124
+ anneal_lr: bool = True
125
+ gamma: float = 0.99
126
+ gae_lambda: float = 0.95
127
+ num_minibatches: int = 4
128
+ update_epochs: int = 4
129
+ norm_adv: bool = True
130
+ clip_coef: float = 0.2
131
+ clip_vloss: bool = True
132
+ ent_coef: float = 0.01
133
+ vf_coef: float = 0.5
134
+ max_grad_norm: float = 0.5
135
+ target_kl: float | None = None
136
+
137
+ # Rubik specific
138
+ scramble_depth: int = 2
139
+ max_steps_env: int = 20
140
+
141
+ # runtime filled
142
+ batch_size: int = 0
143
+ minibatch_size: int = 0
144
+ num_iterations: int = 0
145
+ eval_splits: int = 2
146
+ eval_episodes: int = 4000
147
+
148
+
149
+ def make_env(idx, run_name, seed, scramble_depth, max_steps_env, capture_video=False):
150
+ def thunk():
151
+ config = RubiksCube2x2Config(scramble_depth=scramble_depth, max_steps=max_steps_env, render_mode='text')
152
+ env = RubiksCube2x2Env(config)
153
+ env = RubiksCubeWrapper(env)
154
+ env = gym.wrappers.TimeLimit(env, max_episode_steps=max_steps_env)
155
+ env = gym.wrappers.RecordEpisodeStatistics(env)
156
+ if capture_video and idx == 0:
157
+ env = gym.wrappers.RecordVideo(env, f"videos/{run_name}")
158
+ return env
159
+ return thunk
160
+
161
+
162
+ def layer_init(layer, std=np.sqrt(2), bias_const=0.0):
163
+ torch.nn.init.orthogonal_(layer.weight, std)
164
+ torch.nn.init.constant_(layer.bias, bias_const)
165
+ return layer
166
+
167
+
168
+ class Agent(nn.Module):
169
+ def __init__(self, envs):
170
+ super().__init__()
171
+ obs_shape = int(np.array(envs.single_observation_space.shape).prod())
172
+ hidden = 128
173
+ self.critic = nn.Sequential(
174
+ layer_init(nn.Linear(obs_shape, hidden)),
175
+ nn.Tanh(),
176
+ layer_init(nn.Linear(hidden, hidden)),
177
+ nn.Tanh(),
178
+ layer_init(nn.Linear(hidden, 1), std=1.0),
179
+ )
180
+ self.actor = nn.Sequential(
181
+ layer_init(nn.Linear(obs_shape, hidden)),
182
+ nn.Tanh(),
183
+ layer_init(nn.Linear(hidden, hidden)),
184
+ nn.Tanh(),
185
+ layer_init(nn.Linear(hidden, envs.single_action_space.n), std=0.01),
186
+ )
187
+
188
+ def get_value(self, x):
189
+ return self.critic(x)
190
+
191
+ def get_action_and_value(self, x, action=None):
192
+ logits = self.actor(x)
193
+ probs = Categorical(logits=logits)
194
+ if action is None:
195
+ action = probs.sample()
196
+ return action, probs.log_prob(action), probs.entropy(), self.critic(x)
197
+
198
+
199
+ if __name__ == "__main__":
200
+ args = tyro.cli(Args)
201
+ args.batch_size = int(args.num_envs * args.num_steps)
202
+ args.minibatch_size = int(args.batch_size // args.num_minibatches)
203
+ args.num_iterations = args.total_timesteps // args.batch_size
204
+ run_name = f"{args.env_id}__{args.exp_name}__{args.seed}__{int(time.time())}"
205
+
206
+ if args.track:
207
+ import wandb
208
+ wandb.init(
209
+ project=args.wandb_project_name,
210
+ entity=args.wandb_entity,
211
+ config=vars(args),
212
+ name=run_name,
213
+ monitor_gym=True,
214
+ save_code=True,
215
+ )
216
+ try:
217
+ wandb.define_metric("global_step")
218
+ for prefix in ["train/*", "rollout/*", "eval/*", "losses/*", "charts/*", "perf/*"]:
219
+ wandb.define_metric(prefix, step_metric="global_step")
220
+ except Exception:
221
+ pass
222
+
223
+ # seeding
224
+ random.seed(args.seed)
225
+ np.random.seed(args.seed)
226
+ torch.manual_seed(args.seed)
227
+ torch.backends.cudnn.deterministic = args.torch_deterministic
228
+
229
+ device = torch.device("cuda" if torch.cuda.is_available() and args.cuda else "cpu")
230
+
231
+ # envs
232
+ envs = gym.vector.SyncVectorEnv([
233
+ make_env(i, run_name, args.seed, args.scramble_depth, args.max_steps_env, args.capture_video)
234
+ for i in range(args.num_envs)
235
+ ])
236
+ assert isinstance(envs.single_action_space, gym.spaces.Discrete)
237
+
238
+ agent = Agent(envs).to(device)
239
+ optimizer = optim.Adam(agent.parameters(), lr=args.learning_rate, eps=1e-5)
240
+
241
+ # storage
242
+ obs = torch.zeros((args.num_steps, args.num_envs) + envs.single_observation_space.shape).to(device)
243
+ actions = torch.zeros((args.num_steps, args.num_envs) + envs.single_action_space.shape).to(device)
244
+ logprobs = torch.zeros((args.num_steps, args.num_envs)).to(device)
245
+ rewards = torch.zeros((args.num_steps, args.num_envs)).to(device)
246
+ dones = torch.zeros((args.num_steps, args.num_envs)).to(device)
247
+ values = torch.zeros((args.num_steps, args.num_envs)).to(device)
248
+
249
+ # start
250
+ global_step = 0
251
+ start_time = time.time()
252
+ next_obs, _ = envs.reset(seed=args.seed)
253
+ next_obs = torch.Tensor(next_obs).to(device)
254
+ next_done = torch.zeros(args.num_envs).to(device)
255
+
256
+ # eval helper similar to FrozenLake: collect greedy eval trajectories and write metrics.json
257
+ def collect_eval_trajectories(agent_model, make_env_fn, n_episodes, step_tag):
258
+ out_dir = Path(f"runs/{run_name}/trajectories/step_{step_tag}")
259
+ out_dir.mkdir(parents=True, exist_ok=True)
260
+ out_path = out_dir / "trajectories.jsonl"
261
+ env = make_env_fn()
262
+ collected = 0
263
+ summary_returns = []
264
+ summary_success = []
265
+ with out_path.open("w") as f:
266
+ while collected < n_episodes:
267
+ state, _ = env.reset(seed=args.seed + 100000 + collected)
268
+ traj_states = [state.tolist()]
269
+ traj_actions = []
270
+ traj_rewards = []
271
+ traj_dones = []
272
+ traj_success = []
273
+ done = False
274
+ step_count = 0
275
+ max_eval_steps = getattr(env, '_max_episode_steps', None) or int(args.max_steps_env)
276
+ while not done:
277
+ with torch.no_grad():
278
+ logits = agent_model.actor(torch.tensor(state, dtype=torch.float32, device=device).unsqueeze(0))
279
+ action = int(torch.argmax(logits, dim=1).item())
280
+ next_state, reward, terminated, truncated, info = env.step(action)
281
+ traj_actions.append(int(action))
282
+ traj_rewards.append(float(reward))
283
+ step_count += 1
284
+ d = bool(terminated) or bool(truncated) or (step_count >= max_eval_steps)
285
+ traj_dones.append(d)
286
+ traj_success.append(bool((info or {}).get('success', False)))
287
+ state = next_state
288
+ traj_states.append(state.tolist())
289
+ done = d
290
+ ep_ret = float(sum(traj_rewards))
291
+ ep_succ = bool(any(traj_success))
292
+ record = {
293
+ "states": traj_states,
294
+ "actions": traj_actions,
295
+ "rewards": traj_rewards,
296
+ "dones": traj_dones,
297
+ "success": traj_success,
298
+ "episode_return": ep_ret,
299
+ "episode_success": ep_succ,
300
+ }
301
+ f.write(json.dumps(record) + "\n")
302
+ collected += 1
303
+ summary_returns.append(ep_ret)
304
+ summary_success.append(1.0 if ep_succ else 0.0)
305
+ env.close()
306
+ try:
307
+ metrics = {
308
+ "global_step": int(step_tag),
309
+ "episodes": int(n_episodes),
310
+ "success_rate": float(np.mean(summary_success)) if len(summary_success) else 0.0,
311
+ "avg_return": float(np.mean(summary_returns)) if len(summary_returns) else 0.0,
312
+ "std_return": float(np.std(summary_returns)) if len(summary_returns) else 0.0,
313
+ }
314
+ with (out_dir / "metrics.json").open("w") as mf:
315
+ json.dump(metrics, mf)
316
+ except Exception as e:
317
+ print(f"Warning: failed to write eval metrics: {e}")
318
+
319
+ # training loop
320
+ eval_every_iters = max(1, args.num_iterations // args.eval_splits)
321
+ for iteration in range(1, args.num_iterations + 1):
322
+ # Anneal LR
323
+ if args.anneal_lr:
324
+ frac = 1.0 - (iteration - 1.0) / args.num_iterations
325
+ lrnow = frac * args.learning_rate
326
+ optimizer.param_groups[0]["lr"] = lrnow
327
+
328
+ # accumulate per-iteration episode successes
329
+ iter_successes = []
330
+ for step in range(0, args.num_steps):
331
+ global_step += args.num_envs
332
+ obs[step] = next_obs
333
+ dones[step] = next_done
334
+
335
+ with torch.no_grad():
336
+ action, logprob, _, value = agent.get_action_and_value(next_obs)
337
+ values[step] = value.flatten()
338
+ actions[step] = action
339
+ logprobs[step] = logprob
340
+
341
+ next_obs, reward, terminations, truncations, infos = envs.step(action.cpu().numpy())
342
+ next_done = np.logical_or(terminations, truncations)
343
+ rewards[step] = torch.tensor(reward).to(device).view(-1)
344
+ next_obs, next_done = torch.Tensor(next_obs).to(device), torch.Tensor(next_done).to(device)
345
+
346
+ # Episode stats logging similar to FrozenLake
347
+ try:
348
+ mask = None
349
+ if isinstance(infos, dict):
350
+ if "_episode" in infos:
351
+ mask = np.asarray(infos["_episode"]).astype(bool)
352
+ elif "episode" in infos and isinstance(infos["episode"], dict) and "_l" in infos["episode"]:
353
+ mask = np.asarray(infos["episode"]["_l"]).astype(bool)
354
+ if mask is not None and np.any(mask):
355
+ r_arr = np.asarray(infos.get("episode", {}).get("r", np.zeros_like(mask, dtype=float)))
356
+ l_arr = np.asarray(infos.get("episode", {}).get("l", np.zeros_like(mask, dtype=int)))
357
+ # prefer success from info; fallback to ep return > 0
358
+ if "success" in infos:
359
+ succ_arr = np.asarray(infos.get("success", np.zeros_like(mask, dtype=bool))).astype(float)
360
+ else:
361
+ try:
362
+ succ_arr = (np.asarray(r_arr) > 0).astype(float)
363
+ except Exception:
364
+ succ_arr = np.zeros_like(mask, dtype=float)
365
+ # collect iteration successes for training success rate
366
+ try:
367
+ for s in np.asarray(succ_arr)[mask]:
368
+ iter_successes.append(float(s))
369
+ except Exception:
370
+ pass
371
+ if args.track:
372
+ try:
373
+ import wandb
374
+ log_dict = {
375
+ "global_step": int(global_step),
376
+ "rollout/ep_rew_mean": float(np.mean(r_arr[mask])) if np.any(mask) else None,
377
+ "rollout/ep_len_mean": float(np.mean(l_arr[mask])) if np.any(mask) else None,
378
+ "rollout/success_rate": float(np.mean(succ_arr[mask])) if np.any(mask) else None,
379
+ }
380
+ wandb.log(log_dict, step=global_step)
381
+ except Exception:
382
+ pass
383
+ except Exception:
384
+ pass
385
+
386
+ # GAE
387
+ with torch.no_grad():
388
+ next_value = agent.get_value(next_obs).reshape(1, -1)
389
+ advantages = torch.zeros_like(rewards).to(device)
390
+ lastgaelam = 0
391
+ for t in reversed(range(args.num_steps)):
392
+ if t == args.num_steps - 1:
393
+ nextnonterminal = 1.0 - next_done
394
+ nextvalues = next_value
395
+ else:
396
+ nextnonterminal = 1.0 - dones[t + 1]
397
+ nextvalues = values[t + 1]
398
+ delta = rewards[t] + args.gamma * nextvalues * nextnonterminal - values[t]
399
+ advantages[t] = lastgaelam = delta + args.gamma * args.gae_lambda * nextnonterminal * lastgaelam
400
+ returns = advantages + values
401
+
402
+ # flatten batch
403
+ b_obs = obs.reshape((-1,) + envs.single_observation_space.shape)
404
+ b_logprobs = logprobs.reshape(-1)
405
+ b_actions = actions.reshape((-1,) + envs.single_action_space.shape)
406
+ b_advantages = advantages.reshape(-1)
407
+ b_returns = returns.reshape(-1)
408
+ b_values = values.reshape(-1)
409
+
410
+ # update
411
+ b_inds = np.arange(args.batch_size)
412
+ clipfracs = []
413
+ for epoch in range(args.update_epochs):
414
+ np.random.shuffle(b_inds)
415
+ for start in range(0, args.batch_size, args.minibatch_size):
416
+ end = start + args.minibatch_size
417
+ mb_inds = b_inds[start:end]
418
+
419
+ _, newlogprob, entropy, newvalue = agent.get_action_and_value(b_obs[mb_inds], b_actions.long()[mb_inds])
420
+ logratio = newlogprob - b_logprobs[mb_inds]
421
+ ratio = logratio.exp()
422
+
423
+ with torch.no_grad():
424
+ old_approx_kl = (-logratio).mean()
425
+ approx_kl = ((ratio - 1) - logratio).mean()
426
+ clipfracs += [((ratio - 1.0).abs() > args.clip_coef).float().mean().item()]
427
+
428
+ mb_advantages = b_advantages[mb_inds]
429
+ if args.norm_adv:
430
+ mb_advantages = (mb_advantages - mb_advantages.mean()) / (mb_advantages.std() + 1e-8)
431
+
432
+ pg_loss1 = -mb_advantages * ratio
433
+ pg_loss2 = -mb_advantages * torch.clamp(ratio, 1 - args.clip_coef, 1 + args.clip_coef)
434
+ pg_loss = torch.max(pg_loss1, pg_loss2).mean()
435
+
436
+ newvalue = newvalue.view(-1)
437
+ if args.clip_vloss:
438
+ v_loss_unclipped = (newvalue - b_returns[mb_inds]) ** 2
439
+ v_clipped = b_values[mb_inds] + torch.clamp(
440
+ newvalue - b_values[mb_inds], -args.clip_coef, args.clip_coef,
441
+ )
442
+ v_loss_clipped = (v_clipped - b_returns[mb_inds]) ** 2
443
+ v_loss = 0.5 * torch.max(v_loss_unclipped, v_loss_clipped).mean()
444
+ else:
445
+ v_loss = 0.5 * ((newvalue - b_returns[mb_inds]) ** 2).mean()
446
+
447
+ entropy_loss = entropy.mean()
448
+ loss = pg_loss - args.ent_coef * entropy_loss + v_loss * args.vf_coef
449
+
450
+ optimizer.zero_grad()
451
+ loss.backward()
452
+ nn.utils.clip_grad_norm_(agent.parameters(), args.max_grad_norm)
453
+ optimizer.step()
454
+
455
+ if args.target_kl is not None and approx_kl > args.target_kl:
456
+ break
457
+
458
+ # metrics
459
+ y_pred, y_true = b_values.cpu().numpy(), b_returns.cpu().numpy()
460
+ var_y = np.var(y_true)
461
+ explained_var = np.nan if var_y == 0 else 1 - np.var(y_true - y_pred) / var_y
462
+
463
+ sps = int(global_step / (time.time() - start_time))
464
+ train_success_rate = float(np.mean(iter_successes)) if len(iter_successes) else 0.0
465
+ print(f"Iter {iteration:4d}/{args.num_iterations} | SPS: {sps:5d} | R: {rewards.mean().item():6.3f}")
466
+ if args.track:
467
+ try:
468
+ import wandb
469
+ wandb.log({
470
+ "global_step": int(global_step),
471
+ "charts/progress": float(100.0 * iteration / max(1, args.num_iterations)),
472
+ "train/value_loss": float(v_loss.item()),
473
+ "train/policy_loss": float(pg_loss.item()),
474
+ "losses/value_loss": float(v_loss.item()),
475
+ "losses/policy_loss": float(pg_loss.item()),
476
+ "train/entropy": float(entropy_loss.item()),
477
+ "train/old_approx_kl": float(old_approx_kl.item()),
478
+ "train/approx_kl": float(approx_kl.item()),
479
+ "train/clipfrac": float(np.mean(clipfracs)) if len(clipfracs) else 0.0,
480
+ "losses/explained_variance": float(explained_var),
481
+ "charts/avg_reward": float(rewards.mean().item()),
482
+ "charts/avg_value": float(values.mean().item()),
483
+ "perf/SPS": int(sps),
484
+ "charts/SPS": int(sps),
485
+ "train/success_rate": train_success_rate,
486
+ "charts/train_success_rate": train_success_rate,
487
+ "train/learning_rate": float(optimizer.param_groups[0]["lr"]),
488
+ }, step=global_step)
489
+ except Exception:
490
+ pass
491
+
492
+ # periodic evaluation collection
493
+ if iteration % eval_every_iters == 0:
494
+ try:
495
+ eval_thunk = make_env(0, run_name, args.seed + 9999, args.scramble_depth, args.max_steps_env, False)
496
+ collect_eval_trajectories(agent, eval_thunk, n_episodes=args.eval_episodes, step_tag=global_step)
497
+ if args.track:
498
+ try:
499
+ import json as _json
500
+ from pathlib import Path as _Path
501
+ mpath = _Path(f"runs/{run_name}/trajectories/step_{global_step}/metrics.json")
502
+ if mpath.exists():
503
+ with mpath.open("r") as mf:
504
+ metrics = _json.load(mf)
505
+ wandb.log({
506
+ "eval/success_rate": metrics.get("success_rate"),
507
+ "eval/avg_return": metrics.get("avg_return"),
508
+ "eval/std_return": metrics.get("std_return"),
509
+ "eval/episodes": metrics.get("episodes"),
510
+ }, step=global_step)
511
+ except Exception:
512
+ pass
513
+ print(f"Collected {args.eval_episodes} eval trajectories at global_step {global_step}")
514
+ except Exception as e:
515
+ print(f"Warning: eval trajectory collection failed at step {global_step}: {e}")
516
+
517
+ envs.close()
wandb/run-20251218_184253-g8kppnjh/files/config.yaml ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _wandb:
2
+ value:
3
+ cli_version: 0.23.0
4
+ code_path: code/cleanrl/cleanrl/ppo_rubikscube.py
5
+ e:
6
+ xtmqsnhbpijxn98k1keqte2hruuy3myj:
7
+ args:
8
+ - --track
9
+ codePath: cleanrl/cleanrl/ppo_rubikscube.py
10
+ codePathLocal: cleanrl/cleanrl/ppo_rubikscube.py
11
+ cpu_count: 64
12
+ cpu_count_logical: 128
13
+ cudaVersion: "12.4"
14
+ disk:
15
+ /:
16
+ total: "5153960755200"
17
+ used: "447529222144"
18
+ email: haoyu-wa22@mails.tsinghua.edu.cn
19
+ executable: /root/local/miniconda3/envs/ragen/bin/python
20
+ git:
21
+ commit: 8d73639b99b38265453f898b8d6af7d4af50d56e
22
+ remote: https://github.com/mll-lab-nu/RAGEN.git
23
+ gpu: NVIDIA H100 80GB HBM3
24
+ gpu_count: 8
25
+ gpu_nvidia:
26
+ - architecture: Hopper
27
+ cudaCores: 16896
28
+ memoryTotal: "85520809984"
29
+ name: NVIDIA H100 80GB HBM3
30
+ uuid: GPU-35e2d43d-4067-82ce-90d4-def9e389bf28
31
+ - architecture: Hopper
32
+ cudaCores: 16896
33
+ memoryTotal: "85520809984"
34
+ name: NVIDIA H100 80GB HBM3
35
+ uuid: GPU-af4135e3-88f2-e9ac-518d-502c75a85429
36
+ - architecture: Hopper
37
+ cudaCores: 16896
38
+ memoryTotal: "85520809984"
39
+ name: NVIDIA H100 80GB HBM3
40
+ uuid: GPU-d7fdeeba-fe9b-ec03-d9f7-6724fe4266b5
41
+ - architecture: Hopper
42
+ cudaCores: 16896
43
+ memoryTotal: "85520809984"
44
+ name: NVIDIA H100 80GB HBM3
45
+ uuid: GPU-ccc4f668-3882-5a8e-2c07-c5cd08f6f666
46
+ - architecture: Hopper
47
+ cudaCores: 16896
48
+ memoryTotal: "85520809984"
49
+ name: NVIDIA H100 80GB HBM3
50
+ uuid: GPU-7b73c0cf-d3d5-e10c-7176-a43be1e41001
51
+ - architecture: Hopper
52
+ cudaCores: 16896
53
+ memoryTotal: "85520809984"
54
+ name: NVIDIA H100 80GB HBM3
55
+ uuid: GPU-81b58d94-5d1f-8ec2-f9d2-fd56172ed177
56
+ - architecture: Hopper
57
+ cudaCores: 16896
58
+ memoryTotal: "85520809984"
59
+ name: NVIDIA H100 80GB HBM3
60
+ uuid: GPU-03e8bc66-3b44-6794-49fd-5392fbdda6d1
61
+ - architecture: Hopper
62
+ cudaCores: 16896
63
+ memoryTotal: "85520809984"
64
+ name: NVIDIA H100 80GB HBM3
65
+ uuid: GPU-b7cf0ec6-7c29-1179-dceb-09565da51890
66
+ host: pt-4d654cf4576f4d23ad3d3919f12932fe-worker-0
67
+ memory:
68
+ total: "2163642122240"
69
+ os: Linux-5.14.0-284.25.1.el9_2.x86_64-x86_64-with-glibc2.35
70
+ program: /mnt/general/wanghy/RAGEN/cleanrl/cleanrl/ppo_rubikscube.py
71
+ python: CPython 3.10.19
72
+ root: /mnt/general/wanghy/RAGEN
73
+ startedAt: "2025-12-18T10:42:53.636495Z"
74
+ writerId: xtmqsnhbpijxn98k1keqte2hruuy3myj
75
+ m:
76
+ - "1": global_step
77
+ "6":
78
+ - 3
79
+ "7": []
80
+ - "2": train/*
81
+ "5": 1
82
+ "6":
83
+ - 1
84
+ "7": []
85
+ - "2": rollout/*
86
+ "5": 1
87
+ "6":
88
+ - 1
89
+ "7": []
90
+ - "2": eval/*
91
+ "5": 1
92
+ "6":
93
+ - 1
94
+ "7": []
95
+ - "2": losses/*
96
+ "5": 1
97
+ "6":
98
+ - 1
99
+ "7": []
100
+ - "2": charts/*
101
+ "5": 1
102
+ "6":
103
+ - 1
104
+ "7": []
105
+ - "2": perf/*
106
+ "5": 1
107
+ "6":
108
+ - 1
109
+ "7": []
110
+ python_version: 3.10.19
111
+ t:
112
+ "1":
113
+ - 1
114
+ - 11
115
+ - 30
116
+ - 49
117
+ - 50
118
+ - 51
119
+ - 105
120
+ "2":
121
+ - 1
122
+ - 11
123
+ - 30
124
+ - 49
125
+ - 50
126
+ - 51
127
+ - 105
128
+ "3":
129
+ - 7
130
+ - 13
131
+ - 16
132
+ - 61
133
+ "4": 3.10.19
134
+ "5": 0.23.0
135
+ "6": 4.57.1
136
+ "12": 0.23.0
137
+ "13": linux-x86_64
138
+ anneal_lr:
139
+ value: true
140
+ batch_size:
141
+ value: 1024
142
+ capture_video:
143
+ value: false
144
+ clip_coef:
145
+ value: 0.2
146
+ clip_vloss:
147
+ value: true
148
+ cuda:
149
+ value: true
150
+ ent_coef:
151
+ value: 0.01
152
+ env_id:
153
+ value: RubiksCube2x2
154
+ eval_episodes:
155
+ value: 4000
156
+ eval_splits:
157
+ value: 2
158
+ exp_name:
159
+ value: ppo_rubikscube
160
+ gae_lambda:
161
+ value: 0.95
162
+ gamma:
163
+ value: 0.99
164
+ learning_rate:
165
+ value: 0.00025
166
+ max_grad_norm:
167
+ value: 0.5
168
+ max_steps_env:
169
+ value: 20
170
+ minibatch_size:
171
+ value: 256
172
+ norm_adv:
173
+ value: true
174
+ num_envs:
175
+ value: 8
176
+ num_iterations:
177
+ value: 976
178
+ num_minibatches:
179
+ value: 4
180
+ num_steps:
181
+ value: 128
182
+ scramble_depth:
183
+ value: 2
184
+ seed:
185
+ value: 1
186
+ target_kl:
187
+ value: null
188
+ torch_deterministic:
189
+ value: true
190
+ total_timesteps:
191
+ value: 1000000
192
+ track:
193
+ value: true
194
+ update_epochs:
195
+ value: 4
196
+ vf_coef:
197
+ value: 0.5
198
+ wandb_entity:
199
+ value: null
200
+ wandb_project_name:
201
+ value: cleanRL
wandb/run-20251218_184253-g8kppnjh/files/diff.patch ADDED
@@ -0,0 +1,1162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/config/base.yaml b/config/base.yaml
2
+ index a1659e4..9df6250 100644
3
+ --- a/config/base.yaml
4
+ +++ b/config/base.yaml
5
+ @@ -9,15 +9,16 @@ seed:
6
+ train: 10000
7
+ val: 123
8
+
9
+ -micro_batch_size_per_gpu: 4
10
+ +micro_batch_size_per_gpu: 1
11
+ ppo_mini_batch_size: 32
12
+ -model_path: Qwen/Qwen2.5-3B-Instruct
13
+ +model_path: /mnt/general/share/model/Qwen/Qwen2.5-0.5B-Instruct
14
+ +# Qwen/Qwen2.5-0.5B-Instruct
15
+ enable_response_mask: True # Enabling response mask could improve stability of rollout/old_log_prob, as P(st|history) are no longer calculated in loss here. See https://docs.google.com/document/d/1bg7obeiKTExuHHBl5uOiSpec5uLDZ2Tgvxy6li5pHX4/edit?usp=sharing for more details.
16
+ grpo_advantage_length_weight: False # if you do not enable this and critic/advantage_estimator is GRPO, and the critic/advantages/mean is too low, then you can try enabling this to encourage reasoning and forbid collapse
17
+
18
+ lora:
19
+ rank: 0
20
+ - alpha: 64
21
+ + alpha: 16
22
+ target_modules: all-linear
23
+
24
+ actor_rollout_ref:
25
+ @@ -46,10 +47,10 @@ actor_rollout_ref:
26
+ name: vllm
27
+ log_prob_micro_batch_size_per_gpu: ${micro_batch_size_per_gpu} # following micro_batch_size_per_gpu
28
+ tensor_model_parallel_size: 1
29
+ - max_model_len: 3600
30
+ + max_model_len: 7200 #3600 why** 14400
31
+ prompt_length: 1 # useless. Just put it here
32
+ response_length: 400 # single-turn response length
33
+ - gpu_memory_utilization: 0.5
34
+ + gpu_memory_utilization: 0.7
35
+ max_num_batched_tokens: 8192 # set only when enable_chunked_prefill is true
36
+ temperature: 1
37
+ rollout_filter_ratio: 0.25
38
+ @@ -90,26 +91,28 @@ algorithm:
39
+ kl_coef: 0.000
40
+
41
+ trainer:
42
+ - project_name: ragen_latest
43
+ + project_name:
44
+ experiment_name: test
45
+ local_log_dir: "results/"
46
+ - save_freq: 100
47
+ + save_freq: -1
48
+ total_training_steps: 200
49
+ validation_steps: 1 # validation instances = validation_steps * val_env_groups * group_size
50
+ val_before_train: True
51
+ n_gpus_per_node: 1
52
+ test_freq: 10
53
+ generations_to_log_to_wandb:
54
+ + train: 128
55
+ val: 20
56
+ logger: [ 'console', 'wandb' ]
57
+ max_actor_ckpt_to_keep: 1
58
+ max_critic_ckpt_to_keep: 1
59
+ + default_local_dir: /mnt/general/wanghy/RAGEN/saves/
60
+
61
+ agent_proxy:
62
+ max_context_window: -1 # set a value > 0 to enable context window for long trajectory
63
+ - max_turn: 5
64
+ + max_turn: 25 #25 why** 700
65
+ action_sep: "||"
66
+ - max_actions_per_turn: 2 # how many actions can be output at most in a single turn
67
+ + max_actions_per_turn: 1 # how many actions can be output at most in a single turn
68
+ use_turn_scores: False # important to GAE when applying token-level rewards to token-level advantages. If False, will take the sum of scores as the reward for the last turn.
69
+ enable_think: True # False -> no think RL
70
+ reward_normalization:
71
+ @@ -126,11 +129,11 @@ es_manager:
72
+ tags: ["CoordSokoban"]
73
+ n_groups: [8] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
74
+ val:
75
+ - env_groups: 32
76
+ - group_size: 16 # should be set to 1 because when val temperature is set to 0 and group size > 1, there will be repetitive prompts which leads to same trajectory.
77
+ + env_groups: 256
78
+ + group_size: 1 # should be set to 1 because when val temperature is set to 0 and group size > 1, there will be repetitive prompts which leads to same trajectory.
79
+ env_configs:
80
+ tags: ["CoordSokoban"]
81
+ - n_groups: [32] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
82
+ + n_groups: [256] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
83
+
84
+ ctx_manager:
85
+ generation: # go to vllm
86
+ diff --git a/config/envs.yaml b/config/envs.yaml
87
+ index 1002ac8..ba3ac6f 100644
88
+ --- a/config/envs.yaml
89
+ +++ b/config/envs.yaml
90
+ @@ -2,6 +2,7 @@ custom_envs:
91
+ SimpleSokoban:
92
+ env_type: sokoban
93
+ max_actions_per_traj: 10 # used in environment state manager to control the actual max actions executed per trajectory
94
+ + # ORIGNAL env_instruction
95
+ env_instruction: |
96
+ You are solving the Sokoban puzzle.
97
+ You are the player and you need to push all boxes to targets.
98
+ @@ -12,7 +13,7 @@ custom_envs:
99
+ env_config: # keys should be a subset of SokobanConfig
100
+ dim_x: 6
101
+ dim_y: 6
102
+ - num_boxes: 1
103
+ + num_boxes: 2
104
+ max_steps: 100
105
+
106
+ LargerSokoban:
107
+ @@ -65,7 +66,7 @@ custom_envs:
108
+ env_config: # keys should be a subset of SokobanConfig
109
+ dim_x: 6
110
+ dim_y: 6
111
+ - num_boxes: 1
112
+ + num_boxes: 2
113
+ max_steps: 100
114
+ observation_format: "grid_coord"
115
+
116
+ @@ -111,14 +112,14 @@ custom_envs:
117
+
118
+ FrozenLake:
119
+ env_type: frozen_lake
120
+ - max_actions_per_traj: 10
121
+ + max_actions_per_traj: 25
122
+ env_instruction: "You are solving the FrozenLake puzzle. Forbid the whole and go to the target. You may move to the unintended direction due to the slippery ice. Example answer format: <think>To forbid the hole and go to the target, I should go left then go up.</think><answer>Left || Up</answer>"
123
+ max_tokens: 100
124
+ env_config: null
125
+
126
+ CoordFrozenLake:
127
+ env_type: frozen_lake
128
+ - max_actions_per_traj: 10
129
+ + max_actions_per_traj: 25
130
+ env_instruction: |
131
+ You are solving the FrozenLake puzzle. The observation includes both a symbol grid and zero-indexed coordinates for the start, goal, player, and any holes.
132
+ Coordinates range from the top-left corner (0, 0) to the bottom-right corner (5, 5).
133
+ @@ -195,4 +196,80 @@ custom_envs:
134
+ max_actions_per_traj: 30
135
+ env_instruction: "You are a Lean theorem prover. Given a Lean theorem statement, propose a sequence of tactics that completes the proof. Think step by step about which tactics to apply next. Provide tactics separated by '||', for example <answer>intro || simp || rfl</answer>."
136
+ max_tokens: 512
137
+ - env_config: null # Please refer to ragen/env/lean/config.py for a full list of parameters.
138
+
139
+ + env_config: null # Please refer to ragen/env/lean/config.py for a full list of parameters.
140
+ +
141
+ +
142
+ + game_2048:
143
+ + env_type: game_2048
144
+ + max_actions_per_traj: 700
145
+ + env_instruction: |
146
+ + You are playing the 2048 game on a 4x4 grid. Merge equal tiles by sliding Up, Right, Down, or Left.
147
+ + If a move is invalid (no tiles move), a small penalty is applied. Respond with a single action.
148
+ + Example: <answer>Up</answer>
149
+ + max_tokens: 8192
150
+ + env_config: null
151
+ +
152
+ + blackjack:
153
+ + env_type: blackjack
154
+ + max_actions_per_traj: 10
155
+ + env_instruction: |
156
+ + You are playing Blackjack against a dealer. The dealer must hit on 16 or less and stand on 17 or more.
157
+ + Choose either Stick or Hit. Respond with a single action.
158
+ + Example: <answer>Hit</answer>
159
+ + max_tokens: 64
160
+ + env_config: null
161
+ +
162
+ + rubikscube:
163
+ + env_type: rubikscube
164
+ + max_actions_per_traj: 20
165
+ + env_instruction: |
166
+ + You are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.
167
+ + Available actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.
168
+ + - Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).
169
+ + - Modifiers: A letter alone means 90° clockwise (e.g., 'R'). A letter with prime (') means 90° counter-clockwise (e.g., "R'").
170
+ + Respond with a sequence of actions separated by "||".
171
+ + Example: <answer>U</answer>
172
+ + max_tokens: 96
173
+ + env_config:
174
+ + scramble_depth: 1
175
+ + max_steps: 20
176
+ + render_mode: "text"
177
+ +
178
+ + SimpleSudoku:
179
+ + env_type: sudoku
180
+ + max_actions_per_traj: 20
181
+ + env_instruction: |
182
+ + You are solving a Sudoku puzzle. Fill in the grid so that every row, column, and 2x2 box contains the numbers 1-4 without repetition.
183
+ + Initial cells are shown in [brackets] and cannot be modified. Empty cells are shown as dots (.).
184
+ + Place numbers one at a time using the format, for example: <answer>place 1 at row 2 col 3</answer> or <answer>1,2,3</answer>
185
+ + The environment will provide feedback on valid/invalid moves and show conflicts if any occur.
186
+ + max_tokens: 150
187
+ + parallel_friendly: false
188
+ + max_workers: 32
189
+ + env_config:
190
+ + grid_size: 4
191
+ + difficulty: "easy"
192
+ + render_format: "with_feedback"
193
+ + show_conflicts: false
194
+ + show_valid_numbers: false
195
+ + max_steps: 20
196
+ +
197
+ + MediumSudoku:
198
+ + env_type: sudoku
199
+ + max_actions_per_traj: 30
200
+ + env_instruction: |
201
+ + You are solving a Sudoku puzzle. Fill in the grid so that every row, column, and 3x3 box contains the numbers 1-9 without repetition.
202
+ + Initial cells are shown in [brackets] and cannot be modified. Empty cells are shown as dots (.).
203
+ + Place numbers one at a time using the format: <answer>place 5 at row 2 col 3</answer> or <answer>2,3,5</answer>
204
+ + The environment will provide feedback on valid/invalid moves and show conflicts if any occur.
205
+ + max_tokens: 150
206
+ + parallel_friendly: false
207
+ + max_workers: 32
208
+ + env_config:
209
+ + grid_size: 9
210
+ + difficulty: "medium"
211
+ + render_format: "with_feedback"
212
+ + show_conflicts: true
213
+ + show_valid_numbers: true
214
+ + max_steps: 81
215
+ +
216
+ diff --git a/config/eval.yaml b/config/eval.yaml
217
+ index e65f3a5..7775fd1 100644
218
+ --- a/config/eval.yaml
219
+ +++ b/config/eval.yaml
220
+ @@ -1,14 +1,15 @@
221
+ defaults:
222
+ - envs
223
+ -
224
+ +enable_response_mask: True
225
+ system:
226
+ - CUDA_VISIBLE_DEVICES: "0"
227
+ + CUDA_VISIBLE_DEVICES: "0,1,2,3,4,5,6,7"
228
+
229
+ seed:
230
+ train: 10000
231
+ val: 123
232
+
233
+ -model_path: Qwen/Qwen2.5-3B-Instruct
234
+ +model_path: /mnt/general/share/model/openai/gpt-oss-20b
235
+ +# /mnt/general/share/model/tyzhu/SPA-frozenlake-qwen2.5-1.5b-instruct
236
+
237
+ lora:
238
+ rank: 0
239
+ @@ -24,9 +25,9 @@ actor_rollout_ref:
240
+ rollout:
241
+ name: vllm
242
+ log_prob_micro_batch_size_per_gpu: ${micro_batch_size_per_gpu}
243
+ - tensor_model_parallel_size: 1
244
+ + tensor_model_parallel_size: 8
245
+ dtype: bfloat16
246
+ - max_model_len: 3600
247
+ + max_model_len: 7200
248
+ prompt_length: 1
249
+ response_length: 400
250
+ gpu_memory_utilization: 0.9
251
+ @@ -35,6 +36,7 @@ actor_rollout_ref:
252
+ free_cache_engine: True
253
+ enable_chunked_prefill: False
254
+ disable_log_stats: False
255
+ + do_sample: True
256
+ val_kwargs:
257
+ do_sample: True
258
+ temperature: 0.5
259
+ @@ -44,9 +46,9 @@ actor_rollout_ref:
260
+
261
+ agent_proxy:
262
+ max_context_window: -1
263
+ - max_turn: 5
264
+ + max_turn: 25
265
+ action_sep: "||"
266
+ - max_actions_per_turn: 2
267
+ + max_actions_per_turn: 1
268
+ use_turn_scores: False
269
+ enable_think: True
270
+ reward_normalization:
271
+ @@ -59,13 +61,13 @@ es_manager:
272
+ env_groups: 8
273
+ group_size: 16
274
+ env_configs:
275
+ - tags: ["CoordSokoban"]
276
+ + tags: ["BanditTest"]
277
+ n_groups: [8]
278
+ val:
279
+ env_groups: 32
280
+ - group_size: 16
281
+ + group_size: 128
282
+ env_configs:
283
+ - tags: ["CoordSokoban"]
284
+ + tags: ["BanditTest"]
285
+ n_groups: [32]
286
+
287
+ ctx_manager:
288
+ diff --git a/config/evaluate_api_llm.yaml b/config/evaluate_api_llm.yaml
289
+ index b21c95e..e2e6761 100644
290
+ --- a/config/evaluate_api_llm.yaml
291
+ +++ b/config/evaluate_api_llm.yaml
292
+ @@ -1,8 +1,11 @@
293
+ +#export OPENAI_BASE_URL="https://api.ohmygpt.com/v1"
294
+ +#export OPENAI_API_KEY="sk-o4sMxBkN5BB100C4D4a3T3BlBkFJF7791CA39EA14ca98041"
295
+ +#python -m ragen.eval_api hydra.searchpath='[file://./verl/verl/trainer/config]'
296
+ defaults:
297
+ - base # this is a symbolic link to the verl/verl/trainer/config/ppo_trainer.yaml file
298
+
299
+ model_config:
300
+ - model_name: gpt-4o # should be registered in model_info
301
+ + model_name: ark-deepseek-v3-250324 # should be registered in model_info
302
+ max_concurrency: 16
303
+
304
+ model_info:
305
+ @@ -24,9 +27,9 @@ model_info:
306
+ generation_kwargs:
307
+ temperature: 0
308
+ max_tokens: 512 # max_completion_tokens if o1-mini
309
+ - gpt-4o:
310
+ + gpt-4o-mini:
311
+ provider_name: openai
312
+ - model_name: gpt-4o
313
+ + model_name: gpt-4o-mini
314
+ generation_kwargs:
315
+ temperature: 0
316
+ max_tokens: 512 # max_completion_tokens if o1-mini
317
+ @@ -36,21 +39,42 @@ model_info:
318
+ generation_kwargs:
319
+ temperature: 0
320
+ max_completion_tokens: 512
321
+ + ark-deepseek-v3-250324:
322
+ + provider_name: openai
323
+ + model_name: ark-deepseek-v3-250324
324
+ + generation_kwargs:
325
+ + temperature: 0
326
+ + max_completion_tokens: 512
327
+ deepseek-v3:
328
+ provider_name: deepseek
329
+ model_name: deepseek-chat
330
+ generation_kwargs:
331
+ temperature: 0
332
+ max_completion_tokens: 512
333
+ + glm-4.6:
334
+ + provider_name: openai
335
+ + model_name: glm-4.6
336
+ + generation_kwargs:
337
+ + temperature: 0
338
+ + max_completion_tokens: 512
339
+ + TA/openai/gpt-oss-120b:
340
+ + provider_name: openai
341
+ + model_name: TA/openai/gpt-oss-120b
342
+ + generation_kwargs:
343
+ + temperature: 0
344
+ + max_tokens: 8192
345
+ + # max_retries: 5
346
+
347
+ -
348
+ -
349
+ +agent_proxy:
350
+ + max_turn: 5
351
+ es_manager:
352
+ val:
353
+ - env_groups: 256
354
+ + env_groups: 128
355
+ group_size: 1 # should be set to 1 because val temperature is set to 0 and same prompt leads to same output
356
+ env_configs:
357
+ - tags: ["CoordSokoban"]
358
+ - n_groups: [256] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
359
+ + tags: ["rubikscube"]
360
+ + n_groups: [128] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
361
+
362
+
363
+ +rollout:
364
+ + max_model_len: 7200
365
+
366
+ Submodule external/webshop-minimal contains modified content
367
+ diff --git a/external/webshop-minimal/requirements.txt b/external/webshop-minimal/requirements.txt
368
+ index 5a1b04f..238ed5a 100644
369
+ --- a/external/webshop-minimal/requirements.txt
370
+ +++ b/external/webshop-minimal/requirements.txt
371
+ @@ -4,7 +4,7 @@ flask
372
+ html2text
373
+ rank_bm25
374
+ pyserini
375
+ -faiss-cpu
376
+ +faiss-gpu
377
+ thefuzz
378
+ gdown
379
+ spacy
380
+ diff --git a/ragen/env/__init__.py b/ragen/env/__init__.py
381
+ index b0f3461..bc6838e 100644
382
+ --- a/ragen/env/__init__.py
383
+ +++ b/ragen/env/__init__.py
384
+ @@ -12,6 +12,14 @@ from .metamathqa.env import MetaMathQAEnv
385
+ from .metamathqa.config import MetaMathQAEnvConfig
386
+ from .lean.config import LeanEnvConfig
387
+ from .lean.env import LeanEnv
388
+ +from .game_2048.config import Game2048EnvConfig
389
+ +from .game_2048.env import Game2048Env
390
+ +from .blackjack.config import BlackjackEnvConfig
391
+ +from .blackjack.env import BlackjackEnv
392
+ +from .rubikscube.config import RubiksCube2x2Config
393
+ +from .rubikscube.env import RubiksCube2x2Env
394
+ +from .sudoku.config import SudokuEnvConfig
395
+ +from .sudoku.env import SudokuEnv
396
+
397
+
398
+ REGISTERED_ENVS = {
399
+ @@ -22,6 +30,10 @@ REGISTERED_ENVS = {
400
+ # 'alfworld': AlfredTXTEnv,
401
+ 'metamathqa': MetaMathQAEnv,
402
+ 'lean': LeanEnv,
403
+ + 'game_2048': Game2048Env,
404
+ + 'blackjack': BlackjackEnv,
405
+ + 'rubikscube': RubiksCube2x2Env,
406
+ + 'sudoku': SudokuEnv,
407
+ }
408
+
409
+ REGISTERED_ENV_CONFIGS = {
410
+ @@ -32,6 +44,10 @@ REGISTERED_ENV_CONFIGS = {
411
+ # 'alfworld': AlfredEnvConfig,
412
+ 'metamathqa': MetaMathQAEnvConfig,
413
+ 'lean': LeanEnvConfig,
414
+ + 'game_2048': Game2048EnvConfig,
415
+ + 'blackjack': BlackjackEnvConfig,
416
+ + 'rubikscube': RubiksCube2x2Config,
417
+ + 'sudoku': SudokuEnvConfig,
418
+ }
419
+
420
+ try:
421
+ diff --git a/ragen/env/frozen_lake/config.py b/ragen/env/frozen_lake/config.py
422
+ index de054f4..9950c34 100644
423
+ --- a/ragen/env/frozen_lake/config.py
424
+ +++ b/ragen/env/frozen_lake/config.py
425
+ @@ -8,7 +8,7 @@ class FrozenLakeEnvConfig:
426
+ size: int = 4
427
+ p: float = 0.9
428
+ success_rate: float = 0.8
429
+ - is_slippery: bool = True
430
+ + is_slippery: bool = False
431
+ map_seed: Optional[int] = None
432
+ render_mode: str = "text"
433
+ observation_format: str = "grid"
434
+ diff --git a/ragen/env/frozen_lake/env.py b/ragen/env/frozen_lake/env.py
435
+ index 9ee3add..eef11d8 100644
436
+ --- a/ragen/env/frozen_lake/env.py
437
+ +++ b/ragen/env/frozen_lake/env.py
438
+ @@ -13,6 +13,7 @@ from ragen.env.base import BaseDiscreteActionEnv
439
+ class FrozenLakeEnv(BaseDiscreteActionEnv, GymFrozenLakeEnv):
440
+ def __init__(self, config: FrozenLakeEnvConfig = FrozenLakeEnvConfig()):
441
+ # Using mappings directly from config
442
+ + # import pdb;pdb.set_trace()
443
+ self.config = config
444
+ self.GRID_LOOKUP = config.grid_lookup
445
+ self.ACTION_LOOKUP = config.action_lookup
446
+ @@ -95,6 +96,7 @@ class FrozenLakeEnv(BaseDiscreteActionEnv, GymFrozenLakeEnv):
447
+ if __name__ == "__main__":
448
+ import matplotlib.pyplot as plt
449
+ config = FrozenLakeEnvConfig(size=4, is_slippery=True)
450
+ + # import pdb;pdb.set_trace()
451
+ env = FrozenLakeEnv(config)
452
+ print(env.reset())
453
+ while True:
454
+ diff --git a/ragen/env/sokoban/env.py b/ragen/env/sokoban/env.py
455
+ index 17cd636..6922b54 100644
456
+ --- a/ragen/env/sokoban/env.py
457
+ +++ b/ragen/env/sokoban/env.py
458
+ @@ -33,6 +33,7 @@ class SokobanEnv(BaseDiscreteActionEnv, GymSokobanEnv):
459
+ def reset(self, seed=None, mode=None):
460
+ try:
461
+ with all_seed(seed):
462
+ + # import pdb;pdb.set_trace()
463
+ self.room_fixed, self.room_state, self.box_mapping, action_sequence = generate_room(
464
+ dim=self.dim_room,
465
+ num_steps=self.num_gen_steps,
466
+ diff --git a/ragen/llm_agent/agent_proxy.py b/ragen/llm_agent/agent_proxy.py
467
+ index c25b50d..f6c4088 100644
468
+ --- a/ragen/llm_agent/agent_proxy.py
469
+ +++ b/ragen/llm_agent/agent_proxy.py
470
+ @@ -287,6 +287,7 @@ def main(config):
471
+ proxy = LLMAgentProxy(config, actor_wg, tokenizer)
472
+ import time
473
+ start_time = time.time()
474
+ + # import pdb;pdb.set_trace()
475
+ rollouts = proxy.rollout(
476
+ DataProto(
477
+ batch=None,
478
+ diff --git a/ragen/llm_agent/base_llm.py b/ragen/llm_agent/base_llm.py
479
+ index 358a2eb..b6f7797 100644
480
+ --- a/ragen/llm_agent/base_llm.py
481
+ +++ b/ragen/llm_agent/base_llm.py
482
+ @@ -33,6 +33,7 @@ class OpenAIProvider(LLMProvider):
483
+ raise ValueError("OpenAI API key not provided and not found in environment variables")
484
+
485
+ self.client = AsyncOpenAI(api_key=self.api_key)
486
+ + # import pdb;pdb.set_trace()
487
+
488
+ async def generate(self, messages: List[Dict[str, str]], **kwargs) -> LLMResponse:
489
+ if "o1-mini" in self.model_name:
490
+ @@ -46,10 +47,7 @@ class OpenAIProvider(LLMProvider):
491
+ )
492
+ if response.choices[0].finish_reason in ['length', 'content_filter']:
493
+ raise ValueError("Content filtered or length exceeded")
494
+ - return LLMResponse(
495
+ - content=response.choices[0].message.content,
496
+ - model_name=response.model
497
+ - )
498
+ + return LLMResponse(content=response.choices[0].message.content,model_name=response.model)
499
+
500
+ class DeepSeekProvider(LLMProvider):
501
+ """DeepSeek API provider implementation"""
502
+ @@ -199,7 +197,7 @@ class ConcurrentLLM:
503
+
504
+ # Queue to store unfinished or failed tasks
505
+ current_batch = messages_list.copy()
506
+ - max_retries = kwargs.get("max_retries", 100)
507
+ + max_retries = kwargs.get("max_retries", 10)
508
+ retry_count = 0
509
+
510
+ while current_batch and retry_count < max_retries:
511
+ diff --git a/ragen/llm_agent/ctx_manager.py b/ragen/llm_agent/ctx_manager.py
512
+ index 905247a..af20a01 100644
513
+ --- a/ragen/llm_agent/ctx_manager.py
514
+ +++ b/ragen/llm_agent/ctx_manager.py
515
+ @@ -88,6 +88,7 @@ class ContextManager:
516
+ Initialize the ContextManager.
517
+ Processor is used to process the image data.
518
+ """
519
+ + # import pdb;pdb.set_trace()
520
+ self.config = config
521
+ self.tokenizer = tokenizer
522
+ self.processor = processor
523
+ @@ -311,7 +312,7 @@ class ContextManager:
524
+
525
+ llm_input_texts.append(text_with_prompt)
526
+ messages_list.append(messages)
527
+ -
528
+ + # import pdb;pdb.set_trace()
529
+ inputs = self.tokenizer(llm_input_texts, return_tensors="pt", padding=True, padding_side="left", truncation=False) # We have truncated previously, truncation in tokenizer may cause issues.
530
+ input_ids, attention_mask = inputs.input_ids, inputs.attention_mask
531
+ position_ids = (attention_mask.cumsum(dim=-1) - 1).clamp(min=0)
532
+ @@ -353,6 +354,30 @@ class ContextManager:
533
+ key: np.sum(value) / self.env_nums[key.split("/")[0]]
534
+ for key, value in metrics.items()
535
+ }
536
+ + # Derived metrics for wandb logging
537
+ + try:
538
+ + # charts/avg_episode_return: average across all 2048 env groups
539
+ + ep_keys = [k for k in metrics.keys() if k.endswith('/episodic_return')]
540
+ + if len(ep_keys) > 0:
541
+ + ep_vals = []
542
+ + for k in ep_keys:
543
+ + tag = k.split('/')[0]
544
+ + denom = self.env_nums.get(tag, max(1, len(metrics[k])))
545
+ + ep_vals.append(float(np.sum(metrics[k]) / denom))
546
+ + mean_metrics["charts/avg_episode_return"] = float(np.mean(ep_vals))
547
+ + except Exception:
548
+ + pass
549
+ + try:
550
+ + # rollout/max_tile: max over all envs in this batch
551
+ + tile_keys = [k for k in metrics.keys() if k.endswith('/max_tile')]
552
+ + if len(tile_keys) > 0:
553
+ + tile_vals = []
554
+ + for k in tile_keys:
555
+ + tile_vals.extend(metrics[k])
556
+ + if len(tile_vals) > 0:
557
+ + mean_metrics["rollout/max_tile"] = int(np.max(tile_vals))
558
+ + except Exception:
559
+ + pass
560
+ for key, values in metrics.items():
561
+ if not isinstance(values, list):
562
+ continue
563
+ diff --git a/ragen/llm_agent/es_manager.py b/ragen/llm_agent/es_manager.py
564
+ index b87a2b3..1a49d3e 100644
565
+ --- a/ragen/llm_agent/es_manager.py
566
+ +++ b/ragen/llm_agent/es_manager.py
567
+ @@ -128,18 +128,40 @@ class EnvStateManager:
568
+ env_outputs: List[Dict]
569
+ {env_id: int, history: List[Dict][{state: str, actions: List[str], reward: float, info: Dict, llm_response: str, llm_raw_response: str, (Optional)images: List[PIL.Image.Image]}]}
570
+ """
571
+ + # def _execute_actions(env, actions):
572
+ + # acc_reward, turn_info, turn_done = 0, {}, False
573
+ + # executed_actions = []
574
+ + # for action in actions:
575
+ + # _, reward, done, info = env.step(action)
576
+ + # acc_reward += reward
577
+ + # turn_info.update(info) # NOTE: currently use last info for multi-action
578
+ + # executed_actions.append(action)
579
+ + # if done:
580
+ + # turn_done = True
581
+ + # break
582
+ +
583
+ + # return acc_reward, turn_info, turn_done, executed_actions
584
+ def _execute_actions(env, actions):
585
+ - acc_reward, turn_info, turn_done = 0, {}, False
586
+ + acc_reward, turn_info, turn_done = 0.0, {}, False
587
+ + raw_acc_reward = 0.0
588
+ executed_actions = []
589
+ for action in actions:
590
+ _, reward, done, info = env.step(action)
591
+ - acc_reward += reward
592
+ + acc_reward += float(reward)
593
+ + try:
594
+ + raw_acc_reward += float(info.get('raw_reward', 0.0))
595
+ + except Exception:
596
+ + pass
597
+ turn_info.update(info) # NOTE: currently use last info for multi-action
598
+ executed_actions.append(action)
599
+ if done:
600
+ turn_done = True
601
+ break
602
+ -
603
+ + # Overwrite per-turn raw_reward to reflect the sum across all executed actions in this turn
604
+ + try:
605
+ + turn_info['raw_reward'] = float(raw_acc_reward)
606
+ + except Exception:
607
+ + pass
608
+ return acc_reward, turn_info, turn_done, executed_actions
609
+
610
+ def _log_env_state(status, history, cur_obs, max_actions_per_traj, executed_actions, all_actions, acc_reward, turn_done, turn_info, env_input):
611
+ @@ -198,6 +220,18 @@ class EnvStateManager:
612
+ 'success': float(status.terminated and (not status.truncated)),
613
+ 'num_actions': status.num_actions,
614
+ }
615
+ + # Add episodic-level metrics
616
+ + # try:
617
+ + # # Sum of per-turn rewards equals the episodic return (env-shaped reward)
618
+ + # env_metric['episodic_return'] = float(sum(status.rewards))
619
+ + # except Exception:
620
+ + # pass
621
+ + try:
622
+ + # Final max tile on the board at the end of the rollout
623
+ + import numpy as _np
624
+ + env_metric['max_tile'] = int(_np.max(entry['env'].grid))
625
+ + except Exception:
626
+ + pass
627
+ custom_metric = {}
628
+ for turn in cache['history']:
629
+ for k, v in turn.get('info', {}).items():
630
+ @@ -212,6 +246,12 @@ class EnvStateManager:
631
+ "Skipping non-numeric metric '%s' with value %r for env %s.",
632
+ k, v, entry['tag']
633
+ )
634
+ + # Add episodic_return as the SUM of raw_reward across steps (align with CleanRL)
635
+ + try:
636
+ + if 'raw_reward' in custom_metric:
637
+ + env_metric['episodic_return'] = float(np.sum(custom_metric['raw_reward']))
638
+ + except Exception:
639
+ + pass
640
+ for k, v in custom_metric.items():
641
+ # TODO: Move TURN_LVL_METRICS into the environment
642
+ if "webshop" not in cache['tag'].lower() or ("webshop" in cache['tag'].lower() and k in TURN_LVL_METRICS):
643
+ @@ -219,7 +259,12 @@ class EnvStateManager:
644
+ else:
645
+ env_metric['traj_sum/' + k] = np.sum(v)
646
+
647
+ -
648
+ + try:
649
+ + if 'score' in custom_metric and len(custom_metric['score']) > 0:
650
+ + env_metric['final_score'] = float(custom_metric['score'][-1])
651
+ + except Exception:
652
+ + pass
653
+ +
654
+ cache['history'][-1]['metrics'] = custom_metric
655
+ env_metric = {f"{entry['tag']}/{k}": v for k, v in env_metric.items()}
656
+ cache['metrics'] = env_metric
657
+ diff --git a/requirements.txt b/requirements.txt
658
+ index 2fd756e..9b521bf 100644
659
+ --- a/requirements.txt
660
+ +++ b/requirements.txt
661
+ @@ -7,7 +7,6 @@ accelerate
662
+ codetiming
663
+ datasets
664
+ dill
665
+ -flash-attn==2.7.4.post1
666
+ hydra-core
667
+ numpy
668
+ pandas
669
+ @@ -15,19 +14,19 @@ pybind11
670
+ ray>=2.10
671
+ tensordict>=0.8.0,<0.9.0
672
+ transformers
673
+ -vllm==0.8.2
674
+ +vllm==0.8.5
675
+ wandb
676
+ gymnasium
677
+ gymnasium[toy-text]
678
+
679
+ pyarrow>=15.0.0
680
+ pylatexenc
681
+ -torchdata
682
+ +# torchdata
683
+ debugpy
684
+
685
+ together
686
+ anthropic
687
+ -faiss-cpu==1.11.0
688
+ +faiss-gpu
689
+
690
+ # This is optional, but needs to be installed with main requirements if you want to use webshop
691
+ -r external/webshop-minimal/requirements.txt
692
+ diff --git a/scripts/setup_ragen.sh b/scripts/setup_ragen.sh
693
+ index f9a7cd9..85a93c4 100644
694
+ --- a/scripts/setup_ragen.sh
695
+ +++ b/scripts/setup_ragen.sh
696
+ @@ -94,10 +94,10 @@ main() {
697
+ pip install torch==2.5.0 --index-url https://download.pytorch.org/whl/cu124
698
+
699
+ print_step "Installing flash-attention..."
700
+ - pip3 install flash-attn==2.7.4.post1 --no-build-isolation
701
+ + # pip3 install flash-attn==2.7.4.post1 --no-build-isolation
702
+ else
703
+ print_step "Installing PyTorch without CUDA support..."
704
+ - pip install torch==2.5.0
705
+ + pip install torch==2.4.0
706
+ fi
707
+
708
+ # Install remaining requirements
709
+ @@ -137,8 +137,8 @@ main() {
710
+ conda install conda-forge::gdown
711
+ mkdir -p external/webshop-minimal/webshop_minimal/data/full
712
+ cd external/webshop-minimal/webshop_minimal/data/full
713
+ - gdown https://drive.google.com/uc?id=1A2whVgOO0euk5O13n2iYDM0bQRkkRduB # items_shuffle
714
+ - gdown https://drive.google.com/uc?id=1s2j6NgHljiZzQNL3veZaAiyW_qDEgBNi # items_ins_v2
715
+ + # gdown https://drive.google.com/uc?id=1A2whVgOO0euk5O13n2iYDM0bQRkkRduB # items_shuffle
716
+ + # gdown https://drive.google.com/uc?id=1s2j6NgHljiZzQNL3veZaAiyW_qDEgBNi # items_ins_v2
717
+ cd ../../../../..
718
+
719
+ echo -e "${GREEN}Installation completed successfully!${NC}"
720
+ diff --git a/train_all.sh b/train_all.sh
721
+ index 0157306..33035f5 100755
722
+ --- a/train_all.sh
723
+ +++ b/train_all.sh
724
+ @@ -6,246 +6,257 @@ USE_GRPO="algorithm.adv_estimator=grpo"
725
+ USE_PPO="algorithm.adv_estimator=gae" # by default.
726
+ USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
727
+
728
+ +
729
+ +# python train.py --config-name _8_2048 system.CUDA_VISIBLE_DEVICES="'0,1,2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=game_2048 $USE_PPO $USE_BASE
730
+ +
731
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'0,1'" trainer.project_name=ragen_latest_qwen_05B_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=rubikscube-1 $USE_PPO $USE_BASE
732
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-1.5B-Instruct trainer.experiment_name=rubikscube-2 $USE_PPO $USE_BASE
733
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'4,5'" trainer.project_name=ragen_latest_qwen_25_3b_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-3B-Instruct trainer.experiment_name=rubikscube-2 $USE_PPO $USE_BASE
734
+ +python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'6,7'" trainer.project_name=ragen_latest_qwen_05B_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=rubikscube-3 $USE_PPO $USE_BASE
735
+ +
736
+ # Section 3.1&3.2 - General Observations
737
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-ppo $USE_PPO $USE_BASE &
738
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-grpo $USE_GRPO $USE_BASE &
739
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE &
740
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-grpo $USE_GRPO $USE_BASE &
741
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozen_lake-ppo $USE_PPO $USE_BASE &
742
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozen_lake-grpo $USE_GRPO $USE_BASE &
743
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="'6,7'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=bandit-ppo-multitask $USE_PPO $USE_BASE &
744
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="'7'" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-ppo-frommlp $USE_PPO $USE_BASE
745
+
746
+ -# Section 4.1 - Filtering and critic
747
+ -# 0.25
748
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.25 actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
749
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
750
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
751
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
752
+ -
753
+ -wait
754
+ -
755
+ -# 0.5
756
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-ppo-rolloutfilter0.5 actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
757
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
758
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
759
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
760
+ -
761
+ -# 0.75
762
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.75 actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
763
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
764
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
765
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
766
+ -
767
+ -wait
768
+ -
769
+ -# Section 4.2 - Ablation on Critic/ClipHigh/KL. Start from Basic and add more components. The best setting for StarPO in agent is rollout_filter+Critic+Cliphigh+NoKL
770
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
771
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
772
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
773
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
774
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozenlake-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
775
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozenlake-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
776
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozenlake-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
777
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozenlake-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
778
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="'0,1'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=sokoban-ppo-box1-multitask $USE_PPO $USE_BASE
779
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-grpo $USE_GRPO $USE_BASE &
780
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
781
+
782
+ -wait
783
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'4,5,6,7'" trainer.project_name=ragen_latest_qwen_25_3b_it trainer.n_gpus_per_node=4 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_3B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
784
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'4,5,6,7'" trainer.n_gpus_per_node=4 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
785
+
786
+ -# Section 5.1 - Reasoning Helps Generalization
787
+ +# # Section 4.1 - Filtering and critic
788
+ +# # 0.25
789
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.25 actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
790
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
791
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
792
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
793
+
794
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-generalization \
795
+ - custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
796
+ - custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
797
+ - custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
798
+ - custom_envs.BanditTest.env_config.hi_arm_name="Librarian"
799
+ +# wait
800
+
801
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-generalization-nothink \
802
+ - custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
803
+ - custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
804
+ - custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
805
+ - custom_envs.BanditTest.env_config.hi_arm_name="Librarian" \
806
+ - agent_proxy.enable_think=False
807
+ +# # 0.5
808
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-ppo-rolloutfilter0.5 actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
809
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
810
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
811
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
812
+ +
813
+ +# # 0.75
814
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.75 actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
815
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
816
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
817
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
818
+
819
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=bandit-generalization-rev \
820
+ - custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
821
+ - custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
822
+ - custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
823
+ - custom_envs.BanditTest.env_config.hi_arm_name="Trader"
824
+ +# wait
825
+
826
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=bandit-generalization-rev-nothink \
827
+ - custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
828
+ - custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
829
+ - custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
830
+ - custom_envs.BanditTest.env_config.hi_arm_name="Trader" \
831
+ - agent_proxy.enable_think=False
832
+ +# # Section 4.2 - Ablation on Critic/ClipHigh/KL. Start from Basic and add more components. The best setting for StarPO in agent is rollout_filter+Critic+Cliphigh+NoKL
833
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
834
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
835
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
836
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
837
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozenlake-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
838
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozenlake-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
839
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozenlake-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
840
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozenlake-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
841
+
842
+ +# wait
843
+
844
+ -SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
845
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization micro_batch_size_per_gpu=8 model_path=Qwen/Qwen2.5-1.5B-Instruct&
846
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-generalization-nothink $SOKOBAN_GENERALIZATION_CONFIG agent_proxy.enable_think=False &
847
+ +# # Section 5.1 - Reasoning Helps Generalization
848
+
849
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-generalization \
850
+ +# custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
851
+ +# custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
852
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
853
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Librarian"
854
+
855
+ -# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=128 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SokobanDifferentGridVocab] es_manager.val.env_configs.n_groups=[128]"
856
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG &
857
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-generalization-nothink \
858
+ +# custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
859
+ +# custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
860
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
861
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Librarian" \
862
+ +# agent_proxy.enable_think=False
863
+
864
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=bandit-generalization-rev \
865
+ +# custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
866
+ +# custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
867
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
868
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Trader"
869
+
870
+ -# COMPOSITIONALITY_CONFIG="es_manager.train.env_groups=16 es_manager.train.env_configs.tags=[Bandit,SimpleSokoban] es_manager.train.env_configs.n_groups=[8,8] es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[Bandit,SimpleSokoban,LargerSokoban,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128] actor_rollout_ref.rollout.rollout_filter_ratio=1" # NOTE that we don't filter out low-var rollout in this setting
871
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=compositional-generalization $COMPOSITIONALITY_CONFIG &
872
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=compositional-generalization-nothink $COMPOSITIONALITY_CONFIG agent_proxy.enable_think=False &
873
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=bandit-generalization-rev-nothink \
874
+ +# custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
875
+ +# custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
876
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
877
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Trader" \
878
+ +# agent_proxy.enable_think=False
879
+
880
+ -wait
881
+
882
+ -# Section 5.2 - what leads to better reasoning?
883
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B-Instruct &
884
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B-Instruct &
885
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct trainer.n_gpus_per_node=2 &
886
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B-Instruct trainer.n_gpus_per_node=4 &
887
+ +# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
888
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization micro_batch_size_per_gpu=8 model_path=Qwen/Qwen2.5-1.5B-Instruct&
889
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-generalization-nothink $SOKOBAN_GENERALIZATION_CONFIG agent_proxy.enable_think=False &
890
+
891
+ -wait
892
+
893
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B &
894
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B &
895
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B &
896
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B &
897
+ +# # SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=128 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SokobanDifferentGridVocab] es_manager.val.env_configs.n_groups=[128]"
898
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG &
899
+
900
+ -wait
901
+
902
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-7B &
903
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B &
904
+ +# # COMPOSITIONALITY_CONFIG="es_manager.train.env_groups=16 es_manager.train.env_configs.tags=[Bandit,SimpleSokoban] es_manager.train.env_configs.n_groups=[8,8] es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[Bandit,SimpleSokoban,LargerSokoban,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128] actor_rollout_ref.rollout.rollout_filter_ratio=1" # NOTE that we don't filter out low-var rollout in this setting
905
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=compositional-generalization $COMPOSITIONALITY_CONFIG &
906
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=compositional-generalization-nothink $COMPOSITIONALITY_CONFIG agent_proxy.enable_think=False &
907
+
908
+ +# wait
909
+
910
+ -wait
911
+ +# # Section 5.2 - what leads to better reasoning?
912
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B-Instruct &
913
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B-Instruct &
914
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct trainer.n_gpus_per_node=2 &
915
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B-Instruct trainer.n_gpus_per_node=4 &
916
+
917
+ -# Section 6.1 varying action count
918
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-action-count-1 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=5 custom_envs.LargerSokoban.max_actions_per_traj=5 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=5 custom_envs.FrozenLake.max_actions_per_traj=5 agent_proxy.max_actions_per_turn=1 &
919
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-action-count-2 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=10 custom_envs.LargerSokoban.max_actions_per_traj=10 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=10 custom_envs.FrozenLake.max_actions_per_traj=10 agent_proxy.max_actions_per_turn=2 &
920
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-action-count-3 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=15 custom_envs.LargerSokoban.max_actions_per_traj=15 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=15 custom_envs.FrozenLake.max_actions_per_traj=15 agent_proxy.max_actions_per_turn=3 &
921
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-action-count-4 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=20 custom_envs.LargerSokoban.max_actions_per_traj=20 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=20 custom_envs.FrozenLake.max_actions_per_traj=20 agent_proxy.max_actions_per_turn=4 &
922
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-action-count-5 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=25 custom_envs.LargerSokoban.max_actions_per_traj=25 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=25 custom_envs.FrozenLake.max_actions_per_traj=25 agent_proxy.max_actions_per_turn=5 &
923
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-action-count-6 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=30 custom_envs.LargerSokoban.max_actions_per_traj=30 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=30 custom_envs.FrozenLake.max_actions_per_traj=30 agent_proxy.max_actions_per_turn=6 &
924
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-action-count-7 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=35 custom_envs.LargerSokoban.max_actions_per_traj=35 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=35 custom_envs.FrozenLake.max_actions_per_traj=35 agent_proxy.max_actions_per_turn=7 &
925
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-action-count-8 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=40 custom_envs.LargerSokoban.max_actions_per_traj=40 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=40 custom_envs.FrozenLake.max_actions_per_traj=40 agent_proxy.max_actions_per_turn=8 &
926
+ +# wait
927
+
928
+ -# section 6.2 Varying prompt diversity
929
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-prompt-diversity-4 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=4 es_manager.train.group_size=32 es_manager.train.env_configs.n_groups=[4] &
930
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-prompt-diversity-8 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] &
931
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-prompt-diversity-16 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=8 es_manager.train.env_configs.n_groups=[16] &
932
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-prompt-diversity-32 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=32 es_manager.train.group_size=4 es_manager.train.env_configs.n_groups=[32] &
933
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-prompt-diversity-64 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=64 es_manager.train.group_size=2 es_manager.train.env_configs.n_groups=[64] &
934
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-prompt-diversity-128 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=128 es_manager.train.group_size=1 es_manager.train.env_configs.n_groups=[128] &
935
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B &
936
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B &
937
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B &
938
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B &
939
+
940
+ -wait
941
+ +# wait
942
+
943
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-online-2 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[16] trainer.total_training_steps=100 trainer.test_freq=5 &
944
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-7B &
945
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B &
946
+
947
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-online-5 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=40 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[40] trainer.total_training_steps=40 trainer.test_freq=2 &
948
+
949
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-online-10 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=80 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[80] trainer.total_training_steps=80 trainer.test_freq=1 &
950
+ +# wait
951
+
952
+ +# # Section 6.1 varying action count
953
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-action-count-1 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=5 custom_envs.LargerSokoban.max_actions_per_traj=5 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=5 custom_envs.FrozenLake.max_actions_per_traj=5 agent_proxy.max_actions_per_turn=1 &
954
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-action-count-2 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=10 custom_envs.LargerSokoban.max_actions_per_traj=10 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=10 custom_envs.FrozenLake.max_actions_per_traj=10 agent_proxy.max_actions_per_turn=2 &
955
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-action-count-3 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=15 custom_envs.LargerSokoban.max_actions_per_traj=15 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=15 custom_envs.FrozenLake.max_actions_per_traj=15 agent_proxy.max_actions_per_turn=3 &
956
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-action-count-4 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=20 custom_envs.LargerSokoban.max_actions_per_traj=20 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=20 custom_envs.FrozenLake.max_actions_per_traj=20 agent_proxy.max_actions_per_turn=4 &
957
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-action-count-5 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=25 custom_envs.LargerSokoban.max_actions_per_traj=25 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=25 custom_envs.FrozenLake.max_actions_per_traj=25 agent_proxy.max_actions_per_turn=5 &
958
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-action-count-6 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=30 custom_envs.LargerSokoban.max_actions_per_traj=30 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=30 custom_envs.FrozenLake.max_actions_per_traj=30 agent_proxy.max_actions_per_turn=6 &
959
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-action-count-7 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=35 custom_envs.LargerSokoban.max_actions_per_traj=35 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=35 custom_envs.FrozenLake.max_actions_per_traj=35 agent_proxy.max_actions_per_turn=7 &
960
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-action-count-8 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=40 custom_envs.LargerSokoban.max_actions_per_traj=40 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=40 custom_envs.FrozenLake.max_actions_per_traj=40 agent_proxy.max_actions_per_turn=8 &
961
+
962
+ +# # section 6.2 Varying prompt diversity
963
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-prompt-diversity-4 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=4 es_manager.train.group_size=32 es_manager.train.env_configs.n_groups=[4] &
964
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-prompt-diversity-8 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] &
965
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-prompt-diversity-16 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=8 es_manager.train.env_configs.n_groups=[16] &
966
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-prompt-diversity-32 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=32 es_manager.train.group_size=4 es_manager.train.env_configs.n_groups=[32] &
967
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-prompt-diversity-64 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=64 es_manager.train.group_size=2 es_manager.train.env_configs.n_groups=[64] &
968
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-prompt-diversity-128 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=128 es_manager.train.group_size=1 es_manager.train.env_configs.n_groups=[128] &
969
+
970
+ +# wait
971
+
972
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-online-2 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[16] trainer.total_training_steps=100 trainer.test_freq=5 &
973
+
974
+ -# Extension: Training 7B reasoning model
975
+ -SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
976
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct-largescale $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] micro_batch_size_per_gpu=8 ppo_mini_batch_size=64 actor_rollout_ref.rollout.response_length=1024 actor_rollout_ref.rollout.max_model_len=6400 trainer.test_freq=5 actor_rollout_ref.rollout.max_num_batched_tokens=24000 micro_batch_size_per_gpu=2 actor_rollout_ref.rollout.rollout_filter_ratio=1 &
977
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-online-5 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=40 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[40] trainer.total_training_steps=40 trainer.test_freq=2 &
978
+
979
+ -python -m ragen.llm_agent.agent_proxy model_path=Qwen/Qwen2.5-3B-Instruct system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 actor_rollout_ref.rollout.tensor_model_parallel_size=4 actor_rollout_ref.rollout.response_length=2048 actor_rollout_ref.rollout.max_model_len=12800
980
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-online-10 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=80 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[80] trainer.total_training_steps=80 trainer.test_freq=1 &
981
+
982
+ -# trainer.save_freq=50 trainer.default_local_dir=/mnt/local/cache/exp_name
983
+
984
+ -# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
985
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization &
986
+
987
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/bandit-generalization &
988
+
989
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=frozenlake-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/frozenlake-generalization &
990
+
991
+ +# # Extension: Training 7B reasoning model
992
+ +# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
993
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct-largescale $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] micro_batch_size_per_gpu=8 ppo_mini_batch_size=64 actor_rollout_ref.rollout.response_length=1024 actor_rollout_ref.rollout.max_model_len=6400 trainer.test_freq=5 actor_rollout_ref.rollout.max_num_batched_tokens=24000 micro_batch_size_per_gpu=2 actor_rollout_ref.rollout.rollout_filter_ratio=1 &
994
+
995
+ +# python -m ragen.llm_agent.agent_proxy model_path=Qwen/Qwen2.5-3B-Instruct system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 actor_rollout_ref.rollout.tensor_model_parallel_size=4 actor_rollout_ref.rollout.response_length=2048 actor_rollout_ref.rollout.max_model_len=12800
996
+
997
+ +# # trainer.save_freq=50 trainer.default_local_dir=/mnt/local/cache/exp_name
998
+
999
+ -# USE_PPO="algorithm.adv_estimator=gae" # by default.
1000
+ -# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1001
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE ppo_mini_batch_size=64 enable_response_mask=True &
1002
+ +# # USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1003
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization &
1004
+
1005
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/bandit-generalization &
1006
+
1007
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std &
1008
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=frozenlake-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/frozenlake-generalization &
1009
+
1010
+ -# enable_response_mask: False
1011
+ -# grpo_advantage_length_weight: True
1012
+
1013
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo-1-5b algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std agent_proxy.max_actions_per_turn=5 custom_envs.SimpleSokoban.max_actions_per_traj=25 enable_response_mask=True grpo_advantage_length_weight=False model_path=Qwen/Qwen2.5-1.5B-Instruct &
1014
+
1015
+
1016
+ -# extension: 7B with lora. Currently NOT recommended to use lora: within current version of vllm, this could result in rollouts slower than non-lora by 100%
1017
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-7B-Instruct trainer.experiment_name=sokoban_7b_instruct_lora_newversion lora.rank=16
1018
+ +# # USE_PPO="algorithm.adv_estimator=gae" # by default.
1019
+ +# # USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1020
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE ppo_mini_batch_size=64 enable_response_mask=True &
1021
+
1022
+ -# extension: bi-level gae
1023
+ -python train.py trainer.experiment_name=sokoban-bi-level-gae-final \
1024
+ - system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
1025
+ - model_path=Qwen/Qwen2.5-0.5B-Instruct \
1026
+ - algorithm.bi_level_gae=True algorithm.high_level_gamma=0.95 \
1027
+ - agent_proxy.use_turn_scores=True \
1028
+ - actor_rollout_ref.rollout.tp_size_check=False
1029
+
1030
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std &
1031
+
1032
+ -# extension: webshop
1033
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1034
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1035
+ - trainer.experiment_name=webshop-3b-ppo-s $USE_PPO \
1036
+ - trainer.nnodes=1 &
1037
+ +# # enable_response_mask: False
1038
+ +# # grpo_advantage_length_weight: True
1039
+
1040
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo-1-5b algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std agent_proxy.max_actions_per_turn=5 custom_envs.SimpleSokoban.max_actions_per_traj=25 enable_response_mask=True grpo_advantage_length_weight=False model_path=Qwen/Qwen2.5-1.5B-Instruct &
1041
+
1042
+ -USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1043
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1044
+ - trainer.experiment_name=webshop-3b-grpo-s $USE_GRPO \
1045
+ - trainer.nnodes=1 &
1046
+
1047
+ -# StarPO ppo
1048
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1049
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1050
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1051
+ - trainer.experiment_name=webshop-3b-ppo $USE_PPO $USE_BASE \
1052
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1053
+ - trainer.nnodes=1 &
1054
+ +# # extension: 7B with lora. Currently NOT recommended to use lora: within current version of vllm, this could result in rollouts slower than non-lora by 100%
1055
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-7B-Instruct trainer.experiment_name=sokoban_7b_instruct_lora_newversion lora.rank=16
1056
+
1057
+ -# StarPO grpo
1058
+ -USE_GRPO="algorithm.adv_estimator=grpo"
1059
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1060
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1061
+ - trainer.experiment_name=webshop-3b-grpo $USE_GRPO $USE_BASE \
1062
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1063
+ - trainer.nnodes=1 &
1064
+ +# # extension: bi-level gae
1065
+ +# python train.py trainer.experiment_name=sokoban-bi-level-gae-final \
1066
+ +# system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
1067
+ +# model_path=Qwen/Qwen2.5-0.5B-Instruct \
1068
+ +# algorithm.bi_level_gae=True algorithm.high_level_gamma=0.95 \
1069
+ +# agent_proxy.use_turn_scores=True \
1070
+ +# actor_rollout_ref.rollout.tp_size_check=False
1071
+
1072
+
1073
+ -# normal:sokoban
1074
+ -# extension: sokoban
1075
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1076
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1077
+ - trainer.experiment_name=sokoban-3b-ppo-s $USE_PPO \
1078
+ - trainer.nnodes=1 &
1079
+ +# # extension: webshop
1080
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1081
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1082
+ +# trainer.experiment_name=webshop-3b-ppo-s $USE_PPO \
1083
+ +# trainer.nnodes=1 &
1084
+
1085
+
1086
+ -USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1087
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1088
+ - trainer.experiment_name=sokoban-3b-grpo-s $USE_GRPO \
1089
+ - trainer.nnodes=1 &
1090
+ +# USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1091
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1092
+ +# trainer.experiment_name=webshop-3b-grpo-s $USE_GRPO \
1093
+ +# trainer.nnodes=1 &
1094
+
1095
+ -# StarPO ppo
1096
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1097
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1098
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1099
+ - trainer.experiment_name=sokoban-3b-ppo $USE_PPO $USE_BASE \
1100
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1101
+ - trainer.nnodes=1 &
1102
+ +# # StarPO ppo
1103
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1104
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1105
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1106
+ +# trainer.experiment_name=webshop-3b-ppo $USE_PPO $USE_BASE \
1107
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1108
+ +# trainer.nnodes=1 &
1109
+
1110
+ -# StarPO grpo
1111
+ -USE_GRPO="algorithm.adv_estimator=grpo"
1112
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1113
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1114
+ - trainer.experiment_name=sokoban-3b-grpo $USE_GRPO $USE_BASE \
1115
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1116
+ - trainer.nnodes=1 &
1117
+ +# # StarPO grpo
1118
+ +# USE_GRPO="algorithm.adv_estimator=grpo"
1119
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1120
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1121
+ +# trainer.experiment_name=webshop-3b-grpo $USE_GRPO $USE_BASE \
1122
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1123
+ +# trainer.nnodes=1 &
1124
+ +
1125
+ +
1126
+ +# # normal:sokoban
1127
+ +# # extension: sokoban
1128
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1129
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1130
+ +# trainer.experiment_name=sokoban-3b-ppo-s $USE_PPO \
1131
+ +# trainer.nnodes=1 &
1132
+ +
1133
+ +
1134
+ +# USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1135
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1136
+ +# trainer.experiment_name=sokoban-3b-grpo-s $USE_GRPO \
1137
+ +# trainer.nnodes=1 &
1138
+ +
1139
+ +# # StarPO ppo
1140
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1141
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1142
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1143
+ +# trainer.experiment_name=sokoban-3b-ppo $USE_PPO $USE_BASE \
1144
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1145
+ +# trainer.nnodes=1 &
1146
+ +
1147
+ +# # StarPO grpo
1148
+ +# USE_GRPO="algorithm.adv_estimator=grpo"
1149
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1150
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1151
+ +# trainer.experiment_name=sokoban-3b-grpo $USE_GRPO $USE_BASE \
1152
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1153
+ +# trainer.nnodes=1 &
1154
+
1155
+
1156
+
1157
+ -python train.py \
1158
+ - trainer.experiment_name=3b-full-ppo-test system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2
1159
+
1160
+ +# python train.py \
1161
+ +# trainer.experiment_name=3b-full-ppo-test system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2
1162
+
wandb/run-20251218_184253-g8kppnjh/files/diff_8d73639b99b38265453f898b8d6af7d4af50d56e.patch ADDED
@@ -0,0 +1,1162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/config/base.yaml b/config/base.yaml
2
+ index a1659e4..9df6250 100644
3
+ --- a/config/base.yaml
4
+ +++ b/config/base.yaml
5
+ @@ -9,15 +9,16 @@ seed:
6
+ train: 10000
7
+ val: 123
8
+
9
+ -micro_batch_size_per_gpu: 4
10
+ +micro_batch_size_per_gpu: 1
11
+ ppo_mini_batch_size: 32
12
+ -model_path: Qwen/Qwen2.5-3B-Instruct
13
+ +model_path: /mnt/general/share/model/Qwen/Qwen2.5-0.5B-Instruct
14
+ +# Qwen/Qwen2.5-0.5B-Instruct
15
+ enable_response_mask: True # Enabling response mask could improve stability of rollout/old_log_prob, as P(st|history) are no longer calculated in loss here. See https://docs.google.com/document/d/1bg7obeiKTExuHHBl5uOiSpec5uLDZ2Tgvxy6li5pHX4/edit?usp=sharing for more details.
16
+ grpo_advantage_length_weight: False # if you do not enable this and critic/advantage_estimator is GRPO, and the critic/advantages/mean is too low, then you can try enabling this to encourage reasoning and forbid collapse
17
+
18
+ lora:
19
+ rank: 0
20
+ - alpha: 64
21
+ + alpha: 16
22
+ target_modules: all-linear
23
+
24
+ actor_rollout_ref:
25
+ @@ -46,10 +47,10 @@ actor_rollout_ref:
26
+ name: vllm
27
+ log_prob_micro_batch_size_per_gpu: ${micro_batch_size_per_gpu} # following micro_batch_size_per_gpu
28
+ tensor_model_parallel_size: 1
29
+ - max_model_len: 3600
30
+ + max_model_len: 7200 #3600 why** 14400
31
+ prompt_length: 1 # useless. Just put it here
32
+ response_length: 400 # single-turn response length
33
+ - gpu_memory_utilization: 0.5
34
+ + gpu_memory_utilization: 0.7
35
+ max_num_batched_tokens: 8192 # set only when enable_chunked_prefill is true
36
+ temperature: 1
37
+ rollout_filter_ratio: 0.25
38
+ @@ -90,26 +91,28 @@ algorithm:
39
+ kl_coef: 0.000
40
+
41
+ trainer:
42
+ - project_name: ragen_latest
43
+ + project_name:
44
+ experiment_name: test
45
+ local_log_dir: "results/"
46
+ - save_freq: 100
47
+ + save_freq: -1
48
+ total_training_steps: 200
49
+ validation_steps: 1 # validation instances = validation_steps * val_env_groups * group_size
50
+ val_before_train: True
51
+ n_gpus_per_node: 1
52
+ test_freq: 10
53
+ generations_to_log_to_wandb:
54
+ + train: 128
55
+ val: 20
56
+ logger: [ 'console', 'wandb' ]
57
+ max_actor_ckpt_to_keep: 1
58
+ max_critic_ckpt_to_keep: 1
59
+ + default_local_dir: /mnt/general/wanghy/RAGEN/saves/
60
+
61
+ agent_proxy:
62
+ max_context_window: -1 # set a value > 0 to enable context window for long trajectory
63
+ - max_turn: 5
64
+ + max_turn: 25 #25 why** 700
65
+ action_sep: "||"
66
+ - max_actions_per_turn: 2 # how many actions can be output at most in a single turn
67
+ + max_actions_per_turn: 1 # how many actions can be output at most in a single turn
68
+ use_turn_scores: False # important to GAE when applying token-level rewards to token-level advantages. If False, will take the sum of scores as the reward for the last turn.
69
+ enable_think: True # False -> no think RL
70
+ reward_normalization:
71
+ @@ -126,11 +129,11 @@ es_manager:
72
+ tags: ["CoordSokoban"]
73
+ n_groups: [8] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
74
+ val:
75
+ - env_groups: 32
76
+ - group_size: 16 # should be set to 1 because when val temperature is set to 0 and group size > 1, there will be repetitive prompts which leads to same trajectory.
77
+ + env_groups: 256
78
+ + group_size: 1 # should be set to 1 because when val temperature is set to 0 and group size > 1, there will be repetitive prompts which leads to same trajectory.
79
+ env_configs:
80
+ tags: ["CoordSokoban"]
81
+ - n_groups: [32] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
82
+ + n_groups: [256] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
83
+
84
+ ctx_manager:
85
+ generation: # go to vllm
86
+ diff --git a/config/envs.yaml b/config/envs.yaml
87
+ index 1002ac8..ba3ac6f 100644
88
+ --- a/config/envs.yaml
89
+ +++ b/config/envs.yaml
90
+ @@ -2,6 +2,7 @@ custom_envs:
91
+ SimpleSokoban:
92
+ env_type: sokoban
93
+ max_actions_per_traj: 10 # used in environment state manager to control the actual max actions executed per trajectory
94
+ + # ORIGNAL env_instruction
95
+ env_instruction: |
96
+ You are solving the Sokoban puzzle.
97
+ You are the player and you need to push all boxes to targets.
98
+ @@ -12,7 +13,7 @@ custom_envs:
99
+ env_config: # keys should be a subset of SokobanConfig
100
+ dim_x: 6
101
+ dim_y: 6
102
+ - num_boxes: 1
103
+ + num_boxes: 2
104
+ max_steps: 100
105
+
106
+ LargerSokoban:
107
+ @@ -65,7 +66,7 @@ custom_envs:
108
+ env_config: # keys should be a subset of SokobanConfig
109
+ dim_x: 6
110
+ dim_y: 6
111
+ - num_boxes: 1
112
+ + num_boxes: 2
113
+ max_steps: 100
114
+ observation_format: "grid_coord"
115
+
116
+ @@ -111,14 +112,14 @@ custom_envs:
117
+
118
+ FrozenLake:
119
+ env_type: frozen_lake
120
+ - max_actions_per_traj: 10
121
+ + max_actions_per_traj: 25
122
+ env_instruction: "You are solving the FrozenLake puzzle. Forbid the whole and go to the target. You may move to the unintended direction due to the slippery ice. Example answer format: <think>To forbid the hole and go to the target, I should go left then go up.</think><answer>Left || Up</answer>"
123
+ max_tokens: 100
124
+ env_config: null
125
+
126
+ CoordFrozenLake:
127
+ env_type: frozen_lake
128
+ - max_actions_per_traj: 10
129
+ + max_actions_per_traj: 25
130
+ env_instruction: |
131
+ You are solving the FrozenLake puzzle. The observation includes both a symbol grid and zero-indexed coordinates for the start, goal, player, and any holes.
132
+ Coordinates range from the top-left corner (0, 0) to the bottom-right corner (5, 5).
133
+ @@ -195,4 +196,80 @@ custom_envs:
134
+ max_actions_per_traj: 30
135
+ env_instruction: "You are a Lean theorem prover. Given a Lean theorem statement, propose a sequence of tactics that completes the proof. Think step by step about which tactics to apply next. Provide tactics separated by '||', for example <answer>intro || simp || rfl</answer>."
136
+ max_tokens: 512
137
+ - env_config: null # Please refer to ragen/env/lean/config.py for a full list of parameters.
138
+
139
+ + env_config: null # Please refer to ragen/env/lean/config.py for a full list of parameters.
140
+ +
141
+ +
142
+ + game_2048:
143
+ + env_type: game_2048
144
+ + max_actions_per_traj: 700
145
+ + env_instruction: |
146
+ + You are playing the 2048 game on a 4x4 grid. Merge equal tiles by sliding Up, Right, Down, or Left.
147
+ + If a move is invalid (no tiles move), a small penalty is applied. Respond with a single action.
148
+ + Example: <answer>Up</answer>
149
+ + max_tokens: 8192
150
+ + env_config: null
151
+ +
152
+ + blackjack:
153
+ + env_type: blackjack
154
+ + max_actions_per_traj: 10
155
+ + env_instruction: |
156
+ + You are playing Blackjack against a dealer. The dealer must hit on 16 or less and stand on 17 or more.
157
+ + Choose either Stick or Hit. Respond with a single action.
158
+ + Example: <answer>Hit</answer>
159
+ + max_tokens: 64
160
+ + env_config: null
161
+ +
162
+ + rubikscube:
163
+ + env_type: rubikscube
164
+ + max_actions_per_traj: 20
165
+ + env_instruction: |
166
+ + You are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.
167
+ + Available actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.
168
+ + - Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).
169
+ + - Modifiers: A letter alone means 90° clockwise (e.g., 'R'). A letter with prime (') means 90° counter-clockwise (e.g., "R'").
170
+ + Respond with a sequence of actions separated by "||".
171
+ + Example: <answer>U</answer>
172
+ + max_tokens: 96
173
+ + env_config:
174
+ + scramble_depth: 1
175
+ + max_steps: 20
176
+ + render_mode: "text"
177
+ +
178
+ + SimpleSudoku:
179
+ + env_type: sudoku
180
+ + max_actions_per_traj: 20
181
+ + env_instruction: |
182
+ + You are solving a Sudoku puzzle. Fill in the grid so that every row, column, and 2x2 box contains the numbers 1-4 without repetition.
183
+ + Initial cells are shown in [brackets] and cannot be modified. Empty cells are shown as dots (.).
184
+ + Place numbers one at a time using the format, for example: <answer>place 1 at row 2 col 3</answer> or <answer>1,2,3</answer>
185
+ + The environment will provide feedback on valid/invalid moves and show conflicts if any occur.
186
+ + max_tokens: 150
187
+ + parallel_friendly: false
188
+ + max_workers: 32
189
+ + env_config:
190
+ + grid_size: 4
191
+ + difficulty: "easy"
192
+ + render_format: "with_feedback"
193
+ + show_conflicts: false
194
+ + show_valid_numbers: false
195
+ + max_steps: 20
196
+ +
197
+ + MediumSudoku:
198
+ + env_type: sudoku
199
+ + max_actions_per_traj: 30
200
+ + env_instruction: |
201
+ + You are solving a Sudoku puzzle. Fill in the grid so that every row, column, and 3x3 box contains the numbers 1-9 without repetition.
202
+ + Initial cells are shown in [brackets] and cannot be modified. Empty cells are shown as dots (.).
203
+ + Place numbers one at a time using the format: <answer>place 5 at row 2 col 3</answer> or <answer>2,3,5</answer>
204
+ + The environment will provide feedback on valid/invalid moves and show conflicts if any occur.
205
+ + max_tokens: 150
206
+ + parallel_friendly: false
207
+ + max_workers: 32
208
+ + env_config:
209
+ + grid_size: 9
210
+ + difficulty: "medium"
211
+ + render_format: "with_feedback"
212
+ + show_conflicts: true
213
+ + show_valid_numbers: true
214
+ + max_steps: 81
215
+ +
216
+ diff --git a/config/eval.yaml b/config/eval.yaml
217
+ index e65f3a5..7775fd1 100644
218
+ --- a/config/eval.yaml
219
+ +++ b/config/eval.yaml
220
+ @@ -1,14 +1,15 @@
221
+ defaults:
222
+ - envs
223
+ -
224
+ +enable_response_mask: True
225
+ system:
226
+ - CUDA_VISIBLE_DEVICES: "0"
227
+ + CUDA_VISIBLE_DEVICES: "0,1,2,3,4,5,6,7"
228
+
229
+ seed:
230
+ train: 10000
231
+ val: 123
232
+
233
+ -model_path: Qwen/Qwen2.5-3B-Instruct
234
+ +model_path: /mnt/general/share/model/openai/gpt-oss-20b
235
+ +# /mnt/general/share/model/tyzhu/SPA-frozenlake-qwen2.5-1.5b-instruct
236
+
237
+ lora:
238
+ rank: 0
239
+ @@ -24,9 +25,9 @@ actor_rollout_ref:
240
+ rollout:
241
+ name: vllm
242
+ log_prob_micro_batch_size_per_gpu: ${micro_batch_size_per_gpu}
243
+ - tensor_model_parallel_size: 1
244
+ + tensor_model_parallel_size: 8
245
+ dtype: bfloat16
246
+ - max_model_len: 3600
247
+ + max_model_len: 7200
248
+ prompt_length: 1
249
+ response_length: 400
250
+ gpu_memory_utilization: 0.9
251
+ @@ -35,6 +36,7 @@ actor_rollout_ref:
252
+ free_cache_engine: True
253
+ enable_chunked_prefill: False
254
+ disable_log_stats: False
255
+ + do_sample: True
256
+ val_kwargs:
257
+ do_sample: True
258
+ temperature: 0.5
259
+ @@ -44,9 +46,9 @@ actor_rollout_ref:
260
+
261
+ agent_proxy:
262
+ max_context_window: -1
263
+ - max_turn: 5
264
+ + max_turn: 25
265
+ action_sep: "||"
266
+ - max_actions_per_turn: 2
267
+ + max_actions_per_turn: 1
268
+ use_turn_scores: False
269
+ enable_think: True
270
+ reward_normalization:
271
+ @@ -59,13 +61,13 @@ es_manager:
272
+ env_groups: 8
273
+ group_size: 16
274
+ env_configs:
275
+ - tags: ["CoordSokoban"]
276
+ + tags: ["BanditTest"]
277
+ n_groups: [8]
278
+ val:
279
+ env_groups: 32
280
+ - group_size: 16
281
+ + group_size: 128
282
+ env_configs:
283
+ - tags: ["CoordSokoban"]
284
+ + tags: ["BanditTest"]
285
+ n_groups: [32]
286
+
287
+ ctx_manager:
288
+ diff --git a/config/evaluate_api_llm.yaml b/config/evaluate_api_llm.yaml
289
+ index b21c95e..e2e6761 100644
290
+ --- a/config/evaluate_api_llm.yaml
291
+ +++ b/config/evaluate_api_llm.yaml
292
+ @@ -1,8 +1,11 @@
293
+ +#export OPENAI_BASE_URL="https://api.ohmygpt.com/v1"
294
+ +#export OPENAI_API_KEY="sk-o4sMxBkN5BB100C4D4a3T3BlBkFJF7791CA39EA14ca98041"
295
+ +#python -m ragen.eval_api hydra.searchpath='[file://./verl/verl/trainer/config]'
296
+ defaults:
297
+ - base # this is a symbolic link to the verl/verl/trainer/config/ppo_trainer.yaml file
298
+
299
+ model_config:
300
+ - model_name: gpt-4o # should be registered in model_info
301
+ + model_name: ark-deepseek-v3-250324 # should be registered in model_info
302
+ max_concurrency: 16
303
+
304
+ model_info:
305
+ @@ -24,9 +27,9 @@ model_info:
306
+ generation_kwargs:
307
+ temperature: 0
308
+ max_tokens: 512 # max_completion_tokens if o1-mini
309
+ - gpt-4o:
310
+ + gpt-4o-mini:
311
+ provider_name: openai
312
+ - model_name: gpt-4o
313
+ + model_name: gpt-4o-mini
314
+ generation_kwargs:
315
+ temperature: 0
316
+ max_tokens: 512 # max_completion_tokens if o1-mini
317
+ @@ -36,21 +39,42 @@ model_info:
318
+ generation_kwargs:
319
+ temperature: 0
320
+ max_completion_tokens: 512
321
+ + ark-deepseek-v3-250324:
322
+ + provider_name: openai
323
+ + model_name: ark-deepseek-v3-250324
324
+ + generation_kwargs:
325
+ + temperature: 0
326
+ + max_completion_tokens: 512
327
+ deepseek-v3:
328
+ provider_name: deepseek
329
+ model_name: deepseek-chat
330
+ generation_kwargs:
331
+ temperature: 0
332
+ max_completion_tokens: 512
333
+ + glm-4.6:
334
+ + provider_name: openai
335
+ + model_name: glm-4.6
336
+ + generation_kwargs:
337
+ + temperature: 0
338
+ + max_completion_tokens: 512
339
+ + TA/openai/gpt-oss-120b:
340
+ + provider_name: openai
341
+ + model_name: TA/openai/gpt-oss-120b
342
+ + generation_kwargs:
343
+ + temperature: 0
344
+ + max_tokens: 8192
345
+ + # max_retries: 5
346
+
347
+ -
348
+ -
349
+ +agent_proxy:
350
+ + max_turn: 5
351
+ es_manager:
352
+ val:
353
+ - env_groups: 256
354
+ + env_groups: 128
355
+ group_size: 1 # should be set to 1 because val temperature is set to 0 and same prompt leads to same output
356
+ env_configs:
357
+ - tags: ["CoordSokoban"]
358
+ - n_groups: [256] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
359
+ + tags: ["rubikscube"]
360
+ + n_groups: [128] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
361
+
362
+
363
+ +rollout:
364
+ + max_model_len: 7200
365
+
366
+ Submodule external/webshop-minimal contains modified content
367
+ diff --git a/external/webshop-minimal/requirements.txt b/external/webshop-minimal/requirements.txt
368
+ index 5a1b04f..238ed5a 100644
369
+ --- a/external/webshop-minimal/requirements.txt
370
+ +++ b/external/webshop-minimal/requirements.txt
371
+ @@ -4,7 +4,7 @@ flask
372
+ html2text
373
+ rank_bm25
374
+ pyserini
375
+ -faiss-cpu
376
+ +faiss-gpu
377
+ thefuzz
378
+ gdown
379
+ spacy
380
+ diff --git a/ragen/env/__init__.py b/ragen/env/__init__.py
381
+ index b0f3461..bc6838e 100644
382
+ --- a/ragen/env/__init__.py
383
+ +++ b/ragen/env/__init__.py
384
+ @@ -12,6 +12,14 @@ from .metamathqa.env import MetaMathQAEnv
385
+ from .metamathqa.config import MetaMathQAEnvConfig
386
+ from .lean.config import LeanEnvConfig
387
+ from .lean.env import LeanEnv
388
+ +from .game_2048.config import Game2048EnvConfig
389
+ +from .game_2048.env import Game2048Env
390
+ +from .blackjack.config import BlackjackEnvConfig
391
+ +from .blackjack.env import BlackjackEnv
392
+ +from .rubikscube.config import RubiksCube2x2Config
393
+ +from .rubikscube.env import RubiksCube2x2Env
394
+ +from .sudoku.config import SudokuEnvConfig
395
+ +from .sudoku.env import SudokuEnv
396
+
397
+
398
+ REGISTERED_ENVS = {
399
+ @@ -22,6 +30,10 @@ REGISTERED_ENVS = {
400
+ # 'alfworld': AlfredTXTEnv,
401
+ 'metamathqa': MetaMathQAEnv,
402
+ 'lean': LeanEnv,
403
+ + 'game_2048': Game2048Env,
404
+ + 'blackjack': BlackjackEnv,
405
+ + 'rubikscube': RubiksCube2x2Env,
406
+ + 'sudoku': SudokuEnv,
407
+ }
408
+
409
+ REGISTERED_ENV_CONFIGS = {
410
+ @@ -32,6 +44,10 @@ REGISTERED_ENV_CONFIGS = {
411
+ # 'alfworld': AlfredEnvConfig,
412
+ 'metamathqa': MetaMathQAEnvConfig,
413
+ 'lean': LeanEnvConfig,
414
+ + 'game_2048': Game2048EnvConfig,
415
+ + 'blackjack': BlackjackEnvConfig,
416
+ + 'rubikscube': RubiksCube2x2Config,
417
+ + 'sudoku': SudokuEnvConfig,
418
+ }
419
+
420
+ try:
421
+ diff --git a/ragen/env/frozen_lake/config.py b/ragen/env/frozen_lake/config.py
422
+ index de054f4..9950c34 100644
423
+ --- a/ragen/env/frozen_lake/config.py
424
+ +++ b/ragen/env/frozen_lake/config.py
425
+ @@ -8,7 +8,7 @@ class FrozenLakeEnvConfig:
426
+ size: int = 4
427
+ p: float = 0.9
428
+ success_rate: float = 0.8
429
+ - is_slippery: bool = True
430
+ + is_slippery: bool = False
431
+ map_seed: Optional[int] = None
432
+ render_mode: str = "text"
433
+ observation_format: str = "grid"
434
+ diff --git a/ragen/env/frozen_lake/env.py b/ragen/env/frozen_lake/env.py
435
+ index 9ee3add..eef11d8 100644
436
+ --- a/ragen/env/frozen_lake/env.py
437
+ +++ b/ragen/env/frozen_lake/env.py
438
+ @@ -13,6 +13,7 @@ from ragen.env.base import BaseDiscreteActionEnv
439
+ class FrozenLakeEnv(BaseDiscreteActionEnv, GymFrozenLakeEnv):
440
+ def __init__(self, config: FrozenLakeEnvConfig = FrozenLakeEnvConfig()):
441
+ # Using mappings directly from config
442
+ + # import pdb;pdb.set_trace()
443
+ self.config = config
444
+ self.GRID_LOOKUP = config.grid_lookup
445
+ self.ACTION_LOOKUP = config.action_lookup
446
+ @@ -95,6 +96,7 @@ class FrozenLakeEnv(BaseDiscreteActionEnv, GymFrozenLakeEnv):
447
+ if __name__ == "__main__":
448
+ import matplotlib.pyplot as plt
449
+ config = FrozenLakeEnvConfig(size=4, is_slippery=True)
450
+ + # import pdb;pdb.set_trace()
451
+ env = FrozenLakeEnv(config)
452
+ print(env.reset())
453
+ while True:
454
+ diff --git a/ragen/env/sokoban/env.py b/ragen/env/sokoban/env.py
455
+ index 17cd636..6922b54 100644
456
+ --- a/ragen/env/sokoban/env.py
457
+ +++ b/ragen/env/sokoban/env.py
458
+ @@ -33,6 +33,7 @@ class SokobanEnv(BaseDiscreteActionEnv, GymSokobanEnv):
459
+ def reset(self, seed=None, mode=None):
460
+ try:
461
+ with all_seed(seed):
462
+ + # import pdb;pdb.set_trace()
463
+ self.room_fixed, self.room_state, self.box_mapping, action_sequence = generate_room(
464
+ dim=self.dim_room,
465
+ num_steps=self.num_gen_steps,
466
+ diff --git a/ragen/llm_agent/agent_proxy.py b/ragen/llm_agent/agent_proxy.py
467
+ index c25b50d..f6c4088 100644
468
+ --- a/ragen/llm_agent/agent_proxy.py
469
+ +++ b/ragen/llm_agent/agent_proxy.py
470
+ @@ -287,6 +287,7 @@ def main(config):
471
+ proxy = LLMAgentProxy(config, actor_wg, tokenizer)
472
+ import time
473
+ start_time = time.time()
474
+ + # import pdb;pdb.set_trace()
475
+ rollouts = proxy.rollout(
476
+ DataProto(
477
+ batch=None,
478
+ diff --git a/ragen/llm_agent/base_llm.py b/ragen/llm_agent/base_llm.py
479
+ index 358a2eb..b6f7797 100644
480
+ --- a/ragen/llm_agent/base_llm.py
481
+ +++ b/ragen/llm_agent/base_llm.py
482
+ @@ -33,6 +33,7 @@ class OpenAIProvider(LLMProvider):
483
+ raise ValueError("OpenAI API key not provided and not found in environment variables")
484
+
485
+ self.client = AsyncOpenAI(api_key=self.api_key)
486
+ + # import pdb;pdb.set_trace()
487
+
488
+ async def generate(self, messages: List[Dict[str, str]], **kwargs) -> LLMResponse:
489
+ if "o1-mini" in self.model_name:
490
+ @@ -46,10 +47,7 @@ class OpenAIProvider(LLMProvider):
491
+ )
492
+ if response.choices[0].finish_reason in ['length', 'content_filter']:
493
+ raise ValueError("Content filtered or length exceeded")
494
+ - return LLMResponse(
495
+ - content=response.choices[0].message.content,
496
+ - model_name=response.model
497
+ - )
498
+ + return LLMResponse(content=response.choices[0].message.content,model_name=response.model)
499
+
500
+ class DeepSeekProvider(LLMProvider):
501
+ """DeepSeek API provider implementation"""
502
+ @@ -199,7 +197,7 @@ class ConcurrentLLM:
503
+
504
+ # Queue to store unfinished or failed tasks
505
+ current_batch = messages_list.copy()
506
+ - max_retries = kwargs.get("max_retries", 100)
507
+ + max_retries = kwargs.get("max_retries", 10)
508
+ retry_count = 0
509
+
510
+ while current_batch and retry_count < max_retries:
511
+ diff --git a/ragen/llm_agent/ctx_manager.py b/ragen/llm_agent/ctx_manager.py
512
+ index 905247a..af20a01 100644
513
+ --- a/ragen/llm_agent/ctx_manager.py
514
+ +++ b/ragen/llm_agent/ctx_manager.py
515
+ @@ -88,6 +88,7 @@ class ContextManager:
516
+ Initialize the ContextManager.
517
+ Processor is used to process the image data.
518
+ """
519
+ + # import pdb;pdb.set_trace()
520
+ self.config = config
521
+ self.tokenizer = tokenizer
522
+ self.processor = processor
523
+ @@ -311,7 +312,7 @@ class ContextManager:
524
+
525
+ llm_input_texts.append(text_with_prompt)
526
+ messages_list.append(messages)
527
+ -
528
+ + # import pdb;pdb.set_trace()
529
+ inputs = self.tokenizer(llm_input_texts, return_tensors="pt", padding=True, padding_side="left", truncation=False) # We have truncated previously, truncation in tokenizer may cause issues.
530
+ input_ids, attention_mask = inputs.input_ids, inputs.attention_mask
531
+ position_ids = (attention_mask.cumsum(dim=-1) - 1).clamp(min=0)
532
+ @@ -353,6 +354,30 @@ class ContextManager:
533
+ key: np.sum(value) / self.env_nums[key.split("/")[0]]
534
+ for key, value in metrics.items()
535
+ }
536
+ + # Derived metrics for wandb logging
537
+ + try:
538
+ + # charts/avg_episode_return: average across all 2048 env groups
539
+ + ep_keys = [k for k in metrics.keys() if k.endswith('/episodic_return')]
540
+ + if len(ep_keys) > 0:
541
+ + ep_vals = []
542
+ + for k in ep_keys:
543
+ + tag = k.split('/')[0]
544
+ + denom = self.env_nums.get(tag, max(1, len(metrics[k])))
545
+ + ep_vals.append(float(np.sum(metrics[k]) / denom))
546
+ + mean_metrics["charts/avg_episode_return"] = float(np.mean(ep_vals))
547
+ + except Exception:
548
+ + pass
549
+ + try:
550
+ + # rollout/max_tile: max over all envs in this batch
551
+ + tile_keys = [k for k in metrics.keys() if k.endswith('/max_tile')]
552
+ + if len(tile_keys) > 0:
553
+ + tile_vals = []
554
+ + for k in tile_keys:
555
+ + tile_vals.extend(metrics[k])
556
+ + if len(tile_vals) > 0:
557
+ + mean_metrics["rollout/max_tile"] = int(np.max(tile_vals))
558
+ + except Exception:
559
+ + pass
560
+ for key, values in metrics.items():
561
+ if not isinstance(values, list):
562
+ continue
563
+ diff --git a/ragen/llm_agent/es_manager.py b/ragen/llm_agent/es_manager.py
564
+ index b87a2b3..1a49d3e 100644
565
+ --- a/ragen/llm_agent/es_manager.py
566
+ +++ b/ragen/llm_agent/es_manager.py
567
+ @@ -128,18 +128,40 @@ class EnvStateManager:
568
+ env_outputs: List[Dict]
569
+ {env_id: int, history: List[Dict][{state: str, actions: List[str], reward: float, info: Dict, llm_response: str, llm_raw_response: str, (Optional)images: List[PIL.Image.Image]}]}
570
+ """
571
+ + # def _execute_actions(env, actions):
572
+ + # acc_reward, turn_info, turn_done = 0, {}, False
573
+ + # executed_actions = []
574
+ + # for action in actions:
575
+ + # _, reward, done, info = env.step(action)
576
+ + # acc_reward += reward
577
+ + # turn_info.update(info) # NOTE: currently use last info for multi-action
578
+ + # executed_actions.append(action)
579
+ + # if done:
580
+ + # turn_done = True
581
+ + # break
582
+ +
583
+ + # return acc_reward, turn_info, turn_done, executed_actions
584
+ def _execute_actions(env, actions):
585
+ - acc_reward, turn_info, turn_done = 0, {}, False
586
+ + acc_reward, turn_info, turn_done = 0.0, {}, False
587
+ + raw_acc_reward = 0.0
588
+ executed_actions = []
589
+ for action in actions:
590
+ _, reward, done, info = env.step(action)
591
+ - acc_reward += reward
592
+ + acc_reward += float(reward)
593
+ + try:
594
+ + raw_acc_reward += float(info.get('raw_reward', 0.0))
595
+ + except Exception:
596
+ + pass
597
+ turn_info.update(info) # NOTE: currently use last info for multi-action
598
+ executed_actions.append(action)
599
+ if done:
600
+ turn_done = True
601
+ break
602
+ -
603
+ + # Overwrite per-turn raw_reward to reflect the sum across all executed actions in this turn
604
+ + try:
605
+ + turn_info['raw_reward'] = float(raw_acc_reward)
606
+ + except Exception:
607
+ + pass
608
+ return acc_reward, turn_info, turn_done, executed_actions
609
+
610
+ def _log_env_state(status, history, cur_obs, max_actions_per_traj, executed_actions, all_actions, acc_reward, turn_done, turn_info, env_input):
611
+ @@ -198,6 +220,18 @@ class EnvStateManager:
612
+ 'success': float(status.terminated and (not status.truncated)),
613
+ 'num_actions': status.num_actions,
614
+ }
615
+ + # Add episodic-level metrics
616
+ + # try:
617
+ + # # Sum of per-turn rewards equals the episodic return (env-shaped reward)
618
+ + # env_metric['episodic_return'] = float(sum(status.rewards))
619
+ + # except Exception:
620
+ + # pass
621
+ + try:
622
+ + # Final max tile on the board at the end of the rollout
623
+ + import numpy as _np
624
+ + env_metric['max_tile'] = int(_np.max(entry['env'].grid))
625
+ + except Exception:
626
+ + pass
627
+ custom_metric = {}
628
+ for turn in cache['history']:
629
+ for k, v in turn.get('info', {}).items():
630
+ @@ -212,6 +246,12 @@ class EnvStateManager:
631
+ "Skipping non-numeric metric '%s' with value %r for env %s.",
632
+ k, v, entry['tag']
633
+ )
634
+ + # Add episodic_return as the SUM of raw_reward across steps (align with CleanRL)
635
+ + try:
636
+ + if 'raw_reward' in custom_metric:
637
+ + env_metric['episodic_return'] = float(np.sum(custom_metric['raw_reward']))
638
+ + except Exception:
639
+ + pass
640
+ for k, v in custom_metric.items():
641
+ # TODO: Move TURN_LVL_METRICS into the environment
642
+ if "webshop" not in cache['tag'].lower() or ("webshop" in cache['tag'].lower() and k in TURN_LVL_METRICS):
643
+ @@ -219,7 +259,12 @@ class EnvStateManager:
644
+ else:
645
+ env_metric['traj_sum/' + k] = np.sum(v)
646
+
647
+ -
648
+ + try:
649
+ + if 'score' in custom_metric and len(custom_metric['score']) > 0:
650
+ + env_metric['final_score'] = float(custom_metric['score'][-1])
651
+ + except Exception:
652
+ + pass
653
+ +
654
+ cache['history'][-1]['metrics'] = custom_metric
655
+ env_metric = {f"{entry['tag']}/{k}": v for k, v in env_metric.items()}
656
+ cache['metrics'] = env_metric
657
+ diff --git a/requirements.txt b/requirements.txt
658
+ index 2fd756e..9b521bf 100644
659
+ --- a/requirements.txt
660
+ +++ b/requirements.txt
661
+ @@ -7,7 +7,6 @@ accelerate
662
+ codetiming
663
+ datasets
664
+ dill
665
+ -flash-attn==2.7.4.post1
666
+ hydra-core
667
+ numpy
668
+ pandas
669
+ @@ -15,19 +14,19 @@ pybind11
670
+ ray>=2.10
671
+ tensordict>=0.8.0,<0.9.0
672
+ transformers
673
+ -vllm==0.8.2
674
+ +vllm==0.8.5
675
+ wandb
676
+ gymnasium
677
+ gymnasium[toy-text]
678
+
679
+ pyarrow>=15.0.0
680
+ pylatexenc
681
+ -torchdata
682
+ +# torchdata
683
+ debugpy
684
+
685
+ together
686
+ anthropic
687
+ -faiss-cpu==1.11.0
688
+ +faiss-gpu
689
+
690
+ # This is optional, but needs to be installed with main requirements if you want to use webshop
691
+ -r external/webshop-minimal/requirements.txt
692
+ diff --git a/scripts/setup_ragen.sh b/scripts/setup_ragen.sh
693
+ index f9a7cd9..85a93c4 100644
694
+ --- a/scripts/setup_ragen.sh
695
+ +++ b/scripts/setup_ragen.sh
696
+ @@ -94,10 +94,10 @@ main() {
697
+ pip install torch==2.5.0 --index-url https://download.pytorch.org/whl/cu124
698
+
699
+ print_step "Installing flash-attention..."
700
+ - pip3 install flash-attn==2.7.4.post1 --no-build-isolation
701
+ + # pip3 install flash-attn==2.7.4.post1 --no-build-isolation
702
+ else
703
+ print_step "Installing PyTorch without CUDA support..."
704
+ - pip install torch==2.5.0
705
+ + pip install torch==2.4.0
706
+ fi
707
+
708
+ # Install remaining requirements
709
+ @@ -137,8 +137,8 @@ main() {
710
+ conda install conda-forge::gdown
711
+ mkdir -p external/webshop-minimal/webshop_minimal/data/full
712
+ cd external/webshop-minimal/webshop_minimal/data/full
713
+ - gdown https://drive.google.com/uc?id=1A2whVgOO0euk5O13n2iYDM0bQRkkRduB # items_shuffle
714
+ - gdown https://drive.google.com/uc?id=1s2j6NgHljiZzQNL3veZaAiyW_qDEgBNi # items_ins_v2
715
+ + # gdown https://drive.google.com/uc?id=1A2whVgOO0euk5O13n2iYDM0bQRkkRduB # items_shuffle
716
+ + # gdown https://drive.google.com/uc?id=1s2j6NgHljiZzQNL3veZaAiyW_qDEgBNi # items_ins_v2
717
+ cd ../../../../..
718
+
719
+ echo -e "${GREEN}Installation completed successfully!${NC}"
720
+ diff --git a/train_all.sh b/train_all.sh
721
+ index 0157306..33035f5 100755
722
+ --- a/train_all.sh
723
+ +++ b/train_all.sh
724
+ @@ -6,246 +6,257 @@ USE_GRPO="algorithm.adv_estimator=grpo"
725
+ USE_PPO="algorithm.adv_estimator=gae" # by default.
726
+ USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
727
+
728
+ +
729
+ +# python train.py --config-name _8_2048 system.CUDA_VISIBLE_DEVICES="'0,1,2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=game_2048 $USE_PPO $USE_BASE
730
+ +
731
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'0,1'" trainer.project_name=ragen_latest_qwen_05B_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=rubikscube-1 $USE_PPO $USE_BASE
732
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-1.5B-Instruct trainer.experiment_name=rubikscube-2 $USE_PPO $USE_BASE
733
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'4,5'" trainer.project_name=ragen_latest_qwen_25_3b_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-3B-Instruct trainer.experiment_name=rubikscube-2 $USE_PPO $USE_BASE
734
+ +python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'6,7'" trainer.project_name=ragen_latest_qwen_05B_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=rubikscube-3 $USE_PPO $USE_BASE
735
+ +
736
+ # Section 3.1&3.2 - General Observations
737
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-ppo $USE_PPO $USE_BASE &
738
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-grpo $USE_GRPO $USE_BASE &
739
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE &
740
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-grpo $USE_GRPO $USE_BASE &
741
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozen_lake-ppo $USE_PPO $USE_BASE &
742
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozen_lake-grpo $USE_GRPO $USE_BASE &
743
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="'6,7'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=bandit-ppo-multitask $USE_PPO $USE_BASE &
744
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="'7'" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-ppo-frommlp $USE_PPO $USE_BASE
745
+
746
+ -# Section 4.1 - Filtering and critic
747
+ -# 0.25
748
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.25 actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
749
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
750
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
751
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
752
+ -
753
+ -wait
754
+ -
755
+ -# 0.5
756
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-ppo-rolloutfilter0.5 actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
757
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
758
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
759
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
760
+ -
761
+ -# 0.75
762
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.75 actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
763
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
764
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
765
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
766
+ -
767
+ -wait
768
+ -
769
+ -# Section 4.2 - Ablation on Critic/ClipHigh/KL. Start from Basic and add more components. The best setting for StarPO in agent is rollout_filter+Critic+Cliphigh+NoKL
770
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
771
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
772
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
773
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
774
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozenlake-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
775
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozenlake-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
776
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozenlake-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
777
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozenlake-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
778
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="'0,1'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=sokoban-ppo-box1-multitask $USE_PPO $USE_BASE
779
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-grpo $USE_GRPO $USE_BASE &
780
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
781
+
782
+ -wait
783
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'4,5,6,7'" trainer.project_name=ragen_latest_qwen_25_3b_it trainer.n_gpus_per_node=4 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_3B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
784
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'4,5,6,7'" trainer.n_gpus_per_node=4 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
785
+
786
+ -# Section 5.1 - Reasoning Helps Generalization
787
+ +# # Section 4.1 - Filtering and critic
788
+ +# # 0.25
789
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.25 actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
790
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
791
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
792
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
793
+
794
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-generalization \
795
+ - custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
796
+ - custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
797
+ - custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
798
+ - custom_envs.BanditTest.env_config.hi_arm_name="Librarian"
799
+ +# wait
800
+
801
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-generalization-nothink \
802
+ - custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
803
+ - custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
804
+ - custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
805
+ - custom_envs.BanditTest.env_config.hi_arm_name="Librarian" \
806
+ - agent_proxy.enable_think=False
807
+ +# # 0.5
808
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-ppo-rolloutfilter0.5 actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
809
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
810
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
811
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
812
+ +
813
+ +# # 0.75
814
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.75 actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
815
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
816
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
817
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
818
+
819
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=bandit-generalization-rev \
820
+ - custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
821
+ - custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
822
+ - custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
823
+ - custom_envs.BanditTest.env_config.hi_arm_name="Trader"
824
+ +# wait
825
+
826
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=bandit-generalization-rev-nothink \
827
+ - custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
828
+ - custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
829
+ - custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
830
+ - custom_envs.BanditTest.env_config.hi_arm_name="Trader" \
831
+ - agent_proxy.enable_think=False
832
+ +# # Section 4.2 - Ablation on Critic/ClipHigh/KL. Start from Basic and add more components. The best setting for StarPO in agent is rollout_filter+Critic+Cliphigh+NoKL
833
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
834
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
835
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
836
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
837
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozenlake-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
838
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozenlake-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
839
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozenlake-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
840
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozenlake-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
841
+
842
+ +# wait
843
+
844
+ -SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
845
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization micro_batch_size_per_gpu=8 model_path=Qwen/Qwen2.5-1.5B-Instruct&
846
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-generalization-nothink $SOKOBAN_GENERALIZATION_CONFIG agent_proxy.enable_think=False &
847
+ +# # Section 5.1 - Reasoning Helps Generalization
848
+
849
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-generalization \
850
+ +# custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
851
+ +# custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
852
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
853
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Librarian"
854
+
855
+ -# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=128 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SokobanDifferentGridVocab] es_manager.val.env_configs.n_groups=[128]"
856
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG &
857
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-generalization-nothink \
858
+ +# custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
859
+ +# custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
860
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
861
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Librarian" \
862
+ +# agent_proxy.enable_think=False
863
+
864
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=bandit-generalization-rev \
865
+ +# custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
866
+ +# custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
867
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
868
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Trader"
869
+
870
+ -# COMPOSITIONALITY_CONFIG="es_manager.train.env_groups=16 es_manager.train.env_configs.tags=[Bandit,SimpleSokoban] es_manager.train.env_configs.n_groups=[8,8] es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[Bandit,SimpleSokoban,LargerSokoban,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128] actor_rollout_ref.rollout.rollout_filter_ratio=1" # NOTE that we don't filter out low-var rollout in this setting
871
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=compositional-generalization $COMPOSITIONALITY_CONFIG &
872
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=compositional-generalization-nothink $COMPOSITIONALITY_CONFIG agent_proxy.enable_think=False &
873
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=bandit-generalization-rev-nothink \
874
+ +# custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
875
+ +# custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
876
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
877
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Trader" \
878
+ +# agent_proxy.enable_think=False
879
+
880
+ -wait
881
+
882
+ -# Section 5.2 - what leads to better reasoning?
883
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B-Instruct &
884
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B-Instruct &
885
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct trainer.n_gpus_per_node=2 &
886
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B-Instruct trainer.n_gpus_per_node=4 &
887
+ +# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
888
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization micro_batch_size_per_gpu=8 model_path=Qwen/Qwen2.5-1.5B-Instruct&
889
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-generalization-nothink $SOKOBAN_GENERALIZATION_CONFIG agent_proxy.enable_think=False &
890
+
891
+ -wait
892
+
893
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B &
894
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B &
895
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B &
896
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B &
897
+ +# # SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=128 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SokobanDifferentGridVocab] es_manager.val.env_configs.n_groups=[128]"
898
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG &
899
+
900
+ -wait
901
+
902
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-7B &
903
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B &
904
+ +# # COMPOSITIONALITY_CONFIG="es_manager.train.env_groups=16 es_manager.train.env_configs.tags=[Bandit,SimpleSokoban] es_manager.train.env_configs.n_groups=[8,8] es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[Bandit,SimpleSokoban,LargerSokoban,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128] actor_rollout_ref.rollout.rollout_filter_ratio=1" # NOTE that we don't filter out low-var rollout in this setting
905
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=compositional-generalization $COMPOSITIONALITY_CONFIG &
906
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=compositional-generalization-nothink $COMPOSITIONALITY_CONFIG agent_proxy.enable_think=False &
907
+
908
+ +# wait
909
+
910
+ -wait
911
+ +# # Section 5.2 - what leads to better reasoning?
912
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B-Instruct &
913
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B-Instruct &
914
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct trainer.n_gpus_per_node=2 &
915
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B-Instruct trainer.n_gpus_per_node=4 &
916
+
917
+ -# Section 6.1 varying action count
918
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-action-count-1 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=5 custom_envs.LargerSokoban.max_actions_per_traj=5 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=5 custom_envs.FrozenLake.max_actions_per_traj=5 agent_proxy.max_actions_per_turn=1 &
919
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-action-count-2 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=10 custom_envs.LargerSokoban.max_actions_per_traj=10 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=10 custom_envs.FrozenLake.max_actions_per_traj=10 agent_proxy.max_actions_per_turn=2 &
920
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-action-count-3 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=15 custom_envs.LargerSokoban.max_actions_per_traj=15 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=15 custom_envs.FrozenLake.max_actions_per_traj=15 agent_proxy.max_actions_per_turn=3 &
921
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-action-count-4 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=20 custom_envs.LargerSokoban.max_actions_per_traj=20 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=20 custom_envs.FrozenLake.max_actions_per_traj=20 agent_proxy.max_actions_per_turn=4 &
922
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-action-count-5 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=25 custom_envs.LargerSokoban.max_actions_per_traj=25 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=25 custom_envs.FrozenLake.max_actions_per_traj=25 agent_proxy.max_actions_per_turn=5 &
923
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-action-count-6 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=30 custom_envs.LargerSokoban.max_actions_per_traj=30 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=30 custom_envs.FrozenLake.max_actions_per_traj=30 agent_proxy.max_actions_per_turn=6 &
924
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-action-count-7 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=35 custom_envs.LargerSokoban.max_actions_per_traj=35 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=35 custom_envs.FrozenLake.max_actions_per_traj=35 agent_proxy.max_actions_per_turn=7 &
925
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-action-count-8 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=40 custom_envs.LargerSokoban.max_actions_per_traj=40 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=40 custom_envs.FrozenLake.max_actions_per_traj=40 agent_proxy.max_actions_per_turn=8 &
926
+ +# wait
927
+
928
+ -# section 6.2 Varying prompt diversity
929
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-prompt-diversity-4 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=4 es_manager.train.group_size=32 es_manager.train.env_configs.n_groups=[4] &
930
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-prompt-diversity-8 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] &
931
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-prompt-diversity-16 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=8 es_manager.train.env_configs.n_groups=[16] &
932
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-prompt-diversity-32 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=32 es_manager.train.group_size=4 es_manager.train.env_configs.n_groups=[32] &
933
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-prompt-diversity-64 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=64 es_manager.train.group_size=2 es_manager.train.env_configs.n_groups=[64] &
934
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-prompt-diversity-128 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=128 es_manager.train.group_size=1 es_manager.train.env_configs.n_groups=[128] &
935
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B &
936
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B &
937
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B &
938
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B &
939
+
940
+ -wait
941
+ +# wait
942
+
943
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-online-2 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[16] trainer.total_training_steps=100 trainer.test_freq=5 &
944
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-7B &
945
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B &
946
+
947
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-online-5 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=40 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[40] trainer.total_training_steps=40 trainer.test_freq=2 &
948
+
949
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-online-10 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=80 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[80] trainer.total_training_steps=80 trainer.test_freq=1 &
950
+ +# wait
951
+
952
+ +# # Section 6.1 varying action count
953
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-action-count-1 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=5 custom_envs.LargerSokoban.max_actions_per_traj=5 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=5 custom_envs.FrozenLake.max_actions_per_traj=5 agent_proxy.max_actions_per_turn=1 &
954
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-action-count-2 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=10 custom_envs.LargerSokoban.max_actions_per_traj=10 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=10 custom_envs.FrozenLake.max_actions_per_traj=10 agent_proxy.max_actions_per_turn=2 &
955
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-action-count-3 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=15 custom_envs.LargerSokoban.max_actions_per_traj=15 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=15 custom_envs.FrozenLake.max_actions_per_traj=15 agent_proxy.max_actions_per_turn=3 &
956
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-action-count-4 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=20 custom_envs.LargerSokoban.max_actions_per_traj=20 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=20 custom_envs.FrozenLake.max_actions_per_traj=20 agent_proxy.max_actions_per_turn=4 &
957
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-action-count-5 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=25 custom_envs.LargerSokoban.max_actions_per_traj=25 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=25 custom_envs.FrozenLake.max_actions_per_traj=25 agent_proxy.max_actions_per_turn=5 &
958
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-action-count-6 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=30 custom_envs.LargerSokoban.max_actions_per_traj=30 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=30 custom_envs.FrozenLake.max_actions_per_traj=30 agent_proxy.max_actions_per_turn=6 &
959
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-action-count-7 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=35 custom_envs.LargerSokoban.max_actions_per_traj=35 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=35 custom_envs.FrozenLake.max_actions_per_traj=35 agent_proxy.max_actions_per_turn=7 &
960
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-action-count-8 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=40 custom_envs.LargerSokoban.max_actions_per_traj=40 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=40 custom_envs.FrozenLake.max_actions_per_traj=40 agent_proxy.max_actions_per_turn=8 &
961
+
962
+ +# # section 6.2 Varying prompt diversity
963
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-prompt-diversity-4 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=4 es_manager.train.group_size=32 es_manager.train.env_configs.n_groups=[4] &
964
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-prompt-diversity-8 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] &
965
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-prompt-diversity-16 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=8 es_manager.train.env_configs.n_groups=[16] &
966
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-prompt-diversity-32 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=32 es_manager.train.group_size=4 es_manager.train.env_configs.n_groups=[32] &
967
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-prompt-diversity-64 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=64 es_manager.train.group_size=2 es_manager.train.env_configs.n_groups=[64] &
968
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-prompt-diversity-128 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=128 es_manager.train.group_size=1 es_manager.train.env_configs.n_groups=[128] &
969
+
970
+ +# wait
971
+
972
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-online-2 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[16] trainer.total_training_steps=100 trainer.test_freq=5 &
973
+
974
+ -# Extension: Training 7B reasoning model
975
+ -SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
976
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct-largescale $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] micro_batch_size_per_gpu=8 ppo_mini_batch_size=64 actor_rollout_ref.rollout.response_length=1024 actor_rollout_ref.rollout.max_model_len=6400 trainer.test_freq=5 actor_rollout_ref.rollout.max_num_batched_tokens=24000 micro_batch_size_per_gpu=2 actor_rollout_ref.rollout.rollout_filter_ratio=1 &
977
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-online-5 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=40 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[40] trainer.total_training_steps=40 trainer.test_freq=2 &
978
+
979
+ -python -m ragen.llm_agent.agent_proxy model_path=Qwen/Qwen2.5-3B-Instruct system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 actor_rollout_ref.rollout.tensor_model_parallel_size=4 actor_rollout_ref.rollout.response_length=2048 actor_rollout_ref.rollout.max_model_len=12800
980
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-online-10 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=80 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[80] trainer.total_training_steps=80 trainer.test_freq=1 &
981
+
982
+ -# trainer.save_freq=50 trainer.default_local_dir=/mnt/local/cache/exp_name
983
+
984
+ -# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
985
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization &
986
+
987
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/bandit-generalization &
988
+
989
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=frozenlake-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/frozenlake-generalization &
990
+
991
+ +# # Extension: Training 7B reasoning model
992
+ +# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
993
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct-largescale $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] micro_batch_size_per_gpu=8 ppo_mini_batch_size=64 actor_rollout_ref.rollout.response_length=1024 actor_rollout_ref.rollout.max_model_len=6400 trainer.test_freq=5 actor_rollout_ref.rollout.max_num_batched_tokens=24000 micro_batch_size_per_gpu=2 actor_rollout_ref.rollout.rollout_filter_ratio=1 &
994
+
995
+ +# python -m ragen.llm_agent.agent_proxy model_path=Qwen/Qwen2.5-3B-Instruct system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 actor_rollout_ref.rollout.tensor_model_parallel_size=4 actor_rollout_ref.rollout.response_length=2048 actor_rollout_ref.rollout.max_model_len=12800
996
+
997
+ +# # trainer.save_freq=50 trainer.default_local_dir=/mnt/local/cache/exp_name
998
+
999
+ -# USE_PPO="algorithm.adv_estimator=gae" # by default.
1000
+ -# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1001
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE ppo_mini_batch_size=64 enable_response_mask=True &
1002
+ +# # USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1003
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization &
1004
+
1005
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/bandit-generalization &
1006
+
1007
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std &
1008
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=frozenlake-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/frozenlake-generalization &
1009
+
1010
+ -# enable_response_mask: False
1011
+ -# grpo_advantage_length_weight: True
1012
+
1013
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo-1-5b algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std agent_proxy.max_actions_per_turn=5 custom_envs.SimpleSokoban.max_actions_per_traj=25 enable_response_mask=True grpo_advantage_length_weight=False model_path=Qwen/Qwen2.5-1.5B-Instruct &
1014
+
1015
+
1016
+ -# extension: 7B with lora. Currently NOT recommended to use lora: within current version of vllm, this could result in rollouts slower than non-lora by 100%
1017
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-7B-Instruct trainer.experiment_name=sokoban_7b_instruct_lora_newversion lora.rank=16
1018
+ +# # USE_PPO="algorithm.adv_estimator=gae" # by default.
1019
+ +# # USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1020
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE ppo_mini_batch_size=64 enable_response_mask=True &
1021
+
1022
+ -# extension: bi-level gae
1023
+ -python train.py trainer.experiment_name=sokoban-bi-level-gae-final \
1024
+ - system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
1025
+ - model_path=Qwen/Qwen2.5-0.5B-Instruct \
1026
+ - algorithm.bi_level_gae=True algorithm.high_level_gamma=0.95 \
1027
+ - agent_proxy.use_turn_scores=True \
1028
+ - actor_rollout_ref.rollout.tp_size_check=False
1029
+
1030
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std &
1031
+
1032
+ -# extension: webshop
1033
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1034
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1035
+ - trainer.experiment_name=webshop-3b-ppo-s $USE_PPO \
1036
+ - trainer.nnodes=1 &
1037
+ +# # enable_response_mask: False
1038
+ +# # grpo_advantage_length_weight: True
1039
+
1040
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo-1-5b algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std agent_proxy.max_actions_per_turn=5 custom_envs.SimpleSokoban.max_actions_per_traj=25 enable_response_mask=True grpo_advantage_length_weight=False model_path=Qwen/Qwen2.5-1.5B-Instruct &
1041
+
1042
+ -USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1043
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1044
+ - trainer.experiment_name=webshop-3b-grpo-s $USE_GRPO \
1045
+ - trainer.nnodes=1 &
1046
+
1047
+ -# StarPO ppo
1048
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1049
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1050
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1051
+ - trainer.experiment_name=webshop-3b-ppo $USE_PPO $USE_BASE \
1052
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1053
+ - trainer.nnodes=1 &
1054
+ +# # extension: 7B with lora. Currently NOT recommended to use lora: within current version of vllm, this could result in rollouts slower than non-lora by 100%
1055
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-7B-Instruct trainer.experiment_name=sokoban_7b_instruct_lora_newversion lora.rank=16
1056
+
1057
+ -# StarPO grpo
1058
+ -USE_GRPO="algorithm.adv_estimator=grpo"
1059
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1060
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1061
+ - trainer.experiment_name=webshop-3b-grpo $USE_GRPO $USE_BASE \
1062
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1063
+ - trainer.nnodes=1 &
1064
+ +# # extension: bi-level gae
1065
+ +# python train.py trainer.experiment_name=sokoban-bi-level-gae-final \
1066
+ +# system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
1067
+ +# model_path=Qwen/Qwen2.5-0.5B-Instruct \
1068
+ +# algorithm.bi_level_gae=True algorithm.high_level_gamma=0.95 \
1069
+ +# agent_proxy.use_turn_scores=True \
1070
+ +# actor_rollout_ref.rollout.tp_size_check=False
1071
+
1072
+
1073
+ -# normal:sokoban
1074
+ -# extension: sokoban
1075
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1076
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1077
+ - trainer.experiment_name=sokoban-3b-ppo-s $USE_PPO \
1078
+ - trainer.nnodes=1 &
1079
+ +# # extension: webshop
1080
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1081
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1082
+ +# trainer.experiment_name=webshop-3b-ppo-s $USE_PPO \
1083
+ +# trainer.nnodes=1 &
1084
+
1085
+
1086
+ -USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1087
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1088
+ - trainer.experiment_name=sokoban-3b-grpo-s $USE_GRPO \
1089
+ - trainer.nnodes=1 &
1090
+ +# USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1091
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1092
+ +# trainer.experiment_name=webshop-3b-grpo-s $USE_GRPO \
1093
+ +# trainer.nnodes=1 &
1094
+
1095
+ -# StarPO ppo
1096
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1097
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1098
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1099
+ - trainer.experiment_name=sokoban-3b-ppo $USE_PPO $USE_BASE \
1100
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1101
+ - trainer.nnodes=1 &
1102
+ +# # StarPO ppo
1103
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1104
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1105
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1106
+ +# trainer.experiment_name=webshop-3b-ppo $USE_PPO $USE_BASE \
1107
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1108
+ +# trainer.nnodes=1 &
1109
+
1110
+ -# StarPO grpo
1111
+ -USE_GRPO="algorithm.adv_estimator=grpo"
1112
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1113
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1114
+ - trainer.experiment_name=sokoban-3b-grpo $USE_GRPO $USE_BASE \
1115
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1116
+ - trainer.nnodes=1 &
1117
+ +# # StarPO grpo
1118
+ +# USE_GRPO="algorithm.adv_estimator=grpo"
1119
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1120
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1121
+ +# trainer.experiment_name=webshop-3b-grpo $USE_GRPO $USE_BASE \
1122
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1123
+ +# trainer.nnodes=1 &
1124
+ +
1125
+ +
1126
+ +# # normal:sokoban
1127
+ +# # extension: sokoban
1128
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1129
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1130
+ +# trainer.experiment_name=sokoban-3b-ppo-s $USE_PPO \
1131
+ +# trainer.nnodes=1 &
1132
+ +
1133
+ +
1134
+ +# USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1135
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1136
+ +# trainer.experiment_name=sokoban-3b-grpo-s $USE_GRPO \
1137
+ +# trainer.nnodes=1 &
1138
+ +
1139
+ +# # StarPO ppo
1140
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1141
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1142
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1143
+ +# trainer.experiment_name=sokoban-3b-ppo $USE_PPO $USE_BASE \
1144
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1145
+ +# trainer.nnodes=1 &
1146
+ +
1147
+ +# # StarPO grpo
1148
+ +# USE_GRPO="algorithm.adv_estimator=grpo"
1149
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1150
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1151
+ +# trainer.experiment_name=sokoban-3b-grpo $USE_GRPO $USE_BASE \
1152
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1153
+ +# trainer.nnodes=1 &
1154
+
1155
+
1156
+
1157
+ -python train.py \
1158
+ - trainer.experiment_name=3b-full-ppo-test system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2
1159
+
1160
+ +# python train.py \
1161
+ +# trainer.experiment_name=3b-full-ppo-test system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2
1162
+
wandb/run-20251218_184253-g8kppnjh/files/requirements.txt ADDED
@@ -0,0 +1,315 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ colorama==0.4.6
2
+ psutil==7.1.2
3
+ ragen==0.1
4
+ ragen==0.1
5
+ setuptools==80.9.0
6
+ wheel==0.45.1
7
+ pip==25.3
8
+ ragen==0.1
9
+ pytz==2025.2
10
+ nvidia-cusparselt-cu12==0.6.2
11
+ mpmath==1.3.0
12
+ typing_extensions==4.15.0
13
+ sympy==1.13.1
14
+ pylatexenc==2.10
15
+ nvidia-cusolver-cu12==11.6.1.9
16
+ numpy==1.26.4
17
+ Markdown==3.10
18
+ absl-py==2.3.1
19
+ pyasn1_modules==0.4.2
20
+ Werkzeug==3.1.3
21
+ networkx==3.3
22
+ MarkupSafe==2.1.5
23
+ fsspec==2025.9.0
24
+ filelock==3.19.1
25
+ nvidia-cudnn-cu12==9.1.0.70
26
+ Jinja2==3.1.6
27
+ tensorboard==2.20.0
28
+ triton==3.2.0
29
+ pillow==11.3.0
30
+ xxhash==3.6.0
31
+ nvidia-nvtx-cu12==12.4.127
32
+ nvidia-nvjitlink-cu12==12.4.127
33
+ nvidia-nccl-cu12==2.21.5
34
+ nvidia-curand-cu12==10.3.5.147
35
+ wrapt==2.0.1
36
+ nvidia-cufft-cu12==11.2.1.3
37
+ pyjnius==1.7.0
38
+ nvidia-cuda-runtime-cu12==12.4.127
39
+ nvidia-cuda-nvrtc-cu12==12.4.127
40
+ websockets==15.0.1
41
+ nvidia-cuda-cupti-cu12==12.4.127
42
+ zipp==3.23.0
43
+ nvidia-cublas-cu12==12.4.5.8
44
+ nvidia-cusparse-cu12==12.3.1.170
45
+ flash_attn==2.8.3
46
+ rsa==4.9.1
47
+ einops==0.8.1
48
+ py-cpuinfo==9.0.0
49
+ pure_eval==0.2.3
50
+ ptyprocess==0.7.0
51
+ gym-notices==0.1.0
52
+ flatbuffers==25.9.23
53
+ fastrlock==0.8.3
54
+ Farama-Notifications==0.0.4
55
+ faiss-gpu==1.7.2
56
+ antlr4-python3-runtime==4.9.3
57
+ wcwidth==0.2.14
58
+ wasabi==1.1.3
59
+ uvloop==0.22.1
60
+ urllib3==2.5.0
61
+ tzdata==2025.2
62
+ typing-inspection==0.4.2
63
+ traitlets==5.14.3
64
+ tqdm==4.67.1
65
+ tomli==2.3.0
66
+ threadpoolctl==3.6.0
67
+ tenacity==9.1.2
68
+ tabulate==0.9.0
69
+ spacy-loggers==1.0.5
70
+ spacy-legacy==3.0.12
71
+ soupsieve==2.8
72
+ sniffio==1.3.1
73
+ smmap==5.0.2
74
+ six==1.17.0
75
+ shellingham==1.5.4
76
+ sentencepiece==0.2.1
77
+ scipy==1.15.3
78
+ safetensors==0.6.2
79
+ rpds-py==0.29.0
80
+ rignore==0.7.6
81
+ regex==2025.11.3
82
+ RapidFuzz==3.14.3
83
+ rank-bm25==0.2.2
84
+ pyzmq==27.1.0
85
+ PyYAML==6.0.3
86
+ pytokens==0.3.0
87
+ python-multipart==0.0.20
88
+ python-json-logger==4.0.0
89
+ python-dotenv==1.2.1
90
+ PySocks==1.7.1
91
+ pyparsing==3.2.5
92
+ PyJWT==2.10.1
93
+ Pygments==2.19.2
94
+ pygame==2.6.1
95
+ pydantic_core==2.41.5
96
+ pycparser==2.23
97
+ pycountry==24.6.1
98
+ pybind11==3.0.1
99
+ pyarrow==22.0.0
100
+ psutil==7.1.3
101
+ protobuf==4.25.8
102
+ propcache==0.4.1
103
+ prometheus_client==0.23.1
104
+ platformdirs==4.5.0
105
+ pexpect==4.9.0
106
+ pathspec==0.12.1
107
+ partial-json-parser==0.2.1.1.post6
108
+ parso==0.8.5
109
+ packaging==25.0
110
+ orjson==3.11.4
111
+ opentelemetry-semantic-conventions-ai==0.4.13
112
+ opencv-python-headless==4.12.0.88
113
+ ninja==1.13.0
114
+ nest-asyncio==1.6.0
115
+ mypy_extensions==1.1.0
116
+ murmurhash==1.0.15
117
+ multidict==6.7.0
118
+ msgspec==0.19.0
119
+ msgpack==1.1.2
120
+ mdurl==0.1.2
121
+ loguru==0.7.3
122
+ llvmlite==0.44.0
123
+ llguidance==0.7.30
124
+ lark==1.2.2
125
+ kiwisolver==1.4.9
126
+ joblib==1.5.2
127
+ jiter==0.12.0
128
+ itsdangerous==2.2.0
129
+ interegular==0.3.3
130
+ ImageIO==2.37.2
131
+ idna==3.11
132
+ humanfriendly==10.0
133
+ httpx-sse==0.4.3
134
+ httptools==0.7.1
135
+ html2text==2025.4.15
136
+ hf-xet==1.2.0
137
+ h11==0.16.0
138
+ grpcio==1.76.0
139
+ frozenlist==1.8.0
140
+ fonttools==4.60.1
141
+ executing==2.2.1
142
+ exceptiongroup==1.3.0
143
+ eval_type_backport==0.2.2
144
+ docstring_parser==0.17.0
145
+ dnspython==2.8.0
146
+ distro==1.9.0
147
+ diskcache==5.6.3
148
+ dill==0.4.0
149
+ decorator==5.2.1
150
+ debugpy==1.8.17
151
+ Cython==3.2.1
152
+ cymem==2.0.13
153
+ cycler==0.12.1
154
+ cupy-cuda12x==13.6.0
155
+ contourpy==1.3.2
156
+ colorama==0.4.6
157
+ codetiming==1.4.0
158
+ cloudpickle==3.1.2
159
+ cloudpathlib==0.23.0
160
+ click==8.3.1
161
+ charset-normalizer==3.4.4
162
+ certifi==2025.11.12
163
+ catalogue==2.0.10
164
+ cachetools==6.2.2
165
+ blis==1.3.2
166
+ blinker==1.9.0
167
+ blake3==1.0.8
168
+ attrs==25.4.0
169
+ async-timeout==5.0.1
170
+ asttokens==3.0.1
171
+ astor==0.8.1
172
+ annotated-types==0.7.0
173
+ annotated-doc==0.0.4
174
+ airportsdata==20250909
175
+ aiohappyeyeballs==2.6.1
176
+ yarl==1.22.0
177
+ uvicorn==0.38.0
178
+ typer-slim==0.20.0
179
+ thefuzz==0.22.1
180
+ stack-data==0.6.3
181
+ srsly==2.5.1
182
+ smart_open==7.5.0
183
+ sentry-sdk==2.44.0
184
+ scikit-learn==1.7.2
185
+ requests==2.32.5
186
+ referencing==0.37.0
187
+ python-dateutil==2.9.0.post0
188
+ pydantic==2.12.4
189
+ prompt_toolkit==3.0.52
190
+ preshed==3.0.11
191
+ opentelemetry-proto==1.26.0
192
+ omegaconf==2.3.0
193
+ numba==0.61.2
194
+ nltk==3.9.2
195
+ multiprocess==0.70.18
196
+ matplotlib-inline==0.2.1
197
+ markdown-it-py==4.0.0
198
+ jedi==0.19.2
199
+ importlib_metadata==8.0.0
200
+ httpcore==1.0.9
201
+ gymnasium==1.2.2
202
+ gym==0.26.2
203
+ googleapis-common-protos==1.72.0
204
+ gitdb==4.0.12
205
+ gguf==0.17.1
206
+ Flask==3.1.2
207
+ faiss-cpu==1.13.0
208
+ email-validator==2.3.0
209
+ depyf==0.18.0
210
+ Deprecated==1.3.1
211
+ coloredlogs==15.0.1
212
+ cffi==2.0.0
213
+ black==25.11.0
214
+ beautifulsoup4==4.14.2
215
+ anyio==4.11.0
216
+ aiosignal==1.4.0
217
+ watchfiles==1.1.1
218
+ tiktoken==0.12.0
219
+ starlette==0.49.3
220
+ sse-starlette==3.0.3
221
+ rich==14.2.0
222
+ pydantic-settings==2.12.0
223
+ pydantic-extra-types==2.10.6
224
+ pandas==2.3.3
225
+ opentelemetry-exporter-otlp-proto-common==1.26.0
226
+ onnxruntime==1.23.2
227
+ matplotlib==3.10.7
228
+ lm-format-enforcer==0.10.12
229
+ jsonschema-specifications==2025.9.1
230
+ ipython==8.37.0
231
+ hydra-core==1.3.2
232
+ huggingface-hub==0.36.0
233
+ httpx==0.28.1
234
+ gym-sokoban==0.0.6
235
+ GitPython==3.1.45
236
+ cryptography==46.0.3
237
+ confection==0.1.5
238
+ cleantext==1.1.4
239
+ aiohttp==3.13.2
240
+ weasel==0.4.3
241
+ wandb==0.23.0
242
+ typer==0.19.2
243
+ virtualenv==20.35.4
244
+ pyasn1==0.6.1
245
+ torch==2.6.0
246
+ tokenizers==0.22.1
247
+ thinc==8.3.9
248
+ rich-toolkit==0.15.1
249
+ prometheus-fastapi-instrumentator==7.1.0
250
+ openai==2.8.0
251
+ jsonschema==4.25.1
252
+ gdown==5.2.0
253
+ fastapi==0.121.2
254
+ anthropic==0.73.0
255
+ xformers==0.0.29.post2
256
+ transformers==4.57.1
257
+ proto-plus==1.26.1
258
+ torchvision==0.21.0
259
+ torchdata==0.11.0
260
+ torchaudio==2.6.0
261
+ together==1.5.30
262
+ tensordict==0.8.3
263
+ spacy==3.8.9
264
+ ray==2.51.1
265
+ outlines_core==0.1.26
266
+ mistral_common==1.8.5
267
+ mcp==1.21.1
268
+ fastapi-cloud-cli==0.3.1
269
+ fastapi-cli==0.0.16
270
+ datasets==4.4.1
271
+ accelerate==1.11.0
272
+ xgrammar==0.1.18
273
+ pyserini==1.2.0
274
+ peft==0.18.0
275
+ outlines==0.1.11
276
+ opentelemetry-exporter-otlp-proto-http==1.26.0
277
+ opentelemetry-exporter-otlp-proto-grpc==1.26.0
278
+ kimina-client==0.2.1
279
+ compressed-tensors==0.9.3
280
+ opentelemetry-exporter-otlp==1.26.0
281
+ vllm==0.8.5
282
+ py-spy==0.4.1
283
+ opencensus-context==0.1.3
284
+ distlib==0.4.0
285
+ colorful==0.5.8
286
+ tensorboard-data-server==0.7.2
287
+ google-auth==2.43.0
288
+ google-api-core==2.28.1
289
+ aiohttp-cors==0.8.1
290
+ opentelemetry-exporter-prometheus==0.59b0
291
+ opencensus==0.11.4
292
+ verl==0.5.0.dev0
293
+ opentelemetry-api==1.38.0
294
+ opentelemetry-semantic-conventions==0.59b0
295
+ opentelemetry-sdk==1.38.0
296
+ typeguard==4.4.4
297
+ shtab==1.8.0
298
+ tyro==0.9.35
299
+ verl==0.5.0.dev0
300
+ autocommand==2.2.2
301
+ backports.tarfile==1.2.0
302
+ importlib_metadata==8.0.0
303
+ inflect==7.3.1
304
+ jaraco.collections==5.1.0
305
+ jaraco.context==5.3.0
306
+ jaraco.functools==4.0.1
307
+ jaraco.text==3.12.1
308
+ more-itertools==10.3.0
309
+ packaging==24.2
310
+ platformdirs==4.2.2
311
+ tomli==2.0.1
312
+ typeguard==4.3.0
313
+ typing_extensions==4.12.2
314
+ wheel==0.45.1
315
+ zipp==3.19.2
wandb/run-20251218_184253-g8kppnjh/files/wandb-metadata.json ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "os": "Linux-5.14.0-284.25.1.el9_2.x86_64-x86_64-with-glibc2.35",
3
+ "python": "CPython 3.10.19",
4
+ "startedAt": "2025-12-18T10:42:53.636495Z",
5
+ "args": [
6
+ "--track"
7
+ ],
8
+ "program": "/mnt/general/wanghy/RAGEN/cleanrl/cleanrl/ppo_rubikscube.py",
9
+ "codePath": "cleanrl/cleanrl/ppo_rubikscube.py",
10
+ "codePathLocal": "cleanrl/cleanrl/ppo_rubikscube.py",
11
+ "git": {
12
+ "remote": "https://github.com/mll-lab-nu/RAGEN.git",
13
+ "commit": "8d73639b99b38265453f898b8d6af7d4af50d56e"
14
+ },
15
+ "email": "haoyu-wa22@mails.tsinghua.edu.cn",
16
+ "root": "/mnt/general/wanghy/RAGEN",
17
+ "host": "pt-4d654cf4576f4d23ad3d3919f12932fe-worker-0",
18
+ "executable": "/root/local/miniconda3/envs/ragen/bin/python",
19
+ "cpu_count": 64,
20
+ "cpu_count_logical": 128,
21
+ "gpu": "NVIDIA H100 80GB HBM3",
22
+ "gpu_count": 8,
23
+ "disk": {
24
+ "/": {
25
+ "total": "5153960755200",
26
+ "used": "447529222144"
27
+ }
28
+ },
29
+ "memory": {
30
+ "total": "2163642122240"
31
+ },
32
+ "gpu_nvidia": [
33
+ {
34
+ "name": "NVIDIA H100 80GB HBM3",
35
+ "memoryTotal": "85520809984",
36
+ "cudaCores": 16896,
37
+ "architecture": "Hopper",
38
+ "uuid": "GPU-35e2d43d-4067-82ce-90d4-def9e389bf28"
39
+ },
40
+ {
41
+ "name": "NVIDIA H100 80GB HBM3",
42
+ "memoryTotal": "85520809984",
43
+ "cudaCores": 16896,
44
+ "architecture": "Hopper",
45
+ "uuid": "GPU-af4135e3-88f2-e9ac-518d-502c75a85429"
46
+ },
47
+ {
48
+ "name": "NVIDIA H100 80GB HBM3",
49
+ "memoryTotal": "85520809984",
50
+ "cudaCores": 16896,
51
+ "architecture": "Hopper",
52
+ "uuid": "GPU-d7fdeeba-fe9b-ec03-d9f7-6724fe4266b5"
53
+ },
54
+ {
55
+ "name": "NVIDIA H100 80GB HBM3",
56
+ "memoryTotal": "85520809984",
57
+ "cudaCores": 16896,
58
+ "architecture": "Hopper",
59
+ "uuid": "GPU-ccc4f668-3882-5a8e-2c07-c5cd08f6f666"
60
+ },
61
+ {
62
+ "name": "NVIDIA H100 80GB HBM3",
63
+ "memoryTotal": "85520809984",
64
+ "cudaCores": 16896,
65
+ "architecture": "Hopper",
66
+ "uuid": "GPU-7b73c0cf-d3d5-e10c-7176-a43be1e41001"
67
+ },
68
+ {
69
+ "name": "NVIDIA H100 80GB HBM3",
70
+ "memoryTotal": "85520809984",
71
+ "cudaCores": 16896,
72
+ "architecture": "Hopper",
73
+ "uuid": "GPU-81b58d94-5d1f-8ec2-f9d2-fd56172ed177"
74
+ },
75
+ {
76
+ "name": "NVIDIA H100 80GB HBM3",
77
+ "memoryTotal": "85520809984",
78
+ "cudaCores": 16896,
79
+ "architecture": "Hopper",
80
+ "uuid": "GPU-03e8bc66-3b44-6794-49fd-5392fbdda6d1"
81
+ },
82
+ {
83
+ "name": "NVIDIA H100 80GB HBM3",
84
+ "memoryTotal": "85520809984",
85
+ "cudaCores": 16896,
86
+ "architecture": "Hopper",
87
+ "uuid": "GPU-b7cf0ec6-7c29-1179-dceb-09565da51890"
88
+ }
89
+ ],
90
+ "cudaVersion": "12.4",
91
+ "writerId": "xtmqsnhbpijxn98k1keqte2hruuy3myj"
92
+ }
wandb/run-20251218_184253-g8kppnjh/files/wandb-summary.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"train/policy_loss":-7.938966155052185e-05,"losses/value_loss":0.011233147233724594,"_runtime":398.070420408,"charts/train_success_rate":0.9559471365638766,"train/learning_rate":2.561475409836034e-07,"losses/policy_loss":-7.938966155052185e-05,"_step":999424,"_timestamp":1.766054973203551e+09,"train/success_rate":0.9559471365638766,"eval/success_rate":0.9395,"train/clipfrac":0,"rollout/ep_rew_mean":1,"charts/SPS":2564,"eval/episodes":4000,"perf/SPS":2564,"_wandb":{"runtime":398},"train/entropy":0.6522258520126343,"eval/avg_return":0.9395,"train/approx_kl":1.0943040251731873e-07,"train/old_approx_kl":-3.494042903184891e-05,"train/value_loss":0.011233147233724594,"charts/avg_reward":0.2119140625,"eval/std_return":0.23841088481862568,"rollout/success_rate":1,"charts/avg_value":0.7838361263275146,"charts/progress":100,"global_step":999424,"rollout/ep_len_mean":2,"losses/explained_variance":0.8802414909005165}
wandb/run-20251218_184253-g8kppnjh/run-g8kppnjh.wandb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:acc5f34010aa9cd646f8ad9a1d408d705346725e08d9f5548af728cf52e903db
3
+ size 47336006
wandb/run-20251218_185248-ts36d12x/files/code/cleanrl/cleanrl/ppo_rubikscube.py ADDED
@@ -0,0 +1,517 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PPO with small MLP for RAGEN Rubik's Cube 2x2 using the existing env (no env edits)
2
+ import os
3
+ import random
4
+ import time
5
+ from dataclasses import dataclass
6
+ from pathlib import Path
7
+ from typing import Tuple, Dict, Any, List
8
+ import json
9
+ import re
10
+
11
+ import gymnasium as gym
12
+ import numpy as np
13
+ import torch
14
+ import torch.nn as nn
15
+ import torch.optim as optim
16
+ import tyro
17
+ from torch.distributions.categorical import Categorical
18
+
19
+ import sys
20
+ sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../../'))
21
+
22
+ from ragen.env.rubikscube.env import RubiksCube2x2Env
23
+ from ragen.env.rubikscube.config import RubiksCube2x2Config
24
+
25
+
26
+ class RubiksCubeWrapper(gym.Env):
27
+ """
28
+ Adapter to use ragen RubiksCube2x2Env with Gymnasium vector API.
29
+ - Converts text observation to one-hot vector of 24 stickers x 6 colors.
30
+ - Maps agent actions [0..11] to env actions [1..12].
31
+ - Exposes proper observation_space and action_space.
32
+ """
33
+ metadata = {"render_modes": ["rgb_array", "human", "ansi"]}
34
+
35
+ def __init__(self, env: RubiksCube2x2Env):
36
+ super().__init__()
37
+ self._env = env
38
+ # 24 stickers, 6 colors -> one-hot size 144
39
+ self._colors = ['W', 'O', 'G', 'R', 'B', 'Y']
40
+ self._color_to_idx = {c: i for i, c in enumerate(self._colors)}
41
+ self.observation_space = gym.spaces.Box(low=0.0, high=1.0, shape=(24 * len(self._colors),), dtype=np.float32)
42
+ self.action_space = gym.spaces.Discrete(12)
43
+ # precompile regex to extract 4 letters within [X, X]\n [X, X]
44
+ # Lines look like: "Up (U): [W, W]\n [W, W]"
45
+ self._face_pat = re.compile(r"\[(?:\s*([A-Z])\s*,\s*([A-Z])\s*\])\n\s*\[(?:\s*([A-Z])\s*,\s*([A-Z])\s*\])")
46
+
47
+ def _encode_obs(self, text_obs: str) -> np.ndarray:
48
+ # Extract the six face blocks in the order U, L, F, R, B, D as rendered
49
+ faces_order = ["Up (U):", "Left (L):", "Front (F):", "Right (R):", "Back (B):", "Down (D):"]
50
+ onehots: List[int] = []
51
+ # Build a map from header to its block text
52
+ lines = text_obs.splitlines()
53
+ # Collect blocks starting after header line and including the next line for second row
54
+ i = 0
55
+ blocks: List[str] = []
56
+ while i < len(lines):
57
+ line = lines[i]
58
+ for header in faces_order:
59
+ if line.startswith(header):
60
+ # Join current line's bracketed pair and the next line (which contains the second pair)
61
+ # Remove the "Header:" prefix to keep only the bracket portions
62
+ content = line[len(header):].strip()
63
+ next_line = lines[i + 1] if i + 1 < len(lines) else ""
64
+ block = f"{content}\n{next_line}"
65
+ blocks.append(block)
66
+ break
67
+ i += 1
68
+ # Fallback: if regex fails, return zeros
69
+ if len(blocks) != 6:
70
+ return np.zeros(24 * len(self._colors), dtype=np.float32)
71
+ stickers: List[int] = []
72
+ for blk in blocks:
73
+ m = self._face_pat.search(blk)
74
+ if not m:
75
+ return np.zeros(24 * len(self._colors), dtype=np.float32)
76
+ # order: 0,1,2,3 per render() doc
77
+ c0, c1, c2, c3 = m.group(1), m.group(2), m.group(3), m.group(4)
78
+ stickers.extend([c0, c1, c2, c3])
79
+ # stickers now length 24; convert to one-hot
80
+ grid = np.zeros((24, len(self._colors)), dtype=np.float32)
81
+ for idx, ch in enumerate(stickers):
82
+ cidx = self._color_to_idx.get(ch, None)
83
+ if cidx is not None:
84
+ grid[idx, cidx] = 1.0
85
+ return grid.reshape(-1)
86
+
87
+ def reset(self, *, seed: int | None = None, options: Dict[str, Any] | None = None):
88
+ text_obs = self._env.reset(seed=seed)
89
+ obs = self._encode_obs(text_obs)
90
+ return obs, {}
91
+
92
+ def step(self, action: int):
93
+ mapped = int(action) + 1 # 0..11 -> 1..12
94
+ text_obs, reward, done, info = self._env.step(mapped)
95
+ obs = self._encode_obs(text_obs)
96
+ terminated = bool(done)
97
+ truncated = False
98
+ return obs, float(reward), terminated, truncated, info or {}
99
+
100
+ def render(self):
101
+ return self._env.render()
102
+
103
+ def close(self):
104
+ self._env.close()
105
+
106
+
107
+ @dataclass
108
+ class Args:
109
+ exp_name: str = os.path.basename(__file__)[: -len(".py")]
110
+ seed: int = 1
111
+ torch_deterministic: bool = True
112
+ cuda: bool = True
113
+ track: bool = True
114
+ wandb_project_name: str = "cleanRL"
115
+ wandb_entity: str | None = None
116
+ capture_video: bool = False
117
+
118
+ # Algorithm
119
+ env_id: str = "RubiksCube2x2"
120
+ total_timesteps: int = 1000_000
121
+ learning_rate: float = 2.5e-4
122
+ num_envs: int = 8
123
+ num_steps: int = 128
124
+ anneal_lr: bool = True
125
+ gamma: float = 0.99
126
+ gae_lambda: float = 0.95
127
+ num_minibatches: int = 4
128
+ update_epochs: int = 4
129
+ norm_adv: bool = True
130
+ clip_coef: float = 0.2
131
+ clip_vloss: bool = True
132
+ ent_coef: float = 0.01
133
+ vf_coef: float = 0.5
134
+ max_grad_norm: float = 0.5
135
+ target_kl: float | None = None
136
+
137
+ # Rubik specific
138
+ scramble_depth: int = 1
139
+ max_steps_env: int = 20
140
+
141
+ # runtime filled
142
+ batch_size: int = 0
143
+ minibatch_size: int = 0
144
+ num_iterations: int = 0
145
+ eval_splits: int = 2
146
+ eval_episodes: int = 4000
147
+
148
+
149
+ def make_env(idx, run_name, seed, scramble_depth, max_steps_env, capture_video=False):
150
+ def thunk():
151
+ config = RubiksCube2x2Config(scramble_depth=scramble_depth, max_steps=max_steps_env, render_mode='text')
152
+ env = RubiksCube2x2Env(config)
153
+ env = RubiksCubeWrapper(env)
154
+ env = gym.wrappers.TimeLimit(env, max_episode_steps=max_steps_env)
155
+ env = gym.wrappers.RecordEpisodeStatistics(env)
156
+ if capture_video and idx == 0:
157
+ env = gym.wrappers.RecordVideo(env, f"videos/{run_name}")
158
+ return env
159
+ return thunk
160
+
161
+
162
+ def layer_init(layer, std=np.sqrt(2), bias_const=0.0):
163
+ torch.nn.init.orthogonal_(layer.weight, std)
164
+ torch.nn.init.constant_(layer.bias, bias_const)
165
+ return layer
166
+
167
+
168
+ class Agent(nn.Module):
169
+ def __init__(self, envs):
170
+ super().__init__()
171
+ obs_shape = int(np.array(envs.single_observation_space.shape).prod())
172
+ hidden = 128
173
+ self.critic = nn.Sequential(
174
+ layer_init(nn.Linear(obs_shape, hidden)),
175
+ nn.Tanh(),
176
+ layer_init(nn.Linear(hidden, hidden)),
177
+ nn.Tanh(),
178
+ layer_init(nn.Linear(hidden, 1), std=1.0),
179
+ )
180
+ self.actor = nn.Sequential(
181
+ layer_init(nn.Linear(obs_shape, hidden)),
182
+ nn.Tanh(),
183
+ layer_init(nn.Linear(hidden, hidden)),
184
+ nn.Tanh(),
185
+ layer_init(nn.Linear(hidden, envs.single_action_space.n), std=0.01),
186
+ )
187
+
188
+ def get_value(self, x):
189
+ return self.critic(x)
190
+
191
+ def get_action_and_value(self, x, action=None):
192
+ logits = self.actor(x)
193
+ probs = Categorical(logits=logits)
194
+ if action is None:
195
+ action = probs.sample()
196
+ return action, probs.log_prob(action), probs.entropy(), self.critic(x)
197
+
198
+
199
+ if __name__ == "__main__":
200
+ args = tyro.cli(Args)
201
+ args.batch_size = int(args.num_envs * args.num_steps)
202
+ args.minibatch_size = int(args.batch_size // args.num_minibatches)
203
+ args.num_iterations = args.total_timesteps // args.batch_size
204
+ run_name = f"{args.env_id}__{args.exp_name}__{args.seed}__{int(time.time())}"
205
+
206
+ if args.track:
207
+ import wandb
208
+ wandb.init(
209
+ project=args.wandb_project_name,
210
+ entity=args.wandb_entity,
211
+ config=vars(args),
212
+ name=run_name,
213
+ monitor_gym=True,
214
+ save_code=True,
215
+ )
216
+ try:
217
+ wandb.define_metric("global_step")
218
+ for prefix in ["train/*", "rollout/*", "eval/*", "losses/*", "charts/*", "perf/*"]:
219
+ wandb.define_metric(prefix, step_metric="global_step")
220
+ except Exception:
221
+ pass
222
+
223
+ # seeding
224
+ random.seed(args.seed)
225
+ np.random.seed(args.seed)
226
+ torch.manual_seed(args.seed)
227
+ torch.backends.cudnn.deterministic = args.torch_deterministic
228
+
229
+ device = torch.device("cuda" if torch.cuda.is_available() and args.cuda else "cpu")
230
+
231
+ # envs
232
+ envs = gym.vector.SyncVectorEnv([
233
+ make_env(i, run_name, args.seed, args.scramble_depth, args.max_steps_env, args.capture_video)
234
+ for i in range(args.num_envs)
235
+ ])
236
+ assert isinstance(envs.single_action_space, gym.spaces.Discrete)
237
+
238
+ agent = Agent(envs).to(device)
239
+ optimizer = optim.Adam(agent.parameters(), lr=args.learning_rate, eps=1e-5)
240
+
241
+ # storage
242
+ obs = torch.zeros((args.num_steps, args.num_envs) + envs.single_observation_space.shape).to(device)
243
+ actions = torch.zeros((args.num_steps, args.num_envs) + envs.single_action_space.shape).to(device)
244
+ logprobs = torch.zeros((args.num_steps, args.num_envs)).to(device)
245
+ rewards = torch.zeros((args.num_steps, args.num_envs)).to(device)
246
+ dones = torch.zeros((args.num_steps, args.num_envs)).to(device)
247
+ values = torch.zeros((args.num_steps, args.num_envs)).to(device)
248
+
249
+ # start
250
+ global_step = 0
251
+ start_time = time.time()
252
+ next_obs, _ = envs.reset(seed=args.seed)
253
+ next_obs = torch.Tensor(next_obs).to(device)
254
+ next_done = torch.zeros(args.num_envs).to(device)
255
+
256
+ # eval helper similar to FrozenLake: collect greedy eval trajectories and write metrics.json
257
+ def collect_eval_trajectories(agent_model, make_env_fn, n_episodes, step_tag):
258
+ out_dir = Path(f"runs/{run_name}/trajectories/step_{step_tag}")
259
+ out_dir.mkdir(parents=True, exist_ok=True)
260
+ out_path = out_dir / "trajectories.jsonl"
261
+ env = make_env_fn()
262
+ collected = 0
263
+ summary_returns = []
264
+ summary_success = []
265
+ with out_path.open("w") as f:
266
+ while collected < n_episodes:
267
+ state, _ = env.reset(seed=args.seed + 100000 + collected)
268
+ traj_states = [state.tolist()]
269
+ traj_actions = []
270
+ traj_rewards = []
271
+ traj_dones = []
272
+ traj_success = []
273
+ done = False
274
+ step_count = 0
275
+ max_eval_steps = getattr(env, '_max_episode_steps', None) or int(args.max_steps_env)
276
+ while not done:
277
+ with torch.no_grad():
278
+ logits = agent_model.actor(torch.tensor(state, dtype=torch.float32, device=device).unsqueeze(0))
279
+ action = int(torch.argmax(logits, dim=1).item())
280
+ next_state, reward, terminated, truncated, info = env.step(action)
281
+ traj_actions.append(int(action))
282
+ traj_rewards.append(float(reward))
283
+ step_count += 1
284
+ d = bool(terminated) or bool(truncated) or (step_count >= max_eval_steps)
285
+ traj_dones.append(d)
286
+ traj_success.append(bool((info or {}).get('success', False)))
287
+ state = next_state
288
+ traj_states.append(state.tolist())
289
+ done = d
290
+ ep_ret = float(sum(traj_rewards))
291
+ ep_succ = bool(any(traj_success))
292
+ record = {
293
+ "states": traj_states,
294
+ "actions": traj_actions,
295
+ "rewards": traj_rewards,
296
+ "dones": traj_dones,
297
+ "success": traj_success,
298
+ "episode_return": ep_ret,
299
+ "episode_success": ep_succ,
300
+ }
301
+ f.write(json.dumps(record) + "\n")
302
+ collected += 1
303
+ summary_returns.append(ep_ret)
304
+ summary_success.append(1.0 if ep_succ else 0.0)
305
+ env.close()
306
+ try:
307
+ metrics = {
308
+ "global_step": int(step_tag),
309
+ "episodes": int(n_episodes),
310
+ "success_rate": float(np.mean(summary_success)) if len(summary_success) else 0.0,
311
+ "avg_return": float(np.mean(summary_returns)) if len(summary_returns) else 0.0,
312
+ "std_return": float(np.std(summary_returns)) if len(summary_returns) else 0.0,
313
+ }
314
+ with (out_dir / "metrics.json").open("w") as mf:
315
+ json.dump(metrics, mf)
316
+ except Exception as e:
317
+ print(f"Warning: failed to write eval metrics: {e}")
318
+
319
+ # training loop
320
+ eval_every_iters = max(1, args.num_iterations // args.eval_splits)
321
+ for iteration in range(1, args.num_iterations + 1):
322
+ # Anneal LR
323
+ if args.anneal_lr:
324
+ frac = 1.0 - (iteration - 1.0) / args.num_iterations
325
+ lrnow = frac * args.learning_rate
326
+ optimizer.param_groups[0]["lr"] = lrnow
327
+
328
+ # accumulate per-iteration episode successes
329
+ iter_successes = []
330
+ for step in range(0, args.num_steps):
331
+ global_step += args.num_envs
332
+ obs[step] = next_obs
333
+ dones[step] = next_done
334
+
335
+ with torch.no_grad():
336
+ action, logprob, _, value = agent.get_action_and_value(next_obs)
337
+ values[step] = value.flatten()
338
+ actions[step] = action
339
+ logprobs[step] = logprob
340
+
341
+ next_obs, reward, terminations, truncations, infos = envs.step(action.cpu().numpy())
342
+ next_done = np.logical_or(terminations, truncations)
343
+ rewards[step] = torch.tensor(reward).to(device).view(-1)
344
+ next_obs, next_done = torch.Tensor(next_obs).to(device), torch.Tensor(next_done).to(device)
345
+
346
+ # Episode stats logging similar to FrozenLake
347
+ try:
348
+ mask = None
349
+ if isinstance(infos, dict):
350
+ if "_episode" in infos:
351
+ mask = np.asarray(infos["_episode"]).astype(bool)
352
+ elif "episode" in infos and isinstance(infos["episode"], dict) and "_l" in infos["episode"]:
353
+ mask = np.asarray(infos["episode"]["_l"]).astype(bool)
354
+ if mask is not None and np.any(mask):
355
+ r_arr = np.asarray(infos.get("episode", {}).get("r", np.zeros_like(mask, dtype=float)))
356
+ l_arr = np.asarray(infos.get("episode", {}).get("l", np.zeros_like(mask, dtype=int)))
357
+ # prefer success from info; fallback to ep return > 0
358
+ if "success" in infos:
359
+ succ_arr = np.asarray(infos.get("success", np.zeros_like(mask, dtype=bool))).astype(float)
360
+ else:
361
+ try:
362
+ succ_arr = (np.asarray(r_arr) > 0).astype(float)
363
+ except Exception:
364
+ succ_arr = np.zeros_like(mask, dtype=float)
365
+ # collect iteration successes for training success rate
366
+ try:
367
+ for s in np.asarray(succ_arr)[mask]:
368
+ iter_successes.append(float(s))
369
+ except Exception:
370
+ pass
371
+ if args.track:
372
+ try:
373
+ import wandb
374
+ log_dict = {
375
+ "global_step": int(global_step),
376
+ "rollout/ep_rew_mean": float(np.mean(r_arr[mask])) if np.any(mask) else None,
377
+ "rollout/ep_len_mean": float(np.mean(l_arr[mask])) if np.any(mask) else None,
378
+ "rollout/success_rate": float(np.mean(succ_arr[mask])) if np.any(mask) else None,
379
+ }
380
+ wandb.log(log_dict, step=global_step)
381
+ except Exception:
382
+ pass
383
+ except Exception:
384
+ pass
385
+
386
+ # GAE
387
+ with torch.no_grad():
388
+ next_value = agent.get_value(next_obs).reshape(1, -1)
389
+ advantages = torch.zeros_like(rewards).to(device)
390
+ lastgaelam = 0
391
+ for t in reversed(range(args.num_steps)):
392
+ if t == args.num_steps - 1:
393
+ nextnonterminal = 1.0 - next_done
394
+ nextvalues = next_value
395
+ else:
396
+ nextnonterminal = 1.0 - dones[t + 1]
397
+ nextvalues = values[t + 1]
398
+ delta = rewards[t] + args.gamma * nextvalues * nextnonterminal - values[t]
399
+ advantages[t] = lastgaelam = delta + args.gamma * args.gae_lambda * nextnonterminal * lastgaelam
400
+ returns = advantages + values
401
+
402
+ # flatten batch
403
+ b_obs = obs.reshape((-1,) + envs.single_observation_space.shape)
404
+ b_logprobs = logprobs.reshape(-1)
405
+ b_actions = actions.reshape((-1,) + envs.single_action_space.shape)
406
+ b_advantages = advantages.reshape(-1)
407
+ b_returns = returns.reshape(-1)
408
+ b_values = values.reshape(-1)
409
+
410
+ # update
411
+ b_inds = np.arange(args.batch_size)
412
+ clipfracs = []
413
+ for epoch in range(args.update_epochs):
414
+ np.random.shuffle(b_inds)
415
+ for start in range(0, args.batch_size, args.minibatch_size):
416
+ end = start + args.minibatch_size
417
+ mb_inds = b_inds[start:end]
418
+
419
+ _, newlogprob, entropy, newvalue = agent.get_action_and_value(b_obs[mb_inds], b_actions.long()[mb_inds])
420
+ logratio = newlogprob - b_logprobs[mb_inds]
421
+ ratio = logratio.exp()
422
+
423
+ with torch.no_grad():
424
+ old_approx_kl = (-logratio).mean()
425
+ approx_kl = ((ratio - 1) - logratio).mean()
426
+ clipfracs += [((ratio - 1.0).abs() > args.clip_coef).float().mean().item()]
427
+
428
+ mb_advantages = b_advantages[mb_inds]
429
+ if args.norm_adv:
430
+ mb_advantages = (mb_advantages - mb_advantages.mean()) / (mb_advantages.std() + 1e-8)
431
+
432
+ pg_loss1 = -mb_advantages * ratio
433
+ pg_loss2 = -mb_advantages * torch.clamp(ratio, 1 - args.clip_coef, 1 + args.clip_coef)
434
+ pg_loss = torch.max(pg_loss1, pg_loss2).mean()
435
+
436
+ newvalue = newvalue.view(-1)
437
+ if args.clip_vloss:
438
+ v_loss_unclipped = (newvalue - b_returns[mb_inds]) ** 2
439
+ v_clipped = b_values[mb_inds] + torch.clamp(
440
+ newvalue - b_values[mb_inds], -args.clip_coef, args.clip_coef,
441
+ )
442
+ v_loss_clipped = (v_clipped - b_returns[mb_inds]) ** 2
443
+ v_loss = 0.5 * torch.max(v_loss_unclipped, v_loss_clipped).mean()
444
+ else:
445
+ v_loss = 0.5 * ((newvalue - b_returns[mb_inds]) ** 2).mean()
446
+
447
+ entropy_loss = entropy.mean()
448
+ loss = pg_loss - args.ent_coef * entropy_loss + v_loss * args.vf_coef
449
+
450
+ optimizer.zero_grad()
451
+ loss.backward()
452
+ nn.utils.clip_grad_norm_(agent.parameters(), args.max_grad_norm)
453
+ optimizer.step()
454
+
455
+ if args.target_kl is not None and approx_kl > args.target_kl:
456
+ break
457
+
458
+ # metrics
459
+ y_pred, y_true = b_values.cpu().numpy(), b_returns.cpu().numpy()
460
+ var_y = np.var(y_true)
461
+ explained_var = np.nan if var_y == 0 else 1 - np.var(y_true - y_pred) / var_y
462
+
463
+ sps = int(global_step / (time.time() - start_time))
464
+ train_success_rate = float(np.mean(iter_successes)) if len(iter_successes) else 0.0
465
+ print(f"Iter {iteration:4d}/{args.num_iterations} | SPS: {sps:5d} | R: {rewards.mean().item():6.3f}")
466
+ if args.track:
467
+ try:
468
+ import wandb
469
+ wandb.log({
470
+ "global_step": int(global_step),
471
+ "charts/progress": float(100.0 * iteration / max(1, args.num_iterations)),
472
+ "train/value_loss": float(v_loss.item()),
473
+ "train/policy_loss": float(pg_loss.item()),
474
+ "losses/value_loss": float(v_loss.item()),
475
+ "losses/policy_loss": float(pg_loss.item()),
476
+ "train/entropy": float(entropy_loss.item()),
477
+ "train/old_approx_kl": float(old_approx_kl.item()),
478
+ "train/approx_kl": float(approx_kl.item()),
479
+ "train/clipfrac": float(np.mean(clipfracs)) if len(clipfracs) else 0.0,
480
+ "losses/explained_variance": float(explained_var),
481
+ "charts/avg_reward": float(rewards.mean().item()),
482
+ "charts/avg_value": float(values.mean().item()),
483
+ "perf/SPS": int(sps),
484
+ "charts/SPS": int(sps),
485
+ "train/success_rate": train_success_rate,
486
+ "charts/train_success_rate": train_success_rate,
487
+ "train/learning_rate": float(optimizer.param_groups[0]["lr"]),
488
+ }, step=global_step)
489
+ except Exception:
490
+ pass
491
+
492
+ # periodic evaluation collection
493
+ if iteration % eval_every_iters == 0:
494
+ try:
495
+ eval_thunk = make_env(0, run_name, args.seed + 9999, args.scramble_depth, args.max_steps_env, False)
496
+ collect_eval_trajectories(agent, eval_thunk, n_episodes=args.eval_episodes, step_tag=global_step)
497
+ if args.track:
498
+ try:
499
+ import json as _json
500
+ from pathlib import Path as _Path
501
+ mpath = _Path(f"runs/{run_name}/trajectories/step_{global_step}/metrics.json")
502
+ if mpath.exists():
503
+ with mpath.open("r") as mf:
504
+ metrics = _json.load(mf)
505
+ wandb.log({
506
+ "eval/success_rate": metrics.get("success_rate"),
507
+ "eval/avg_return": metrics.get("avg_return"),
508
+ "eval/std_return": metrics.get("std_return"),
509
+ "eval/episodes": metrics.get("episodes"),
510
+ }, step=global_step)
511
+ except Exception:
512
+ pass
513
+ print(f"Collected {args.eval_episodes} eval trajectories at global_step {global_step}")
514
+ except Exception as e:
515
+ print(f"Warning: eval trajectory collection failed at step {global_step}: {e}")
516
+
517
+ envs.close()
wandb/run-20251218_185248-ts36d12x/files/config.yaml ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _wandb:
2
+ value:
3
+ cli_version: 0.23.0
4
+ code_path: code/cleanrl/cleanrl/ppo_rubikscube.py
5
+ e:
6
+ pa2plkmx4kakxqj0z9828uzvhc7cjmd1:
7
+ args:
8
+ - --track
9
+ codePath: cleanrl/cleanrl/ppo_rubikscube.py
10
+ codePathLocal: cleanrl/cleanrl/ppo_rubikscube.py
11
+ cpu_count: 64
12
+ cpu_count_logical: 128
13
+ cudaVersion: "12.4"
14
+ disk:
15
+ /:
16
+ total: "5153960755200"
17
+ used: "447561207808"
18
+ email: haoyu-wa22@mails.tsinghua.edu.cn
19
+ executable: /root/local/miniconda3/envs/ragen/bin/python
20
+ git:
21
+ commit: 8d73639b99b38265453f898b8d6af7d4af50d56e
22
+ remote: https://github.com/mll-lab-nu/RAGEN.git
23
+ gpu: NVIDIA H100 80GB HBM3
24
+ gpu_count: 8
25
+ gpu_nvidia:
26
+ - architecture: Hopper
27
+ cudaCores: 16896
28
+ memoryTotal: "85520809984"
29
+ name: NVIDIA H100 80GB HBM3
30
+ uuid: GPU-35e2d43d-4067-82ce-90d4-def9e389bf28
31
+ - architecture: Hopper
32
+ cudaCores: 16896
33
+ memoryTotal: "85520809984"
34
+ name: NVIDIA H100 80GB HBM3
35
+ uuid: GPU-af4135e3-88f2-e9ac-518d-502c75a85429
36
+ - architecture: Hopper
37
+ cudaCores: 16896
38
+ memoryTotal: "85520809984"
39
+ name: NVIDIA H100 80GB HBM3
40
+ uuid: GPU-d7fdeeba-fe9b-ec03-d9f7-6724fe4266b5
41
+ - architecture: Hopper
42
+ cudaCores: 16896
43
+ memoryTotal: "85520809984"
44
+ name: NVIDIA H100 80GB HBM3
45
+ uuid: GPU-ccc4f668-3882-5a8e-2c07-c5cd08f6f666
46
+ - architecture: Hopper
47
+ cudaCores: 16896
48
+ memoryTotal: "85520809984"
49
+ name: NVIDIA H100 80GB HBM3
50
+ uuid: GPU-7b73c0cf-d3d5-e10c-7176-a43be1e41001
51
+ - architecture: Hopper
52
+ cudaCores: 16896
53
+ memoryTotal: "85520809984"
54
+ name: NVIDIA H100 80GB HBM3
55
+ uuid: GPU-81b58d94-5d1f-8ec2-f9d2-fd56172ed177
56
+ - architecture: Hopper
57
+ cudaCores: 16896
58
+ memoryTotal: "85520809984"
59
+ name: NVIDIA H100 80GB HBM3
60
+ uuid: GPU-03e8bc66-3b44-6794-49fd-5392fbdda6d1
61
+ - architecture: Hopper
62
+ cudaCores: 16896
63
+ memoryTotal: "85520809984"
64
+ name: NVIDIA H100 80GB HBM3
65
+ uuid: GPU-b7cf0ec6-7c29-1179-dceb-09565da51890
66
+ host: pt-4d654cf4576f4d23ad3d3919f12932fe-worker-0
67
+ memory:
68
+ total: "2163642122240"
69
+ os: Linux-5.14.0-284.25.1.el9_2.x86_64-x86_64-with-glibc2.35
70
+ program: /mnt/general/wanghy/RAGEN/cleanrl/cleanrl/ppo_rubikscube.py
71
+ python: CPython 3.10.19
72
+ root: /mnt/general/wanghy/RAGEN
73
+ startedAt: "2025-12-18T10:52:48.969828Z"
74
+ writerId: pa2plkmx4kakxqj0z9828uzvhc7cjmd1
75
+ m:
76
+ - "1": global_step
77
+ "6":
78
+ - 3
79
+ "7": []
80
+ - "2": charts/*
81
+ "5": 1
82
+ "6":
83
+ - 1
84
+ "7": []
85
+ - "2": perf/*
86
+ "5": 1
87
+ "6":
88
+ - 1
89
+ "7": []
90
+ - "2": train/*
91
+ "5": 1
92
+ "6":
93
+ - 1
94
+ "7": []
95
+ - "2": rollout/*
96
+ "5": 1
97
+ "6":
98
+ - 1
99
+ "7": []
100
+ - "2": eval/*
101
+ "5": 1
102
+ "6":
103
+ - 1
104
+ "7": []
105
+ - "2": losses/*
106
+ "5": 1
107
+ "6":
108
+ - 1
109
+ "7": []
110
+ python_version: 3.10.19
111
+ t:
112
+ "1":
113
+ - 1
114
+ - 11
115
+ - 30
116
+ - 49
117
+ - 50
118
+ - 51
119
+ - 105
120
+ "2":
121
+ - 1
122
+ - 11
123
+ - 30
124
+ - 49
125
+ - 50
126
+ - 51
127
+ - 105
128
+ "3":
129
+ - 7
130
+ - 13
131
+ - 16
132
+ - 61
133
+ "4": 3.10.19
134
+ "5": 0.23.0
135
+ "6": 4.57.1
136
+ "12": 0.23.0
137
+ "13": linux-x86_64
138
+ anneal_lr:
139
+ value: true
140
+ batch_size:
141
+ value: 1024
142
+ capture_video:
143
+ value: false
144
+ clip_coef:
145
+ value: 0.2
146
+ clip_vloss:
147
+ value: true
148
+ cuda:
149
+ value: true
150
+ ent_coef:
151
+ value: 0.01
152
+ env_id:
153
+ value: RubiksCube2x2
154
+ eval_episodes:
155
+ value: 4000
156
+ eval_splits:
157
+ value: 2
158
+ exp_name:
159
+ value: ppo_rubikscube
160
+ gae_lambda:
161
+ value: 0.95
162
+ gamma:
163
+ value: 0.99
164
+ learning_rate:
165
+ value: 0.00025
166
+ max_grad_norm:
167
+ value: 0.5
168
+ max_steps_env:
169
+ value: 20
170
+ minibatch_size:
171
+ value: 256
172
+ norm_adv:
173
+ value: true
174
+ num_envs:
175
+ value: 8
176
+ num_iterations:
177
+ value: 976
178
+ num_minibatches:
179
+ value: 4
180
+ num_steps:
181
+ value: 128
182
+ scramble_depth:
183
+ value: 1
184
+ seed:
185
+ value: 1
186
+ target_kl:
187
+ value: null
188
+ torch_deterministic:
189
+ value: true
190
+ total_timesteps:
191
+ value: 1000000
192
+ track:
193
+ value: true
194
+ update_epochs:
195
+ value: 4
196
+ vf_coef:
197
+ value: 0.5
198
+ wandb_entity:
199
+ value: null
200
+ wandb_project_name:
201
+ value: cleanRL
wandb/run-20251218_185248-ts36d12x/files/diff.patch ADDED
@@ -0,0 +1,1162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/config/base.yaml b/config/base.yaml
2
+ index a1659e4..9df6250 100644
3
+ --- a/config/base.yaml
4
+ +++ b/config/base.yaml
5
+ @@ -9,15 +9,16 @@ seed:
6
+ train: 10000
7
+ val: 123
8
+
9
+ -micro_batch_size_per_gpu: 4
10
+ +micro_batch_size_per_gpu: 1
11
+ ppo_mini_batch_size: 32
12
+ -model_path: Qwen/Qwen2.5-3B-Instruct
13
+ +model_path: /mnt/general/share/model/Qwen/Qwen2.5-0.5B-Instruct
14
+ +# Qwen/Qwen2.5-0.5B-Instruct
15
+ enable_response_mask: True # Enabling response mask could improve stability of rollout/old_log_prob, as P(st|history) are no longer calculated in loss here. See https://docs.google.com/document/d/1bg7obeiKTExuHHBl5uOiSpec5uLDZ2Tgvxy6li5pHX4/edit?usp=sharing for more details.
16
+ grpo_advantage_length_weight: False # if you do not enable this and critic/advantage_estimator is GRPO, and the critic/advantages/mean is too low, then you can try enabling this to encourage reasoning and forbid collapse
17
+
18
+ lora:
19
+ rank: 0
20
+ - alpha: 64
21
+ + alpha: 16
22
+ target_modules: all-linear
23
+
24
+ actor_rollout_ref:
25
+ @@ -46,10 +47,10 @@ actor_rollout_ref:
26
+ name: vllm
27
+ log_prob_micro_batch_size_per_gpu: ${micro_batch_size_per_gpu} # following micro_batch_size_per_gpu
28
+ tensor_model_parallel_size: 1
29
+ - max_model_len: 3600
30
+ + max_model_len: 7200 #3600 why** 14400
31
+ prompt_length: 1 # useless. Just put it here
32
+ response_length: 400 # single-turn response length
33
+ - gpu_memory_utilization: 0.5
34
+ + gpu_memory_utilization: 0.7
35
+ max_num_batched_tokens: 8192 # set only when enable_chunked_prefill is true
36
+ temperature: 1
37
+ rollout_filter_ratio: 0.25
38
+ @@ -90,26 +91,28 @@ algorithm:
39
+ kl_coef: 0.000
40
+
41
+ trainer:
42
+ - project_name: ragen_latest
43
+ + project_name:
44
+ experiment_name: test
45
+ local_log_dir: "results/"
46
+ - save_freq: 100
47
+ + save_freq: -1
48
+ total_training_steps: 200
49
+ validation_steps: 1 # validation instances = validation_steps * val_env_groups * group_size
50
+ val_before_train: True
51
+ n_gpus_per_node: 1
52
+ test_freq: 10
53
+ generations_to_log_to_wandb:
54
+ + train: 128
55
+ val: 20
56
+ logger: [ 'console', 'wandb' ]
57
+ max_actor_ckpt_to_keep: 1
58
+ max_critic_ckpt_to_keep: 1
59
+ + default_local_dir: /mnt/general/wanghy/RAGEN/saves/
60
+
61
+ agent_proxy:
62
+ max_context_window: -1 # set a value > 0 to enable context window for long trajectory
63
+ - max_turn: 5
64
+ + max_turn: 25 #25 why** 700
65
+ action_sep: "||"
66
+ - max_actions_per_turn: 2 # how many actions can be output at most in a single turn
67
+ + max_actions_per_turn: 1 # how many actions can be output at most in a single turn
68
+ use_turn_scores: False # important to GAE when applying token-level rewards to token-level advantages. If False, will take the sum of scores as the reward for the last turn.
69
+ enable_think: True # False -> no think RL
70
+ reward_normalization:
71
+ @@ -126,11 +129,11 @@ es_manager:
72
+ tags: ["CoordSokoban"]
73
+ n_groups: [8] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
74
+ val:
75
+ - env_groups: 32
76
+ - group_size: 16 # should be set to 1 because when val temperature is set to 0 and group size > 1, there will be repetitive prompts which leads to same trajectory.
77
+ + env_groups: 256
78
+ + group_size: 1 # should be set to 1 because when val temperature is set to 0 and group size > 1, there will be repetitive prompts which leads to same trajectory.
79
+ env_configs:
80
+ tags: ["CoordSokoban"]
81
+ - n_groups: [32] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
82
+ + n_groups: [256] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
83
+
84
+ ctx_manager:
85
+ generation: # go to vllm
86
+ diff --git a/config/envs.yaml b/config/envs.yaml
87
+ index 1002ac8..ba3ac6f 100644
88
+ --- a/config/envs.yaml
89
+ +++ b/config/envs.yaml
90
+ @@ -2,6 +2,7 @@ custom_envs:
91
+ SimpleSokoban:
92
+ env_type: sokoban
93
+ max_actions_per_traj: 10 # used in environment state manager to control the actual max actions executed per trajectory
94
+ + # ORIGNAL env_instruction
95
+ env_instruction: |
96
+ You are solving the Sokoban puzzle.
97
+ You are the player and you need to push all boxes to targets.
98
+ @@ -12,7 +13,7 @@ custom_envs:
99
+ env_config: # keys should be a subset of SokobanConfig
100
+ dim_x: 6
101
+ dim_y: 6
102
+ - num_boxes: 1
103
+ + num_boxes: 2
104
+ max_steps: 100
105
+
106
+ LargerSokoban:
107
+ @@ -65,7 +66,7 @@ custom_envs:
108
+ env_config: # keys should be a subset of SokobanConfig
109
+ dim_x: 6
110
+ dim_y: 6
111
+ - num_boxes: 1
112
+ + num_boxes: 2
113
+ max_steps: 100
114
+ observation_format: "grid_coord"
115
+
116
+ @@ -111,14 +112,14 @@ custom_envs:
117
+
118
+ FrozenLake:
119
+ env_type: frozen_lake
120
+ - max_actions_per_traj: 10
121
+ + max_actions_per_traj: 25
122
+ env_instruction: "You are solving the FrozenLake puzzle. Forbid the whole and go to the target. You may move to the unintended direction due to the slippery ice. Example answer format: <think>To forbid the hole and go to the target, I should go left then go up.</think><answer>Left || Up</answer>"
123
+ max_tokens: 100
124
+ env_config: null
125
+
126
+ CoordFrozenLake:
127
+ env_type: frozen_lake
128
+ - max_actions_per_traj: 10
129
+ + max_actions_per_traj: 25
130
+ env_instruction: |
131
+ You are solving the FrozenLake puzzle. The observation includes both a symbol grid and zero-indexed coordinates for the start, goal, player, and any holes.
132
+ Coordinates range from the top-left corner (0, 0) to the bottom-right corner (5, 5).
133
+ @@ -195,4 +196,80 @@ custom_envs:
134
+ max_actions_per_traj: 30
135
+ env_instruction: "You are a Lean theorem prover. Given a Lean theorem statement, propose a sequence of tactics that completes the proof. Think step by step about which tactics to apply next. Provide tactics separated by '||', for example <answer>intro || simp || rfl</answer>."
136
+ max_tokens: 512
137
+ - env_config: null # Please refer to ragen/env/lean/config.py for a full list of parameters.
138
+
139
+ + env_config: null # Please refer to ragen/env/lean/config.py for a full list of parameters.
140
+ +
141
+ +
142
+ + game_2048:
143
+ + env_type: game_2048
144
+ + max_actions_per_traj: 700
145
+ + env_instruction: |
146
+ + You are playing the 2048 game on a 4x4 grid. Merge equal tiles by sliding Up, Right, Down, or Left.
147
+ + If a move is invalid (no tiles move), a small penalty is applied. Respond with a single action.
148
+ + Example: <answer>Up</answer>
149
+ + max_tokens: 8192
150
+ + env_config: null
151
+ +
152
+ + blackjack:
153
+ + env_type: blackjack
154
+ + max_actions_per_traj: 10
155
+ + env_instruction: |
156
+ + You are playing Blackjack against a dealer. The dealer must hit on 16 or less and stand on 17 or more.
157
+ + Choose either Stick or Hit. Respond with a single action.
158
+ + Example: <answer>Hit</answer>
159
+ + max_tokens: 64
160
+ + env_config: null
161
+ +
162
+ + rubikscube:
163
+ + env_type: rubikscube
164
+ + max_actions_per_traj: 20
165
+ + env_instruction: |
166
+ + You are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.
167
+ + Available actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.
168
+ + - Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).
169
+ + - Modifiers: A letter alone means 90° clockwise (e.g., 'R'). A letter with prime (') means 90° counter-clockwise (e.g., "R'").
170
+ + Respond with a sequence of actions separated by "||".
171
+ + Example: <answer>U</answer>
172
+ + max_tokens: 96
173
+ + env_config:
174
+ + scramble_depth: 1
175
+ + max_steps: 20
176
+ + render_mode: "text"
177
+ +
178
+ + SimpleSudoku:
179
+ + env_type: sudoku
180
+ + max_actions_per_traj: 20
181
+ + env_instruction: |
182
+ + You are solving a Sudoku puzzle. Fill in the grid so that every row, column, and 2x2 box contains the numbers 1-4 without repetition.
183
+ + Initial cells are shown in [brackets] and cannot be modified. Empty cells are shown as dots (.).
184
+ + Place numbers one at a time using the format, for example: <answer>place 1 at row 2 col 3</answer> or <answer>1,2,3</answer>
185
+ + The environment will provide feedback on valid/invalid moves and show conflicts if any occur.
186
+ + max_tokens: 150
187
+ + parallel_friendly: false
188
+ + max_workers: 32
189
+ + env_config:
190
+ + grid_size: 4
191
+ + difficulty: "easy"
192
+ + render_format: "with_feedback"
193
+ + show_conflicts: false
194
+ + show_valid_numbers: false
195
+ + max_steps: 20
196
+ +
197
+ + MediumSudoku:
198
+ + env_type: sudoku
199
+ + max_actions_per_traj: 30
200
+ + env_instruction: |
201
+ + You are solving a Sudoku puzzle. Fill in the grid so that every row, column, and 3x3 box contains the numbers 1-9 without repetition.
202
+ + Initial cells are shown in [brackets] and cannot be modified. Empty cells are shown as dots (.).
203
+ + Place numbers one at a time using the format: <answer>place 5 at row 2 col 3</answer> or <answer>2,3,5</answer>
204
+ + The environment will provide feedback on valid/invalid moves and show conflicts if any occur.
205
+ + max_tokens: 150
206
+ + parallel_friendly: false
207
+ + max_workers: 32
208
+ + env_config:
209
+ + grid_size: 9
210
+ + difficulty: "medium"
211
+ + render_format: "with_feedback"
212
+ + show_conflicts: true
213
+ + show_valid_numbers: true
214
+ + max_steps: 81
215
+ +
216
+ diff --git a/config/eval.yaml b/config/eval.yaml
217
+ index e65f3a5..7775fd1 100644
218
+ --- a/config/eval.yaml
219
+ +++ b/config/eval.yaml
220
+ @@ -1,14 +1,15 @@
221
+ defaults:
222
+ - envs
223
+ -
224
+ +enable_response_mask: True
225
+ system:
226
+ - CUDA_VISIBLE_DEVICES: "0"
227
+ + CUDA_VISIBLE_DEVICES: "0,1,2,3,4,5,6,7"
228
+
229
+ seed:
230
+ train: 10000
231
+ val: 123
232
+
233
+ -model_path: Qwen/Qwen2.5-3B-Instruct
234
+ +model_path: /mnt/general/share/model/openai/gpt-oss-20b
235
+ +# /mnt/general/share/model/tyzhu/SPA-frozenlake-qwen2.5-1.5b-instruct
236
+
237
+ lora:
238
+ rank: 0
239
+ @@ -24,9 +25,9 @@ actor_rollout_ref:
240
+ rollout:
241
+ name: vllm
242
+ log_prob_micro_batch_size_per_gpu: ${micro_batch_size_per_gpu}
243
+ - tensor_model_parallel_size: 1
244
+ + tensor_model_parallel_size: 8
245
+ dtype: bfloat16
246
+ - max_model_len: 3600
247
+ + max_model_len: 7200
248
+ prompt_length: 1
249
+ response_length: 400
250
+ gpu_memory_utilization: 0.9
251
+ @@ -35,6 +36,7 @@ actor_rollout_ref:
252
+ free_cache_engine: True
253
+ enable_chunked_prefill: False
254
+ disable_log_stats: False
255
+ + do_sample: True
256
+ val_kwargs:
257
+ do_sample: True
258
+ temperature: 0.5
259
+ @@ -44,9 +46,9 @@ actor_rollout_ref:
260
+
261
+ agent_proxy:
262
+ max_context_window: -1
263
+ - max_turn: 5
264
+ + max_turn: 25
265
+ action_sep: "||"
266
+ - max_actions_per_turn: 2
267
+ + max_actions_per_turn: 1
268
+ use_turn_scores: False
269
+ enable_think: True
270
+ reward_normalization:
271
+ @@ -59,13 +61,13 @@ es_manager:
272
+ env_groups: 8
273
+ group_size: 16
274
+ env_configs:
275
+ - tags: ["CoordSokoban"]
276
+ + tags: ["BanditTest"]
277
+ n_groups: [8]
278
+ val:
279
+ env_groups: 32
280
+ - group_size: 16
281
+ + group_size: 128
282
+ env_configs:
283
+ - tags: ["CoordSokoban"]
284
+ + tags: ["BanditTest"]
285
+ n_groups: [32]
286
+
287
+ ctx_manager:
288
+ diff --git a/config/evaluate_api_llm.yaml b/config/evaluate_api_llm.yaml
289
+ index b21c95e..e2e6761 100644
290
+ --- a/config/evaluate_api_llm.yaml
291
+ +++ b/config/evaluate_api_llm.yaml
292
+ @@ -1,8 +1,11 @@
293
+ +#export OPENAI_BASE_URL="https://api.ohmygpt.com/v1"
294
+ +#export OPENAI_API_KEY="sk-o4sMxBkN5BB100C4D4a3T3BlBkFJF7791CA39EA14ca98041"
295
+ +#python -m ragen.eval_api hydra.searchpath='[file://./verl/verl/trainer/config]'
296
+ defaults:
297
+ - base # this is a symbolic link to the verl/verl/trainer/config/ppo_trainer.yaml file
298
+
299
+ model_config:
300
+ - model_name: gpt-4o # should be registered in model_info
301
+ + model_name: ark-deepseek-v3-250324 # should be registered in model_info
302
+ max_concurrency: 16
303
+
304
+ model_info:
305
+ @@ -24,9 +27,9 @@ model_info:
306
+ generation_kwargs:
307
+ temperature: 0
308
+ max_tokens: 512 # max_completion_tokens if o1-mini
309
+ - gpt-4o:
310
+ + gpt-4o-mini:
311
+ provider_name: openai
312
+ - model_name: gpt-4o
313
+ + model_name: gpt-4o-mini
314
+ generation_kwargs:
315
+ temperature: 0
316
+ max_tokens: 512 # max_completion_tokens if o1-mini
317
+ @@ -36,21 +39,42 @@ model_info:
318
+ generation_kwargs:
319
+ temperature: 0
320
+ max_completion_tokens: 512
321
+ + ark-deepseek-v3-250324:
322
+ + provider_name: openai
323
+ + model_name: ark-deepseek-v3-250324
324
+ + generation_kwargs:
325
+ + temperature: 0
326
+ + max_completion_tokens: 512
327
+ deepseek-v3:
328
+ provider_name: deepseek
329
+ model_name: deepseek-chat
330
+ generation_kwargs:
331
+ temperature: 0
332
+ max_completion_tokens: 512
333
+ + glm-4.6:
334
+ + provider_name: openai
335
+ + model_name: glm-4.6
336
+ + generation_kwargs:
337
+ + temperature: 0
338
+ + max_completion_tokens: 512
339
+ + TA/openai/gpt-oss-120b:
340
+ + provider_name: openai
341
+ + model_name: TA/openai/gpt-oss-120b
342
+ + generation_kwargs:
343
+ + temperature: 0
344
+ + max_tokens: 8192
345
+ + # max_retries: 5
346
+
347
+ -
348
+ -
349
+ +agent_proxy:
350
+ + max_turn: 5
351
+ es_manager:
352
+ val:
353
+ - env_groups: 256
354
+ + env_groups: 128
355
+ group_size: 1 # should be set to 1 because val temperature is set to 0 and same prompt leads to same output
356
+ env_configs:
357
+ - tags: ["CoordSokoban"]
358
+ - n_groups: [256] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
359
+ + tags: ["rubikscube"]
360
+ + n_groups: [128] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
361
+
362
+
363
+ +rollout:
364
+ + max_model_len: 7200
365
+
366
+ Submodule external/webshop-minimal contains modified content
367
+ diff --git a/external/webshop-minimal/requirements.txt b/external/webshop-minimal/requirements.txt
368
+ index 5a1b04f..238ed5a 100644
369
+ --- a/external/webshop-minimal/requirements.txt
370
+ +++ b/external/webshop-minimal/requirements.txt
371
+ @@ -4,7 +4,7 @@ flask
372
+ html2text
373
+ rank_bm25
374
+ pyserini
375
+ -faiss-cpu
376
+ +faiss-gpu
377
+ thefuzz
378
+ gdown
379
+ spacy
380
+ diff --git a/ragen/env/__init__.py b/ragen/env/__init__.py
381
+ index b0f3461..bc6838e 100644
382
+ --- a/ragen/env/__init__.py
383
+ +++ b/ragen/env/__init__.py
384
+ @@ -12,6 +12,14 @@ from .metamathqa.env import MetaMathQAEnv
385
+ from .metamathqa.config import MetaMathQAEnvConfig
386
+ from .lean.config import LeanEnvConfig
387
+ from .lean.env import LeanEnv
388
+ +from .game_2048.config import Game2048EnvConfig
389
+ +from .game_2048.env import Game2048Env
390
+ +from .blackjack.config import BlackjackEnvConfig
391
+ +from .blackjack.env import BlackjackEnv
392
+ +from .rubikscube.config import RubiksCube2x2Config
393
+ +from .rubikscube.env import RubiksCube2x2Env
394
+ +from .sudoku.config import SudokuEnvConfig
395
+ +from .sudoku.env import SudokuEnv
396
+
397
+
398
+ REGISTERED_ENVS = {
399
+ @@ -22,6 +30,10 @@ REGISTERED_ENVS = {
400
+ # 'alfworld': AlfredTXTEnv,
401
+ 'metamathqa': MetaMathQAEnv,
402
+ 'lean': LeanEnv,
403
+ + 'game_2048': Game2048Env,
404
+ + 'blackjack': BlackjackEnv,
405
+ + 'rubikscube': RubiksCube2x2Env,
406
+ + 'sudoku': SudokuEnv,
407
+ }
408
+
409
+ REGISTERED_ENV_CONFIGS = {
410
+ @@ -32,6 +44,10 @@ REGISTERED_ENV_CONFIGS = {
411
+ # 'alfworld': AlfredEnvConfig,
412
+ 'metamathqa': MetaMathQAEnvConfig,
413
+ 'lean': LeanEnvConfig,
414
+ + 'game_2048': Game2048EnvConfig,
415
+ + 'blackjack': BlackjackEnvConfig,
416
+ + 'rubikscube': RubiksCube2x2Config,
417
+ + 'sudoku': SudokuEnvConfig,
418
+ }
419
+
420
+ try:
421
+ diff --git a/ragen/env/frozen_lake/config.py b/ragen/env/frozen_lake/config.py
422
+ index de054f4..9950c34 100644
423
+ --- a/ragen/env/frozen_lake/config.py
424
+ +++ b/ragen/env/frozen_lake/config.py
425
+ @@ -8,7 +8,7 @@ class FrozenLakeEnvConfig:
426
+ size: int = 4
427
+ p: float = 0.9
428
+ success_rate: float = 0.8
429
+ - is_slippery: bool = True
430
+ + is_slippery: bool = False
431
+ map_seed: Optional[int] = None
432
+ render_mode: str = "text"
433
+ observation_format: str = "grid"
434
+ diff --git a/ragen/env/frozen_lake/env.py b/ragen/env/frozen_lake/env.py
435
+ index 9ee3add..eef11d8 100644
436
+ --- a/ragen/env/frozen_lake/env.py
437
+ +++ b/ragen/env/frozen_lake/env.py
438
+ @@ -13,6 +13,7 @@ from ragen.env.base import BaseDiscreteActionEnv
439
+ class FrozenLakeEnv(BaseDiscreteActionEnv, GymFrozenLakeEnv):
440
+ def __init__(self, config: FrozenLakeEnvConfig = FrozenLakeEnvConfig()):
441
+ # Using mappings directly from config
442
+ + # import pdb;pdb.set_trace()
443
+ self.config = config
444
+ self.GRID_LOOKUP = config.grid_lookup
445
+ self.ACTION_LOOKUP = config.action_lookup
446
+ @@ -95,6 +96,7 @@ class FrozenLakeEnv(BaseDiscreteActionEnv, GymFrozenLakeEnv):
447
+ if __name__ == "__main__":
448
+ import matplotlib.pyplot as plt
449
+ config = FrozenLakeEnvConfig(size=4, is_slippery=True)
450
+ + # import pdb;pdb.set_trace()
451
+ env = FrozenLakeEnv(config)
452
+ print(env.reset())
453
+ while True:
454
+ diff --git a/ragen/env/sokoban/env.py b/ragen/env/sokoban/env.py
455
+ index 17cd636..6922b54 100644
456
+ --- a/ragen/env/sokoban/env.py
457
+ +++ b/ragen/env/sokoban/env.py
458
+ @@ -33,6 +33,7 @@ class SokobanEnv(BaseDiscreteActionEnv, GymSokobanEnv):
459
+ def reset(self, seed=None, mode=None):
460
+ try:
461
+ with all_seed(seed):
462
+ + # import pdb;pdb.set_trace()
463
+ self.room_fixed, self.room_state, self.box_mapping, action_sequence = generate_room(
464
+ dim=self.dim_room,
465
+ num_steps=self.num_gen_steps,
466
+ diff --git a/ragen/llm_agent/agent_proxy.py b/ragen/llm_agent/agent_proxy.py
467
+ index c25b50d..f6c4088 100644
468
+ --- a/ragen/llm_agent/agent_proxy.py
469
+ +++ b/ragen/llm_agent/agent_proxy.py
470
+ @@ -287,6 +287,7 @@ def main(config):
471
+ proxy = LLMAgentProxy(config, actor_wg, tokenizer)
472
+ import time
473
+ start_time = time.time()
474
+ + # import pdb;pdb.set_trace()
475
+ rollouts = proxy.rollout(
476
+ DataProto(
477
+ batch=None,
478
+ diff --git a/ragen/llm_agent/base_llm.py b/ragen/llm_agent/base_llm.py
479
+ index 358a2eb..b6f7797 100644
480
+ --- a/ragen/llm_agent/base_llm.py
481
+ +++ b/ragen/llm_agent/base_llm.py
482
+ @@ -33,6 +33,7 @@ class OpenAIProvider(LLMProvider):
483
+ raise ValueError("OpenAI API key not provided and not found in environment variables")
484
+
485
+ self.client = AsyncOpenAI(api_key=self.api_key)
486
+ + # import pdb;pdb.set_trace()
487
+
488
+ async def generate(self, messages: List[Dict[str, str]], **kwargs) -> LLMResponse:
489
+ if "o1-mini" in self.model_name:
490
+ @@ -46,10 +47,7 @@ class OpenAIProvider(LLMProvider):
491
+ )
492
+ if response.choices[0].finish_reason in ['length', 'content_filter']:
493
+ raise ValueError("Content filtered or length exceeded")
494
+ - return LLMResponse(
495
+ - content=response.choices[0].message.content,
496
+ - model_name=response.model
497
+ - )
498
+ + return LLMResponse(content=response.choices[0].message.content,model_name=response.model)
499
+
500
+ class DeepSeekProvider(LLMProvider):
501
+ """DeepSeek API provider implementation"""
502
+ @@ -199,7 +197,7 @@ class ConcurrentLLM:
503
+
504
+ # Queue to store unfinished or failed tasks
505
+ current_batch = messages_list.copy()
506
+ - max_retries = kwargs.get("max_retries", 100)
507
+ + max_retries = kwargs.get("max_retries", 10)
508
+ retry_count = 0
509
+
510
+ while current_batch and retry_count < max_retries:
511
+ diff --git a/ragen/llm_agent/ctx_manager.py b/ragen/llm_agent/ctx_manager.py
512
+ index 905247a..af20a01 100644
513
+ --- a/ragen/llm_agent/ctx_manager.py
514
+ +++ b/ragen/llm_agent/ctx_manager.py
515
+ @@ -88,6 +88,7 @@ class ContextManager:
516
+ Initialize the ContextManager.
517
+ Processor is used to process the image data.
518
+ """
519
+ + # import pdb;pdb.set_trace()
520
+ self.config = config
521
+ self.tokenizer = tokenizer
522
+ self.processor = processor
523
+ @@ -311,7 +312,7 @@ class ContextManager:
524
+
525
+ llm_input_texts.append(text_with_prompt)
526
+ messages_list.append(messages)
527
+ -
528
+ + # import pdb;pdb.set_trace()
529
+ inputs = self.tokenizer(llm_input_texts, return_tensors="pt", padding=True, padding_side="left", truncation=False) # We have truncated previously, truncation in tokenizer may cause issues.
530
+ input_ids, attention_mask = inputs.input_ids, inputs.attention_mask
531
+ position_ids = (attention_mask.cumsum(dim=-1) - 1).clamp(min=0)
532
+ @@ -353,6 +354,30 @@ class ContextManager:
533
+ key: np.sum(value) / self.env_nums[key.split("/")[0]]
534
+ for key, value in metrics.items()
535
+ }
536
+ + # Derived metrics for wandb logging
537
+ + try:
538
+ + # charts/avg_episode_return: average across all 2048 env groups
539
+ + ep_keys = [k for k in metrics.keys() if k.endswith('/episodic_return')]
540
+ + if len(ep_keys) > 0:
541
+ + ep_vals = []
542
+ + for k in ep_keys:
543
+ + tag = k.split('/')[0]
544
+ + denom = self.env_nums.get(tag, max(1, len(metrics[k])))
545
+ + ep_vals.append(float(np.sum(metrics[k]) / denom))
546
+ + mean_metrics["charts/avg_episode_return"] = float(np.mean(ep_vals))
547
+ + except Exception:
548
+ + pass
549
+ + try:
550
+ + # rollout/max_tile: max over all envs in this batch
551
+ + tile_keys = [k for k in metrics.keys() if k.endswith('/max_tile')]
552
+ + if len(tile_keys) > 0:
553
+ + tile_vals = []
554
+ + for k in tile_keys:
555
+ + tile_vals.extend(metrics[k])
556
+ + if len(tile_vals) > 0:
557
+ + mean_metrics["rollout/max_tile"] = int(np.max(tile_vals))
558
+ + except Exception:
559
+ + pass
560
+ for key, values in metrics.items():
561
+ if not isinstance(values, list):
562
+ continue
563
+ diff --git a/ragen/llm_agent/es_manager.py b/ragen/llm_agent/es_manager.py
564
+ index b87a2b3..1a49d3e 100644
565
+ --- a/ragen/llm_agent/es_manager.py
566
+ +++ b/ragen/llm_agent/es_manager.py
567
+ @@ -128,18 +128,40 @@ class EnvStateManager:
568
+ env_outputs: List[Dict]
569
+ {env_id: int, history: List[Dict][{state: str, actions: List[str], reward: float, info: Dict, llm_response: str, llm_raw_response: str, (Optional)images: List[PIL.Image.Image]}]}
570
+ """
571
+ + # def _execute_actions(env, actions):
572
+ + # acc_reward, turn_info, turn_done = 0, {}, False
573
+ + # executed_actions = []
574
+ + # for action in actions:
575
+ + # _, reward, done, info = env.step(action)
576
+ + # acc_reward += reward
577
+ + # turn_info.update(info) # NOTE: currently use last info for multi-action
578
+ + # executed_actions.append(action)
579
+ + # if done:
580
+ + # turn_done = True
581
+ + # break
582
+ +
583
+ + # return acc_reward, turn_info, turn_done, executed_actions
584
+ def _execute_actions(env, actions):
585
+ - acc_reward, turn_info, turn_done = 0, {}, False
586
+ + acc_reward, turn_info, turn_done = 0.0, {}, False
587
+ + raw_acc_reward = 0.0
588
+ executed_actions = []
589
+ for action in actions:
590
+ _, reward, done, info = env.step(action)
591
+ - acc_reward += reward
592
+ + acc_reward += float(reward)
593
+ + try:
594
+ + raw_acc_reward += float(info.get('raw_reward', 0.0))
595
+ + except Exception:
596
+ + pass
597
+ turn_info.update(info) # NOTE: currently use last info for multi-action
598
+ executed_actions.append(action)
599
+ if done:
600
+ turn_done = True
601
+ break
602
+ -
603
+ + # Overwrite per-turn raw_reward to reflect the sum across all executed actions in this turn
604
+ + try:
605
+ + turn_info['raw_reward'] = float(raw_acc_reward)
606
+ + except Exception:
607
+ + pass
608
+ return acc_reward, turn_info, turn_done, executed_actions
609
+
610
+ def _log_env_state(status, history, cur_obs, max_actions_per_traj, executed_actions, all_actions, acc_reward, turn_done, turn_info, env_input):
611
+ @@ -198,6 +220,18 @@ class EnvStateManager:
612
+ 'success': float(status.terminated and (not status.truncated)),
613
+ 'num_actions': status.num_actions,
614
+ }
615
+ + # Add episodic-level metrics
616
+ + # try:
617
+ + # # Sum of per-turn rewards equals the episodic return (env-shaped reward)
618
+ + # env_metric['episodic_return'] = float(sum(status.rewards))
619
+ + # except Exception:
620
+ + # pass
621
+ + try:
622
+ + # Final max tile on the board at the end of the rollout
623
+ + import numpy as _np
624
+ + env_metric['max_tile'] = int(_np.max(entry['env'].grid))
625
+ + except Exception:
626
+ + pass
627
+ custom_metric = {}
628
+ for turn in cache['history']:
629
+ for k, v in turn.get('info', {}).items():
630
+ @@ -212,6 +246,12 @@ class EnvStateManager:
631
+ "Skipping non-numeric metric '%s' with value %r for env %s.",
632
+ k, v, entry['tag']
633
+ )
634
+ + # Add episodic_return as the SUM of raw_reward across steps (align with CleanRL)
635
+ + try:
636
+ + if 'raw_reward' in custom_metric:
637
+ + env_metric['episodic_return'] = float(np.sum(custom_metric['raw_reward']))
638
+ + except Exception:
639
+ + pass
640
+ for k, v in custom_metric.items():
641
+ # TODO: Move TURN_LVL_METRICS into the environment
642
+ if "webshop" not in cache['tag'].lower() or ("webshop" in cache['tag'].lower() and k in TURN_LVL_METRICS):
643
+ @@ -219,7 +259,12 @@ class EnvStateManager:
644
+ else:
645
+ env_metric['traj_sum/' + k] = np.sum(v)
646
+
647
+ -
648
+ + try:
649
+ + if 'score' in custom_metric and len(custom_metric['score']) > 0:
650
+ + env_metric['final_score'] = float(custom_metric['score'][-1])
651
+ + except Exception:
652
+ + pass
653
+ +
654
+ cache['history'][-1]['metrics'] = custom_metric
655
+ env_metric = {f"{entry['tag']}/{k}": v for k, v in env_metric.items()}
656
+ cache['metrics'] = env_metric
657
+ diff --git a/requirements.txt b/requirements.txt
658
+ index 2fd756e..9b521bf 100644
659
+ --- a/requirements.txt
660
+ +++ b/requirements.txt
661
+ @@ -7,7 +7,6 @@ accelerate
662
+ codetiming
663
+ datasets
664
+ dill
665
+ -flash-attn==2.7.4.post1
666
+ hydra-core
667
+ numpy
668
+ pandas
669
+ @@ -15,19 +14,19 @@ pybind11
670
+ ray>=2.10
671
+ tensordict>=0.8.0,<0.9.0
672
+ transformers
673
+ -vllm==0.8.2
674
+ +vllm==0.8.5
675
+ wandb
676
+ gymnasium
677
+ gymnasium[toy-text]
678
+
679
+ pyarrow>=15.0.0
680
+ pylatexenc
681
+ -torchdata
682
+ +# torchdata
683
+ debugpy
684
+
685
+ together
686
+ anthropic
687
+ -faiss-cpu==1.11.0
688
+ +faiss-gpu
689
+
690
+ # This is optional, but needs to be installed with main requirements if you want to use webshop
691
+ -r external/webshop-minimal/requirements.txt
692
+ diff --git a/scripts/setup_ragen.sh b/scripts/setup_ragen.sh
693
+ index f9a7cd9..85a93c4 100644
694
+ --- a/scripts/setup_ragen.sh
695
+ +++ b/scripts/setup_ragen.sh
696
+ @@ -94,10 +94,10 @@ main() {
697
+ pip install torch==2.5.0 --index-url https://download.pytorch.org/whl/cu124
698
+
699
+ print_step "Installing flash-attention..."
700
+ - pip3 install flash-attn==2.7.4.post1 --no-build-isolation
701
+ + # pip3 install flash-attn==2.7.4.post1 --no-build-isolation
702
+ else
703
+ print_step "Installing PyTorch without CUDA support..."
704
+ - pip install torch==2.5.0
705
+ + pip install torch==2.4.0
706
+ fi
707
+
708
+ # Install remaining requirements
709
+ @@ -137,8 +137,8 @@ main() {
710
+ conda install conda-forge::gdown
711
+ mkdir -p external/webshop-minimal/webshop_minimal/data/full
712
+ cd external/webshop-minimal/webshop_minimal/data/full
713
+ - gdown https://drive.google.com/uc?id=1A2whVgOO0euk5O13n2iYDM0bQRkkRduB # items_shuffle
714
+ - gdown https://drive.google.com/uc?id=1s2j6NgHljiZzQNL3veZaAiyW_qDEgBNi # items_ins_v2
715
+ + # gdown https://drive.google.com/uc?id=1A2whVgOO0euk5O13n2iYDM0bQRkkRduB # items_shuffle
716
+ + # gdown https://drive.google.com/uc?id=1s2j6NgHljiZzQNL3veZaAiyW_qDEgBNi # items_ins_v2
717
+ cd ../../../../..
718
+
719
+ echo -e "${GREEN}Installation completed successfully!${NC}"
720
+ diff --git a/train_all.sh b/train_all.sh
721
+ index 0157306..33035f5 100755
722
+ --- a/train_all.sh
723
+ +++ b/train_all.sh
724
+ @@ -6,246 +6,257 @@ USE_GRPO="algorithm.adv_estimator=grpo"
725
+ USE_PPO="algorithm.adv_estimator=gae" # by default.
726
+ USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
727
+
728
+ +
729
+ +# python train.py --config-name _8_2048 system.CUDA_VISIBLE_DEVICES="'0,1,2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=game_2048 $USE_PPO $USE_BASE
730
+ +
731
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'0,1'" trainer.project_name=ragen_latest_qwen_05B_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=rubikscube-1 $USE_PPO $USE_BASE
732
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-1.5B-Instruct trainer.experiment_name=rubikscube-2 $USE_PPO $USE_BASE
733
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'4,5'" trainer.project_name=ragen_latest_qwen_25_3b_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-3B-Instruct trainer.experiment_name=rubikscube-2 $USE_PPO $USE_BASE
734
+ +python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'6,7'" trainer.project_name=ragen_latest_qwen_05B_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=rubikscube-3 $USE_PPO $USE_BASE
735
+ +
736
+ # Section 3.1&3.2 - General Observations
737
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-ppo $USE_PPO $USE_BASE &
738
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-grpo $USE_GRPO $USE_BASE &
739
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE &
740
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-grpo $USE_GRPO $USE_BASE &
741
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozen_lake-ppo $USE_PPO $USE_BASE &
742
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozen_lake-grpo $USE_GRPO $USE_BASE &
743
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="'6,7'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=bandit-ppo-multitask $USE_PPO $USE_BASE &
744
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="'7'" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-ppo-frommlp $USE_PPO $USE_BASE
745
+
746
+ -# Section 4.1 - Filtering and critic
747
+ -# 0.25
748
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.25 actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
749
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
750
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
751
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
752
+ -
753
+ -wait
754
+ -
755
+ -# 0.5
756
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-ppo-rolloutfilter0.5 actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
757
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
758
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
759
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
760
+ -
761
+ -# 0.75
762
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.75 actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
763
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
764
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
765
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
766
+ -
767
+ -wait
768
+ -
769
+ -# Section 4.2 - Ablation on Critic/ClipHigh/KL. Start from Basic and add more components. The best setting for StarPO in agent is rollout_filter+Critic+Cliphigh+NoKL
770
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
771
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
772
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
773
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
774
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozenlake-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
775
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozenlake-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
776
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozenlake-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
777
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozenlake-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
778
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="'0,1'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=sokoban-ppo-box1-multitask $USE_PPO $USE_BASE
779
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-grpo $USE_GRPO $USE_BASE &
780
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
781
+
782
+ -wait
783
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'4,5,6,7'" trainer.project_name=ragen_latest_qwen_25_3b_it trainer.n_gpus_per_node=4 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_3B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
784
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'4,5,6,7'" trainer.n_gpus_per_node=4 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
785
+
786
+ -# Section 5.1 - Reasoning Helps Generalization
787
+ +# # Section 4.1 - Filtering and critic
788
+ +# # 0.25
789
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.25 actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
790
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
791
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
792
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
793
+
794
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-generalization \
795
+ - custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
796
+ - custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
797
+ - custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
798
+ - custom_envs.BanditTest.env_config.hi_arm_name="Librarian"
799
+ +# wait
800
+
801
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-generalization-nothink \
802
+ - custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
803
+ - custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
804
+ - custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
805
+ - custom_envs.BanditTest.env_config.hi_arm_name="Librarian" \
806
+ - agent_proxy.enable_think=False
807
+ +# # 0.5
808
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-ppo-rolloutfilter0.5 actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
809
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
810
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
811
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
812
+ +
813
+ +# # 0.75
814
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.75 actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
815
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
816
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
817
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
818
+
819
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=bandit-generalization-rev \
820
+ - custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
821
+ - custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
822
+ - custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
823
+ - custom_envs.BanditTest.env_config.hi_arm_name="Trader"
824
+ +# wait
825
+
826
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=bandit-generalization-rev-nothink \
827
+ - custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
828
+ - custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
829
+ - custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
830
+ - custom_envs.BanditTest.env_config.hi_arm_name="Trader" \
831
+ - agent_proxy.enable_think=False
832
+ +# # Section 4.2 - Ablation on Critic/ClipHigh/KL. Start from Basic and add more components. The best setting for StarPO in agent is rollout_filter+Critic+Cliphigh+NoKL
833
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
834
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
835
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
836
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
837
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozenlake-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
838
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozenlake-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
839
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozenlake-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
840
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozenlake-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
841
+
842
+ +# wait
843
+
844
+ -SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
845
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization micro_batch_size_per_gpu=8 model_path=Qwen/Qwen2.5-1.5B-Instruct&
846
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-generalization-nothink $SOKOBAN_GENERALIZATION_CONFIG agent_proxy.enable_think=False &
847
+ +# # Section 5.1 - Reasoning Helps Generalization
848
+
849
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-generalization \
850
+ +# custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
851
+ +# custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
852
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
853
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Librarian"
854
+
855
+ -# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=128 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SokobanDifferentGridVocab] es_manager.val.env_configs.n_groups=[128]"
856
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG &
857
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-generalization-nothink \
858
+ +# custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
859
+ +# custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
860
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
861
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Librarian" \
862
+ +# agent_proxy.enable_think=False
863
+
864
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=bandit-generalization-rev \
865
+ +# custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
866
+ +# custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
867
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
868
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Trader"
869
+
870
+ -# COMPOSITIONALITY_CONFIG="es_manager.train.env_groups=16 es_manager.train.env_configs.tags=[Bandit,SimpleSokoban] es_manager.train.env_configs.n_groups=[8,8] es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[Bandit,SimpleSokoban,LargerSokoban,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128] actor_rollout_ref.rollout.rollout_filter_ratio=1" # NOTE that we don't filter out low-var rollout in this setting
871
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=compositional-generalization $COMPOSITIONALITY_CONFIG &
872
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=compositional-generalization-nothink $COMPOSITIONALITY_CONFIG agent_proxy.enable_think=False &
873
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=bandit-generalization-rev-nothink \
874
+ +# custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
875
+ +# custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
876
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
877
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Trader" \
878
+ +# agent_proxy.enable_think=False
879
+
880
+ -wait
881
+
882
+ -# Section 5.2 - what leads to better reasoning?
883
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B-Instruct &
884
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B-Instruct &
885
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct trainer.n_gpus_per_node=2 &
886
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B-Instruct trainer.n_gpus_per_node=4 &
887
+ +# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
888
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization micro_batch_size_per_gpu=8 model_path=Qwen/Qwen2.5-1.5B-Instruct&
889
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-generalization-nothink $SOKOBAN_GENERALIZATION_CONFIG agent_proxy.enable_think=False &
890
+
891
+ -wait
892
+
893
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B &
894
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B &
895
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B &
896
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B &
897
+ +# # SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=128 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SokobanDifferentGridVocab] es_manager.val.env_configs.n_groups=[128]"
898
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG &
899
+
900
+ -wait
901
+
902
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-7B &
903
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B &
904
+ +# # COMPOSITIONALITY_CONFIG="es_manager.train.env_groups=16 es_manager.train.env_configs.tags=[Bandit,SimpleSokoban] es_manager.train.env_configs.n_groups=[8,8] es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[Bandit,SimpleSokoban,LargerSokoban,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128] actor_rollout_ref.rollout.rollout_filter_ratio=1" # NOTE that we don't filter out low-var rollout in this setting
905
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=compositional-generalization $COMPOSITIONALITY_CONFIG &
906
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=compositional-generalization-nothink $COMPOSITIONALITY_CONFIG agent_proxy.enable_think=False &
907
+
908
+ +# wait
909
+
910
+ -wait
911
+ +# # Section 5.2 - what leads to better reasoning?
912
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B-Instruct &
913
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B-Instruct &
914
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct trainer.n_gpus_per_node=2 &
915
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B-Instruct trainer.n_gpus_per_node=4 &
916
+
917
+ -# Section 6.1 varying action count
918
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-action-count-1 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=5 custom_envs.LargerSokoban.max_actions_per_traj=5 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=5 custom_envs.FrozenLake.max_actions_per_traj=5 agent_proxy.max_actions_per_turn=1 &
919
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-action-count-2 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=10 custom_envs.LargerSokoban.max_actions_per_traj=10 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=10 custom_envs.FrozenLake.max_actions_per_traj=10 agent_proxy.max_actions_per_turn=2 &
920
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-action-count-3 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=15 custom_envs.LargerSokoban.max_actions_per_traj=15 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=15 custom_envs.FrozenLake.max_actions_per_traj=15 agent_proxy.max_actions_per_turn=3 &
921
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-action-count-4 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=20 custom_envs.LargerSokoban.max_actions_per_traj=20 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=20 custom_envs.FrozenLake.max_actions_per_traj=20 agent_proxy.max_actions_per_turn=4 &
922
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-action-count-5 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=25 custom_envs.LargerSokoban.max_actions_per_traj=25 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=25 custom_envs.FrozenLake.max_actions_per_traj=25 agent_proxy.max_actions_per_turn=5 &
923
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-action-count-6 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=30 custom_envs.LargerSokoban.max_actions_per_traj=30 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=30 custom_envs.FrozenLake.max_actions_per_traj=30 agent_proxy.max_actions_per_turn=6 &
924
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-action-count-7 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=35 custom_envs.LargerSokoban.max_actions_per_traj=35 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=35 custom_envs.FrozenLake.max_actions_per_traj=35 agent_proxy.max_actions_per_turn=7 &
925
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-action-count-8 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=40 custom_envs.LargerSokoban.max_actions_per_traj=40 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=40 custom_envs.FrozenLake.max_actions_per_traj=40 agent_proxy.max_actions_per_turn=8 &
926
+ +# wait
927
+
928
+ -# section 6.2 Varying prompt diversity
929
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-prompt-diversity-4 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=4 es_manager.train.group_size=32 es_manager.train.env_configs.n_groups=[4] &
930
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-prompt-diversity-8 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] &
931
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-prompt-diversity-16 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=8 es_manager.train.env_configs.n_groups=[16] &
932
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-prompt-diversity-32 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=32 es_manager.train.group_size=4 es_manager.train.env_configs.n_groups=[32] &
933
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-prompt-diversity-64 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=64 es_manager.train.group_size=2 es_manager.train.env_configs.n_groups=[64] &
934
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-prompt-diversity-128 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=128 es_manager.train.group_size=1 es_manager.train.env_configs.n_groups=[128] &
935
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B &
936
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B &
937
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B &
938
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B &
939
+
940
+ -wait
941
+ +# wait
942
+
943
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-online-2 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[16] trainer.total_training_steps=100 trainer.test_freq=5 &
944
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-7B &
945
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B &
946
+
947
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-online-5 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=40 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[40] trainer.total_training_steps=40 trainer.test_freq=2 &
948
+
949
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-online-10 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=80 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[80] trainer.total_training_steps=80 trainer.test_freq=1 &
950
+ +# wait
951
+
952
+ +# # Section 6.1 varying action count
953
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-action-count-1 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=5 custom_envs.LargerSokoban.max_actions_per_traj=5 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=5 custom_envs.FrozenLake.max_actions_per_traj=5 agent_proxy.max_actions_per_turn=1 &
954
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-action-count-2 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=10 custom_envs.LargerSokoban.max_actions_per_traj=10 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=10 custom_envs.FrozenLake.max_actions_per_traj=10 agent_proxy.max_actions_per_turn=2 &
955
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-action-count-3 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=15 custom_envs.LargerSokoban.max_actions_per_traj=15 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=15 custom_envs.FrozenLake.max_actions_per_traj=15 agent_proxy.max_actions_per_turn=3 &
956
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-action-count-4 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=20 custom_envs.LargerSokoban.max_actions_per_traj=20 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=20 custom_envs.FrozenLake.max_actions_per_traj=20 agent_proxy.max_actions_per_turn=4 &
957
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-action-count-5 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=25 custom_envs.LargerSokoban.max_actions_per_traj=25 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=25 custom_envs.FrozenLake.max_actions_per_traj=25 agent_proxy.max_actions_per_turn=5 &
958
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-action-count-6 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=30 custom_envs.LargerSokoban.max_actions_per_traj=30 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=30 custom_envs.FrozenLake.max_actions_per_traj=30 agent_proxy.max_actions_per_turn=6 &
959
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-action-count-7 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=35 custom_envs.LargerSokoban.max_actions_per_traj=35 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=35 custom_envs.FrozenLake.max_actions_per_traj=35 agent_proxy.max_actions_per_turn=7 &
960
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-action-count-8 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=40 custom_envs.LargerSokoban.max_actions_per_traj=40 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=40 custom_envs.FrozenLake.max_actions_per_traj=40 agent_proxy.max_actions_per_turn=8 &
961
+
962
+ +# # section 6.2 Varying prompt diversity
963
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-prompt-diversity-4 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=4 es_manager.train.group_size=32 es_manager.train.env_configs.n_groups=[4] &
964
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-prompt-diversity-8 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] &
965
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-prompt-diversity-16 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=8 es_manager.train.env_configs.n_groups=[16] &
966
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-prompt-diversity-32 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=32 es_manager.train.group_size=4 es_manager.train.env_configs.n_groups=[32] &
967
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-prompt-diversity-64 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=64 es_manager.train.group_size=2 es_manager.train.env_configs.n_groups=[64] &
968
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-prompt-diversity-128 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=128 es_manager.train.group_size=1 es_manager.train.env_configs.n_groups=[128] &
969
+
970
+ +# wait
971
+
972
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-online-2 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[16] trainer.total_training_steps=100 trainer.test_freq=5 &
973
+
974
+ -# Extension: Training 7B reasoning model
975
+ -SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
976
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct-largescale $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] micro_batch_size_per_gpu=8 ppo_mini_batch_size=64 actor_rollout_ref.rollout.response_length=1024 actor_rollout_ref.rollout.max_model_len=6400 trainer.test_freq=5 actor_rollout_ref.rollout.max_num_batched_tokens=24000 micro_batch_size_per_gpu=2 actor_rollout_ref.rollout.rollout_filter_ratio=1 &
977
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-online-5 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=40 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[40] trainer.total_training_steps=40 trainer.test_freq=2 &
978
+
979
+ -python -m ragen.llm_agent.agent_proxy model_path=Qwen/Qwen2.5-3B-Instruct system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 actor_rollout_ref.rollout.tensor_model_parallel_size=4 actor_rollout_ref.rollout.response_length=2048 actor_rollout_ref.rollout.max_model_len=12800
980
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-online-10 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=80 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[80] trainer.total_training_steps=80 trainer.test_freq=1 &
981
+
982
+ -# trainer.save_freq=50 trainer.default_local_dir=/mnt/local/cache/exp_name
983
+
984
+ -# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
985
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization &
986
+
987
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/bandit-generalization &
988
+
989
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=frozenlake-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/frozenlake-generalization &
990
+
991
+ +# # Extension: Training 7B reasoning model
992
+ +# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
993
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct-largescale $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] micro_batch_size_per_gpu=8 ppo_mini_batch_size=64 actor_rollout_ref.rollout.response_length=1024 actor_rollout_ref.rollout.max_model_len=6400 trainer.test_freq=5 actor_rollout_ref.rollout.max_num_batched_tokens=24000 micro_batch_size_per_gpu=2 actor_rollout_ref.rollout.rollout_filter_ratio=1 &
994
+
995
+ +# python -m ragen.llm_agent.agent_proxy model_path=Qwen/Qwen2.5-3B-Instruct system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 actor_rollout_ref.rollout.tensor_model_parallel_size=4 actor_rollout_ref.rollout.response_length=2048 actor_rollout_ref.rollout.max_model_len=12800
996
+
997
+ +# # trainer.save_freq=50 trainer.default_local_dir=/mnt/local/cache/exp_name
998
+
999
+ -# USE_PPO="algorithm.adv_estimator=gae" # by default.
1000
+ -# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1001
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE ppo_mini_batch_size=64 enable_response_mask=True &
1002
+ +# # USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1003
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization &
1004
+
1005
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/bandit-generalization &
1006
+
1007
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std &
1008
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=frozenlake-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/frozenlake-generalization &
1009
+
1010
+ -# enable_response_mask: False
1011
+ -# grpo_advantage_length_weight: True
1012
+
1013
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo-1-5b algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std agent_proxy.max_actions_per_turn=5 custom_envs.SimpleSokoban.max_actions_per_traj=25 enable_response_mask=True grpo_advantage_length_weight=False model_path=Qwen/Qwen2.5-1.5B-Instruct &
1014
+
1015
+
1016
+ -# extension: 7B with lora. Currently NOT recommended to use lora: within current version of vllm, this could result in rollouts slower than non-lora by 100%
1017
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-7B-Instruct trainer.experiment_name=sokoban_7b_instruct_lora_newversion lora.rank=16
1018
+ +# # USE_PPO="algorithm.adv_estimator=gae" # by default.
1019
+ +# # USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1020
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE ppo_mini_batch_size=64 enable_response_mask=True &
1021
+
1022
+ -# extension: bi-level gae
1023
+ -python train.py trainer.experiment_name=sokoban-bi-level-gae-final \
1024
+ - system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
1025
+ - model_path=Qwen/Qwen2.5-0.5B-Instruct \
1026
+ - algorithm.bi_level_gae=True algorithm.high_level_gamma=0.95 \
1027
+ - agent_proxy.use_turn_scores=True \
1028
+ - actor_rollout_ref.rollout.tp_size_check=False
1029
+
1030
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std &
1031
+
1032
+ -# extension: webshop
1033
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1034
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1035
+ - trainer.experiment_name=webshop-3b-ppo-s $USE_PPO \
1036
+ - trainer.nnodes=1 &
1037
+ +# # enable_response_mask: False
1038
+ +# # grpo_advantage_length_weight: True
1039
+
1040
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo-1-5b algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std agent_proxy.max_actions_per_turn=5 custom_envs.SimpleSokoban.max_actions_per_traj=25 enable_response_mask=True grpo_advantage_length_weight=False model_path=Qwen/Qwen2.5-1.5B-Instruct &
1041
+
1042
+ -USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1043
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1044
+ - trainer.experiment_name=webshop-3b-grpo-s $USE_GRPO \
1045
+ - trainer.nnodes=1 &
1046
+
1047
+ -# StarPO ppo
1048
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1049
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1050
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1051
+ - trainer.experiment_name=webshop-3b-ppo $USE_PPO $USE_BASE \
1052
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1053
+ - trainer.nnodes=1 &
1054
+ +# # extension: 7B with lora. Currently NOT recommended to use lora: within current version of vllm, this could result in rollouts slower than non-lora by 100%
1055
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-7B-Instruct trainer.experiment_name=sokoban_7b_instruct_lora_newversion lora.rank=16
1056
+
1057
+ -# StarPO grpo
1058
+ -USE_GRPO="algorithm.adv_estimator=grpo"
1059
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1060
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1061
+ - trainer.experiment_name=webshop-3b-grpo $USE_GRPO $USE_BASE \
1062
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1063
+ - trainer.nnodes=1 &
1064
+ +# # extension: bi-level gae
1065
+ +# python train.py trainer.experiment_name=sokoban-bi-level-gae-final \
1066
+ +# system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
1067
+ +# model_path=Qwen/Qwen2.5-0.5B-Instruct \
1068
+ +# algorithm.bi_level_gae=True algorithm.high_level_gamma=0.95 \
1069
+ +# agent_proxy.use_turn_scores=True \
1070
+ +# actor_rollout_ref.rollout.tp_size_check=False
1071
+
1072
+
1073
+ -# normal:sokoban
1074
+ -# extension: sokoban
1075
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1076
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1077
+ - trainer.experiment_name=sokoban-3b-ppo-s $USE_PPO \
1078
+ - trainer.nnodes=1 &
1079
+ +# # extension: webshop
1080
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1081
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1082
+ +# trainer.experiment_name=webshop-3b-ppo-s $USE_PPO \
1083
+ +# trainer.nnodes=1 &
1084
+
1085
+
1086
+ -USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1087
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1088
+ - trainer.experiment_name=sokoban-3b-grpo-s $USE_GRPO \
1089
+ - trainer.nnodes=1 &
1090
+ +# USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1091
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1092
+ +# trainer.experiment_name=webshop-3b-grpo-s $USE_GRPO \
1093
+ +# trainer.nnodes=1 &
1094
+
1095
+ -# StarPO ppo
1096
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1097
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1098
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1099
+ - trainer.experiment_name=sokoban-3b-ppo $USE_PPO $USE_BASE \
1100
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1101
+ - trainer.nnodes=1 &
1102
+ +# # StarPO ppo
1103
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1104
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1105
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1106
+ +# trainer.experiment_name=webshop-3b-ppo $USE_PPO $USE_BASE \
1107
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1108
+ +# trainer.nnodes=1 &
1109
+
1110
+ -# StarPO grpo
1111
+ -USE_GRPO="algorithm.adv_estimator=grpo"
1112
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1113
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1114
+ - trainer.experiment_name=sokoban-3b-grpo $USE_GRPO $USE_BASE \
1115
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1116
+ - trainer.nnodes=1 &
1117
+ +# # StarPO grpo
1118
+ +# USE_GRPO="algorithm.adv_estimator=grpo"
1119
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1120
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1121
+ +# trainer.experiment_name=webshop-3b-grpo $USE_GRPO $USE_BASE \
1122
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1123
+ +# trainer.nnodes=1 &
1124
+ +
1125
+ +
1126
+ +# # normal:sokoban
1127
+ +# # extension: sokoban
1128
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1129
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1130
+ +# trainer.experiment_name=sokoban-3b-ppo-s $USE_PPO \
1131
+ +# trainer.nnodes=1 &
1132
+ +
1133
+ +
1134
+ +# USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1135
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1136
+ +# trainer.experiment_name=sokoban-3b-grpo-s $USE_GRPO \
1137
+ +# trainer.nnodes=1 &
1138
+ +
1139
+ +# # StarPO ppo
1140
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1141
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1142
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1143
+ +# trainer.experiment_name=sokoban-3b-ppo $USE_PPO $USE_BASE \
1144
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1145
+ +# trainer.nnodes=1 &
1146
+ +
1147
+ +# # StarPO grpo
1148
+ +# USE_GRPO="algorithm.adv_estimator=grpo"
1149
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1150
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1151
+ +# trainer.experiment_name=sokoban-3b-grpo $USE_GRPO $USE_BASE \
1152
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1153
+ +# trainer.nnodes=1 &
1154
+
1155
+
1156
+
1157
+ -python train.py \
1158
+ - trainer.experiment_name=3b-full-ppo-test system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2
1159
+
1160
+ +# python train.py \
1161
+ +# trainer.experiment_name=3b-full-ppo-test system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2
1162
+
wandb/run-20251218_185248-ts36d12x/files/diff_8d73639b99b38265453f898b8d6af7d4af50d56e.patch ADDED
@@ -0,0 +1,1162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ diff --git a/config/base.yaml b/config/base.yaml
2
+ index a1659e4..9df6250 100644
3
+ --- a/config/base.yaml
4
+ +++ b/config/base.yaml
5
+ @@ -9,15 +9,16 @@ seed:
6
+ train: 10000
7
+ val: 123
8
+
9
+ -micro_batch_size_per_gpu: 4
10
+ +micro_batch_size_per_gpu: 1
11
+ ppo_mini_batch_size: 32
12
+ -model_path: Qwen/Qwen2.5-3B-Instruct
13
+ +model_path: /mnt/general/share/model/Qwen/Qwen2.5-0.5B-Instruct
14
+ +# Qwen/Qwen2.5-0.5B-Instruct
15
+ enable_response_mask: True # Enabling response mask could improve stability of rollout/old_log_prob, as P(st|history) are no longer calculated in loss here. See https://docs.google.com/document/d/1bg7obeiKTExuHHBl5uOiSpec5uLDZ2Tgvxy6li5pHX4/edit?usp=sharing for more details.
16
+ grpo_advantage_length_weight: False # if you do not enable this and critic/advantage_estimator is GRPO, and the critic/advantages/mean is too low, then you can try enabling this to encourage reasoning and forbid collapse
17
+
18
+ lora:
19
+ rank: 0
20
+ - alpha: 64
21
+ + alpha: 16
22
+ target_modules: all-linear
23
+
24
+ actor_rollout_ref:
25
+ @@ -46,10 +47,10 @@ actor_rollout_ref:
26
+ name: vllm
27
+ log_prob_micro_batch_size_per_gpu: ${micro_batch_size_per_gpu} # following micro_batch_size_per_gpu
28
+ tensor_model_parallel_size: 1
29
+ - max_model_len: 3600
30
+ + max_model_len: 7200 #3600 why** 14400
31
+ prompt_length: 1 # useless. Just put it here
32
+ response_length: 400 # single-turn response length
33
+ - gpu_memory_utilization: 0.5
34
+ + gpu_memory_utilization: 0.7
35
+ max_num_batched_tokens: 8192 # set only when enable_chunked_prefill is true
36
+ temperature: 1
37
+ rollout_filter_ratio: 0.25
38
+ @@ -90,26 +91,28 @@ algorithm:
39
+ kl_coef: 0.000
40
+
41
+ trainer:
42
+ - project_name: ragen_latest
43
+ + project_name:
44
+ experiment_name: test
45
+ local_log_dir: "results/"
46
+ - save_freq: 100
47
+ + save_freq: -1
48
+ total_training_steps: 200
49
+ validation_steps: 1 # validation instances = validation_steps * val_env_groups * group_size
50
+ val_before_train: True
51
+ n_gpus_per_node: 1
52
+ test_freq: 10
53
+ generations_to_log_to_wandb:
54
+ + train: 128
55
+ val: 20
56
+ logger: [ 'console', 'wandb' ]
57
+ max_actor_ckpt_to_keep: 1
58
+ max_critic_ckpt_to_keep: 1
59
+ + default_local_dir: /mnt/general/wanghy/RAGEN/saves/
60
+
61
+ agent_proxy:
62
+ max_context_window: -1 # set a value > 0 to enable context window for long trajectory
63
+ - max_turn: 5
64
+ + max_turn: 25 #25 why** 700
65
+ action_sep: "||"
66
+ - max_actions_per_turn: 2 # how many actions can be output at most in a single turn
67
+ + max_actions_per_turn: 1 # how many actions can be output at most in a single turn
68
+ use_turn_scores: False # important to GAE when applying token-level rewards to token-level advantages. If False, will take the sum of scores as the reward for the last turn.
69
+ enable_think: True # False -> no think RL
70
+ reward_normalization:
71
+ @@ -126,11 +129,11 @@ es_manager:
72
+ tags: ["CoordSokoban"]
73
+ n_groups: [8] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
74
+ val:
75
+ - env_groups: 32
76
+ - group_size: 16 # should be set to 1 because when val temperature is set to 0 and group size > 1, there will be repetitive prompts which leads to same trajectory.
77
+ + env_groups: 256
78
+ + group_size: 1 # should be set to 1 because when val temperature is set to 0 and group size > 1, there will be repetitive prompts which leads to same trajectory.
79
+ env_configs:
80
+ tags: ["CoordSokoban"]
81
+ - n_groups: [32] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
82
+ + n_groups: [256] # TODO: If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
83
+
84
+ ctx_manager:
85
+ generation: # go to vllm
86
+ diff --git a/config/envs.yaml b/config/envs.yaml
87
+ index 1002ac8..ba3ac6f 100644
88
+ --- a/config/envs.yaml
89
+ +++ b/config/envs.yaml
90
+ @@ -2,6 +2,7 @@ custom_envs:
91
+ SimpleSokoban:
92
+ env_type: sokoban
93
+ max_actions_per_traj: 10 # used in environment state manager to control the actual max actions executed per trajectory
94
+ + # ORIGNAL env_instruction
95
+ env_instruction: |
96
+ You are solving the Sokoban puzzle.
97
+ You are the player and you need to push all boxes to targets.
98
+ @@ -12,7 +13,7 @@ custom_envs:
99
+ env_config: # keys should be a subset of SokobanConfig
100
+ dim_x: 6
101
+ dim_y: 6
102
+ - num_boxes: 1
103
+ + num_boxes: 2
104
+ max_steps: 100
105
+
106
+ LargerSokoban:
107
+ @@ -65,7 +66,7 @@ custom_envs:
108
+ env_config: # keys should be a subset of SokobanConfig
109
+ dim_x: 6
110
+ dim_y: 6
111
+ - num_boxes: 1
112
+ + num_boxes: 2
113
+ max_steps: 100
114
+ observation_format: "grid_coord"
115
+
116
+ @@ -111,14 +112,14 @@ custom_envs:
117
+
118
+ FrozenLake:
119
+ env_type: frozen_lake
120
+ - max_actions_per_traj: 10
121
+ + max_actions_per_traj: 25
122
+ env_instruction: "You are solving the FrozenLake puzzle. Forbid the whole and go to the target. You may move to the unintended direction due to the slippery ice. Example answer format: <think>To forbid the hole and go to the target, I should go left then go up.</think><answer>Left || Up</answer>"
123
+ max_tokens: 100
124
+ env_config: null
125
+
126
+ CoordFrozenLake:
127
+ env_type: frozen_lake
128
+ - max_actions_per_traj: 10
129
+ + max_actions_per_traj: 25
130
+ env_instruction: |
131
+ You are solving the FrozenLake puzzle. The observation includes both a symbol grid and zero-indexed coordinates for the start, goal, player, and any holes.
132
+ Coordinates range from the top-left corner (0, 0) to the bottom-right corner (5, 5).
133
+ @@ -195,4 +196,80 @@ custom_envs:
134
+ max_actions_per_traj: 30
135
+ env_instruction: "You are a Lean theorem prover. Given a Lean theorem statement, propose a sequence of tactics that completes the proof. Think step by step about which tactics to apply next. Provide tactics separated by '||', for example <answer>intro || simp || rfl</answer>."
136
+ max_tokens: 512
137
+ - env_config: null # Please refer to ragen/env/lean/config.py for a full list of parameters.
138
+
139
+ + env_config: null # Please refer to ragen/env/lean/config.py for a full list of parameters.
140
+ +
141
+ +
142
+ + game_2048:
143
+ + env_type: game_2048
144
+ + max_actions_per_traj: 700
145
+ + env_instruction: |
146
+ + You are playing the 2048 game on a 4x4 grid. Merge equal tiles by sliding Up, Right, Down, or Left.
147
+ + If a move is invalid (no tiles move), a small penalty is applied. Respond with a single action.
148
+ + Example: <answer>Up</answer>
149
+ + max_tokens: 8192
150
+ + env_config: null
151
+ +
152
+ + blackjack:
153
+ + env_type: blackjack
154
+ + max_actions_per_traj: 10
155
+ + env_instruction: |
156
+ + You are playing Blackjack against a dealer. The dealer must hit on 16 or less and stand on 17 or more.
157
+ + Choose either Stick or Hit. Respond with a single action.
158
+ + Example: <answer>Hit</answer>
159
+ + max_tokens: 64
160
+ + env_config: null
161
+ +
162
+ + rubikscube:
163
+ + env_type: rubikscube
164
+ + max_actions_per_traj: 20
165
+ + env_instruction: |
166
+ + You are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.
167
+ + Available actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.
168
+ + - Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).
169
+ + - Modifiers: A letter alone means 90° clockwise (e.g., 'R'). A letter with prime (') means 90° counter-clockwise (e.g., "R'").
170
+ + Respond with a sequence of actions separated by "||".
171
+ + Example: <answer>U</answer>
172
+ + max_tokens: 96
173
+ + env_config:
174
+ + scramble_depth: 1
175
+ + max_steps: 20
176
+ + render_mode: "text"
177
+ +
178
+ + SimpleSudoku:
179
+ + env_type: sudoku
180
+ + max_actions_per_traj: 20
181
+ + env_instruction: |
182
+ + You are solving a Sudoku puzzle. Fill in the grid so that every row, column, and 2x2 box contains the numbers 1-4 without repetition.
183
+ + Initial cells are shown in [brackets] and cannot be modified. Empty cells are shown as dots (.).
184
+ + Place numbers one at a time using the format, for example: <answer>place 1 at row 2 col 3</answer> or <answer>1,2,3</answer>
185
+ + The environment will provide feedback on valid/invalid moves and show conflicts if any occur.
186
+ + max_tokens: 150
187
+ + parallel_friendly: false
188
+ + max_workers: 32
189
+ + env_config:
190
+ + grid_size: 4
191
+ + difficulty: "easy"
192
+ + render_format: "with_feedback"
193
+ + show_conflicts: false
194
+ + show_valid_numbers: false
195
+ + max_steps: 20
196
+ +
197
+ + MediumSudoku:
198
+ + env_type: sudoku
199
+ + max_actions_per_traj: 30
200
+ + env_instruction: |
201
+ + You are solving a Sudoku puzzle. Fill in the grid so that every row, column, and 3x3 box contains the numbers 1-9 without repetition.
202
+ + Initial cells are shown in [brackets] and cannot be modified. Empty cells are shown as dots (.).
203
+ + Place numbers one at a time using the format: <answer>place 5 at row 2 col 3</answer> or <answer>2,3,5</answer>
204
+ + The environment will provide feedback on valid/invalid moves and show conflicts if any occur.
205
+ + max_tokens: 150
206
+ + parallel_friendly: false
207
+ + max_workers: 32
208
+ + env_config:
209
+ + grid_size: 9
210
+ + difficulty: "medium"
211
+ + render_format: "with_feedback"
212
+ + show_conflicts: true
213
+ + show_valid_numbers: true
214
+ + max_steps: 81
215
+ +
216
+ diff --git a/config/eval.yaml b/config/eval.yaml
217
+ index e65f3a5..7775fd1 100644
218
+ --- a/config/eval.yaml
219
+ +++ b/config/eval.yaml
220
+ @@ -1,14 +1,15 @@
221
+ defaults:
222
+ - envs
223
+ -
224
+ +enable_response_mask: True
225
+ system:
226
+ - CUDA_VISIBLE_DEVICES: "0"
227
+ + CUDA_VISIBLE_DEVICES: "0,1,2,3,4,5,6,7"
228
+
229
+ seed:
230
+ train: 10000
231
+ val: 123
232
+
233
+ -model_path: Qwen/Qwen2.5-3B-Instruct
234
+ +model_path: /mnt/general/share/model/openai/gpt-oss-20b
235
+ +# /mnt/general/share/model/tyzhu/SPA-frozenlake-qwen2.5-1.5b-instruct
236
+
237
+ lora:
238
+ rank: 0
239
+ @@ -24,9 +25,9 @@ actor_rollout_ref:
240
+ rollout:
241
+ name: vllm
242
+ log_prob_micro_batch_size_per_gpu: ${micro_batch_size_per_gpu}
243
+ - tensor_model_parallel_size: 1
244
+ + tensor_model_parallel_size: 8
245
+ dtype: bfloat16
246
+ - max_model_len: 3600
247
+ + max_model_len: 7200
248
+ prompt_length: 1
249
+ response_length: 400
250
+ gpu_memory_utilization: 0.9
251
+ @@ -35,6 +36,7 @@ actor_rollout_ref:
252
+ free_cache_engine: True
253
+ enable_chunked_prefill: False
254
+ disable_log_stats: False
255
+ + do_sample: True
256
+ val_kwargs:
257
+ do_sample: True
258
+ temperature: 0.5
259
+ @@ -44,9 +46,9 @@ actor_rollout_ref:
260
+
261
+ agent_proxy:
262
+ max_context_window: -1
263
+ - max_turn: 5
264
+ + max_turn: 25
265
+ action_sep: "||"
266
+ - max_actions_per_turn: 2
267
+ + max_actions_per_turn: 1
268
+ use_turn_scores: False
269
+ enable_think: True
270
+ reward_normalization:
271
+ @@ -59,13 +61,13 @@ es_manager:
272
+ env_groups: 8
273
+ group_size: 16
274
+ env_configs:
275
+ - tags: ["CoordSokoban"]
276
+ + tags: ["BanditTest"]
277
+ n_groups: [8]
278
+ val:
279
+ env_groups: 32
280
+ - group_size: 16
281
+ + group_size: 128
282
+ env_configs:
283
+ - tags: ["CoordSokoban"]
284
+ + tags: ["BanditTest"]
285
+ n_groups: [32]
286
+
287
+ ctx_manager:
288
+ diff --git a/config/evaluate_api_llm.yaml b/config/evaluate_api_llm.yaml
289
+ index b21c95e..e2e6761 100644
290
+ --- a/config/evaluate_api_llm.yaml
291
+ +++ b/config/evaluate_api_llm.yaml
292
+ @@ -1,8 +1,11 @@
293
+ +#export OPENAI_BASE_URL="https://api.ohmygpt.com/v1"
294
+ +#export OPENAI_API_KEY="sk-o4sMxBkN5BB100C4D4a3T3BlBkFJF7791CA39EA14ca98041"
295
+ +#python -m ragen.eval_api hydra.searchpath='[file://./verl/verl/trainer/config]'
296
+ defaults:
297
+ - base # this is a symbolic link to the verl/verl/trainer/config/ppo_trainer.yaml file
298
+
299
+ model_config:
300
+ - model_name: gpt-4o # should be registered in model_info
301
+ + model_name: ark-deepseek-v3-250324 # should be registered in model_info
302
+ max_concurrency: 16
303
+
304
+ model_info:
305
+ @@ -24,9 +27,9 @@ model_info:
306
+ generation_kwargs:
307
+ temperature: 0
308
+ max_tokens: 512 # max_completion_tokens if o1-mini
309
+ - gpt-4o:
310
+ + gpt-4o-mini:
311
+ provider_name: openai
312
+ - model_name: gpt-4o
313
+ + model_name: gpt-4o-mini
314
+ generation_kwargs:
315
+ temperature: 0
316
+ max_tokens: 512 # max_completion_tokens if o1-mini
317
+ @@ -36,21 +39,42 @@ model_info:
318
+ generation_kwargs:
319
+ temperature: 0
320
+ max_completion_tokens: 512
321
+ + ark-deepseek-v3-250324:
322
+ + provider_name: openai
323
+ + model_name: ark-deepseek-v3-250324
324
+ + generation_kwargs:
325
+ + temperature: 0
326
+ + max_completion_tokens: 512
327
+ deepseek-v3:
328
+ provider_name: deepseek
329
+ model_name: deepseek-chat
330
+ generation_kwargs:
331
+ temperature: 0
332
+ max_completion_tokens: 512
333
+ + glm-4.6:
334
+ + provider_name: openai
335
+ + model_name: glm-4.6
336
+ + generation_kwargs:
337
+ + temperature: 0
338
+ + max_completion_tokens: 512
339
+ + TA/openai/gpt-oss-120b:
340
+ + provider_name: openai
341
+ + model_name: TA/openai/gpt-oss-120b
342
+ + generation_kwargs:
343
+ + temperature: 0
344
+ + max_tokens: 8192
345
+ + # max_retries: 5
346
+
347
+ -
348
+ -
349
+ +agent_proxy:
350
+ + max_turn: 5
351
+ es_manager:
352
+ val:
353
+ - env_groups: 256
354
+ + env_groups: 128
355
+ group_size: 1 # should be set to 1 because val temperature is set to 0 and same prompt leads to same output
356
+ env_configs:
357
+ - tags: ["CoordSokoban"]
358
+ - n_groups: [256] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
359
+ + tags: ["rubikscube"]
360
+ + n_groups: [128] # If not set, all env names divide nums equally. Under the same group, the env config and env seed (prompt) are equal in each generation
361
+
362
+
363
+ +rollout:
364
+ + max_model_len: 7200
365
+
366
+ Submodule external/webshop-minimal contains modified content
367
+ diff --git a/external/webshop-minimal/requirements.txt b/external/webshop-minimal/requirements.txt
368
+ index 5a1b04f..238ed5a 100644
369
+ --- a/external/webshop-minimal/requirements.txt
370
+ +++ b/external/webshop-minimal/requirements.txt
371
+ @@ -4,7 +4,7 @@ flask
372
+ html2text
373
+ rank_bm25
374
+ pyserini
375
+ -faiss-cpu
376
+ +faiss-gpu
377
+ thefuzz
378
+ gdown
379
+ spacy
380
+ diff --git a/ragen/env/__init__.py b/ragen/env/__init__.py
381
+ index b0f3461..bc6838e 100644
382
+ --- a/ragen/env/__init__.py
383
+ +++ b/ragen/env/__init__.py
384
+ @@ -12,6 +12,14 @@ from .metamathqa.env import MetaMathQAEnv
385
+ from .metamathqa.config import MetaMathQAEnvConfig
386
+ from .lean.config import LeanEnvConfig
387
+ from .lean.env import LeanEnv
388
+ +from .game_2048.config import Game2048EnvConfig
389
+ +from .game_2048.env import Game2048Env
390
+ +from .blackjack.config import BlackjackEnvConfig
391
+ +from .blackjack.env import BlackjackEnv
392
+ +from .rubikscube.config import RubiksCube2x2Config
393
+ +from .rubikscube.env import RubiksCube2x2Env
394
+ +from .sudoku.config import SudokuEnvConfig
395
+ +from .sudoku.env import SudokuEnv
396
+
397
+
398
+ REGISTERED_ENVS = {
399
+ @@ -22,6 +30,10 @@ REGISTERED_ENVS = {
400
+ # 'alfworld': AlfredTXTEnv,
401
+ 'metamathqa': MetaMathQAEnv,
402
+ 'lean': LeanEnv,
403
+ + 'game_2048': Game2048Env,
404
+ + 'blackjack': BlackjackEnv,
405
+ + 'rubikscube': RubiksCube2x2Env,
406
+ + 'sudoku': SudokuEnv,
407
+ }
408
+
409
+ REGISTERED_ENV_CONFIGS = {
410
+ @@ -32,6 +44,10 @@ REGISTERED_ENV_CONFIGS = {
411
+ # 'alfworld': AlfredEnvConfig,
412
+ 'metamathqa': MetaMathQAEnvConfig,
413
+ 'lean': LeanEnvConfig,
414
+ + 'game_2048': Game2048EnvConfig,
415
+ + 'blackjack': BlackjackEnvConfig,
416
+ + 'rubikscube': RubiksCube2x2Config,
417
+ + 'sudoku': SudokuEnvConfig,
418
+ }
419
+
420
+ try:
421
+ diff --git a/ragen/env/frozen_lake/config.py b/ragen/env/frozen_lake/config.py
422
+ index de054f4..9950c34 100644
423
+ --- a/ragen/env/frozen_lake/config.py
424
+ +++ b/ragen/env/frozen_lake/config.py
425
+ @@ -8,7 +8,7 @@ class FrozenLakeEnvConfig:
426
+ size: int = 4
427
+ p: float = 0.9
428
+ success_rate: float = 0.8
429
+ - is_slippery: bool = True
430
+ + is_slippery: bool = False
431
+ map_seed: Optional[int] = None
432
+ render_mode: str = "text"
433
+ observation_format: str = "grid"
434
+ diff --git a/ragen/env/frozen_lake/env.py b/ragen/env/frozen_lake/env.py
435
+ index 9ee3add..eef11d8 100644
436
+ --- a/ragen/env/frozen_lake/env.py
437
+ +++ b/ragen/env/frozen_lake/env.py
438
+ @@ -13,6 +13,7 @@ from ragen.env.base import BaseDiscreteActionEnv
439
+ class FrozenLakeEnv(BaseDiscreteActionEnv, GymFrozenLakeEnv):
440
+ def __init__(self, config: FrozenLakeEnvConfig = FrozenLakeEnvConfig()):
441
+ # Using mappings directly from config
442
+ + # import pdb;pdb.set_trace()
443
+ self.config = config
444
+ self.GRID_LOOKUP = config.grid_lookup
445
+ self.ACTION_LOOKUP = config.action_lookup
446
+ @@ -95,6 +96,7 @@ class FrozenLakeEnv(BaseDiscreteActionEnv, GymFrozenLakeEnv):
447
+ if __name__ == "__main__":
448
+ import matplotlib.pyplot as plt
449
+ config = FrozenLakeEnvConfig(size=4, is_slippery=True)
450
+ + # import pdb;pdb.set_trace()
451
+ env = FrozenLakeEnv(config)
452
+ print(env.reset())
453
+ while True:
454
+ diff --git a/ragen/env/sokoban/env.py b/ragen/env/sokoban/env.py
455
+ index 17cd636..6922b54 100644
456
+ --- a/ragen/env/sokoban/env.py
457
+ +++ b/ragen/env/sokoban/env.py
458
+ @@ -33,6 +33,7 @@ class SokobanEnv(BaseDiscreteActionEnv, GymSokobanEnv):
459
+ def reset(self, seed=None, mode=None):
460
+ try:
461
+ with all_seed(seed):
462
+ + # import pdb;pdb.set_trace()
463
+ self.room_fixed, self.room_state, self.box_mapping, action_sequence = generate_room(
464
+ dim=self.dim_room,
465
+ num_steps=self.num_gen_steps,
466
+ diff --git a/ragen/llm_agent/agent_proxy.py b/ragen/llm_agent/agent_proxy.py
467
+ index c25b50d..f6c4088 100644
468
+ --- a/ragen/llm_agent/agent_proxy.py
469
+ +++ b/ragen/llm_agent/agent_proxy.py
470
+ @@ -287,6 +287,7 @@ def main(config):
471
+ proxy = LLMAgentProxy(config, actor_wg, tokenizer)
472
+ import time
473
+ start_time = time.time()
474
+ + # import pdb;pdb.set_trace()
475
+ rollouts = proxy.rollout(
476
+ DataProto(
477
+ batch=None,
478
+ diff --git a/ragen/llm_agent/base_llm.py b/ragen/llm_agent/base_llm.py
479
+ index 358a2eb..b6f7797 100644
480
+ --- a/ragen/llm_agent/base_llm.py
481
+ +++ b/ragen/llm_agent/base_llm.py
482
+ @@ -33,6 +33,7 @@ class OpenAIProvider(LLMProvider):
483
+ raise ValueError("OpenAI API key not provided and not found in environment variables")
484
+
485
+ self.client = AsyncOpenAI(api_key=self.api_key)
486
+ + # import pdb;pdb.set_trace()
487
+
488
+ async def generate(self, messages: List[Dict[str, str]], **kwargs) -> LLMResponse:
489
+ if "o1-mini" in self.model_name:
490
+ @@ -46,10 +47,7 @@ class OpenAIProvider(LLMProvider):
491
+ )
492
+ if response.choices[0].finish_reason in ['length', 'content_filter']:
493
+ raise ValueError("Content filtered or length exceeded")
494
+ - return LLMResponse(
495
+ - content=response.choices[0].message.content,
496
+ - model_name=response.model
497
+ - )
498
+ + return LLMResponse(content=response.choices[0].message.content,model_name=response.model)
499
+
500
+ class DeepSeekProvider(LLMProvider):
501
+ """DeepSeek API provider implementation"""
502
+ @@ -199,7 +197,7 @@ class ConcurrentLLM:
503
+
504
+ # Queue to store unfinished or failed tasks
505
+ current_batch = messages_list.copy()
506
+ - max_retries = kwargs.get("max_retries", 100)
507
+ + max_retries = kwargs.get("max_retries", 10)
508
+ retry_count = 0
509
+
510
+ while current_batch and retry_count < max_retries:
511
+ diff --git a/ragen/llm_agent/ctx_manager.py b/ragen/llm_agent/ctx_manager.py
512
+ index 905247a..af20a01 100644
513
+ --- a/ragen/llm_agent/ctx_manager.py
514
+ +++ b/ragen/llm_agent/ctx_manager.py
515
+ @@ -88,6 +88,7 @@ class ContextManager:
516
+ Initialize the ContextManager.
517
+ Processor is used to process the image data.
518
+ """
519
+ + # import pdb;pdb.set_trace()
520
+ self.config = config
521
+ self.tokenizer = tokenizer
522
+ self.processor = processor
523
+ @@ -311,7 +312,7 @@ class ContextManager:
524
+
525
+ llm_input_texts.append(text_with_prompt)
526
+ messages_list.append(messages)
527
+ -
528
+ + # import pdb;pdb.set_trace()
529
+ inputs = self.tokenizer(llm_input_texts, return_tensors="pt", padding=True, padding_side="left", truncation=False) # We have truncated previously, truncation in tokenizer may cause issues.
530
+ input_ids, attention_mask = inputs.input_ids, inputs.attention_mask
531
+ position_ids = (attention_mask.cumsum(dim=-1) - 1).clamp(min=0)
532
+ @@ -353,6 +354,30 @@ class ContextManager:
533
+ key: np.sum(value) / self.env_nums[key.split("/")[0]]
534
+ for key, value in metrics.items()
535
+ }
536
+ + # Derived metrics for wandb logging
537
+ + try:
538
+ + # charts/avg_episode_return: average across all 2048 env groups
539
+ + ep_keys = [k for k in metrics.keys() if k.endswith('/episodic_return')]
540
+ + if len(ep_keys) > 0:
541
+ + ep_vals = []
542
+ + for k in ep_keys:
543
+ + tag = k.split('/')[0]
544
+ + denom = self.env_nums.get(tag, max(1, len(metrics[k])))
545
+ + ep_vals.append(float(np.sum(metrics[k]) / denom))
546
+ + mean_metrics["charts/avg_episode_return"] = float(np.mean(ep_vals))
547
+ + except Exception:
548
+ + pass
549
+ + try:
550
+ + # rollout/max_tile: max over all envs in this batch
551
+ + tile_keys = [k for k in metrics.keys() if k.endswith('/max_tile')]
552
+ + if len(tile_keys) > 0:
553
+ + tile_vals = []
554
+ + for k in tile_keys:
555
+ + tile_vals.extend(metrics[k])
556
+ + if len(tile_vals) > 0:
557
+ + mean_metrics["rollout/max_tile"] = int(np.max(tile_vals))
558
+ + except Exception:
559
+ + pass
560
+ for key, values in metrics.items():
561
+ if not isinstance(values, list):
562
+ continue
563
+ diff --git a/ragen/llm_agent/es_manager.py b/ragen/llm_agent/es_manager.py
564
+ index b87a2b3..1a49d3e 100644
565
+ --- a/ragen/llm_agent/es_manager.py
566
+ +++ b/ragen/llm_agent/es_manager.py
567
+ @@ -128,18 +128,40 @@ class EnvStateManager:
568
+ env_outputs: List[Dict]
569
+ {env_id: int, history: List[Dict][{state: str, actions: List[str], reward: float, info: Dict, llm_response: str, llm_raw_response: str, (Optional)images: List[PIL.Image.Image]}]}
570
+ """
571
+ + # def _execute_actions(env, actions):
572
+ + # acc_reward, turn_info, turn_done = 0, {}, False
573
+ + # executed_actions = []
574
+ + # for action in actions:
575
+ + # _, reward, done, info = env.step(action)
576
+ + # acc_reward += reward
577
+ + # turn_info.update(info) # NOTE: currently use last info for multi-action
578
+ + # executed_actions.append(action)
579
+ + # if done:
580
+ + # turn_done = True
581
+ + # break
582
+ +
583
+ + # return acc_reward, turn_info, turn_done, executed_actions
584
+ def _execute_actions(env, actions):
585
+ - acc_reward, turn_info, turn_done = 0, {}, False
586
+ + acc_reward, turn_info, turn_done = 0.0, {}, False
587
+ + raw_acc_reward = 0.0
588
+ executed_actions = []
589
+ for action in actions:
590
+ _, reward, done, info = env.step(action)
591
+ - acc_reward += reward
592
+ + acc_reward += float(reward)
593
+ + try:
594
+ + raw_acc_reward += float(info.get('raw_reward', 0.0))
595
+ + except Exception:
596
+ + pass
597
+ turn_info.update(info) # NOTE: currently use last info for multi-action
598
+ executed_actions.append(action)
599
+ if done:
600
+ turn_done = True
601
+ break
602
+ -
603
+ + # Overwrite per-turn raw_reward to reflect the sum across all executed actions in this turn
604
+ + try:
605
+ + turn_info['raw_reward'] = float(raw_acc_reward)
606
+ + except Exception:
607
+ + pass
608
+ return acc_reward, turn_info, turn_done, executed_actions
609
+
610
+ def _log_env_state(status, history, cur_obs, max_actions_per_traj, executed_actions, all_actions, acc_reward, turn_done, turn_info, env_input):
611
+ @@ -198,6 +220,18 @@ class EnvStateManager:
612
+ 'success': float(status.terminated and (not status.truncated)),
613
+ 'num_actions': status.num_actions,
614
+ }
615
+ + # Add episodic-level metrics
616
+ + # try:
617
+ + # # Sum of per-turn rewards equals the episodic return (env-shaped reward)
618
+ + # env_metric['episodic_return'] = float(sum(status.rewards))
619
+ + # except Exception:
620
+ + # pass
621
+ + try:
622
+ + # Final max tile on the board at the end of the rollout
623
+ + import numpy as _np
624
+ + env_metric['max_tile'] = int(_np.max(entry['env'].grid))
625
+ + except Exception:
626
+ + pass
627
+ custom_metric = {}
628
+ for turn in cache['history']:
629
+ for k, v in turn.get('info', {}).items():
630
+ @@ -212,6 +246,12 @@ class EnvStateManager:
631
+ "Skipping non-numeric metric '%s' with value %r for env %s.",
632
+ k, v, entry['tag']
633
+ )
634
+ + # Add episodic_return as the SUM of raw_reward across steps (align with CleanRL)
635
+ + try:
636
+ + if 'raw_reward' in custom_metric:
637
+ + env_metric['episodic_return'] = float(np.sum(custom_metric['raw_reward']))
638
+ + except Exception:
639
+ + pass
640
+ for k, v in custom_metric.items():
641
+ # TODO: Move TURN_LVL_METRICS into the environment
642
+ if "webshop" not in cache['tag'].lower() or ("webshop" in cache['tag'].lower() and k in TURN_LVL_METRICS):
643
+ @@ -219,7 +259,12 @@ class EnvStateManager:
644
+ else:
645
+ env_metric['traj_sum/' + k] = np.sum(v)
646
+
647
+ -
648
+ + try:
649
+ + if 'score' in custom_metric and len(custom_metric['score']) > 0:
650
+ + env_metric['final_score'] = float(custom_metric['score'][-1])
651
+ + except Exception:
652
+ + pass
653
+ +
654
+ cache['history'][-1]['metrics'] = custom_metric
655
+ env_metric = {f"{entry['tag']}/{k}": v for k, v in env_metric.items()}
656
+ cache['metrics'] = env_metric
657
+ diff --git a/requirements.txt b/requirements.txt
658
+ index 2fd756e..9b521bf 100644
659
+ --- a/requirements.txt
660
+ +++ b/requirements.txt
661
+ @@ -7,7 +7,6 @@ accelerate
662
+ codetiming
663
+ datasets
664
+ dill
665
+ -flash-attn==2.7.4.post1
666
+ hydra-core
667
+ numpy
668
+ pandas
669
+ @@ -15,19 +14,19 @@ pybind11
670
+ ray>=2.10
671
+ tensordict>=0.8.0,<0.9.0
672
+ transformers
673
+ -vllm==0.8.2
674
+ +vllm==0.8.5
675
+ wandb
676
+ gymnasium
677
+ gymnasium[toy-text]
678
+
679
+ pyarrow>=15.0.0
680
+ pylatexenc
681
+ -torchdata
682
+ +# torchdata
683
+ debugpy
684
+
685
+ together
686
+ anthropic
687
+ -faiss-cpu==1.11.0
688
+ +faiss-gpu
689
+
690
+ # This is optional, but needs to be installed with main requirements if you want to use webshop
691
+ -r external/webshop-minimal/requirements.txt
692
+ diff --git a/scripts/setup_ragen.sh b/scripts/setup_ragen.sh
693
+ index f9a7cd9..85a93c4 100644
694
+ --- a/scripts/setup_ragen.sh
695
+ +++ b/scripts/setup_ragen.sh
696
+ @@ -94,10 +94,10 @@ main() {
697
+ pip install torch==2.5.0 --index-url https://download.pytorch.org/whl/cu124
698
+
699
+ print_step "Installing flash-attention..."
700
+ - pip3 install flash-attn==2.7.4.post1 --no-build-isolation
701
+ + # pip3 install flash-attn==2.7.4.post1 --no-build-isolation
702
+ else
703
+ print_step "Installing PyTorch without CUDA support..."
704
+ - pip install torch==2.5.0
705
+ + pip install torch==2.4.0
706
+ fi
707
+
708
+ # Install remaining requirements
709
+ @@ -137,8 +137,8 @@ main() {
710
+ conda install conda-forge::gdown
711
+ mkdir -p external/webshop-minimal/webshop_minimal/data/full
712
+ cd external/webshop-minimal/webshop_minimal/data/full
713
+ - gdown https://drive.google.com/uc?id=1A2whVgOO0euk5O13n2iYDM0bQRkkRduB # items_shuffle
714
+ - gdown https://drive.google.com/uc?id=1s2j6NgHljiZzQNL3veZaAiyW_qDEgBNi # items_ins_v2
715
+ + # gdown https://drive.google.com/uc?id=1A2whVgOO0euk5O13n2iYDM0bQRkkRduB # items_shuffle
716
+ + # gdown https://drive.google.com/uc?id=1s2j6NgHljiZzQNL3veZaAiyW_qDEgBNi # items_ins_v2
717
+ cd ../../../../..
718
+
719
+ echo -e "${GREEN}Installation completed successfully!${NC}"
720
+ diff --git a/train_all.sh b/train_all.sh
721
+ index 0157306..33035f5 100755
722
+ --- a/train_all.sh
723
+ +++ b/train_all.sh
724
+ @@ -6,246 +6,257 @@ USE_GRPO="algorithm.adv_estimator=grpo"
725
+ USE_PPO="algorithm.adv_estimator=gae" # by default.
726
+ USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
727
+
728
+ +
729
+ +# python train.py --config-name _8_2048 system.CUDA_VISIBLE_DEVICES="'0,1,2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=game_2048 $USE_PPO $USE_BASE
730
+ +
731
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'0,1'" trainer.project_name=ragen_latest_qwen_05B_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=rubikscube-1 $USE_PPO $USE_BASE
732
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-1.5B-Instruct trainer.experiment_name=rubikscube-2 $USE_PPO $USE_BASE
733
+ +# python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'4,5'" trainer.project_name=ragen_latest_qwen_25_3b_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-3B-Instruct trainer.experiment_name=rubikscube-2 $USE_PPO $USE_BASE
734
+ +python train.py --config-name _10_rubikscube system.CUDA_VISIBLE_DEVICES="'6,7'" trainer.project_name=ragen_latest_qwen_05B_it trainer.n_gpus_per_node=2 model_path=Qwen/Qwen2.5-0.5B-Instruct trainer.experiment_name=rubikscube-3 $USE_PPO $USE_BASE
735
+ +
736
+ # Section 3.1&3.2 - General Observations
737
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-ppo $USE_PPO $USE_BASE &
738
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-grpo $USE_GRPO $USE_BASE &
739
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE &
740
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-grpo $USE_GRPO $USE_BASE &
741
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozen_lake-ppo $USE_PPO $USE_BASE &
742
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozen_lake-grpo $USE_GRPO $USE_BASE &
743
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="'6,7'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=bandit-ppo-multitask $USE_PPO $USE_BASE &
744
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="'7'" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-ppo-frommlp $USE_PPO $USE_BASE
745
+
746
+ -# Section 4.1 - Filtering and critic
747
+ -# 0.25
748
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.25 actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
749
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
750
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
751
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
752
+ -
753
+ -wait
754
+ -
755
+ -# 0.5
756
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-ppo-rolloutfilter0.5 actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
757
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
758
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
759
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
760
+ -
761
+ -# 0.75
762
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.75 actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
763
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
764
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
765
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
766
+ -
767
+ -wait
768
+ -
769
+ -# Section 4.2 - Ablation on Critic/ClipHigh/KL. Start from Basic and add more components. The best setting for StarPO in agent is rollout_filter+Critic+Cliphigh+NoKL
770
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
771
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
772
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
773
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
774
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozenlake-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
775
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozenlake-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
776
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozenlake-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
777
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozenlake-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
778
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="'0,1'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=sokoban-ppo-box1-multitask $USE_PPO $USE_BASE
779
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-grpo $USE_GRPO $USE_BASE &
780
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'2,3'" trainer.project_name=ragen_latest_qwen_25_15b_it trainer.n_gpus_per_node=2 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
781
+
782
+ -wait
783
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'4,5,6,7'" trainer.project_name=ragen_latest_qwen_25_3b_it trainer.n_gpus_per_node=4 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_3B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
784
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="'4,5,6,7'" trainer.n_gpus_per_node=4 model_path=/mnt/general/wanghy/LLaMA-Factory/saves/qwen3/full/sft/qwen2.5_1.5B_it_multitask trainer.experiment_name=frozen_lake-ppo-slippery-multitask $USE_PPO $USE_BASE
785
+
786
+ -# Section 5.1 - Reasoning Helps Generalization
787
+ +# # Section 4.1 - Filtering and critic
788
+ +# # 0.25
789
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.25 actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
790
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
791
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_PPO &
792
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.25 $USE_GRPO &
793
+
794
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-generalization \
795
+ - custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
796
+ - custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
797
+ - custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
798
+ - custom_envs.BanditTest.env_config.hi_arm_name="Librarian"
799
+ +# wait
800
+
801
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-generalization-nothink \
802
+ - custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
803
+ - custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
804
+ - custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
805
+ - custom_envs.BanditTest.env_config.hi_arm_name="Librarian" \
806
+ - agent_proxy.enable_think=False
807
+ +# # 0.5
808
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-ppo-rolloutfilter0.5 actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
809
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
810
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_PPO &
811
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.5 $USE_GRPO &
812
+ +
813
+ +# # 0.75
814
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-ppo-rolloutfilter0.75 actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
815
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
816
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozen_lake-ppo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_PPO &
817
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozen_lake-grpo actor_rollout_ref.rollout.rollout_filter_ratio=0.75 $USE_GRPO &
818
+
819
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=bandit-generalization-rev \
820
+ - custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
821
+ - custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
822
+ - custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
823
+ - custom_envs.BanditTest.env_config.hi_arm_name="Trader"
824
+ +# wait
825
+
826
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=bandit-generalization-rev-nothink \
827
+ - custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
828
+ - custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
829
+ - custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
830
+ - custom_envs.BanditTest.env_config.hi_arm_name="Trader" \
831
+ - agent_proxy.enable_think=False
832
+ +# # Section 4.2 - Ablation on Critic/ClipHigh/KL. Start from Basic and add more components. The best setting for StarPO in agent is rollout_filter+Critic+Cliphigh+NoKL
833
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
834
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
835
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
836
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
837
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=frozenlake-base-grpo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_GRPO &
838
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=frozenlake-base-ppo algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
839
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=frozenlake-base-ppo-cliphigh algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.28 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
840
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=frozenlake-base-ppo-nokl algorithm.kl_ctrl.kl_coef=0.000 actor_rollout_ref.actor.kl_loss_coef=0.000 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1 $USE_PPO &
841
+
842
+ +# wait
843
+
844
+ -SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
845
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization micro_batch_size_per_gpu=8 model_path=Qwen/Qwen2.5-1.5B-Instruct&
846
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-generalization-nothink $SOKOBAN_GENERALIZATION_CONFIG agent_proxy.enable_think=False &
847
+ +# # Section 5.1 - Reasoning Helps Generalization
848
+
849
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=bandit-generalization \
850
+ +# custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
851
+ +# custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
852
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
853
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Librarian"
854
+
855
+ -# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=128 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SokobanDifferentGridVocab] es_manager.val.env_configs.n_groups=[128]"
856
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG &
857
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=bandit-generalization-nothink \
858
+ +# custom_envs.Bandit.env_config.lo_arm_name="Engineer" \
859
+ +# custom_envs.Bandit.env_config.hi_arm_name="Teacher" \
860
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Trader" \
861
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Librarian" \
862
+ +# agent_proxy.enable_think=False
863
+
864
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=bandit-generalization-rev \
865
+ +# custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
866
+ +# custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
867
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
868
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Trader"
869
+
870
+ -# COMPOSITIONALITY_CONFIG="es_manager.train.env_groups=16 es_manager.train.env_configs.tags=[Bandit,SimpleSokoban] es_manager.train.env_configs.n_groups=[8,8] es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[Bandit,SimpleSokoban,LargerSokoban,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128] actor_rollout_ref.rollout.rollout_filter_ratio=1" # NOTE that we don't filter out low-var rollout in this setting
871
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=compositional-generalization $COMPOSITIONALITY_CONFIG &
872
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=compositional-generalization-nothink $COMPOSITIONALITY_CONFIG agent_proxy.enable_think=False &
873
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=bandit-generalization-rev-nothink \
874
+ +# custom_envs.Bandit.env_config.lo_arm_name="Teacher" \
875
+ +# custom_envs.Bandit.env_config.hi_arm_name="Engineer" \
876
+ +# custom_envs.BanditTest.env_config.lo_arm_name="Librarian" \
877
+ +# custom_envs.BanditTest.env_config.hi_arm_name="Trader" \
878
+ +# agent_proxy.enable_think=False
879
+
880
+ -wait
881
+
882
+ -# Section 5.2 - what leads to better reasoning?
883
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B-Instruct &
884
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B-Instruct &
885
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct trainer.n_gpus_per_node=2 &
886
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B-Instruct trainer.n_gpus_per_node=4 &
887
+ +# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
888
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization micro_batch_size_per_gpu=8 model_path=Qwen/Qwen2.5-1.5B-Instruct&
889
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-generalization-nothink $SOKOBAN_GENERALIZATION_CONFIG agent_proxy.enable_think=False &
890
+
891
+ -wait
892
+
893
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B &
894
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B &
895
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B &
896
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B &
897
+ +# # SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=128 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SokobanDifferentGridVocab] es_manager.val.env_configs.n_groups=[128]"
898
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization $SOKOBAN_GENERALIZATION_CONFIG &
899
+
900
+ -wait
901
+
902
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-7B &
903
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B &
904
+ +# # COMPOSITIONALITY_CONFIG="es_manager.train.env_groups=16 es_manager.train.env_configs.tags=[Bandit,SimpleSokoban] es_manager.train.env_configs.n_groups=[8,8] es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[Bandit,SimpleSokoban,LargerSokoban,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128] actor_rollout_ref.rollout.rollout_filter_ratio=1" # NOTE that we don't filter out low-var rollout in this setting
905
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=compositional-generalization $COMPOSITIONALITY_CONFIG &
906
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=compositional-generalization-nothink $COMPOSITIONALITY_CONFIG agent_proxy.enable_think=False &
907
+
908
+ +# wait
909
+
910
+ -wait
911
+ +# # Section 5.2 - what leads to better reasoning?
912
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B-Instruct &
913
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B-Instruct &
914
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct trainer.n_gpus_per_node=2 &
915
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-instruct $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B-Instruct trainer.n_gpus_per_node=4 &
916
+
917
+ -# Section 6.1 varying action count
918
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-action-count-1 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=5 custom_envs.LargerSokoban.max_actions_per_traj=5 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=5 custom_envs.FrozenLake.max_actions_per_traj=5 agent_proxy.max_actions_per_turn=1 &
919
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-action-count-2 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=10 custom_envs.LargerSokoban.max_actions_per_traj=10 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=10 custom_envs.FrozenLake.max_actions_per_traj=10 agent_proxy.max_actions_per_turn=2 &
920
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-action-count-3 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=15 custom_envs.LargerSokoban.max_actions_per_traj=15 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=15 custom_envs.FrozenLake.max_actions_per_traj=15 agent_proxy.max_actions_per_turn=3 &
921
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-action-count-4 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=20 custom_envs.LargerSokoban.max_actions_per_traj=20 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=20 custom_envs.FrozenLake.max_actions_per_traj=20 agent_proxy.max_actions_per_turn=4 &
922
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-action-count-5 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=25 custom_envs.LargerSokoban.max_actions_per_traj=25 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=25 custom_envs.FrozenLake.max_actions_per_traj=25 agent_proxy.max_actions_per_turn=5 &
923
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-action-count-6 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=30 custom_envs.LargerSokoban.max_actions_per_traj=30 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=30 custom_envs.FrozenLake.max_actions_per_traj=30 agent_proxy.max_actions_per_turn=6 &
924
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-action-count-7 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=35 custom_envs.LargerSokoban.max_actions_per_traj=35 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=35 custom_envs.FrozenLake.max_actions_per_traj=35 agent_proxy.max_actions_per_turn=7 &
925
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-action-count-8 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=40 custom_envs.LargerSokoban.max_actions_per_traj=40 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=40 custom_envs.FrozenLake.max_actions_per_traj=40 agent_proxy.max_actions_per_turn=8 &
926
+ +# wait
927
+
928
+ -# section 6.2 Varying prompt diversity
929
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-prompt-diversity-4 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=4 es_manager.train.group_size=32 es_manager.train.env_configs.n_groups=[4] &
930
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-prompt-diversity-8 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] &
931
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-prompt-diversity-16 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=8 es_manager.train.env_configs.n_groups=[16] &
932
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-prompt-diversity-32 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=32 es_manager.train.group_size=4 es_manager.train.env_configs.n_groups=[32] &
933
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-prompt-diversity-64 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=64 es_manager.train.group_size=2 es_manager.train.env_configs.n_groups=[64] &
934
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-prompt-diversity-128 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=128 es_manager.train.group_size=1 es_manager.train.env_configs.n_groups=[128] &
935
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-generalization-qwen2.5-0.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-0.5B &
936
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-1.5B &
937
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-3b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B &
938
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5,6,7\" trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-7B &
939
+
940
+ -wait
941
+ +# wait
942
+
943
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-online-2 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[16] trainer.total_training_steps=100 trainer.test_freq=5 &
944
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 trainer.n_gpus_per_node=4 trainer.experiment_name=sokoban-generalization-qwen2.5-7b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-7B &
945
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-generalization-qwen2.5-1.5b-r1 $SOKOBAN_GENERALIZATION_CONFIG model_path=deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B &
946
+
947
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-online-5 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=40 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[40] trainer.total_training_steps=40 trainer.test_freq=2 &
948
+
949
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-online-10 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=80 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[80] trainer.total_training_steps=80 trainer.test_freq=1 &
950
+ +# wait
951
+
952
+ +# # Section 6.1 varying action count
953
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-action-count-1 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=5 custom_envs.LargerSokoban.max_actions_per_traj=5 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=5 custom_envs.FrozenLake.max_actions_per_traj=5 agent_proxy.max_actions_per_turn=1 &
954
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-action-count-2 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=10 custom_envs.LargerSokoban.max_actions_per_traj=10 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=10 custom_envs.FrozenLake.max_actions_per_traj=10 agent_proxy.max_actions_per_turn=2 &
955
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-action-count-3 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=15 custom_envs.LargerSokoban.max_actions_per_traj=15 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=15 custom_envs.FrozenLake.max_actions_per_traj=15 agent_proxy.max_actions_per_turn=3 &
956
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-action-count-4 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=20 custom_envs.LargerSokoban.max_actions_per_traj=20 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=20 custom_envs.FrozenLake.max_actions_per_traj=20 agent_proxy.max_actions_per_turn=4 &
957
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-action-count-5 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=25 custom_envs.LargerSokoban.max_actions_per_traj=25 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=25 custom_envs.FrozenLake.max_actions_per_traj=25 agent_proxy.max_actions_per_turn=5 &
958
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-action-count-6 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=30 custom_envs.LargerSokoban.max_actions_per_traj=30 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=30 custom_envs.FrozenLake.max_actions_per_traj=30 agent_proxy.max_actions_per_turn=6 &
959
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-action-count-7 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=35 custom_envs.LargerSokoban.max_actions_per_traj=35 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=35 custom_envs.FrozenLake.max_actions_per_traj=35 agent_proxy.max_actions_per_turn=7 &
960
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-action-count-8 $SOKOBAN_GENERALIZATION_CONFIG custom_envs.SimpleSokoban.max_actions_per_traj=40 custom_envs.LargerSokoban.max_actions_per_traj=40 custom_envs.SokobanDifferentGridVocab.max_actions_per_traj=40 custom_envs.FrozenLake.max_actions_per_traj=40 agent_proxy.max_actions_per_turn=8 &
961
+
962
+ +# # section 6.2 Varying prompt diversity
963
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-prompt-diversity-4 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=4 es_manager.train.group_size=32 es_manager.train.env_configs.n_groups=[4] &
964
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="1" trainer.experiment_name=sokoban-prompt-diversity-8 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] &
965
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="2" trainer.experiment_name=sokoban-prompt-diversity-16 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=8 es_manager.train.env_configs.n_groups=[16] &
966
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="3" trainer.experiment_name=sokoban-prompt-diversity-32 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=32 es_manager.train.group_size=4 es_manager.train.env_configs.n_groups=[32] &
967
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="4" trainer.experiment_name=sokoban-prompt-diversity-64 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=64 es_manager.train.group_size=2 es_manager.train.env_configs.n_groups=[64] &
968
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="5" trainer.experiment_name=sokoban-prompt-diversity-128 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=128 es_manager.train.group_size=1 es_manager.train.env_configs.n_groups=[128] &
969
+
970
+ +# wait
971
+
972
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="6" trainer.experiment_name=sokoban-online-2 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=16 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[16] trainer.total_training_steps=100 trainer.test_freq=5 &
973
+
974
+ -# Extension: Training 7B reasoning model
975
+ -SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
976
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct-largescale $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] micro_batch_size_per_gpu=8 ppo_mini_batch_size=64 actor_rollout_ref.rollout.response_length=1024 actor_rollout_ref.rollout.max_model_len=6400 trainer.test_freq=5 actor_rollout_ref.rollout.max_num_batched_tokens=24000 micro_batch_size_per_gpu=2 actor_rollout_ref.rollout.rollout_filter_ratio=1 &
977
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="7" trainer.experiment_name=sokoban-online-5 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=40 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[40] trainer.total_training_steps=40 trainer.test_freq=2 &
978
+
979
+ -python -m ragen.llm_agent.agent_proxy model_path=Qwen/Qwen2.5-3B-Instruct system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 actor_rollout_ref.rollout.tensor_model_parallel_size=4 actor_rollout_ref.rollout.response_length=2048 actor_rollout_ref.rollout.max_model_len=12800
980
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES="0" trainer.experiment_name=sokoban-online-10 $SOKOBAN_GENERALIZATION_CONFIG es_manager.train.env_groups=80 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[80] trainer.total_training_steps=80 trainer.test_freq=1 &
981
+
982
+ -# trainer.save_freq=50 trainer.default_local_dir=/mnt/local/cache/exp_name
983
+
984
+ -# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
985
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization &
986
+
987
+ -python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/bandit-generalization &
988
+
989
+ -python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=frozenlake-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/frozenlake-generalization &
990
+
991
+ +# # Extension: Training 7B reasoning model
992
+ +# SOKOBAN_GENERALIZATION_CONFIG="es_manager.val.env_groups=512 es_manager.val.group_size=1 es_manager.val.env_configs.tags=[SimpleSokoban,LargerSokoban,SokobanDifferentGridVocab,FrozenLake] es_manager.val.env_configs.n_groups=[128,128,128,128]"
993
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 trainer.experiment_name=sokoban-generalization-qwen2.5-3b-instruct-largescale $SOKOBAN_GENERALIZATION_CONFIG model_path=Qwen/Qwen2.5-3B-Instruct es_manager.train.env_groups=8 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[8] micro_batch_size_per_gpu=8 ppo_mini_batch_size=64 actor_rollout_ref.rollout.response_length=1024 actor_rollout_ref.rollout.max_model_len=6400 trainer.test_freq=5 actor_rollout_ref.rollout.max_num_batched_tokens=24000 micro_batch_size_per_gpu=2 actor_rollout_ref.rollout.rollout_filter_ratio=1 &
994
+
995
+ +# python -m ragen.llm_agent.agent_proxy model_path=Qwen/Qwen2.5-3B-Instruct system.CUDA_VISIBLE_DEVICES=\"0,1,2,3,4,5,6,7\" trainer.n_gpus_per_node=8 actor_rollout_ref.rollout.tensor_model_parallel_size=4 actor_rollout_ref.rollout.response_length=2048 actor_rollout_ref.rollout.max_model_len=12800
996
+
997
+ +# # trainer.save_freq=50 trainer.default_local_dir=/mnt/local/cache/exp_name
998
+
999
+ -# USE_PPO="algorithm.adv_estimator=gae" # by default.
1000
+ -# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1001
+ -# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE ppo_mini_batch_size=64 enable_response_mask=True &
1002
+ +# # USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1003
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/sokoban-generalization &
1004
+
1005
+ +# python train.py --config-name _1_bandit system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=bandit-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/bandit-generalization &
1006
+
1007
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std &
1008
+ +# python train.py --config-name _3_frozen_lake system.CUDA_VISIBLE_DEVICES=\"1\" trainer.n_gpus_per_node=1 trainer.experiment_name=frozenlake-final enable_response_mask=True trainer.total_training_steps=500 trainer.save_freq=50 trainer.default_local_dir=/mnt/local/ragen_checkpoints/frozenlake-generalization &
1009
+
1010
+ -# enable_response_mask: False
1011
+ -# grpo_advantage_length_weight: True
1012
+
1013
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo-1-5b algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std agent_proxy.max_actions_per_turn=5 custom_envs.SimpleSokoban.max_actions_per_traj=25 enable_response_mask=True grpo_advantage_length_weight=False model_path=Qwen/Qwen2.5-1.5B-Instruct &
1014
+
1015
+
1016
+ -# extension: 7B with lora. Currently NOT recommended to use lora: within current version of vllm, this could result in rollouts slower than non-lora by 100%
1017
+ -python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-7B-Instruct trainer.experiment_name=sokoban_7b_instruct_lora_newversion lora.rank=16
1018
+ +# # USE_PPO="algorithm.adv_estimator=gae" # by default.
1019
+ +# # USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1020
+ +# # python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0\" trainer.n_gpus_per_node=1 trainer.experiment_name=sokoban-ppo $USE_PPO $USE_BASE ppo_mini_batch_size=64 enable_response_mask=True &
1021
+
1022
+ -# extension: bi-level gae
1023
+ -python train.py trainer.experiment_name=sokoban-bi-level-gae-final \
1024
+ - system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
1025
+ - model_path=Qwen/Qwen2.5-0.5B-Instruct \
1026
+ - algorithm.bi_level_gae=True algorithm.high_level_gamma=0.95 \
1027
+ - agent_proxy.use_turn_scores=True \
1028
+ - actor_rollout_ref.rollout.tp_size_check=False
1029
+
1030
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std &
1031
+
1032
+ -# extension: webshop
1033
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1034
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1035
+ - trainer.experiment_name=webshop-3b-ppo-s $USE_PPO \
1036
+ - trainer.nnodes=1 &
1037
+ +# # enable_response_mask: False
1038
+ +# # grpo_advantage_length_weight: True
1039
+
1040
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 trainer.experiment_name=sokoban-s-grpo-1-5b algorithm.adv_estimator=grpo agent_proxy.reward_normalization.method=mean_std agent_proxy.max_actions_per_turn=5 custom_envs.SimpleSokoban.max_actions_per_traj=25 enable_response_mask=True grpo_advantage_length_weight=False model_path=Qwen/Qwen2.5-1.5B-Instruct &
1041
+
1042
+ -USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1043
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1044
+ - trainer.experiment_name=webshop-3b-grpo-s $USE_GRPO \
1045
+ - trainer.nnodes=1 &
1046
+
1047
+ -# StarPO ppo
1048
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1049
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1050
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1051
+ - trainer.experiment_name=webshop-3b-ppo $USE_PPO $USE_BASE \
1052
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1053
+ - trainer.nnodes=1 &
1054
+ +# # extension: 7B with lora. Currently NOT recommended to use lora: within current version of vllm, this could result in rollouts slower than non-lora by 100%
1055
+ +# python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 model_path=Qwen/Qwen2.5-7B-Instruct trainer.experiment_name=sokoban_7b_instruct_lora_newversion lora.rank=16
1056
+
1057
+ -# StarPO grpo
1058
+ -USE_GRPO="algorithm.adv_estimator=grpo"
1059
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1060
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1061
+ - trainer.experiment_name=webshop-3b-grpo $USE_GRPO $USE_BASE \
1062
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1063
+ - trainer.nnodes=1 &
1064
+ +# # extension: bi-level gae
1065
+ +# python train.py trainer.experiment_name=sokoban-bi-level-gae-final \
1066
+ +# system.CUDA_VISIBLE_DEVICES=\"0,1,2,3\" trainer.n_gpus_per_node=4 actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
1067
+ +# model_path=Qwen/Qwen2.5-0.5B-Instruct \
1068
+ +# algorithm.bi_level_gae=True algorithm.high_level_gamma=0.95 \
1069
+ +# agent_proxy.use_turn_scores=True \
1070
+ +# actor_rollout_ref.rollout.tp_size_check=False
1071
+
1072
+
1073
+ -# normal:sokoban
1074
+ -# extension: sokoban
1075
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1076
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1077
+ - trainer.experiment_name=sokoban-3b-ppo-s $USE_PPO \
1078
+ - trainer.nnodes=1 &
1079
+ +# # extension: webshop
1080
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1081
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1082
+ +# trainer.experiment_name=webshop-3b-ppo-s $USE_PPO \
1083
+ +# trainer.nnodes=1 &
1084
+
1085
+
1086
+ -USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1087
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1088
+ - trainer.experiment_name=sokoban-3b-grpo-s $USE_GRPO \
1089
+ - trainer.nnodes=1 &
1090
+ +# USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1091
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1092
+ +# trainer.experiment_name=webshop-3b-grpo-s $USE_GRPO \
1093
+ +# trainer.nnodes=1 &
1094
+
1095
+ -# StarPO ppo
1096
+ -USE_PPO="algorithm.adv_estimator=gae" # by default.
1097
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1098
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1099
+ - trainer.experiment_name=sokoban-3b-ppo $USE_PPO $USE_BASE \
1100
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1101
+ - trainer.nnodes=1 &
1102
+ +# # StarPO ppo
1103
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1104
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1105
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1106
+ +# trainer.experiment_name=webshop-3b-ppo $USE_PPO $USE_BASE \
1107
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1108
+ +# trainer.nnodes=1 &
1109
+
1110
+ -# StarPO grpo
1111
+ -USE_GRPO="algorithm.adv_estimator=grpo"
1112
+ -USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1113
+ -MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1114
+ - trainer.experiment_name=sokoban-3b-grpo $USE_GRPO $USE_BASE \
1115
+ - es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1116
+ - trainer.nnodes=1 &
1117
+ +# # StarPO grpo
1118
+ +# USE_GRPO="algorithm.adv_estimator=grpo"
1119
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1120
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _6_webshop system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1121
+ +# trainer.experiment_name=webshop-3b-grpo $USE_GRPO $USE_BASE \
1122
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1123
+ +# trainer.nnodes=1 &
1124
+ +
1125
+ +
1126
+ +# # normal:sokoban
1127
+ +# # extension: sokoban
1128
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1129
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2 \
1130
+ +# trainer.experiment_name=sokoban-3b-ppo-s $USE_PPO \
1131
+ +# trainer.nnodes=1 &
1132
+ +
1133
+ +
1134
+ +# USE_GRPO="algorithm.adv_estimator=grpo" # by default.
1135
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"2,3\" trainer.n_gpus_per_node=2 \
1136
+ +# trainer.experiment_name=sokoban-3b-grpo-s $USE_GRPO \
1137
+ +# trainer.nnodes=1 &
1138
+ +
1139
+ +# # StarPO ppo
1140
+ +# USE_PPO="algorithm.adv_estimator=gae" # by default.
1141
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1142
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"4,5\" trainer.n_gpus_per_node=2 \
1143
+ +# trainer.experiment_name=sokoban-3b-ppo $USE_PPO $USE_BASE \
1144
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1145
+ +# trainer.nnodes=1 &
1146
+ +
1147
+ +# # StarPO grpo
1148
+ +# USE_GRPO="algorithm.adv_estimator=grpo"
1149
+ +# USE_BASE="algorithm.kl_ctrl.kl_coef=0.001 actor_rollout_ref.actor.kl_loss_coef=0.001 actor_rollout_ref.actor.clip_ratio_high=0.2 actor_rollout_ref.rollout.rollout_filter_ratio=1"
1150
+ +# MKL_SERVICE_FORCE_INTEL=1 python train.py --config-name _2_sokoban system.CUDA_VISIBLE_DEVICES=\"6,7\" trainer.n_gpus_per_node=2 \
1151
+ +# trainer.experiment_name=sokoban-3b-grpo $USE_GRPO $USE_BASE \
1152
+ +# es_manager.train.env_groups=2 es_manager.train.group_size=16 es_manager.train.env_configs.n_groups=[2] \
1153
+ +# trainer.nnodes=1 &
1154
+
1155
+
1156
+
1157
+ -python train.py \
1158
+ - trainer.experiment_name=3b-full-ppo-test system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2
1159
+
1160
+ +# python train.py \
1161
+ +# trainer.experiment_name=3b-full-ppo-test system.CUDA_VISIBLE_DEVICES=\"0,1\" trainer.n_gpus_per_node=2
1162
+
wandb/run-20251218_185248-ts36d12x/files/requirements.txt ADDED
@@ -0,0 +1,315 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ colorama==0.4.6
2
+ psutil==7.1.2
3
+ ragen==0.1
4
+ ragen==0.1
5
+ setuptools==80.9.0
6
+ wheel==0.45.1
7
+ pip==25.3
8
+ ragen==0.1
9
+ pytz==2025.2
10
+ nvidia-cusparselt-cu12==0.6.2
11
+ mpmath==1.3.0
12
+ typing_extensions==4.15.0
13
+ sympy==1.13.1
14
+ pylatexenc==2.10
15
+ nvidia-cusolver-cu12==11.6.1.9
16
+ numpy==1.26.4
17
+ Markdown==3.10
18
+ absl-py==2.3.1
19
+ pyasn1_modules==0.4.2
20
+ Werkzeug==3.1.3
21
+ networkx==3.3
22
+ MarkupSafe==2.1.5
23
+ fsspec==2025.9.0
24
+ filelock==3.19.1
25
+ nvidia-cudnn-cu12==9.1.0.70
26
+ Jinja2==3.1.6
27
+ tensorboard==2.20.0
28
+ triton==3.2.0
29
+ pillow==11.3.0
30
+ xxhash==3.6.0
31
+ nvidia-nvtx-cu12==12.4.127
32
+ nvidia-nvjitlink-cu12==12.4.127
33
+ nvidia-nccl-cu12==2.21.5
34
+ nvidia-curand-cu12==10.3.5.147
35
+ wrapt==2.0.1
36
+ nvidia-cufft-cu12==11.2.1.3
37
+ pyjnius==1.7.0
38
+ nvidia-cuda-runtime-cu12==12.4.127
39
+ nvidia-cuda-nvrtc-cu12==12.4.127
40
+ websockets==15.0.1
41
+ nvidia-cuda-cupti-cu12==12.4.127
42
+ zipp==3.23.0
43
+ nvidia-cublas-cu12==12.4.5.8
44
+ nvidia-cusparse-cu12==12.3.1.170
45
+ flash_attn==2.8.3
46
+ rsa==4.9.1
47
+ einops==0.8.1
48
+ py-cpuinfo==9.0.0
49
+ pure_eval==0.2.3
50
+ ptyprocess==0.7.0
51
+ gym-notices==0.1.0
52
+ flatbuffers==25.9.23
53
+ fastrlock==0.8.3
54
+ Farama-Notifications==0.0.4
55
+ faiss-gpu==1.7.2
56
+ antlr4-python3-runtime==4.9.3
57
+ wcwidth==0.2.14
58
+ wasabi==1.1.3
59
+ uvloop==0.22.1
60
+ urllib3==2.5.0
61
+ tzdata==2025.2
62
+ typing-inspection==0.4.2
63
+ traitlets==5.14.3
64
+ tqdm==4.67.1
65
+ tomli==2.3.0
66
+ threadpoolctl==3.6.0
67
+ tenacity==9.1.2
68
+ tabulate==0.9.0
69
+ spacy-loggers==1.0.5
70
+ spacy-legacy==3.0.12
71
+ soupsieve==2.8
72
+ sniffio==1.3.1
73
+ smmap==5.0.2
74
+ six==1.17.0
75
+ shellingham==1.5.4
76
+ sentencepiece==0.2.1
77
+ scipy==1.15.3
78
+ safetensors==0.6.2
79
+ rpds-py==0.29.0
80
+ rignore==0.7.6
81
+ regex==2025.11.3
82
+ RapidFuzz==3.14.3
83
+ rank-bm25==0.2.2
84
+ pyzmq==27.1.0
85
+ PyYAML==6.0.3
86
+ pytokens==0.3.0
87
+ python-multipart==0.0.20
88
+ python-json-logger==4.0.0
89
+ python-dotenv==1.2.1
90
+ PySocks==1.7.1
91
+ pyparsing==3.2.5
92
+ PyJWT==2.10.1
93
+ Pygments==2.19.2
94
+ pygame==2.6.1
95
+ pydantic_core==2.41.5
96
+ pycparser==2.23
97
+ pycountry==24.6.1
98
+ pybind11==3.0.1
99
+ pyarrow==22.0.0
100
+ psutil==7.1.3
101
+ protobuf==4.25.8
102
+ propcache==0.4.1
103
+ prometheus_client==0.23.1
104
+ platformdirs==4.5.0
105
+ pexpect==4.9.0
106
+ pathspec==0.12.1
107
+ partial-json-parser==0.2.1.1.post6
108
+ parso==0.8.5
109
+ packaging==25.0
110
+ orjson==3.11.4
111
+ opentelemetry-semantic-conventions-ai==0.4.13
112
+ opencv-python-headless==4.12.0.88
113
+ ninja==1.13.0
114
+ nest-asyncio==1.6.0
115
+ mypy_extensions==1.1.0
116
+ murmurhash==1.0.15
117
+ multidict==6.7.0
118
+ msgspec==0.19.0
119
+ msgpack==1.1.2
120
+ mdurl==0.1.2
121
+ loguru==0.7.3
122
+ llvmlite==0.44.0
123
+ llguidance==0.7.30
124
+ lark==1.2.2
125
+ kiwisolver==1.4.9
126
+ joblib==1.5.2
127
+ jiter==0.12.0
128
+ itsdangerous==2.2.0
129
+ interegular==0.3.3
130
+ ImageIO==2.37.2
131
+ idna==3.11
132
+ humanfriendly==10.0
133
+ httpx-sse==0.4.3
134
+ httptools==0.7.1
135
+ html2text==2025.4.15
136
+ hf-xet==1.2.0
137
+ h11==0.16.0
138
+ grpcio==1.76.0
139
+ frozenlist==1.8.0
140
+ fonttools==4.60.1
141
+ executing==2.2.1
142
+ exceptiongroup==1.3.0
143
+ eval_type_backport==0.2.2
144
+ docstring_parser==0.17.0
145
+ dnspython==2.8.0
146
+ distro==1.9.0
147
+ diskcache==5.6.3
148
+ dill==0.4.0
149
+ decorator==5.2.1
150
+ debugpy==1.8.17
151
+ Cython==3.2.1
152
+ cymem==2.0.13
153
+ cycler==0.12.1
154
+ cupy-cuda12x==13.6.0
155
+ contourpy==1.3.2
156
+ colorama==0.4.6
157
+ codetiming==1.4.0
158
+ cloudpickle==3.1.2
159
+ cloudpathlib==0.23.0
160
+ click==8.3.1
161
+ charset-normalizer==3.4.4
162
+ certifi==2025.11.12
163
+ catalogue==2.0.10
164
+ cachetools==6.2.2
165
+ blis==1.3.2
166
+ blinker==1.9.0
167
+ blake3==1.0.8
168
+ attrs==25.4.0
169
+ async-timeout==5.0.1
170
+ asttokens==3.0.1
171
+ astor==0.8.1
172
+ annotated-types==0.7.0
173
+ annotated-doc==0.0.4
174
+ airportsdata==20250909
175
+ aiohappyeyeballs==2.6.1
176
+ yarl==1.22.0
177
+ uvicorn==0.38.0
178
+ typer-slim==0.20.0
179
+ thefuzz==0.22.1
180
+ stack-data==0.6.3
181
+ srsly==2.5.1
182
+ smart_open==7.5.0
183
+ sentry-sdk==2.44.0
184
+ scikit-learn==1.7.2
185
+ requests==2.32.5
186
+ referencing==0.37.0
187
+ python-dateutil==2.9.0.post0
188
+ pydantic==2.12.4
189
+ prompt_toolkit==3.0.52
190
+ preshed==3.0.11
191
+ opentelemetry-proto==1.26.0
192
+ omegaconf==2.3.0
193
+ numba==0.61.2
194
+ nltk==3.9.2
195
+ multiprocess==0.70.18
196
+ matplotlib-inline==0.2.1
197
+ markdown-it-py==4.0.0
198
+ jedi==0.19.2
199
+ importlib_metadata==8.0.0
200
+ httpcore==1.0.9
201
+ gymnasium==1.2.2
202
+ gym==0.26.2
203
+ googleapis-common-protos==1.72.0
204
+ gitdb==4.0.12
205
+ gguf==0.17.1
206
+ Flask==3.1.2
207
+ faiss-cpu==1.13.0
208
+ email-validator==2.3.0
209
+ depyf==0.18.0
210
+ Deprecated==1.3.1
211
+ coloredlogs==15.0.1
212
+ cffi==2.0.0
213
+ black==25.11.0
214
+ beautifulsoup4==4.14.2
215
+ anyio==4.11.0
216
+ aiosignal==1.4.0
217
+ watchfiles==1.1.1
218
+ tiktoken==0.12.0
219
+ starlette==0.49.3
220
+ sse-starlette==3.0.3
221
+ rich==14.2.0
222
+ pydantic-settings==2.12.0
223
+ pydantic-extra-types==2.10.6
224
+ pandas==2.3.3
225
+ opentelemetry-exporter-otlp-proto-common==1.26.0
226
+ onnxruntime==1.23.2
227
+ matplotlib==3.10.7
228
+ lm-format-enforcer==0.10.12
229
+ jsonschema-specifications==2025.9.1
230
+ ipython==8.37.0
231
+ hydra-core==1.3.2
232
+ huggingface-hub==0.36.0
233
+ httpx==0.28.1
234
+ gym-sokoban==0.0.6
235
+ GitPython==3.1.45
236
+ cryptography==46.0.3
237
+ confection==0.1.5
238
+ cleantext==1.1.4
239
+ aiohttp==3.13.2
240
+ weasel==0.4.3
241
+ wandb==0.23.0
242
+ typer==0.19.2
243
+ virtualenv==20.35.4
244
+ pyasn1==0.6.1
245
+ torch==2.6.0
246
+ tokenizers==0.22.1
247
+ thinc==8.3.9
248
+ rich-toolkit==0.15.1
249
+ prometheus-fastapi-instrumentator==7.1.0
250
+ openai==2.8.0
251
+ jsonschema==4.25.1
252
+ gdown==5.2.0
253
+ fastapi==0.121.2
254
+ anthropic==0.73.0
255
+ xformers==0.0.29.post2
256
+ transformers==4.57.1
257
+ proto-plus==1.26.1
258
+ torchvision==0.21.0
259
+ torchdata==0.11.0
260
+ torchaudio==2.6.0
261
+ together==1.5.30
262
+ tensordict==0.8.3
263
+ spacy==3.8.9
264
+ ray==2.51.1
265
+ outlines_core==0.1.26
266
+ mistral_common==1.8.5
267
+ mcp==1.21.1
268
+ fastapi-cloud-cli==0.3.1
269
+ fastapi-cli==0.0.16
270
+ datasets==4.4.1
271
+ accelerate==1.11.0
272
+ xgrammar==0.1.18
273
+ pyserini==1.2.0
274
+ peft==0.18.0
275
+ outlines==0.1.11
276
+ opentelemetry-exporter-otlp-proto-http==1.26.0
277
+ opentelemetry-exporter-otlp-proto-grpc==1.26.0
278
+ kimina-client==0.2.1
279
+ compressed-tensors==0.9.3
280
+ opentelemetry-exporter-otlp==1.26.0
281
+ vllm==0.8.5
282
+ py-spy==0.4.1
283
+ opencensus-context==0.1.3
284
+ distlib==0.4.0
285
+ colorful==0.5.8
286
+ tensorboard-data-server==0.7.2
287
+ google-auth==2.43.0
288
+ google-api-core==2.28.1
289
+ aiohttp-cors==0.8.1
290
+ opentelemetry-exporter-prometheus==0.59b0
291
+ opencensus==0.11.4
292
+ verl==0.5.0.dev0
293
+ opentelemetry-api==1.38.0
294
+ opentelemetry-semantic-conventions==0.59b0
295
+ opentelemetry-sdk==1.38.0
296
+ typeguard==4.4.4
297
+ shtab==1.8.0
298
+ tyro==0.9.35
299
+ verl==0.5.0.dev0
300
+ autocommand==2.2.2
301
+ backports.tarfile==1.2.0
302
+ importlib_metadata==8.0.0
303
+ inflect==7.3.1
304
+ jaraco.collections==5.1.0
305
+ jaraco.context==5.3.0
306
+ jaraco.functools==4.0.1
307
+ jaraco.text==3.12.1
308
+ more-itertools==10.3.0
309
+ packaging==24.2
310
+ platformdirs==4.2.2
311
+ tomli==2.0.1
312
+ typeguard==4.3.0
313
+ typing_extensions==4.12.2
314
+ wheel==0.45.1
315
+ zipp==3.19.2
wandb/run-20251218_185248-ts36d12x/files/wandb-metadata.json ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "os": "Linux-5.14.0-284.25.1.el9_2.x86_64-x86_64-with-glibc2.35",
3
+ "python": "CPython 3.10.19",
4
+ "startedAt": "2025-12-18T10:52:48.969828Z",
5
+ "args": [
6
+ "--track"
7
+ ],
8
+ "program": "/mnt/general/wanghy/RAGEN/cleanrl/cleanrl/ppo_rubikscube.py",
9
+ "codePath": "cleanrl/cleanrl/ppo_rubikscube.py",
10
+ "codePathLocal": "cleanrl/cleanrl/ppo_rubikscube.py",
11
+ "git": {
12
+ "remote": "https://github.com/mll-lab-nu/RAGEN.git",
13
+ "commit": "8d73639b99b38265453f898b8d6af7d4af50d56e"
14
+ },
15
+ "email": "haoyu-wa22@mails.tsinghua.edu.cn",
16
+ "root": "/mnt/general/wanghy/RAGEN",
17
+ "host": "pt-4d654cf4576f4d23ad3d3919f12932fe-worker-0",
18
+ "executable": "/root/local/miniconda3/envs/ragen/bin/python",
19
+ "cpu_count": 64,
20
+ "cpu_count_logical": 128,
21
+ "gpu": "NVIDIA H100 80GB HBM3",
22
+ "gpu_count": 8,
23
+ "disk": {
24
+ "/": {
25
+ "total": "5153960755200",
26
+ "used": "447561207808"
27
+ }
28
+ },
29
+ "memory": {
30
+ "total": "2163642122240"
31
+ },
32
+ "gpu_nvidia": [
33
+ {
34
+ "name": "NVIDIA H100 80GB HBM3",
35
+ "memoryTotal": "85520809984",
36
+ "cudaCores": 16896,
37
+ "architecture": "Hopper",
38
+ "uuid": "GPU-35e2d43d-4067-82ce-90d4-def9e389bf28"
39
+ },
40
+ {
41
+ "name": "NVIDIA H100 80GB HBM3",
42
+ "memoryTotal": "85520809984",
43
+ "cudaCores": 16896,
44
+ "architecture": "Hopper",
45
+ "uuid": "GPU-af4135e3-88f2-e9ac-518d-502c75a85429"
46
+ },
47
+ {
48
+ "name": "NVIDIA H100 80GB HBM3",
49
+ "memoryTotal": "85520809984",
50
+ "cudaCores": 16896,
51
+ "architecture": "Hopper",
52
+ "uuid": "GPU-d7fdeeba-fe9b-ec03-d9f7-6724fe4266b5"
53
+ },
54
+ {
55
+ "name": "NVIDIA H100 80GB HBM3",
56
+ "memoryTotal": "85520809984",
57
+ "cudaCores": 16896,
58
+ "architecture": "Hopper",
59
+ "uuid": "GPU-ccc4f668-3882-5a8e-2c07-c5cd08f6f666"
60
+ },
61
+ {
62
+ "name": "NVIDIA H100 80GB HBM3",
63
+ "memoryTotal": "85520809984",
64
+ "cudaCores": 16896,
65
+ "architecture": "Hopper",
66
+ "uuid": "GPU-7b73c0cf-d3d5-e10c-7176-a43be1e41001"
67
+ },
68
+ {
69
+ "name": "NVIDIA H100 80GB HBM3",
70
+ "memoryTotal": "85520809984",
71
+ "cudaCores": 16896,
72
+ "architecture": "Hopper",
73
+ "uuid": "GPU-81b58d94-5d1f-8ec2-f9d2-fd56172ed177"
74
+ },
75
+ {
76
+ "name": "NVIDIA H100 80GB HBM3",
77
+ "memoryTotal": "85520809984",
78
+ "cudaCores": 16896,
79
+ "architecture": "Hopper",
80
+ "uuid": "GPU-03e8bc66-3b44-6794-49fd-5392fbdda6d1"
81
+ },
82
+ {
83
+ "name": "NVIDIA H100 80GB HBM3",
84
+ "memoryTotal": "85520809984",
85
+ "cudaCores": 16896,
86
+ "architecture": "Hopper",
87
+ "uuid": "GPU-b7cf0ec6-7c29-1179-dceb-09565da51890"
88
+ }
89
+ ],
90
+ "cudaVersion": "12.4",
91
+ "writerId": "pa2plkmx4kakxqj0z9828uzvhc7cjmd1"
92
+ }
wandb/run-20251218_185248-ts36d12x/files/wandb-summary.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"rollout/ep_rew_mean":1,"_wandb":{"runtime":488},"losses/explained_variance":0.9999998941191635,"_timestamp":1.7660556590504558e+09,"train/old_approx_kl":1.4977995306253433e-05,"eval/std_return":0,"charts/SPS":2066,"train/clipfrac":0,"train/success_rate":1,"charts/avg_reward":0.5,"eval/episodes":4000,"global_step":999424,"eval/avg_return":1,"rollout/success_rate":1,"train/value_loss":1.2905440605059937e-12,"train/entropy":0.9372190237045288,"train/learning_rate":2.561475409836034e-07,"_step":999424,"losses/value_loss":1.2905440605059937e-12,"_runtime":488.947236407,"losses/policy_loss":-2.1204352378845215e-05,"eval/success_rate":1,"train/approx_kl":5.471520125865936e-08,"perf/SPS":2066,"charts/train_success_rate":1,"rollout/ep_len_mean":1,"charts/avg_value":0.9950001835823059,"train/policy_loss":-2.1204352378845215e-05,"charts/progress":100}
wandb/run-20251218_185248-ts36d12x/run-ts36d12x.wandb ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4130893ad88b9d27d5be99b364340162db95ae9e6a5388fa9dfc4d17a2a17109
3
+ size 57189556
wandb/run-20251218_190243-6eiq1qnz/files/config.yaml ADDED
@@ -0,0 +1,961 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _wandb:
2
+ value:
3
+ cli_version: 0.23.0
4
+ e:
5
+ ksnadu1wq1hn3j4tn7kvyr37dur8onv0:
6
+ args:
7
+ - --node-ip-address=10.119.16.10
8
+ - --node-manager-port=46457
9
+ - --object-store-name=/tmp/ray/session_2025-12-18_19-01-25_051217_50/sockets/plasma_store
10
+ - --raylet-name=/tmp/ray/session_2025-12-18_19-01-25_051217_50/sockets/raylet
11
+ - --redis-address=None
12
+ - --metrics-agent-port=59353
13
+ - --logging-rotate-bytes=536870912
14
+ - --logging-rotate-backup-count=5
15
+ - --runtime-env-agent-port=56001
16
+ - --gcs-address=10.119.16.10:49077
17
+ - --session-name=session_2025-12-18_19-01-25_051217_50
18
+ - --temp-dir=/tmp/ray
19
+ - --webui=127.0.0.1:8265
20
+ - --cluster-id=f44abd8a0353dce8bb3cfc59c203d66bdcc2d6cc10d0841735322fe3
21
+ - --startup-token=112
22
+ - --worker-launch-time-ms=1766055688989
23
+ - --node-id=246330e3702e1feff374f74c418a746f3fd74a876302f01bd5b8d5b4
24
+ - --runtime-env-hash=-839022692
25
+ cpu_count: 64
26
+ cpu_count_logical: 128
27
+ cudaVersion: "12.4"
28
+ disk:
29
+ /:
30
+ total: "5153960755200"
31
+ used: "3194880"
32
+ email: haoyu-wa22@mails.tsinghua.edu.cn
33
+ executable: /root/local/miniconda3/envs/ragen/bin/python
34
+ git:
35
+ commit: 8d73639b99b38265453f898b8d6af7d4af50d56e
36
+ remote: https://github.com/mll-lab-nu/RAGEN.git
37
+ gpu: NVIDIA H100 80GB HBM3
38
+ gpu_count: 8
39
+ gpu_nvidia:
40
+ - architecture: Hopper
41
+ cudaCores: 16896
42
+ memoryTotal: "85520809984"
43
+ name: NVIDIA H100 80GB HBM3
44
+ uuid: GPU-34b1ceb3-41bf-8b15-936b-0cf63020796b
45
+ - architecture: Hopper
46
+ cudaCores: 16896
47
+ memoryTotal: "85520809984"
48
+ name: NVIDIA H100 80GB HBM3
49
+ uuid: GPU-bb0e21ee-96da-91a4-7dde-5f2dada5f894
50
+ - architecture: Hopper
51
+ cudaCores: 16896
52
+ memoryTotal: "85520809984"
53
+ name: NVIDIA H100 80GB HBM3
54
+ uuid: GPU-8788342f-112d-c7cf-f513-0bf789f08656
55
+ - architecture: Hopper
56
+ cudaCores: 16896
57
+ memoryTotal: "85520809984"
58
+ name: NVIDIA H100 80GB HBM3
59
+ uuid: GPU-bb645fc4-7841-b48c-ba0c-75967eeaa342
60
+ - architecture: Hopper
61
+ cudaCores: 16896
62
+ memoryTotal: "85520809984"
63
+ name: NVIDIA H100 80GB HBM3
64
+ uuid: GPU-85d58b2b-da3c-6a28-db10-99f31a8901dd
65
+ - architecture: Hopper
66
+ cudaCores: 16896
67
+ memoryTotal: "85520809984"
68
+ name: NVIDIA H100 80GB HBM3
69
+ uuid: GPU-3744bc51-7758-b4d2-0df8-fd7c43393254
70
+ - architecture: Hopper
71
+ cudaCores: 16896
72
+ memoryTotal: "85520809984"
73
+ name: NVIDIA H100 80GB HBM3
74
+ uuid: GPU-784deca5-2373-020f-5ee6-f841f00d6f77
75
+ - architecture: Hopper
76
+ cudaCores: 16896
77
+ memoryTotal: "85520809984"
78
+ name: NVIDIA H100 80GB HBM3
79
+ uuid: GPU-ea6ca467-24fc-212b-7fc3-2bd657db30c1
80
+ host: pt-9f0a38817de94c12810804da51920883-worker-0
81
+ memory:
82
+ total: "2163639472128"
83
+ os: Linux-5.14.0-284.25.1.el9_2.x86_64-x86_64-with-glibc2.35
84
+ program: /root/local/miniconda3/envs/ragen/lib/python3.10/site-packages/ray/_private/workers/default_worker.py
85
+ python: CPython 3.10.19
86
+ root: /mnt/general/wanghy/RAGEN
87
+ startedAt: "2025-12-18T11:02:43.262285Z"
88
+ writerId: ksnadu1wq1hn3j4tn7kvyr37dur8onv0
89
+ m: []
90
+ python_version: 3.10.19
91
+ t:
92
+ "1":
93
+ - 1
94
+ - 5
95
+ - 11
96
+ - 30
97
+ - 41
98
+ - 49
99
+ - 50
100
+ - 51
101
+ - 53
102
+ - 71
103
+ - 95
104
+ - 97
105
+ - 98
106
+ - 105
107
+ "2":
108
+ - 1
109
+ - 5
110
+ - 11
111
+ - 30
112
+ - 41
113
+ - 49
114
+ - 50
115
+ - 51
116
+ - 53
117
+ - 71
118
+ - 95
119
+ - 97
120
+ - 98
121
+ - 105
122
+ "3":
123
+ - 2
124
+ - 13
125
+ - 16
126
+ - 61
127
+ "4": 3.10.19
128
+ "5": 0.23.0
129
+ "6": 4.57.3
130
+ "12": 0.23.0
131
+ "13": linux-x86_64
132
+ actor_rollout_ref:
133
+ value:
134
+ actor:
135
+ _target_: verl.workers.config.FSDPActorConfig
136
+ checkpoint:
137
+ _target_: verl.trainer.config.CheckpointConfig
138
+ async_save: false
139
+ load_contents:
140
+ - model
141
+ - optimizer
142
+ - extra
143
+ save_contents:
144
+ - model
145
+ - optimizer
146
+ - extra
147
+ clip_ratio: 0.2
148
+ clip_ratio_c: 3
149
+ clip_ratio_high: 0.28
150
+ clip_ratio_low: 0.2
151
+ entropy_checkpointing: false
152
+ entropy_coeff: 0.001
153
+ entropy_from_logits_with_chunking: false
154
+ freeze_vision_tower: false
155
+ fsdp_config:
156
+ _target_: verl.workers.config.FSDPEngineConfig
157
+ entropy_checkpointing: false
158
+ entropy_from_logits_with_chunking: false
159
+ forward_only: false
160
+ forward_prefetch: false
161
+ fsdp_size: -1
162
+ model_dtype: fp32
163
+ offload_policy: false
164
+ optimizer_offload: false
165
+ param_offload: false
166
+ reshard_after_forward: true
167
+ strategy: fsdp
168
+ ulysses_sequence_parallel_size: 1
169
+ use_orig_params: false
170
+ use_torch_compile: true
171
+ wrap_policy:
172
+ min_num_params: 0
173
+ grad_clip: 1
174
+ grpo_advantage_length_weight: false
175
+ kl_loss_coef: 0
176
+ kl_loss_type: kl
177
+ loss_agg_mode: token-mean
178
+ optim:
179
+ _target_: verl.workers.config.FSDPOptimizerConfig
180
+ betas:
181
+ - 0.9
182
+ - 0.999
183
+ clip_grad: 1
184
+ lr: 1e-06
185
+ lr_warmup_steps: -1
186
+ lr_warmup_steps_ratio: 0
187
+ min_lr_ratio: 0
188
+ num_cycles: 0.5
189
+ total_training_steps: 200
190
+ warmup_style: constant
191
+ weight_decay: 0.01
192
+ policy_loss:
193
+ _target_: verl.workers.config.PolicyLossConfig
194
+ clip_cov_lb: 1
195
+ clip_cov_ratio: 0.0002
196
+ clip_cov_ub: 5
197
+ kl_cov_ratio: 0.0002
198
+ loss_mode: vanilla
199
+ ppo_kl_coef: 0.1
200
+ ppo_epochs: 1
201
+ ppo_max_token_len_per_gpu: 16384
202
+ ppo_micro_batch_size: null
203
+ ppo_micro_batch_size_per_gpu: 1
204
+ ppo_mini_batch_size: 32
205
+ profiler:
206
+ _target_: verl.utils.profiler.ProfilerConfig
207
+ all_ranks: false
208
+ enable: false
209
+ ranks: []
210
+ save_path: outputs/profile
211
+ tool: null
212
+ tool_config:
213
+ npu:
214
+ _target_: verl.utils.profiler.config.NPUToolConfig
215
+ analysis: true
216
+ contents: []
217
+ discrete: false
218
+ level: level1
219
+ nsys:
220
+ _target_: verl.utils.profiler.config.NsightToolConfig
221
+ discrete: false
222
+ torch:
223
+ _target_: verl.utils.profiler.config.TorchProfilerToolConfig
224
+ step_end: null
225
+ step_start: 0
226
+ torch_memory:
227
+ _target_: verl.utils.profiler.config.TorchMemoryToolConfig
228
+ stack_depth: 32
229
+ trace_alloc_max_entries: 100000
230
+ shuffle: false
231
+ strategy: fsdp
232
+ tis_imp_ratio_cap: -1
233
+ ulysses_sequence_parallel_size: 1
234
+ use_dynamic_bsz: false
235
+ use_fused_kernels: false
236
+ use_kl_loss: false
237
+ use_ref: true
238
+ use_remove_padding: false
239
+ use_torch_compile: true
240
+ hybrid_engine: true
241
+ model:
242
+ _target_: verl.workers.config.HFModelConfig
243
+ custom_chat_template: null
244
+ enable_activation_offload: false
245
+ enable_gradient_checkpointing: true
246
+ exclude_modules: null
247
+ external_lib: null
248
+ fused_kernel_options:
249
+ impl_backend: torch
250
+ hf_config_path: null
251
+ lora_alpha: 16
252
+ lora_rank: 0
253
+ path: Qwen/Qwen2.5-0.5B-Instruct
254
+ target_modules: all-linear
255
+ tokenizer_path: null
256
+ trust_remote_code: false
257
+ use_fused_kernels: false
258
+ use_liger: false
259
+ use_remove_padding: false
260
+ use_shm: false
261
+ nccl_timeout: 600
262
+ ref:
263
+ entropy_checkpointing: false
264
+ entropy_from_logits_with_chunking: false
265
+ fsdp_config:
266
+ _target_: verl.workers.config.FSDPEngineConfig
267
+ entropy_checkpointing: false
268
+ entropy_from_logits_with_chunking: false
269
+ forward_only: false
270
+ forward_prefetch: false
271
+ fsdp_size: -1
272
+ model_dtype: fp32
273
+ offload_policy: false
274
+ optimizer_offload: false
275
+ param_offload: false
276
+ reshard_after_forward: true
277
+ strategy: fsdp
278
+ ulysses_sequence_parallel_size: 1
279
+ use_orig_params: false
280
+ use_torch_compile: true
281
+ wrap_policy:
282
+ min_num_params: 0
283
+ log_prob_max_token_len_per_gpu: 16384
284
+ log_prob_micro_batch_size: null
285
+ log_prob_micro_batch_size_per_gpu: 1
286
+ log_prob_use_dynamic_bsz: false
287
+ model: null
288
+ profiler:
289
+ _target_: verl.utils.profiler.ProfilerConfig
290
+ all_ranks: false
291
+ enable: false
292
+ ranks: []
293
+ save_path: outputs/profile
294
+ tool: null
295
+ tool_config:
296
+ npu:
297
+ _target_: verl.utils.profiler.config.NPUToolConfig
298
+ analysis: true
299
+ contents: []
300
+ discrete: false
301
+ level: level1
302
+ nsys:
303
+ _target_: verl.utils.profiler.config.NsightToolConfig
304
+ discrete: false
305
+ torch:
306
+ _target_: verl.utils.profiler.config.TorchProfilerToolConfig
307
+ step_end: null
308
+ step_start: 0
309
+ torch_memory:
310
+ _target_: verl.utils.profiler.config.TorchMemoryToolConfig
311
+ stack_depth: 32
312
+ trace_alloc_max_entries: 100000
313
+ strategy: fsdp
314
+ ulysses_sequence_parallel_size: 1
315
+ use_torch_compile: true
316
+ rollout:
317
+ _target_: verl.workers.config.RolloutConfig
318
+ agent:
319
+ _target_: verl.workers.config.AgentLoopConfig
320
+ agent_loop_config_path: null
321
+ custom_async_server:
322
+ _target_: verl.workers.config.CustomAsyncServerConfig
323
+ name: null
324
+ path: null
325
+ num_workers: 8
326
+ calculate_log_probs: false
327
+ cudagraph_capture_sizes: null
328
+ data_parallel_size: 1
329
+ disable_log_stats: true
330
+ do_sample: true
331
+ dtype: bfloat16
332
+ enable_chunked_prefill: true
333
+ enable_prefix_caching: true
334
+ enforce_eager: true
335
+ expert_parallel_size: 1
336
+ free_cache_engine: true
337
+ gpu_memory_utilization: 0.7
338
+ ignore_eos: false
339
+ layered_summon: false
340
+ load_format: dummy
341
+ log_prob_max_token_len_per_gpu: 16384
342
+ log_prob_micro_batch_size: null
343
+ log_prob_micro_batch_size_per_gpu: 1
344
+ log_prob_use_dynamic_bsz: false
345
+ max_model_len: 7200
346
+ max_num_batched_tokens: 8192
347
+ max_num_seqs: 1024
348
+ mode: sync
349
+ multi_stage_wake_up: false
350
+ multi_turn:
351
+ _target_: verl.workers.config.MultiTurnConfig
352
+ enable: false
353
+ format: hermes
354
+ interaction_config_path: null
355
+ max_assistant_turns: null
356
+ max_parallel_calls: 1
357
+ max_tool_response_length: 256
358
+ max_user_turns: null
359
+ num_repeat_rollouts: null
360
+ tokenization_sanity_check_mode: strict
361
+ tool_config_path: null
362
+ tool_response_truncate_side: middle
363
+ use_inference_chat_template: false
364
+ "n": 1
365
+ name: vllm
366
+ over_sample_rate: 0
367
+ profiler:
368
+ _target_: verl.utils.profiler.ProfilerConfig
369
+ all_ranks: false
370
+ enable: false
371
+ ranks: []
372
+ save_path: outputs/profile
373
+ tool: null
374
+ tool_config:
375
+ npu:
376
+ _target_: verl.utils.profiler.config.NPUToolConfig
377
+ analysis: true
378
+ contents: []
379
+ discrete: false
380
+ level: level1
381
+ nsys:
382
+ _target_: verl.utils.profiler.config.NsightToolConfig
383
+ discrete: false
384
+ torch:
385
+ _target_: verl.utils.profiler.config.TorchProfilerToolConfig
386
+ step_end: null
387
+ step_start: 0
388
+ torch_memory:
389
+ _target_: verl.utils.profiler.config.TorchMemoryToolConfig
390
+ stack_depth: 32
391
+ trace_alloc_max_entries: 100000
392
+ prompt_length: 1
393
+ response_length: 500
394
+ rollout_filter_metric: reward_variance
395
+ rollout_filter_ratio: 0.25
396
+ rollout_filter_type: largest
397
+ skip_dump_dir: /tmp/rollout_dump
398
+ skip_rollout: false
399
+ skip_tokenizer_init: true
400
+ temperature: 1
401
+ tensor_model_parallel_size: 1
402
+ top_k: -1
403
+ top_p: 1
404
+ trace:
405
+ _target_: verl.workers.config.TraceConfig
406
+ backend: null
407
+ token2text: false
408
+ update_weights_bucket_megabytes: 512
409
+ val_kwargs:
410
+ _target_: verl.workers.config.SamplingConfig
411
+ do_sample: true
412
+ "n": 1
413
+ temperature: 0.5
414
+ top_k: -1
415
+ top_p: 1
416
+ agent_proxy:
417
+ value:
418
+ action_sep: '||'
419
+ enable_think: true
420
+ max_actions_per_turn: 4
421
+ max_context_window: 5
422
+ max_turn: 25
423
+ reward_normalization:
424
+ grouping: state
425
+ method: identity
426
+ use_turn_scores: false
427
+ algorithm:
428
+ value:
429
+ _target_: verl.trainer.config.AlgoConfig
430
+ adv_estimator: gae
431
+ bi_level_gae: false
432
+ gamma: 1
433
+ high_level_gamma: 0.95
434
+ kl_ctrl:
435
+ _target_: verl.trainer.config.KLControlConfig
436
+ horizon: 10000
437
+ kl_coef: 0
438
+ target_kl: 0.1
439
+ type: fixed
440
+ kl_penalty: kl
441
+ lam: 1
442
+ norm_adv_by_std_in_grpo: true
443
+ pf_ppo:
444
+ reweight_method: pow
445
+ weight_pow: 2
446
+ use_kl_in_reward: false
447
+ use_pf_ppo: false
448
+ critic:
449
+ value:
450
+ _target_: verl.workers.config.FSDPCriticConfig
451
+ checkpoint:
452
+ _target_: verl.trainer.config.CheckpointConfig
453
+ async_save: false
454
+ load_contents:
455
+ - model
456
+ - optimizer
457
+ - extra
458
+ save_contents:
459
+ - model
460
+ - optimizer
461
+ - extra
462
+ cliprange_value: 0.5
463
+ enable: null
464
+ forward_max_token_len_per_gpu: 32768
465
+ forward_micro_batch_size: null
466
+ forward_micro_batch_size_per_gpu: 1
467
+ grad_clip: 1
468
+ loss_agg_mode: token-mean
469
+ model:
470
+ _target_: verl.workers.config.FSDPCriticModelCfg
471
+ enable_activation_offload: false
472
+ enable_gradient_checkpointing: true
473
+ external_lib: null
474
+ fsdp_config:
475
+ _target_: verl.workers.config.FSDPEngineConfig
476
+ entropy_checkpointing: false
477
+ entropy_from_logits_with_chunking: false
478
+ forward_only: false
479
+ forward_prefetch: false
480
+ fsdp_size: -1
481
+ model_dtype: fp32
482
+ offload_policy: false
483
+ optimizer_offload: false
484
+ param_offload: false
485
+ reshard_after_forward: true
486
+ strategy: fsdp
487
+ ulysses_sequence_parallel_size: 1
488
+ use_orig_params: false
489
+ use_torch_compile: true
490
+ wrap_policy:
491
+ min_num_params: 0
492
+ lora_alpha: 16
493
+ lora_rank: 0
494
+ path: Qwen/Qwen2.5-0.5B-Instruct
495
+ target_modules: all-linear
496
+ tokenizer_path: Qwen/Qwen2.5-0.5B-Instruct
497
+ trust_remote_code: false
498
+ use_remove_padding: false
499
+ use_shm: false
500
+ optim:
501
+ _target_: verl.workers.config.FSDPOptimizerConfig
502
+ betas:
503
+ - 0.9
504
+ - 0.999
505
+ clip_grad: 1
506
+ lr: 1e-05
507
+ lr_warmup_steps: -1
508
+ lr_warmup_steps_ratio: 0
509
+ min_lr_ratio: 0
510
+ num_cycles: 0.5
511
+ total_training_steps: 200
512
+ warmup_style: constant
513
+ weight_decay: 0.01
514
+ ppo_epochs: 1
515
+ ppo_max_token_len_per_gpu: 32768
516
+ ppo_micro_batch_size: null
517
+ ppo_micro_batch_size_per_gpu: 1
518
+ ppo_mini_batch_size: 32
519
+ profiler:
520
+ _target_: verl.utils.profiler.ProfilerConfig
521
+ all_ranks: false
522
+ enable: false
523
+ ranks: []
524
+ save_path: outputs/profile
525
+ tool: null
526
+ tool_config:
527
+ npu:
528
+ _target_: verl.utils.profiler.config.NPUToolConfig
529
+ analysis: true
530
+ contents: []
531
+ discrete: false
532
+ level: level1
533
+ nsys:
534
+ _target_: verl.utils.profiler.config.NsightToolConfig
535
+ discrete: false
536
+ torch:
537
+ _target_: verl.utils.profiler.config.TorchProfilerToolConfig
538
+ step_end: null
539
+ step_start: 0
540
+ torch_memory:
541
+ _target_: verl.utils.profiler.config.TorchMemoryToolConfig
542
+ stack_depth: 32
543
+ trace_alloc_max_entries: 100000
544
+ rollout_n: 1
545
+ shuffle: false
546
+ strategy: fsdp
547
+ ulysses_sequence_parallel_size: 1
548
+ use_dynamic_bsz: false
549
+ ctx_manager:
550
+ value:
551
+ generation:
552
+ gen_config:
553
+ kwargs: null
554
+ response_length: 500
555
+ temperature: 1
556
+ top_k: -1
557
+ top_p: 1
558
+ custom_envs:
559
+ value:
560
+ Bandit:
561
+ env_config:
562
+ split: train
563
+ env_instruction: ""
564
+ env_type: bandit
565
+ max_actions_per_traj: 1
566
+ max_tokens: 100
567
+ BanditTest:
568
+ env_config:
569
+ split: test
570
+ env_instruction: ""
571
+ env_type: bandit
572
+ max_actions_per_traj: 1
573
+ max_tokens: 100
574
+ CoordFrozenLake:
575
+ env_config:
576
+ observation_format: grid_coord
577
+ env_instruction: |
578
+ You are solving the FrozenLake puzzle. The observation includes both a symbol grid and zero-indexed coordinates for the start, goal, player, and any holes.
579
+ Coordinates range from the top-left corner (0, 0) to the bottom-right corner (5, 5).
580
+ Beware that the ice is slippery, so the agent might slide and end up in an unintended tile.
581
+ Respond with a sequence of actions such as <answer>Left || Up || Up</answer>.
582
+ env_type: frozen_lake
583
+ max_actions_per_traj: 25
584
+ max_tokens: 120
585
+ CoordSokoban:
586
+ env_config:
587
+ dim_x: 6
588
+ dim_y: 6
589
+ max_steps: 100
590
+ num_boxes: 2
591
+ observation_format: grid_coord
592
+ env_instruction: "You are solving the Sokoban puzzle. You are the player and you need to push all boxes to targets.\nYou are provided with a symbol grid and the zero-indexed coordinates of the player, each box, and each target. \nCoordinates range from the top-left corner (0, 0) to the bottom-right corner (5, 5). \nWhen you are exactly next to a box, you can push it by moving in the same direction. \nYou cannot push a box through a wall, and you cannot pull a box.\nThe answer should be a sequence of actions, like <answer>Right || Right || Up</answer>.\n"
593
+ env_type: sokoban
594
+ max_actions_per_traj: 10
595
+ max_tokens: 120
596
+ Countdown:
597
+ env_config: null
598
+ env_instruction: 'You are solving the Countdown puzzle. You should use the num list to create an equation that equals the target. Example answer format: <think> To find an equation using [3, 5, 2] to get 4. Let''s check 2 + 5 = 7, 7 - 3 = 4. So the answer is 2 + 5 - 3 = 4. </think><answer>2 + 5 - 3</answer>'
599
+ env_type: countdown
600
+ max_actions_per_traj: 1
601
+ max_tokens: 100
602
+ FrozenLake:
603
+ env_config: null
604
+ env_instruction: 'You are solving the FrozenLake puzzle. Forbid the whole and go to the target. You may move to the unintended direction due to the slippery ice. Example answer format: <think>To forbid the hole and go to the target, I should go left then go up.</think><answer>Left || Up</answer>'
605
+ env_type: frozen_lake
606
+ max_actions_per_traj: 25
607
+ max_tokens: 100
608
+ LargerSokoban:
609
+ env_config:
610
+ dim_x: 8
611
+ dim_y: 8
612
+ max_steps: 100
613
+ num_boxes: 2
614
+ search_depth: 10
615
+ env_instruction: "You are solving the Sokoban puzzle. \nYou are the player and you need to push all boxes to targets. \nWhen you are right next to a box, you can push it by moving in the same direction. \nYou cannot push a box through a wall, and you cannot pull a box. \nThe answer should be a sequence of actions, like <answer>Right || Right || Up</answer>\n"
616
+ env_type: sokoban
617
+ max_actions_per_traj: 10
618
+ max_tokens: 100
619
+ Lean:
620
+ env_config: null
621
+ env_instruction: You are a Lean theorem prover. Given a Lean theorem statement, propose a sequence of tactics that completes the proof. Think step by step about which tactics to apply next. Provide tactics separated by '||', for example <answer>intro || simp || rfl</answer>.
622
+ env_type: lean
623
+ max_actions_per_traj: 30
624
+ max_tokens: 512
625
+ MediumSudoku:
626
+ env_config:
627
+ difficulty: medium
628
+ grid_size: 9
629
+ max_steps: 81
630
+ render_format: with_feedback
631
+ show_conflicts: true
632
+ show_valid_numbers: true
633
+ env_instruction: |
634
+ You are solving a Sudoku puzzle. Fill in the grid so that every row, column, and 3x3 box contains the numbers 1-9 without repetition.
635
+ Initial cells are shown in [brackets] and cannot be modified. Empty cells are shown as dots (.).
636
+ Place numbers one at a time using the format: <answer>place 5 at row 2 col 3</answer> or <answer>2,3,5</answer>
637
+ The environment will provide feedback on valid/invalid moves and show conflicts if any occur.
638
+ env_type: sudoku
639
+ max_actions_per_traj: 30
640
+ max_tokens: 150
641
+ max_workers: 32
642
+ parallel_friendly: false
643
+ MetamathQA:
644
+ env_config: null
645
+ env_instruction: 'You are solving Math problems. '
646
+ env_type: metamathqa
647
+ max_actions_per_traj: 1
648
+ max_tokens: 100
649
+ SimpleSokoban:
650
+ env_config:
651
+ dim_x: 6
652
+ dim_y: 6
653
+ max_steps: 100
654
+ num_boxes: 2
655
+ env_instruction: "You are solving the Sokoban puzzle. \nYou are the player and you need to push all boxes to targets. \nWhen you are right next to a box, you can push it by moving in the same direction. \nYou cannot push a box through a wall, and you cannot pull a box. \nThe answer should be a sequence of actions, like <answer>Right || Right || Up</answer>\n"
656
+ env_type: sokoban
657
+ max_actions_per_traj: 10
658
+ max_tokens: 100
659
+ SimpleSudoku:
660
+ env_config:
661
+ difficulty: easy
662
+ grid_size: 4
663
+ max_steps: 20
664
+ render_format: with_feedback
665
+ show_conflicts: false
666
+ show_valid_numbers: false
667
+ env_instruction: |
668
+ You are solving a Sudoku puzzle. Fill in the grid so that every row, column, and 2x2 box contains the numbers 1-4 without repetition.
669
+ Initial cells are shown in [brackets] and cannot be modified. Empty cells are shown as dots (.).
670
+ Place numbers one at a time using the format, for example: <answer>place 1 at row 2 col 3</answer> or <answer>1,2,3</answer>
671
+ The environment will provide feedback on valid/invalid moves and show conflicts if any occur.
672
+ env_type: sudoku
673
+ max_actions_per_traj: 20
674
+ max_tokens: 150
675
+ max_workers: 32
676
+ parallel_friendly: false
677
+ SokobanDifferentGridVocab:
678
+ env_config:
679
+ dim_x: 6
680
+ dim_y: 6
681
+ grid_lookup:
682
+ "0": W
683
+ "1": .
684
+ "2": G
685
+ "3": C
686
+ "4": B
687
+ "5": A
688
+ "6": '@'
689
+ grid_vocab:
690
+ .: empty
691
+ '@': player on target
692
+ A: player
693
+ B: box
694
+ C: box on target
695
+ G: target
696
+ W: wall
697
+ max_steps: 100
698
+ num_boxes: 1
699
+ search_depth: 30
700
+ env_instruction: "You are solving the Sokoban puzzle. \nYou are the player and you need to push all boxes to targets. \nWhen you are right next to a box, you can push it by moving in the same direction. \nYou cannot push a box through a wall, and you cannot pull a box. \nThe answer should be a sequence of actions, like <answer>Right || Right || Up</answer>\n"
701
+ env_type: sokoban
702
+ max_actions_per_traj: 10
703
+ max_tokens: 100
704
+ VisualSimpleSokoban:
705
+ env_config:
706
+ dim_x: 6
707
+ dim_y: 6
708
+ max_steps: 100
709
+ num_boxes: 1
710
+ render_mode: rgb_array
711
+ env_instruction: You are solving the Sokoban puzzle. You are the player and you need to push all boxes to targets. When you are right next to a box, you can push it by moving in the same direction. You cannot push a box through a wall, and you cannot pull a box. The answer should be a sequence of actions, like <answer>Right || Right || Up</answer>
712
+ env_type: sokoban
713
+ max_actions_per_traj: 10
714
+ max_tokens: 100
715
+ WebShop:
716
+ env_config:
717
+ dataset: small
718
+ env_instruction: 'You are browsing an online shop. Based on the instruction, buy a product that close to the production description. You need to search, read the search results, pick a product, choose the size and color and buy. You should only choose action from the available actions list provided later. Example process: I need a gingko light and 20x20 pillow cover that is hand painted. First search[gingko light 20x20 pillow cover hand painted], answer format: <answer>search[blanket with fleece throw]</answer>. Valid answer is search[<keywords>] or click[<clickable>].'
719
+ env_type: webshop
720
+ max_actions_per_traj: 9
721
+ max_tokens: 200
722
+ blackjack:
723
+ env_config: null
724
+ env_instruction: |
725
+ You are playing Blackjack against a dealer. The dealer must hit on 16 or less and stand on 17 or more.
726
+ Choose either Stick or Hit. Respond with a single action.
727
+ Example: <answer>Hit</answer>
728
+ env_type: blackjack
729
+ max_actions_per_traj: 10
730
+ max_tokens: 64
731
+ game_2048:
732
+ env_config: null
733
+ env_instruction: |
734
+ You are playing the 2048 game on a 4x4 grid. Merge equal tiles by sliding Up, Right, Down, or Left.
735
+ If a move is invalid (no tiles move), a small penalty is applied. Respond with a single action.
736
+ Example: <answer>Up</answer>
737
+ env_type: game_2048
738
+ max_actions_per_traj: 700
739
+ max_tokens: 8192
740
+ rubikscube:
741
+ env_config:
742
+ max_steps: 20
743
+ render_mode: text
744
+ scramble_depth: 1
745
+ env_instruction: |
746
+ You are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.
747
+ Available actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.
748
+ - Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).
749
+ - Modifiers: A letter alone means 90° clockwise (e.g., 'R'). A letter with prime (') means 90° counter-clockwise (e.g., "R'").
750
+ Respond with a sequence of actions separated by "||".
751
+ Example: <answer>U</answer>
752
+ env_type: rubikscube
753
+ max_actions_per_traj: 20
754
+ max_tokens: 96
755
+ custom_reward_function:
756
+ value:
757
+ name: compute_score
758
+ path: null
759
+ data:
760
+ value:
761
+ custom_cls:
762
+ name: null
763
+ path: null
764
+ datagen:
765
+ name: null
766
+ path: null
767
+ dataloader_num_workers: 8
768
+ filter_overlong_prompts: false
769
+ filter_overlong_prompts_workers: 1
770
+ image_key: images
771
+ max_prompt_length: null
772
+ max_response_length: null
773
+ prompt_key: prompt
774
+ return_full_prompt: false
775
+ return_multi_modal_inputs: true
776
+ return_raw_chat: false
777
+ return_raw_input_ids: false
778
+ reward_fn_key: data_source
779
+ sampler:
780
+ class_name: null
781
+ class_path: null
782
+ shuffle: true
783
+ tokenizer: null
784
+ train_batch_size: 128
785
+ train_files: ~/data/rlhf/gsm8k/train.parquet
786
+ truncation: error
787
+ trust_remote_code: false
788
+ use_shm: false
789
+ val_batch_size: null
790
+ val_files: ~/data/rlhf/gsm8k/test.parquet
791
+ validation_shuffle: false
792
+ video_key: videos
793
+ enable_response_mask:
794
+ value: true
795
+ es_manager:
796
+ value:
797
+ format_penalty: -0.1
798
+ train:
799
+ env_configs:
800
+ n_groups:
801
+ - 8
802
+ tags:
803
+ - rubikscube
804
+ env_groups: 8
805
+ group_size: 16
806
+ val:
807
+ env_configs:
808
+ n_groups:
809
+ - 256
810
+ tags:
811
+ - rubikscube
812
+ env_groups: 256
813
+ group_size: 1
814
+ global_profiler:
815
+ value:
816
+ _target_: verl.utils.profiler.ProfilerConfig
817
+ global_tool_config:
818
+ nsys:
819
+ _target_: verl.utils.profiler.config.NsightToolConfig
820
+ controller_nsight_options:
821
+ cuda-graph-trace: graph
822
+ cuda-memory-usage: "true"
823
+ trace: cuda,nvtx,cublas,ucx
824
+ discrete: false
825
+ worker_nsight_options:
826
+ capture-range: cudaProfilerApi
827
+ capture-range-end: null
828
+ cuda-graph-trace: graph
829
+ cuda-memory-usage: "true"
830
+ kill: none
831
+ trace: cuda,nvtx,cublas,ucx
832
+ torch_memory:
833
+ context: all
834
+ stack_depth: 32
835
+ stacks: all
836
+ trace_alloc_max_entries: 100000
837
+ profile_continuous_steps: false
838
+ save_path: outputs/profile
839
+ steps: null
840
+ tool: null
841
+ grpo_advantage_length_weight:
842
+ value: false
843
+ lora:
844
+ value:
845
+ alpha: 16
846
+ rank: 0
847
+ target_modules: all-linear
848
+ micro_batch_size_per_gpu:
849
+ value: 1
850
+ model_path:
851
+ value: Qwen/Qwen2.5-0.5B-Instruct
852
+ ppo_mini_batch_size:
853
+ value: 32
854
+ ray_kwargs:
855
+ value:
856
+ ray_init:
857
+ num_cpus: null
858
+ timeline_json_file: null
859
+ reward_model:
860
+ value:
861
+ enable: false
862
+ enable_resource_pool: false
863
+ forward_max_token_len_per_gpu: 32768
864
+ launch_reward_fn_async: false
865
+ max_length: null
866
+ micro_batch_size: null
867
+ micro_batch_size_per_gpu: null
868
+ model:
869
+ external_lib: null
870
+ fsdp_config:
871
+ _target_: verl.workers.config.FSDPEngineConfig
872
+ forward_prefetch: false
873
+ fsdp_size: -1
874
+ param_offload: false
875
+ reshard_after_forward: true
876
+ wrap_policy:
877
+ min_num_params: 0
878
+ input_tokenizer: Qwen/Qwen2.5-0.5B-Instruct
879
+ path: ~/models/FsfairX-LLaMA3-RM-v0.1
880
+ trust_remote_code: false
881
+ use_fused_kernels: false
882
+ use_remove_padding: false
883
+ use_shm: false
884
+ n_gpus_per_node: 0
885
+ nnodes: 0
886
+ profiler:
887
+ _target_: verl.utils.profiler.ProfilerConfig
888
+ all_ranks: false
889
+ enable: false
890
+ ranks: []
891
+ save_path: outputs/profile
892
+ tool: null
893
+ tool_config:
894
+ npu:
895
+ _target_: verl.utils.profiler.config.NPUToolConfig
896
+ analysis: true
897
+ contents: []
898
+ discrete: false
899
+ level: level1
900
+ nsys:
901
+ _target_: verl.utils.profiler.config.NsightToolConfig
902
+ discrete: false
903
+ torch:
904
+ _target_: verl.utils.profiler.config.TorchProfilerToolConfig
905
+ step_end: null
906
+ step_start: 0
907
+ torch_memory:
908
+ _target_: verl.utils.profiler.config.TorchMemoryToolConfig
909
+ stack_depth: 32
910
+ trace_alloc_max_entries: 100000
911
+ reward_manager: naive
912
+ sandbox_fusion:
913
+ max_concurrent: 64
914
+ memory_limit_mb: 1024
915
+ url: null
916
+ strategy: fsdp
917
+ ulysses_sequence_parallel_size: 1
918
+ use_dynamic_bsz: false
919
+ seed:
920
+ value:
921
+ train: 10000
922
+ val: 123
923
+ system:
924
+ value:
925
+ CUDA_VISIBLE_DEVICES: 0,1,2,3,4,5,6,7
926
+ trainer:
927
+ value:
928
+ balance_batch: true
929
+ critic_warmup: 0
930
+ default_hdfs_dir: null
931
+ default_local_dir: /mnt/general/wanghy/RAGEN/saves/
932
+ del_local_ckpt_after_load: false
933
+ device: cuda
934
+ esi_redundant_time: 0
935
+ experiment_name: rubikscube-1-starpos-1218
936
+ generations_to_log_to_wandb:
937
+ train: 128
938
+ val: 20
939
+ local_log_dir: results/
940
+ log_val_generations: 0
941
+ logger:
942
+ - console
943
+ - wandb
944
+ max_actor_ckpt_to_keep: 1
945
+ max_critic_ckpt_to_keep: 1
946
+ n_gpus_per_node: 8
947
+ nnodes: 1
948
+ project_name: ragen_latest_qwen_05B_it
949
+ ray_wait_register_center_timeout: 300
950
+ resume_from_path: null
951
+ resume_mode: auto
952
+ rollout_data_dir: null
953
+ save_freq: -1
954
+ test_freq: 10
955
+ total_epochs: 30
956
+ total_training_steps: 200
957
+ use_legacy_worker_impl: auto
958
+ val_before_train: true
959
+ val_only: false
960
+ validation_data_dir: null
961
+ validation_steps: 1
wandb/run-20251218_190243-6eiq1qnz/files/media/table/val/generations_0_6cb7f39cae32c2b9f416.table.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"columns": ["step", "input_1", "output_1", "score_1", "input_2", "output_2", "score_2", "input_3", "output_3", "score_3", "input_4", "output_4", "score_4", "input_5", "output_5", "score_5", "input_6", "output_6", "score_6", "input_7", "output_7", "score_7", "input_8", "output_8", "score_8", "input_9", "output_9", "score_9", "input_10", "output_10", "score_10", "input_11", "output_11", "score_11", "input_12", "output_12", "score_12", "input_13", "output_13", "score_13", "input_14", "output_14", "score_14", "input_15", "output_15", "score_15", "input_16", "output_16", "score_16", "input_17", "output_17", "score_17", "input_18", "output_18", "score_18", "input_19", "output_19", "score_19", "input_20", "output_20", "score_20"], "data": [[0, "", "system\nYou're a helpful assistant. \nuser\nYou are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.\nAvailable actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.\n- Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).\n- Modifiers: A letter alone means 90\u00b0 clockwise (e.g., 'R'). A letter with prime (') means 90\u00b0 counter-clockwise (e.g., \"R'\").\nRespond with a sequence of actions separated by \"||\".\nExample: <answer>U</answer>\n\nYour available actions are:\nU, U', D, D', L, L', R, R', F, F', B, B'\nYou can make up to 20 actions, separated by the action separator \" || \"\n\nTurn 1:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, B]\n [W, B]\nLeft (L): [O, O]\n [O, O]\nFront (F): [G, W]\n [G, W]\nRight (R): [R, R]\n [R, R]\nBack (B): [Y, B]\n [Y, B]\nDown (D): [Y, G]\n [Y, G]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think> [You are about to make a move that will reverse the order of the colors on the cube.] </think> <answer> [U' || D' || L' || R' || F' || B' || L' || R' || U']\nuser\nReward:\n0.0\n\nTurn 2:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, B]\n [W, B]\nLeft (L): [O, O]\n [O, O]\nFront (F): [G, W]\n [G, W]\nRight (R): [R, R]\n [R, R]\nBack (B): [Y, B]\n [Y, B]\nDown (D): [Y, G]\n [Y, G]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think> [You are about to make a move that will reverse the order of the colors on the cube.] </think> <answer> [U' || D' || L' || R' || F' || B' || L' || R' || U']\nuser\nReward:\n0.0\n\nTurn 3:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, B]\n [W, B]\nLeft (L): [O, O]\n [O, O]\nFront (F): [G, W]\n [G, W]\nRight (R): [R, R]\n [R, R]\nBack (B): [Y, B]\n [Y, B]\nDown (D): [Y, G]\n [Y, G]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think> [You are about to make a move that will reverse the order of the colors on the cube.] </think> <answer> [U' || D' || L' || R' || F' || B' || L' || R' || U']\nuser\nReward:\n0.0\n\nTurn 4:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, B]\n [W, B]\nLeft (L): [O, O]\n [O, O]\nFront (F): [G, W]\n [G, W]\nRight (R): [R, R]\n [R, R]\nBack (B): [Y, B]\n [Y, B]\nDown (D): [Y, G]\n [Y, G]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think> [You are about to make a move that will reverse the order of the colors on the cube.] </think> <answer> [U' || D' || L' || R' || F' || B' || L' || R' || U']\nuser\nReward:\n0.0\n\nTurn 5:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, B]\n [W, B]\nLeft (L): [O, O]\n [O, O]\nFront (F): [G, W]\n [G, W]\nRight (R): [R, R]\n [R, R]\nBack (B): [Y, B]\n [Y, B]\nDown (D): [Y, G]\n [Y, G]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think> [You are about to make a move that will reverse the order of the colors on the cube.] </think> <answer> [U' || D' || L' || R' || F' || B' || L' || R' || U']\n", -2.5, "", "system\nYou're a helpful assistant. \nuser\nYou are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.\nAvailable actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.\n- Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).\n- Modifiers: A letter alone means 90\u00b0 clockwise (e.g., 'R'). A letter with prime (') means 90\u00b0 counter-clockwise (e.g., \"R'\").\nRespond with a sequence of actions separated by \"||\".\nExample: <answer>U</answer>\n\nYour available actions are:\nU, U', D, D', L, L', R, R', F, F', B, B'\nYou can make up to 20 actions, separated by the action separator \" || \"\n\nTurn 1:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 15/20\n\nUp (U): [O, W]\n [G, B]\nLeft (L): [G, Y]\n [G, Y]\nFront (F): [R, R]\n [O, O]\nRight (R): [Y, B]\n [R, B]\nBack (B): [O, R]\n [G, W]\nDown (D): [W, W]\n [B, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 5 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Perform a 90\u00b0 clockwise rotation on the right face again.</think><answer>R</answer>\nuser\nReward:\n0.0\n\nTurn 2:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 16/20\n\nUp (U): [O, R]\n [G, O]\nLeft (L): [G, Y]\n [G, Y]\nFront (F): [R, W]\n [O, Y]\nRight (R): [R, Y]\n [B, B]\nBack (B): [B, R]\n [W, W]\nDown (D): [W, G]\n [B, O]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 4 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Perform a 90\u00b0 clockwise rotation on the right face again.</think><answer>R</answer>\nuser\nReward:\n0.0\n\nTurn 3:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 17/20\n\nUp (U): [O, W]\n [G, Y]\nLeft (L): [G, Y]\n [G, Y]\nFront (F): [R, G]\n [O, O]\nRight (R): [B, R]\n [B, Y]\nBack (B): [O, R]\n [R, W]\nDown (D): [W, W]\n [B, B]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 3 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Perform a 90\u00b0 clockwise rotation on the front face again.</think><answer>F</answer>\nuser\nReward:\n0.0\n\nTurn 4:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 18/20\n\nUp (U): [O, W]\n [Y, Y]\nLeft (L): [G, W]\n [G, W]\nFront (F): [O, R]\n [O, G]\nRight (R): [G, R]\n [Y, Y]\nBack (B): [O, R]\n [R, W]\nDown (D): [B, B]\n [B, B]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 2 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Perform a 90\u00b0 clockwise rotation on the left face again.</think><answer>L</answer>\nuser\nReward:\n0.0\n\nTurn 5:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 19/20\n\nUp (U): [W, W]\n [R, Y]\nLeft (L): [G, G]\n [W, W]\nFront (F): [O, R]\n [Y, G]\nRight (R): [G, R]\n [Y, Y]\nBack (B): [O, B]\n [R, B]\nDown (D): [O, B]\n [O, B]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 1 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Perform a 90\u00b0 clockwise rotation on the back face again.</think><answer>B</answer>\n", 0.0, "", "system\nYou're a helpful assistant. \nuser\nYou are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.\nAvailable actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.\n- Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).\n- Modifiers: A letter alone means 90\u00b0 clockwise (e.g., 'R'). A letter with prime (') means 90\u00b0 counter-clockwise (e.g., \"R'\").\nRespond with a sequence of actions separated by \"||\".\nExample: <answer>U</answer>\n\nYour available actions are:\nU, U', D, D', L, L', R, R', F, F', B, B'\nYou can make up to 20 actions, separated by the action separator \" || \"\n\nTurn 1:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [O, O]\n [B, B]\nFront (F): [G, G]\n [O, O]\nRight (R): [R, R]\n [G, G]\nBack (B): [B, B]\n [R, R]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>U, U', D, D', L, L', R, R', F, F', B, B'</thep answer> U</answer>\nuser\nReward:\n0.0\n\nTurn 2:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [O, O]\n [B, B]\nFront (F): [G, G]\n [O, O]\nRight (R): [R, R]\n [G, G]\nBack (B): [B, B]\n [R, R]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>U, U', D, D', L, L', R, R', F, F', B, B'</thep answer> U</answer>\nuser\nReward:\n0.0\n\nTurn 3:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [O, O]\n [B, B]\nFront (F): [G, G]\n [O, O]\nRight (R): [R, R]\n [G, G]\nBack (B): [B, B]\n [R, R]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>U, U', D, D', L, L', R, R', F, F', B, B'</thep answer> U</answer>\nuser\nReward:\n0.0\n\nTurn 4:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [O, O]\n [B, B]\nFront (F): [G, G]\n [O, O]\nRight (R): [R, R]\n [G, G]\nBack (B): [B, B]\n [R, R]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>U, U', D, D', L, L', R, R', F, F', B, B'</thep answer> U</answer>\nuser\nReward:\n0.0\n\nTurn 5:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [O, O]\n [B, B]\nFront (F): [G, G]\n [O, O]\nRight (R): [R, R]\n [G, G]\nBack (B): [B, B]\n [R, R]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>U, U', D, D', L, L', R, R', F, F', B, B'</thep answer> U</answer>\n", -2.5, "", "system\nYou're a helpful assistant. \nuser\nYou are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.\nAvailable actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.\n- Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).\n- Modifiers: A letter alone means 90\u00b0 clockwise (e.g., 'R'). A letter with prime (') means 90\u00b0 counter-clockwise (e.g., \"R'\").\nRespond with a sequence of actions separated by \"||\".\nExample: <answer>U</answer>\n\nYour available actions are:\nU, U', D, D', L, L', R, R', F, F', B, B'\nYou can make up to 20 actions, separated by the action separator \" || \"\n\nTurn 1:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [O, O]\nLeft (L): [O, Y]\n [O, Y]\nFront (F): [G, G]\n [G, G]\nRight (R): [W, R]\n [W, R]\nBack (B): [B, B]\n [B, B]\nDown (D): [R, R]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>After performing all the steps, I have completed the puzzle.</think><answer>Congratulations! You have successfully solved the Rubik's Cube.</answer>\nuser\nReward:\n0.0\n\nTurn 2:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [O, O]\nLeft (L): [O, Y]\n [O, Y]\nFront (F): [G, G]\n [G, G]\nRight (R): [W, R]\n [W, R]\nBack (B): [B, B]\n [B, B]\nDown (D): [R, R]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>After performing all the steps, I have completed the puzzle.</think><answer>Congratulations! You have successfully solved the Rubik's Cube.</answer>\nuser\nReward:\n0.0\n\nTurn 3:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [O, O]\nLeft (L): [O, Y]\n [O, Y]\nFront (F): [G, G]\n [G, G]\nRight (R): [W, R]\n [W, R]\nBack (B): [B, B]\n [B, B]\nDown (D): [R, R]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>After performing all the steps, I have completed the puzzle.</think><answer>Congratulations! You have successfully solved the Rubik's Cube.</answer>\nuser\nReward:\n0.0\n\nTurn 4:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [O, O]\nLeft (L): [O, Y]\n [O, Y]\nFront (F): [G, G]\n [G, G]\nRight (R): [W, R]\n [W, R]\nBack (B): [B, B]\n [B, B]\nDown (D): [R, R]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>After performing all the steps, I have completed the puzzle.</think><answer>Congratulations! You have successfully solved the Rubik's Cube.</answer>\nuser\nReward:\n0.0\n\nTurn 5:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [O, O]\nLeft (L): [O, Y]\n [O, Y]\nFront (F): [G, G]\n [G, G]\nRight (R): [W, R]\n [W, R]\nBack (B): [B, B]\n [B, B]\nDown (D): [R, R]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>After performing all the steps, I have completed the puzzle.</think><answer>Congratulations! You have successfully solved the Rubik's Cube.</answer>\n", -2.5, "", "system\nYou're a helpful assistant. \nuser\nYou are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.\nAvailable actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.\n- Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).\n- Modifiers: A letter alone means 90\u00b0 clockwise (e.g., 'R'). A letter with prime (') means 90\u00b0 counter-clockwise (e.g., \"R'\").\nRespond with a sequence of actions separated by \"||\".\nExample: <answer>U</answer>\n\nYour available actions are:\nU, U', D, D', L, L', R, R', F, F', B, B'\nYou can make up to 20 actions, separated by the action separator \" || \"\n\nTurn 1:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [R, R]\n [W, W]\nLeft (L): [W, O]\n [W, O]\nFront (F): [G, G]\n [G, G]\nRight (R): [R, Y]\n [R, Y]\nBack (B): [B, B]\n [B, B]\nDown (D): [Y, Y]\n [O, O]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>[You are about to perform a 90-degree clockwise rotation on the front face.]</think><answer>[Perform a 90-degree clockwise rotation on the front face.]</answer>\nuser\nReward:\n0.0\n\nTurn 2:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [R, R]\n [W, W]\nLeft (L): [W, O]\n [W, O]\nFront (F): [G, G]\n [G, G]\nRight (R): [R, Y]\n [R, Y]\nBack (B): [B, B]\n [B, B]\nDown (D): [Y, Y]\n [O, O]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>[You are about to perform a 90-degree counter-clockwise rotation on the front face.]</think><answer>Perform a 90-degree counter-clockwise rotation on the front face.</answer>\nuser\nReward:\n0.0\n\nTurn 3:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [R, R]\n [W, W]\nLeft (L): [W, O]\n [W, O]\nFront (F): [G, G]\n [G, G]\nRight (R): [R, Y]\n [R, Y]\nBack (B): [B, B]\n [B, B]\nDown (D): [Y, Y]\n [O, O]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>[You have completed the 2x2 Rubik's Cube.]</think><answer>Congratulations! You have successfully restored the 2x2 Rubik's Cube to a single, unique color.</answer>\nuser\nReward:\n0.0\n\nTurn 4:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [R, R]\n [W, W]\nLeft (L): [W, O]\n [W, O]\nFront (F): [G, G]\n [G, G]\nRight (R): [R, Y]\n [R, Y]\nBack (B): [B, B]\n [B, B]\nDown (D): [Y, Y]\n [O, O]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>[You have completed the 2x2 Rubik's Cube.]</think><answer>Congratulations! You have successfully restored the 2x2 Rubik's Cube to a single, unique color.</answer>\nuser\nReward:\n0.0\n\nTurn 5:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [R, R]\n [W, W]\nLeft (L): [W, O]\n [W, O]\nFront (F): [G, G]\n [G, G]\nRight (R): [R, Y]\n [R, Y]\nBack (B): [B, B]\n [B, B]\nDown (D): [Y, Y]\n [O, O]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>[You have completed the 2x2 Rubik's Cube.]</think><answer>Congratulations! You have successfully restored the 2x2 Rubik's Cube to a single, unique color.</answer>\n", -2.5, "", "system\nYou're a helpful assistant. \nuser\nYou are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.\nAvailable actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.\n- Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).\n- Modifiers: A letter alone means 90\u00b0 clockwise (e.g., 'R'). A letter with prime (') means 90\u00b0 counter-clockwise (e.g., \"R'\").\nRespond with a sequence of actions separated by \"||\".\nExample: <answer>U</answer>\n\nYour available actions are:\nU, U', D, D', L, L', R, R', F, F', B, B'\nYou can make up to 20 actions, separated by the action separator \" || \"\n\nTurn 1:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 15/20\n\nUp (U): [B, R]\n [W, R]\nLeft (L): [Y, B]\n [Y, B]\nFront (F): [O, B]\n [O, W]\nRight (R): [W, W]\n [G, G]\nBack (B): [G, R]\n [Y, R]\nDown (D): [Y, O]\n [G, O]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 5 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Make 2 face rotations to restore the bottom face.</think><answer>R</answer>\nuser\nReward:\n0.0\n\nTurn 2:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 16/20\n\nUp (U): [B, B]\n [W, W]\nLeft (L): [Y, B]\n [Y, B]\nFront (F): [O, O]\n [O, O]\nRight (R): [G, W]\n [G, W]\nBack (B): [R, R]\n [R, R]\nDown (D): [Y, Y]\n [G, G]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 4 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Make 2 face rotations to restore the bottom face.</think><answer>R</answer>\nuser\nReward:\n0.0\n\nTurn 3:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 17/20\n\nUp (U): [B, O]\n [W, O]\nLeft (L): [Y, B]\n [Y, B]\nFront (F): [O, Y]\n [O, G]\nRight (R): [G, G]\n [W, W]\nBack (B): [W, R]\n [B, R]\nDown (D): [Y, R]\n [G, R]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 3 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Make 2 face rotations to restore the bottom face.</think><answer>R</answer>\nuser\nReward:\n0.0\n\nTurn 4:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 18/20\n\nUp (U): [B, Y]\n [W, G]\nLeft (L): [Y, B]\n [Y, B]\nFront (F): [O, R]\n [O, R]\nRight (R): [W, G]\n [W, G]\nBack (B): [O, R]\n [O, R]\nDown (D): [Y, B]\n [G, W]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 2 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Make 2 face rotations to restore the bottom face.</think><answer>R</answer>\nuser\nReward:\n0.0\n\nTurn 5:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 19/20\n\nUp (U): [B, R]\n [W, R]\nLeft (L): [Y, B]\n [Y, B]\nFront (F): [O, B]\n [O, W]\nRight (R): [W, W]\n [G, G]\nBack (B): [G, R]\n [Y, R]\nDown (D): [Y, O]\n [G, O]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 1 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Make 2 face rotations to restore the bottom face.</think><answer>R</answer>\n", 0.0, "", "system\nYou're a helpful assistant. \nuser\nYou are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.\nAvailable actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.\n- Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).\n- Modifiers: A letter alone means 90\u00b0 clockwise (e.g., 'R'). A letter with prime (') means 90\u00b0 counter-clockwise (e.g., \"R'\").\nRespond with a sequence of actions separated by \"||\".\nExample: <answer>U</answer>\n\nYour available actions are:\nU, U', D, D', L, L', R, R', F, F', B, B'\nYou can make up to 20 actions, separated by the action separator \" || \"\n\nTurn 1:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [B, B]\n [O, O]\nFront (F): [O, O]\n [G, G]\nRight (R): [G, G]\n [R, R]\nBack (B): [R, R]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>[This is the initial state of the Rubik's Cube.]</think><answer>[U]</answer>\nuser\nReward:\n0.0\n\nTurn 2:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [B, B]\n [O, O]\nFront (F): [O, O]\n [G, G]\nRight (R): [G, G]\n [R, R]\nBack (B): [R, R]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>[The cube is already solved.]</think><answer>[No move needed.]</answer>\nuser\nReward:\n0.0\n\nTurn 3:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [B, B]\n [O, O]\nFront (F): [O, O]\n [G, G]\nRight (R): [G, G]\n [R, R]\nBack (B): [R, R]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>[The cube is already solved.]</think><answer>[No move needed.]</answer>\nuser\nReward:\n0.0\n\nTurn 4:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [B, B]\n [O, O]\nFront (F): [O, O]\n [G, G]\nRight (R): [G, G]\n [R, R]\nBack (B): [R, R]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>[This is the initial state of the Rubik's Cube.]</think><answer>[No move needed.]</answer>\nuser\nReward:\n0.0\n\nTurn 5:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [B, B]\n [O, O]\nFront (F): [O, O]\n [G, G]\nRight (R): [G, G]\n [R, R]\nBack (B): [R, R]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>U</think><answer>U</answer>\n", 0.6000000238418579, "", "system\nYou're a helpful assistant. \nuser\nYou are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.\nAvailable actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.\n- Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).\n- Modifiers: A letter alone means 90\u00b0 clockwise (e.g., 'R'). A letter with prime (') means 90\u00b0 counter-clockwise (e.g., \"R'\").\nRespond with a sequence of actions separated by \"||\".\nExample: <answer>U</answer>\n\nYour available actions are:\nU, U', D, D', L, L', R, R', F, F', B, B'\nYou can make up to 20 actions, separated by the action separator \" || \"\n\nTurn 1:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [O, O]\n [G, G]\nFront (F): [G, G]\n [R, R]\nRight (R): [R, R]\n [B, B]\nBack (B): [B, B]\n [O, O]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Rotate the center face clockwise to U''</think><answer>U''</answer>\nuser\nReward:\n0.0\n\nTurn 2:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [O, O]\n [G, G]\nFront (F): [G, G]\n [R, R]\nRight (R): [R, R]\n [B, B]\nBack (B): [B, B]\n [O, O]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Rotate the center face clockwise to U''</think><answer>U''</answer>\nuser\nReward:\n0.0\n\nTurn 3:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [O, O]\n [G, G]\nFront (F): [G, G]\n [R, R]\nRight (R): [R, R]\n [B, B]\nBack (B): [B, B]\n [O, O]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Rotate the center face clockwise to U''</think><answer>U''</answer>\nuser\nReward:\n0.0\n\nTurn 4:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [O, O]\n [G, G]\nFront (F): [G, G]\n [R, R]\nRight (R): [R, R]\n [B, B]\nBack (B): [B, B]\n [O, O]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Rotate the center face clockwise to U''</think><answer>U''</answer>\nuser\nReward:\n0.0\n\nTurn 5:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [O, O]\n [G, G]\nFront (F): [G, G]\n [R, R]\nRight (R): [R, R]\n [B, B]\nBack (B): [B, B]\n [O, O]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Rotate the center face clockwise to U''</think><answer>U''</answer>\n", -2.5, "", "system\nYou're a helpful assistant. \nuser\nYou are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.\nAvailable actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.\n- Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).\n- Modifiers: A letter alone means 90\u00b0 clockwise (e.g., 'R'). A letter with prime (') means 90\u00b0 counter-clockwise (e.g., \"R'\").\nRespond with a sequence of actions separated by \"||\".\nExample: <answer>U</answer>\n\nYour available actions are:\nU, U', D, D', L, L', R, R', F, F', B, B'\nYou can make up to 20 actions, separated by the action separator \" || \"\n\nTurn 1:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 15/20\n\nUp (U): [R, W]\n [R, W]\nLeft (L): [B, B]\n [W, O]\nFront (F): [W, O]\n [G, G]\nRight (R): [G, G]\n [R, Y]\nBack (B): [R, Y]\n [B, B]\nDown (D): [Y, Y]\n [O, O]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 5 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Aligning the top face with the bottom face will help us solve the cube.</think><answer>U</answer>\nuser\nReward:\n0.0\n\nTurn 2:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 16/20\n\nUp (U): [R, R]\n [W, W]\nLeft (L): [W, O]\n [W, O]\nFront (F): [G, G]\n [G, G]\nRight (R): [R, Y]\n [R, Y]\nBack (B): [B, B]\n [B, B]\nDown (D): [Y, Y]\n [O, O]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 4 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Aligning the top face with the bottom face will help us solve the cube.</think><answer>U</answer>\nuser\nReward:\n0.0\n\nTurn 3:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 17/20\n\nUp (U): [W, R]\n [W, R]\nLeft (L): [G, G]\n [W, O]\nFront (F): [R, Y]\n [G, G]\nRight (R): [B, B]\n [R, Y]\nBack (B): [W, O]\n [B, B]\nDown (D): [Y, Y]\n [O, O]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 3 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Aligning the top face with the bottom face will help us solve the cube.</think><answer>U</answer>\nuser\nReward:\n0.0\n\nTurn 4:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 18/20\n\nUp (U): [W, W]\n [R, R]\nLeft (L): [R, Y]\n [W, O]\nFront (F): [B, B]\n [G, G]\nRight (R): [W, O]\n [R, Y]\nBack (B): [G, G]\n [B, B]\nDown (D): [Y, Y]\n [O, O]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 2 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Aligning the top face with the bottom face will help us solve the cube.</think><answer>U</answer>\nuser\nReward:\n0.0\n\nTurn 5:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 19/20\n\nUp (U): [R, W]\n [R, W]\nLeft (L): [B, B]\n [W, O]\nFront (F): [W, O]\n [G, G]\nRight (R): [G, G]\n [R, Y]\nBack (B): [R, Y]\n [B, B]\nDown (D): [Y, Y]\n [O, O]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 1 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Aligning the top face with the bottom face will help us solve the cube.</think><answer>U</answer>\n", 0.0, "", "system\nYou're a helpful assistant. \nuser\nYou are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.\nAvailable actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.\n- Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).\n- Modifiers: A letter alone means 90\u00b0 clockwise (e.g., 'R'). A letter with prime (') means 90\u00b0 counter-clockwise (e.g., \"R'\").\nRespond with a sequence of actions separated by \"||\".\nExample: <answer>U</answer>\n\nYour available actions are:\nU, U', D, D', L, L', R, R', F, F', B, B'\nYou can make up to 20 actions, separated by the action separator \" || \"\n\nTurn 1:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 13/20\n\nUp (U): [O, W]\n [O, W]\nLeft (L): [G, G]\n [O, Y]\nFront (F): [W, R]\n [G, G]\nRight (R): [B, B]\n [W, R]\nBack (B): [O, Y]\n [B, B]\nDown (D): [R, R]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 7 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>U</think><answer>U</answer>\nuser\nReward:\n0.0\n\nTurn 2:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 14/20\n\nUp (U): [O, O]\n [W, W]\nLeft (L): [W, R]\n [O, Y]\nFront (F): [B, B]\n [G, G]\nRight (R): [O, Y]\n [W, R]\nBack (B): [G, G]\n [B, B]\nDown (D): [R, R]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 6 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>U</think><answer>U</answer>\nuser\nReward:\n0.0\n\nTurn 3:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 15/20\n\nUp (U): [W, O]\n [W, O]\nLeft (L): [B, B]\n [O, Y]\nFront (F): [O, Y]\n [G, G]\nRight (R): [G, G]\n [W, R]\nBack (B): [W, R]\n [B, B]\nDown (D): [R, R]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 5 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>U</think><answer>U</answer>\nuser\nReward:\n0.0\n\nTurn 4:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 16/20\n\nUp (U): [W, W]\n [O, O]\nLeft (L): [O, Y]\n [O, Y]\nFront (F): [G, G]\n [G, G]\nRight (R): [W, R]\n [W, R]\nBack (B): [B, B]\n [B, B]\nDown (D): [R, R]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 4 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>U</think><answer>U</answer>\nuser\nReward:\n0.0\n\nTurn 5:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 17/20\n\nUp (U): [O, W]\n [O, W]\nLeft (L): [G, G]\n [O, Y]\nFront (F): [W, R]\n [G, G]\nRight (R): [B, B]\n [W, R]\nBack (B): [O, Y]\n [B, B]\nDown (D): [R, R]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 3 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>U</think><answer>U</answer>\n", -0.699999988079071, "", "system\nYou're a helpful assistant. \nuser\nYou are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.\nAvailable actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.\n- Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).\n- Modifiers: A letter alone means 90\u00b0 clockwise (e.g., 'R'). A letter with prime (') means 90\u00b0 counter-clockwise (e.g., \"R'\").\nRespond with a sequence of actions separated by \"||\".\nExample: <answer>U</answer>\n\nYour available actions are:\nU, U', D, D', L, L', R, R', F, F', B, B'\nYou can make up to 20 actions, separated by the action separator \" || \"\n\nTurn 1:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 15/20\n\nUp (U): [B, W]\n [B, W]\nLeft (L): [O, O]\n [B, Y]\nFront (F): [W, G]\n [O, O]\nRight (R): [R, R]\n [W, G]\nBack (B): [B, Y]\n [R, R]\nDown (D): [G, G]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 5 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Now I need to solve the bottom layer again. I can use U to move the bottom layer to the top layer.</think><answer>U</answer>\nuser\nReward:\n0.0\n\nTurn 2:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 16/20\n\nUp (U): [B, B]\n [W, W]\nLeft (L): [W, G]\n [B, Y]\nFront (F): [R, R]\n [O, O]\nRight (R): [B, Y]\n [W, G]\nBack (B): [O, O]\n [R, R]\nDown (D): [G, G]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 4 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Now I need to solve the bottom layer again. I can use U to move the bottom layer to the top layer.</think><answer>U</answer>\nuser\nReward:\n0.0\n\nTurn 3:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 17/20\n\nUp (U): [W, B]\n [W, B]\nLeft (L): [R, R]\n [B, Y]\nFront (F): [B, Y]\n [O, O]\nRight (R): [O, O]\n [W, G]\nBack (B): [W, G]\n [R, R]\nDown (D): [G, G]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 3 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Now I need to solve the bottom layer again. I can use U to move the bottom layer to the top layer.</think><answer>U</answer>\nuser\nReward:\n0.0\n\nTurn 4:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 18/20\n\nUp (U): [W, W]\n [B, B]\nLeft (L): [B, Y]\n [B, Y]\nFront (F): [O, O]\n [O, O]\nRight (R): [W, G]\n [W, G]\nBack (B): [R, R]\n [R, R]\nDown (D): [G, G]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 2 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Now I need to solve the bottom layer again. I can use U to move the bottom layer to the top layer.</think><answer>U</answer>\nuser\nReward:\n0.0\n\nTurn 5:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 19/20\n\nUp (U): [B, W]\n [B, W]\nLeft (L): [O, O]\n [B, Y]\nFront (F): [W, G]\n [O, O]\nRight (R): [R, R]\n [W, G]\nBack (B): [B, Y]\n [R, R]\nDown (D): [G, G]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 1 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Now I need to solve the bottom layer again. I can use U to move the bottom layer to the top layer.</think><answer>U</answer>\n", 0.0, "", "system\nYou're a helpful assistant. \nuser\nYou are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.\nAvailable actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.\n- Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).\n- Modifiers: A letter alone means 90\u00b0 clockwise (e.g., 'R'). A letter with prime (') means 90\u00b0 counter-clockwise (e.g., \"R'\").\nRespond with a sequence of actions separated by \"||\".\nExample: <answer>U</answer>\n\nYour available actions are:\nU, U', D, D', L, L', R, R', F, F', B, B'\nYou can make up to 20 actions, separated by the action separator \" || \"\n\nTurn 1:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [O, O]\n [G, G]\nFront (F): [G, G]\n [R, R]\nRight (R): [R, R]\n [B, B]\nBack (B): [B, B]\n [O, O]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>[You have completed the 2x2 Rubik's Cube.]</think><answer>[Congratulations! You have solved the 2x2 Rubik's Cube.]</answer>\nuser\nReward:\n0.0\n\nTurn 2:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [O, O]\n [G, G]\nFront (F): [G, G]\n [R, R]\nRight (R): [R, R]\n [B, B]\nBack (B): [B, B]\n [O, O]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>[You have completed the 2x2 Rubik's Cube.]</think><answer>[Congratulations! You have solved the 2x2 Rubik's Cube.]</answer>\nuser\nReward:\n0.0\n\nTurn 3:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [O, O]\n [G, G]\nFront (F): [G, G]\n [R, R]\nRight (R): [R, R]\n [B, B]\nBack (B): [B, B]\n [O, O]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>[You have completed the 2x2 Rubik's Cube.]</think><answer>[Congratulations! You have solved the 2x2 Rubik's Cube.]</answer>\nuser\nReward:\n0.0\n\nTurn 4:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [O, O]\n [G, G]\nFront (F): [G, G]\n [R, R]\nRight (R): [R, R]\n [B, B]\nBack (B): [B, B]\n [O, O]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>[You have completed the 2x2 Rubik's Cube.]</think><answer>[Congratulations! You have solved the 2x2 Rubik's Cube.]</answer>\nuser\nReward:\n0.0\n\nTurn 5:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [O, O]\n [G, G]\nFront (F): [G, G]\n [R, R]\nRight (R): [R, R]\n [B, B]\nBack (B): [B, B]\n [O, O]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>[You have completed the 2x2 Rubik's Cube.]</think><answer>[Congratulations! You have solved the 2x2 Rubik's Cube.]</answer>\n", -2.5, "", "system\nYou're a helpful assistant. \nuser\nYou are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.\nAvailable actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.\n- Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).\n- Modifiers: A letter alone means 90\u00b0 clockwise (e.g., 'R'). A letter with prime (') means 90\u00b0 counter-clockwise (e.g., \"R'\").\nRespond with a sequence of actions separated by \"||\".\nExample: <answer>U</answer>\n\nYour available actions are:\nU, U', D, D', L, L', R, R', F, F', B, B'\nYou can make up to 20 actions, separated by the action separator \" || \"\n\nTurn 1:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 4/20\n\nUp (U): [R, R]\n [G, G]\nLeft (L): [G, O]\n [G, O]\nFront (F): [Y, W]\n [Y, W]\nRight (R): [O, B]\n [O, B]\nBack (B): [W, W]\n [Y, Y]\nDown (D): [B, B]\n [R, R]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 16 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Perform a 90\u00b0 counter-clockwise rotation on the right face again.</think><answer>R\"</answer>\nuser\nReward:\n0.0\n\nTurn 2:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 4/20\n\nUp (U): [R, R]\n [G, G]\nLeft (L): [G, O]\n [G, O]\nFront (F): [Y, W]\n [Y, W]\nRight (R): [O, B]\n [O, B]\nBack (B): [W, W]\n [Y, Y]\nDown (D): [B, B]\n [R, R]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 16 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Perform a 90\u00b0 counter-clockwise rotation on the right face again.</think><answer>R\"</answer>\nuser\nReward:\n0.0\n\nTurn 3:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 4/20\n\nUp (U): [R, R]\n [G, G]\nLeft (L): [G, O]\n [G, O]\nFront (F): [Y, W]\n [Y, W]\nRight (R): [O, B]\n [O, B]\nBack (B): [W, W]\n [Y, Y]\nDown (D): [B, B]\n [R, R]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 16 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Perform a 90\u00b0 counter-clockwise rotation on the right face again.</think><answer>R\"</answer>\nuser\nReward:\n0.0\n\nTurn 4:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 4/20\n\nUp (U): [R, R]\n [G, G]\nLeft (L): [G, O]\n [G, O]\nFront (F): [Y, W]\n [Y, W]\nRight (R): [O, B]\n [O, B]\nBack (B): [W, W]\n [Y, Y]\nDown (D): [B, B]\n [R, R]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 16 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Perform a 90\u00b0 counter-clockwise rotation on the right face again.</think><answer>R\"</answer>\nuser\nReward:\n0.0\n\nTurn 5:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 4/20\n\nUp (U): [R, R]\n [G, G]\nLeft (L): [G, O]\n [G, O]\nFront (F): [Y, W]\n [Y, W]\nRight (R): [O, B]\n [O, B]\nBack (B): [W, W]\n [Y, Y]\nDown (D): [B, B]\n [R, R]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 16 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Perform a 90\u00b0 counter-clockwise rotation on the right face again.</think><answer>R\"</answer>\n", -2.0999999046325684, "", "system\nYou're a helpful assistant. \nuser\nYou are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.\nAvailable actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.\n- Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).\n- Modifiers: A letter alone means 90\u00b0 clockwise (e.g., 'R'). A letter with prime (') means 90\u00b0 counter-clockwise (e.g., \"R'\").\nRespond with a sequence of actions separated by \"||\".\nExample: <answer>U</answer>\n\nYour available actions are:\nU, U', D, D', L, L', R, R', F, F', B, B'\nYou can make up to 20 actions, separated by the action separator \" || \"\n\nTurn 1:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [G, G]\n [O, O]\nFront (F): [R, R]\n [G, G]\nRight (R): [B, B]\n [R, R]\nBack (B): [O, O]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Make a face rotation to align the middle and left faces again.</think><answer>U, U', D, D', L, L', R, R', F, F', B, B'</answer>\nuser\nReward:\n0.0\n\nTurn 2:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [G, G]\n [O, O]\nFront (F): [R, R]\n [G, G]\nRight (R): [B, B]\n [R, R]\nBack (B): [O, O]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Make a face rotation to align the middle and right faces again.</think><answer>U, U', D, D', L, L', R, R', F, F', B, B'</answer>\nuser\nReward:\n0.0\n\nTurn 3:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [G, G]\n [O, O]\nFront (F): [R, R]\n [G, G]\nRight (R): [B, B]\n [R, R]\nBack (B): [O, O]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Make a face rotation to align the middle and top faces again.</think><answer>U, U', D, D', L, L', R, R', F, F', B, B'</answer>\nuser\nReward:\n0.0\n\nTurn 4:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [G, G]\n [O, O]\nFront (F): [R, R]\n [G, G]\nRight (R): [B, B]\n [R, R]\nBack (B): [O, O]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Make a face rotation to align the middle and bottom faces again.</think><answer>U, U', D, D', L, L', R, R', F, F', B, B'</answer>\nuser\nReward:\n0.0\n\nTurn 5:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [G, G]\n [O, O]\nFront (F): [R, R]\n [G, G]\nRight (R): [B, B]\n [R, R]\nBack (B): [O, O]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Make a face rotation to align the middle and left faces again.</think><answer>U, U', D, D', L, L', R, R', F, F', B, B'</answer>\n", -2.5, "", "system\nYou're a helpful assistant. \nuser\nYou are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.\nAvailable actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.\n- Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).\n- Modifiers: A letter alone means 90\u00b0 clockwise (e.g., 'R'). A letter with prime (') means 90\u00b0 counter-clockwise (e.g., \"R'\").\nRespond with a sequence of actions separated by \"||\".\nExample: <answer>U</answer>\n\nYour available actions are:\nU, U', D, D', L, L', R, R', F, F', B, B'\nYou can make up to 20 actions, separated by the action separator \" || \"\n\nTurn 1:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [O, O]\n [B, B]\nFront (F): [G, G]\n [O, O]\nRight (R): [R, R]\n [G, G]\nBack (B): [B, B]\n [R, R]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>[The cube is already in the correct orientation.]</think><answer>[No action needed.]</answer>\nuser\nReward:\n0.0\n\nTurn 2:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [O, O]\n [B, B]\nFront (F): [G, G]\n [O, O]\nRight (R): [R, R]\n [G, G]\nBack (B): [B, B]\n [R, R]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>[The cube is already in the correct orientation.]</think><answer>[No action needed.]</answer>\nuser\nReward:\n0.0\n\nTurn 3:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [O, O]\n [B, B]\nFront (F): [G, G]\n [O, O]\nRight (R): [R, R]\n [G, G]\nBack (B): [B, B]\n [R, R]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>U</think><answer>U</answer>\nuser\nReward:\n0.0\n\nTurn 4:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 1/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [G, G]\n [B, B]\nFront (F): [R, R]\n [O, O]\nRight (R): [B, B]\n [G, G]\nBack (B): [O, O]\n [R, R]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 19 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>U</think><answer>U</answer>\nuser\nReward:\n0.0\n\nTurn 5:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 2/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [R, R]\n [B, B]\nFront (F): [B, B]\n [O, O]\nRight (R): [O, O]\n [G, G]\nBack (B): [G, G]\n [R, R]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 18 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>U</think><answer>U</answer>\n", 0.800000011920929, "", "system\nYou're a helpful assistant. \nuser\nYou are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.\nAvailable actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.\n- Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).\n- Modifiers: A letter alone means 90\u00b0 clockwise (e.g., 'R'). A letter with prime (') means 90\u00b0 counter-clockwise (e.g., \"R'\").\nRespond with a sequence of actions separated by \"||\".\nExample: <answer>U</answer>\n\nYour available actions are:\nU, U', D, D', L, L', R, R', F, F', B, B'\nYou can make up to 20 actions, separated by the action separator \" || \"\n\nTurn 1:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [B, B]\n [O, O]\nFront (F): [O, O]\n [G, G]\nRight (R): [G, G]\n [R, R]\nBack (B): [R, R]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>[You are about to make a move that will reverse the order of the colors on the cube.]</think><answer>[U]</answer>\nuser\nReward:\n0.0\n\nTurn 2:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [B, B]\n [O, O]\nFront (F): [O, O]\n [G, G]\nRight (R): [G, G]\n [R, R]\nBack (B): [R, R]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>[You are about to make a move that will reverse the order of the colors on the cube.]</think><answer>[U]</answer>\nuser\nReward:\n0.0\n\nTurn 3:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [B, B]\n [O, O]\nFront (F): [O, O]\n [G, G]\nRight (R): [G, G]\n [R, R]\nBack (B): [R, R]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>[You are about to reverse the order of the colors on the cube.]</think><answer>[U]</answer>\nuser\nReward:\n0.0\n\nTurn 4:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [B, B]\n [O, O]\nFront (F): [O, O]\n [G, G]\nRight (R): [G, G]\n [R, R]\nBack (B): [R, R]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>[U]</think><answer>[U]</answer>\nuser\nReward:\n0.0\n\nTurn 5:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [B, B]\n [O, O]\nFront (F): [O, O]\n [G, G]\nRight (R): [G, G]\n [R, R]\nBack (B): [R, R]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>U</think><answer>U</answer>\n", 0.10000002384185791, "", "system\nYou're a helpful assistant. \nuser\nYou are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.\nAvailable actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.\n- Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).\n- Modifiers: A letter alone means 90\u00b0 clockwise (e.g., 'R'). A letter with prime (') means 90\u00b0 counter-clockwise (e.g., \"R'\").\nRespond with a sequence of actions separated by \"||\".\nExample: <answer>U</answer>\n\nYour available actions are:\nU, U', D, D', L, L', R, R', F, F', B, B'\nYou can make up to 20 actions, separated by the action separator \" || \"\n\nTurn 1:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [B, B]\n [O, O]\nFront (F): [O, O]\n [G, G]\nRight (R): [G, G]\n [R, R]\nBack (B): [R, R]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Rotate the top left face clockwise to U''</think><answer>U''</answer>\nuser\nReward:\n0.0\n\nTurn 2:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [B, B]\n [O, O]\nFront (F): [O, O]\n [G, G]\nRight (R): [G, G]\n [R, R]\nBack (B): [R, R]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Rotate the top right face clockwise to U''</think><answer>U''</answer>\nuser\nReward:\n0.0\n\nTurn 3:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [B, B]\n [O, O]\nFront (F): [O, O]\n [G, G]\nRight (R): [G, G]\n [R, R]\nBack (B): [R, R]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Rotate the bottom right face clockwise to U''</think><answer>U''</answer>\nuser\nReward:\n0.0\n\nTurn 4:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [B, B]\n [O, O]\nFront (F): [O, O]\n [G, G]\nRight (R): [G, G]\n [R, R]\nBack (B): [R, R]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Rotate the bottom left face clockwise to U''</think><answer>U''</answer>\nuser\nReward:\n0.0\n\nTurn 5:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [B, B]\n [O, O]\nFront (F): [O, O]\n [G, G]\nRight (R): [G, G]\n [R, R]\nBack (B): [R, R]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Rotate the top face clockwise to U</think><answer>U</answer>\n", -0.10000002384185791, "", "system\nYou're a helpful assistant. \nuser\nYou are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.\nAvailable actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.\n- Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).\n- Modifiers: A letter alone means 90\u00b0 clockwise (e.g., 'R'). A letter with prime (') means 90\u00b0 counter-clockwise (e.g., \"R'\").\nRespond with a sequence of actions separated by \"||\".\nExample: <answer>U</answer>\n\nYour available actions are:\nU, U', D, D', L, L', R, R', F, F', B, B'\nYou can make up to 20 actions, separated by the action separator \" || \"\n\nTurn 1:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, B]\n [W, B]\nLeft (L): [O, O]\n [O, O]\nFront (F): [G, W]\n [G, W]\nRight (R): [R, R]\n [R, R]\nBack (B): [Y, B]\n [Y, B]\nDown (D): [Y, G]\n [Y, G]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think> [You are about to make a move that will disrupt the normal order of the cube. This move will cause the cube to rotate and create a pattern that will make it impossible to restore the cube. You need to find a way to restore the cube while keeping the faces identical. Consider using a clockwise rotation of the cube to achieve this. ] </think> <answer> [U, U', D, D', L, L', R, R', F, F', B, B']\nuser\nReward:\n0.0\n\nTurn 2:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, B]\n [W, B]\nLeft (L): [O, O]\n [O, O]\nFront (F): [G, W]\n [G, W]\nRight (R): [R, R]\n [R, R]\nBack (B): [Y, B]\n [Y, B]\nDown (D): [Y, G]\n [Y, G]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think> [You are about to make a move that will disrupt the normal order of the cube. This move will cause the cube to rotate and create a pattern that will make it impossible to restore the cube. You need to find a way to restore the cube while keeping the faces identical. Consider using a clockwise rotation of the cube to achieve this. ] </think> <answer> [U, U', D, D', L, L', R, R', F, F', B, B']\nuser\nReward:\n0.0\n\nTurn 3:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, B]\n [W, B]\nLeft (L): [O, O]\n [O, O]\nFront (F): [G, W]\n [G, W]\nRight (R): [R, R]\n [R, R]\nBack (B): [Y, B]\n [Y, B]\nDown (D): [Y, G]\n [Y, G]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think> [You are about to make a move that will disrupt the normal order of the cube. This move will cause the cube to rotate and create a pattern that will make it impossible to restore the cube. You need to find a way to restore the cube while keeping the faces identical. Consider using a clockwise rotation of the cube to achieve this. ] </think> <answer> [U, U', D, D', L, L', R, R', F, F', B, B']\nuser\nReward:\n0.0\n\nTurn 4:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, B]\n [W, B]\nLeft (L): [O, O]\n [O, O]\nFront (F): [G, W]\n [G, W]\nRight (R): [R, R]\n [R, R]\nBack (B): [Y, B]\n [Y, B]\nDown (D): [Y, G]\n [Y, G]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think> [You are about to make a move that will disrupt the normal order of the cube. This move will cause the cube to rotate and create a pattern that will make it impossible to restore the cube. You need to find a way to restore the cube while keeping the faces identical. Consider using a clockwise rotation of the cube to achieve this. ] </think> <answer> [U, U', D, D', L, L', R, R', F, F', B, B']\nuser\nReward:\n0.0\n\nTurn 5:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, B]\n [W, B]\nLeft (L): [O, O]\n [O, O]\nFront (F): [G, W]\n [G, W]\nRight (R): [R, R]\n [R, R]\nBack (B): [Y, B]\n [Y, B]\nDown (D): [Y, G]\n [Y, G]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think> [You are about to make a move that will disrupt the normal order of the cube. This move will cause the cube to rotate and create a pattern that will make it impossible to restore the cube. You need to find a way to restore the cube while keeping the faces identical. Consider using a clockwise rotation of the cube to achieve this. ] </think> <answer> [U, U', D, D', L, L', R, R', F, F', B, B']\n", -2.5, "", "system\nYou're a helpful assistant. \nuser\nYou are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.\nAvailable actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.\n- Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).\n- Modifiers: A letter alone means 90\u00b0 clockwise (e.g., 'R'). A letter with prime (') means 90\u00b0 counter-clockwise (e.g., \"R'\").\nRespond with a sequence of actions separated by \"||\".\nExample: <answer>U</answer>\n\nYour available actions are:\nU, U', D, D', L, L', R, R', F, F', B, B'\nYou can make up to 20 actions, separated by the action separator \" || \"\n\nTurn 1:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [B, B]\n [O, O]\nFront (F): [O, O]\n [G, G]\nRight (R): [G, G]\n [R, R]\nBack (B): [R, R]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>After U, U', D, D', L, L', R, R', F, F', B, B', the cube is upside down and faces are reversed. This is the first move.</think><answer>U</answer>\n", 1.0, "", "system\nYou're a helpful assistant. \nuser\nYou are solving a 2x2 Rubik's Cube (Pocket Cube). The goal is to restore the cube so that each of the faces consists of a single, unique color.\nAvailable actions use standard Singmaster notation for face rotations: U, U', D, D', L, L', R, R', F, F', B, B'.\n- Faces: U (Up), D (Down), L (Left), R (Right), F (Front), B (Back).\n- Modifiers: A letter alone means 90\u00b0 clockwise (e.g., 'R'). A letter with prime (') means 90\u00b0 counter-clockwise (e.g., \"R'\").\nRespond with a sequence of actions separated by \"||\".\nExample: <answer>U</answer>\n\nYour available actions are:\nU, U', D, D', L, L', R, R', F, F', B, B'\nYou can make up to 20 actions, separated by the action separator \" || \"\n\nTurn 1:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 0/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [G, G]\n [O, O]\nFront (F): [R, R]\n [G, G]\nRight (R): [B, B]\n [R, R]\nBack (B): [O, O]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 20 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>You can use the following actions to solve the Rubik's Cube: U, U', D, D', L, L', R, R', F, F', B, B'</think><answer>U</answer>\nuser\nReward:\n0.0\n\nTurn 2:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 1/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [R, R]\n [O, O]\nFront (F): [B, B]\n [G, G]\nRight (R): [O, O]\n [R, R]\nBack (B): [G, G]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 19 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Using the available actions: U, U', D, D', L, L', R, R', F, F', B, B'</think><answer>U</answer>\nuser\nReward:\n0.0\n\nTurn 3:\nState:\n=== Rubik's Cube 2x2 State ===\nStep: 2/20\n\nUp (U): [W, W]\n [W, W]\nLeft (L): [B, B]\n [O, O]\nFront (F): [O, O]\n [G, G]\nRight (R): [G, G]\n [R, R]\nBack (B): [R, R]\n [B, B]\nDown (D): [Y, Y]\n [Y, Y]\n\nAvailable Actions:\nU, U', D, D', L, L', R, R', F, F', B, B'\n\nWhat is your next move?\nYou have 18 actions left. Always output: <think> [Your thoughts] </think> <answer> [your answer] </answer> with no extra text. Strictly follow this format. Max response length: 96 words (tokens).\n\nassistant\n<think>Using the available actions: U, U', D, D', L, L', R, R', F, F', B, B'</think><answer>U</answer>\n", 1.0]]}
wandb/run-20251218_190243-6eiq1qnz/files/media/table/val/generations_109_6afe86429a1aeaa2828a.table.json ADDED
The diff for this file is too large to render. See raw diff
 
wandb/run-20251218_190243-6eiq1qnz/files/media/table/val/generations_119_e2ca09a14d71e17c86dd.table.json ADDED
The diff for this file is too large to render. See raw diff
 
wandb/run-20251218_190243-6eiq1qnz/files/media/table/val/generations_129_8ccea2d2f61887ccb050.table.json ADDED
The diff for this file is too large to render. See raw diff