Views
No views yet
ac2. Checkpoint saved
after training step 19 (0-indexed). Strict upstream eval parity:
1100s hard kill, verbatim prompts/entrypoints, group 64x8, T=1.0, kl 0.1.1{
2 "step": 19,
3 "progress/batch": 19,
4 "optim/lr": 4e-05,
5 "progress/done_frac": 0.4,
6 "puct/buffer_size": 311,
7 "puct/sampled_size": 8,
8 "puct/T": 9728,
9 "puct/scale_last": 0.43876354831682207,
10 "puct/buffer_value/mean": 0.9243399551905709,
11 "puct/buffer_value/std": 0.05245176406616932,
12 "puct/buffer_value/min": 0.5041471954736918,
13 "puct/buffer_value/max": 0.9429107437905139,
14 "puct/buffer_timestep/mean": 8.717041800643086,
15 "puct/buffer_timestep/std": 5.622388548063089,
16 "puct/buffer_timestep/min": -1.0,
17 "puct/buffer_timestep/max": 18.0,
18 "puct/buffer_construction_len/mean": 2608.636655948553,
19 "puct/buffer_construction_len/std": 2476.3643755946373,
20 "puct/buffer_construction_len/min": 1024.0,
21 "puct/buffer_construction_len/max": 32768.0,
22 "puct/sampled_value/mean": 0.9427751537362545,
23 "puct/sampled_value/std": 6.241915408356088e-05,
24 "puct/sampled_value/min": 0.9426681005376335,
25 "puct/sampled_value/max": 0.9429107437905139,
26 "puct/sampled_timestep/mean": 18.0,
27 "puct/sampled_timestep/std": 0.0,
28 "puct/sampled_timestep/min": 18.0,
29 "puct/sampled_timestep/max": 18.0,
30 "puct/sampled_construction_len/mean": 2048.0,
31 "puct/sampled_construction_len/std": 0.0,
32 "puct/sampled_construction_len/min": 2048.0,
33 "puct/sampled_construction_len/max": 2048.0,
34 "time/sampling": 3408.45854139328,
35 "env/all/ac_tokens_per_turn": 9382.35546875,
36 "env/all/ob_tokens_per_turn": 3230.0,
37 "env/all/turns_per_episode": 1.0,
38 "env/all/total_episodes": 512,
39 "env/all/total_turns": 512,
40 "env/all/total_ac_tokens": 4803766,
41 "env/all/total_ob_tokens": 1653760,
42 "env/all/time/sampling_mean": 356.0684216856025,
43 "env/all/time/sampling_max": 473.0705714225769,
44 "env/all/time/env_step_mean": 1206.822950921487,
45 "env/all/time/env_step_max": 2980.889657020569,
46 "env/all/reward/mean": 0.5058532462424303,
47 "env/all/reward/max": 0.9430526027912056,
48 "env/all/reward/min": 0.0,
49 "env/all/format": 1.0,
50 "env/all/format/min": 1.0,
51 "env/all/format/max": 1.0,
52 "env/all/reward": 0.5058532462424303,
53 "env/all/correctness": 0.60546875,
54 "env/all/correctness/min": 0.0,
55 "env/all/correctness/max": 1.0,
56 "env/all/raw_score": 0.835473748632659,
57 "env/all/raw_score/min": 0.012416322279318456,
58 "env/all/raw_score/max": 0.9430526027912056,
59 "env/all/initial_raw_score": 0.9427751537362544,
60 "env/all/initial_raw_score/min": 0.9426681005376335,
61 "env/all/initial_raw_score/max": 0.9429107437905139,
62 "env/all/msg": "Success; raw_score=0.9429136231592973",
63 "env/all/parsed_code": "```python\nimport numpy as np\nimport time\nfrom typing import Tuple\n\ndef construct_function():\n \"\"\"\n Optimizes step function sequence using a combination of coarse-to-fine upscaling, improved gradient-based ascent with \n adaptive learning rates, and corrected gradient calculations. This approach aims to escape local minima by starting\n with a small sequence and gradually increasing resolution while maintaining a balance between the norms.\n \"\"\"\n def _simpson_l2sq(conv: np.ndarray) -> Tuple[float, np.ndarray]:\n \"\"\"Compute ||f*f||_2^2 via Simpson's rule with endpoint zeros and correct gradient.\"\"\"\n m = conv.size\n if m == 0:\n return 0.0, np.zeros_like(conv)\n dx = 1.0 / (m + 1)\n y = np.zeros(m + 2, dtype=conv.dtype)\n y[0] = 0.0\n y[1:-1] = conv\n y[-1] = 0.0\n lhs = y[:-1]\n rhs = y[1:]\n l2_sq = (dx / 3.0) * np.sum(lhs * lhs + lhs * rhs + rhs * rhs)\n grad_y = (dx / 3.0) * (4.0 * y + np.roll(y, 1) + np.roll(y, -1))\n grad_conv = grad_y[1:-1]\n return float(l2_sq), grad_conv\n\n def _l1(conv: np.ndarray) -> Tuple[float, np.ndarray]:\n \"\"\"Compute ||f*f||_1 and its gradient.\"\"\"\n m = conv.size\n dx = 1.0 / (m + 1) if m > 0 else 1.0\n val = dx * float(np.sum(conv)) if m > 0 else 0.0\n grad = np.full_like(conv, dx)\n return val, grad\n\n def _linf(conv: np.ndarray) -> Tuple[float, np.ndarray]:\n \"\"\"Compute ||f*f||_inf and its subgradient.\"\"\"\n if conv.size == 0:\n return 0.0, np.zeros_like(conv)\n m = float(np.max(conv))\n mask = conv == m\n count = int(mask.sum())\n if count == 0 or m <= 0.0:\n return m, np.zeros_like(conv)\n grad = mask.astype(conv.dtype)\n return m, grad\n\n def _objective_and_grad_conv(conv: np.ndarray) -> Tuple[float, np.ndarray]:\n \"\"\"Compute C = l2_sq / (l1 * linf) and its gradient.\"\"\"\n l2_sq, g_l2 = _simpson_l2sq(conv)\n l1, g_l1 = _l1(conv)\n linf, g_linf = _linf(conv)\n if l1 <= 0.0 or linf <= 0.0:\n return 0.0, np.zeros_like(conv)\n denom = l1 * linf\n c_value = l2_sq / denom\n num_grad = g_l2 * denom - l2_sq * (g_l1 * linf + l1 * g_linf)\n g_conv = num_grad / (denom * denom)\n return float(c_value), g_conv\n\n def _grad_h_from_conv_grad(h: np.ndarray, g_conv: np.ndarray) -> np.ndarray:\n \"\"\"Compute gradient of C w.r.t h from gradient of C w.r.t conv.\"\"\"\n h_rev = h[::-1]\n g_h = 2.0 * np.convolve(g_conv, h_rev, mode=\"valid\")\n return g_h # Added factor of 2 for correct gradient\n\n # Initialize from previous best if available, otherwise use a structured pattern\n max_seconds = 1000\n start_time = time.time()\n \n # Determine initial sequence length and base sequence\n n_coarse = 64 # Start with a smaller sequence\n if 'height_sequence_1' in globals():\n initial_heights = np.array(height_sequence_1, dtype=np.float32)\n else:\n # Structured initial guess: peaks at regular intervals\n initial_heights = np.zeros(n_coarse, dtype=np.float32)\n peak_count = n_coarse // 4\n for i in range(peak_count):\n idx = i * n_coarse // peak_count\n initial_heights[idx] = 1000.0 / peak_count\n \n best_seq = initial_heights.copy()\n best_value = evaluate_sequence(best_seq.tolist())\n \n # Coarse-to-fine upscaling\n current_len = n_coarse\n target_len = 2048\n max_upscale_steps = 8 # Total steps to upscale\n\n for upscale_step in range(max_upscale_steps):\n if current_len >= target_len:\n break\n \n # Upscale using replication to double the length\n new_len = current_len * 2\n upsampled_seq = np.repeat(best_seq, 2)\n \n # Initialize for new length (starting from upscaled version)\n best_seq = upsampled_seq.copy()\n current_len = new_len\n \n # Optimization parameters\n max_iter = 5000 # Reduced for each upscale step\n learning_rate = 0.1 * (1.0 / (upscale_step + 1)) # Decrease learning rate for subsequent steps\n decay_rate = 0.999\n decay_steps = 100\n momentum = 0.9\n velocity = np.zeros_like(best_seq)\n \n for _ in range(max_iter):\n step_time = time.time() - start_time\n if step_time > max_seconds - 5:\n break\n\n # Compute gradient\n conv = np.convolve(best_seq, best_seq, mode='full')\n l2_sq, g_l2 = _simpson_l2sq(conv)\n l1, g_l1 = _l1(conv)\n linf, g_linf = _linf(conv)\n\n if l1 <= 0.0 or linf <= 0.0:\n break # Avoid division by zero\n\n denom = l1 * linf\n c_value = l2_sq / denom\n\n # Compute gradient of C with respect to conv\n g_conv = _objective_and_grad_conv(conv)[1]\n\n # Compute gradient of C with respect to h (unclamped sequence)\n grad_h = _grad_h_from_conv_grad(best_seq, g_conv)\n\n # Update velocity and best_seq using momentum\n velocity = momentum * velocity + learning_rate * grad_h\n best_seq = best_seq + velocity\n best_seq = np.clip(best_seq, 0.0, 1000.0)\n\n # Ensure sum is at least 0.01\n if np.sum(best_seq) < 0.01:\n needed = 0.01 - np.sum(best_seq)\n best_seq += needed / len(best_seq)\n\n # Track best value\n current_value = evaluate_sequence(best_seq.tolist())\n if current_value > best_value:\n best_value = current_value\n best_seq = best_seq.copy()\n\n # Decay learning rate\n if _ % decay_steps == 0:\n learning_rate *= decay_rate\n\n # Final refinement\n max_refinement_iter = 10000\n learning_rate = 0.05\n momentum = 0.8\n velocity = np.zeros_like(best_seq)\n\n for _ in range(max_refinement_iter):\n step_time = time.time() - start_time\n if step_time > max_seconds - 5:\n break\n\n # Compute gradient\n conv = np.convolve(best_seq, best_seq, mode='full')\n l2_sq, g_l2 = _simpson_l2sq(conv)\n l1, g_l1 = _l1(conv)\n linf, g_linf = _linf(conv)\n\n if l1 <= 0.0 or linf <= 0.0:\n break # Avoid division by zero\n\n denom = l1 * linf\n c_value = l2_sq / denom\n\n # Compute gradient of C with respect to conv\n g_conv = _objective_and_grad_conv(conv)[1]\n\n # Compute gradient of C with respect to h (unclamped sequence)\n grad_h = _grad_h_from_conv_grad(best_seq, g_conv)\n\n # Update velocity and best_seq using momentum\n velocity = momentum * velocity + learning_rate * grad_h\n best_seq = best_seq + velocity\n best_seq = np.clip(best_seq, 0.0, 1000.0)\n\n # Ensure sum is at least 0.01\n if np.sum(best_seq) < 0.01:\n needed = 0.01 - np.sum(best_seq)\n best_seq += needed / len(best_seq)\n\n # Track best value\n current_value = evaluate_sequence(best_seq.tolist())\n if current_value > best_value:\n best_value = current_value\n best_seq = best_seq.copy()\n\n # Return the best sequence found\n final_heights = best_seq.tolist()\n final_value = evaluate_sequence(final_heights)\n print(f\"Final C2 lower bound: {final_value:.6f}\")\n return final_heights\n```",
64 "env/all/time/policy": 356.0684216856025,
65 "env/all/time/policy/min": 184.67411303520203,
66 "env/all/time/policy/max": 473.0705714225769,
67 "env/all/time/env_step": 1206.822950921487,
68 "env/all/time/env_step/min": 0.00638127326965332,
69 "env/all/time/env_step/max": 2980.889657020569,
70 "env/all/time/reward_compute": 3.157183527946472e-07,
71 "env/all/time/reward_compute/min": 1.8998980522155762e-07,
72 "env/all/time/reward_compute/max": 9.685754776000977e-07,
73 "env/all/by_group/frac_mixed": 1.0,
74 "env/all/by_group/frac_all_good": 0.0,
75 "env/all/by_group/frac_all_bad": 0.0,
76 "advantage/mean": 0.018878445029258728,
77 "advantage/min": -1.0,
78 "advantage/max": 1.9122068881988525,
79 "time/assemble_training_data": 10.545603036880493,
80 "time/kl_vs_base": 103.4349753856659,
81 "kl_policy_base": 0.0007262257859110832,
82 "time/train": 611.0665316581726,
83 "time/save_checkpoint": 14.461268663406372,
84 "time/total": 4151.219222784042
85}[2026-07-09T06:38:34+00:00] job=1812632 node=node-30 ngpu=3 ntrain=1 replicas=2 flash_attn=no
[2026-07-09T06:45:52+00:00] job=1812704 node=node-30 ngpu=3 ntrain=1 replicas=2 flash_attn=no
[2026-07-09T07:00:42+00:00] job=1812735 node=node-1 ngpu=3 ntrain=1 replicas=2 flash_attn=no
[2026-07-09T07:26:33+00:00] job=1812827 node=node-14 ngpu=3 ntrain=1 replicas=2 flash_attn=yes
[2026-07-09T09:21:09+00:00] job=1813131 node=node-1 ngpu=3 ntrain=1 replicas=2 flash_attn=yes
[2026-07-09T14:53:48+00:00] job=1813132 node=node-2 ngpu=6 ntrain=2 replicas=4 flash_attn=yes
[2026-07-10T03:31:51+00:00] job=1816627 node=node-14 ngpu=3 ntrain=1 replicas=2 flash_attn=yes
[2026-07-10T03:54:03+00:00] job=1816628 node=node-29 ngpu=6 ntrain=2 replicas=4 flash_attn=yes
[2026-07-10T07:56:44+00:00] job=1817463 node=node-27 ngpu=3 ntrain=1 replicas=2 flash_attn=yes
[2026-07-10T09:10:26+00:00] job=1817464 node=node-7 ngpu=6 ntrain=2 replicas=4 flash_attn=yes