Downloads · 30 days
0
EdwardoSunny/ttt-discover-v3-qwen3-8b-ac2-s2-step30
ttt-discover-v3-qwen3-8b-ac2-s2-step30 is a machine learning model from EdwardoSunny. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
LoRA adapter (rank 32, all-linear) from the upstream-faithful local reproduction of TTT-Discover on autoresearch-bench ac2. Checkpoint saved after training step 29 (0-indexed). Strict upstream eval parity: 1100s hard…
Downloads · 30 days
0
Access
Public
Updated Jul 16, 2026
Repo size
354 MB
Likes
1
Public
Click a slice to open those files.
.safetensors349 MB · 99%
From the Hugging Face model README
LoRA adapter (rank 32, all-linear) from the upstream-faithful local
reproduction of TTT-Discover on autoresearch-bench ac2. Checkpoint saved
after training step 29 (0-indexed). Strict upstream eval parity:
1100s hard kill, verbatim prompts/entrypoints, group 64x8, T=1.0, kl 0.1.
{
"step": 29,
"progress/batch": 29,
"optim/lr": 4e-05,
"progress/done_frac": 0.6,
"puct/buffer_size": 469,
"puct/sampled_size": 8,
"puct/T": 14848,
"puct/scale_last": 0.2813532430957808,
"puct/buffer_value/mean": 0.9334453425885022,
"puct/buffer_value/std": 0.04212875866292859,
"puct/buffer_value/min": 0.6666666666666636,
"puct/buffer_value/max": 0.9480199097624474,
"puct/buffer_timestep/mean": 13.81449893390192,
"puct/buffer_timestep/std": 8.501205408978729,
"puct/buffer_timestep/min": -1.0,
"puct/buffer_timestep/max": 28.0,
"puct/buffer_construction_len/mean": 3798.667377398721,
"puct/buffer_construction_len/std": 1865.4151496133456,
"puct/buffer_construction_len/min": 1024.0,
"puct/buffer_construction_len/max": 32768.0,
"puct/sampled_value/mean": 0.9479575748219853,
"puct/sampled_value/std": 6.300131907765783e-05,
"puct/sampled_value/min": 0.9478469241351072,
"puct/sampled_value/max": 0.9480199097624474,
"puct/sampled_timestep/mean": 28.0,
"puct/sampled_timestep/std": 0.0,
"puct/sampled_timestep/min": 28.0,
"puct/sampled_timestep/max": 28.0,
"puct/sampled_construction_len/mean": 4096.0,
"puct/sampled_construction_len/std": 0.0,
"puct/sampled_construction_len/min": 4096.0,
"puct/sampled_construction_len/max": 4096.0,
"time/sampling": 6258.314266681671,
"env/all/ac_tokens_per_turn": 8388.0703125,
"env/all/ob_tokens_per_turn": 4472.5,
"env/all/turns_per_episode": 1.0,
"env/all/total_episodes": 512,
"env/all/total_turns": 512,
"env/all/total_ac_tokens": 4294692,
"env/all/total_ob_tokens": 2289920,
"env/all/time/sampling_mean": 578.7517282003537,
"env/all/time/sampling_max": 786.8268971443176,
"env/all/time/env_step_mean": 2844.6419641110115,
"env/all/time/env_step_max": 5473.894291877747,
"env/all/reward/mean": 0.2036052369681236,
"env/all/reward/max": 0.9480830020801283,
"env/all/reward/min": 0.0,
"env/all/format": 1.0,
"env/all/format/min": 1.0,
"env/all/format/max": 1.0,
"env/all/reward": 0.2036052369681236,
"env/all/correctness": 0.216796875,
"env/all/correctness/min": 0.0,
"env/all/correctness/max": 1.0,
"env/all/raw_score": 0.9391520840331465,
"env/all/raw_score/min": 0.6862913176564078,
"env/all/raw_score/max": 0.9480830020801283,
"env/all/initial_raw_score": 0.9479575748219853,
"env/all/initial_raw_score/min": 0.9478469241351072,
"env/all/initial_raw_score/max": 0.9480199097624474,
"env/all/msg": "Success; raw_score=0.9480211969353866",
"env/all/parsed_code": "```python\nimport numpy as np\nimport time\nfrom typing import List, Tuple\nimport random\n\ndef _simpson_l2sq(conv: np.ndarray) -> Tuple[float, np.ndarray]:\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\ndef _l1(conv: np.ndarray) -> Tuple[float, np.ndarray]:\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\ndef _linf(conv: np.ndarray) -> Tuple[float, np.ndarray]:\n if conv.size == 0:\n return 0.0, np.zeros_like(conv)\n m = float(np.max(conv))\n if m <= 0.0:\n return m, np.zeros_like(conv)\n mask = conv == m\n count = int(mask.sum())\n if count == 0:\n return m, np.zeros_like(conv)\n grad = mask.astype(conv.dtype) / count\n return m, grad\n\ndef _objective_and_grad_conv(conv: np.ndarray) -> Tuple[float, np.ndarray]:\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\ndef _grad_h_from_conv_grad(h: np.ndarray, g_conv: np.ndarray) -> np.ndarray:\n h_rev = h[::-1]\n g_h = np.convolve(g_conv, h_rev, mode=\"valid\")\n return 2.0 * g_h\n\ndef _upsample_1d(h: np.ndarray) -> np.ndarray:\n n = h.shape[0]\n x_old = np.linspace(-0.5, 0.5, n)\n x_new = np.linspace(-0.5, 0.5, 2 * n)\n return np.interp(x_new, x_old, h)\n\ndef _single_candidate_finetune(h0: np.ndarray, lr=0.1, steps=600000, decay_rate=0.999, momentum=0.9, beta=0.999) -> Tuple[np.ndarray, float]:\n h = h0.astype(np.float32).copy()\n last_c = 0.0\n m_buffer = np.zeros_like(h)\n v_buffer = np.zeros_like(h)\n for step in range(steps):\n h_clip = np.clip(h, 0.0, None)\n conv = np.convolve(h_clip, h_clip, mode=\"full\")\n c_val, g_conv = _objective_and_grad_conv(conv)\n g_h = _grad_h_from_conv_grad(h_clip, g_conv)\n m_buffer = momentum * m_buffer + (1 - momentum) * g_h\n v_buffer = beta * v_buffer + (1 - beta) * (g_h ** 2)\n corrected_m = m_buffer / (1 - momentum ** (step + 1))\n corrected_v = v_buffer / (1 - beta ** (step + 1))\n learning_rate_current = lr * (1.0 - step / steps)\n h = np.clip(h + learning_rate_current * corrected_m / (np.sqrt(corrected_v) + 1e-8), 0.0, 1000.0)\n current_c = c_val\n last_c = current_c\n return h, float(last_c)\n\ndef construct_function():\n \"\"\"\n Optimizes a sequence of non-negative heights by enhancing diversity in the initial population and \n applying adaptive, multi-step refinement techniques. This algorithm generates multiple diverse candidates,\n performs multi-scale upsampling with adaptive noise and learning rates, and uses gradient-free \n optimization techniques to refine the best candidates for better overall performance.\n \"\"\"\n np.random.seed(42)\n \n height_sequence_1 = globals().get(\"height_sequence_1\", None)\n target_length = 4096\n initial_n = 8\n \n # Generate even more diverse initial sequences to reduce local optima risk\n def generate_initial_candidates():\n candidates = []\n x = np.linspace(-0.5, 0.5, target_length)\n \n # 1. Random candidate\n seq = np.random.rand(target_length) * 0.01 / target_length\n seq_sum = np.sum(seq)\n if seq_sum < 0.01:\n seq = np.clip(seq + (0.01 - seq_sum) / target_length, 0.0, 1000.0)\n candidates.append(seq)\n \n # 2. Gaussian candidate\n seq_g = 0.01 * np.exp(-((x - 0.0) / 0.2)**2)\n seq_g = np.clip(seq_g / np.sum(seq_g) * 0.01, 0.0, 1000.0)\n candidates.append(seq_g)\n \n # 3. Multiple peaks with random positions and heights\n for _ in range(3):\n positions = np.random.uniform(-0.5, 0.5, size=5)\n heights = np.random.uniform(0.001, 0.01, size=5)\n seq_mp = np.zeros_like(x)\n for pos, height in zip(positions, heights):\n seq_mp += height * np.exp(-((x - pos) / 0.15)**2)\n seq_mp = np.clip(seq_mp / np.sum(seq_mp) * 0.01, 0.0, 1000.0)\n candidates.append(seq_mp)\n \n # 4. Sine wave candidate with multiple frequencies\n seq_sw = 0.01 * np.sin(2 * np.pi * x * 5)\n seq_sw += 0.01 * np.sin(2 * np.pi * x * 10)\n seq_sw = np.clip(seq_sw / np.sum(seq_sw) * 0.01, 0.0, 1000.0)\n candidates.append(seq_sw)\n \n # 5. Triangular candidate\n seq_tr = np.abs(x)\n seq_tr = np.clip(seq_tr / np.sum(seq_tr) * 0.01, 0.0, 1000.0)\n candidates.append(seq_tr)\n \n # 6. Square wave with multiple harmonics\n seq_sq = np.zeros_like(x)\n for i in range(3):\n seq_sq += 0.01 * np.sin(2 * np.pi * x * (2*i+1))\n seq_sq = np.clip(seq_sq / np.sum(seq_sq) * 0.01, 0.0, 1000.0)\n candidates.append(seq_sq)\n \n # 7. Exponential decay candidate with random start\n start = np.random.uniform(-0.5, 0.5)\n seq_exp = 0.01 * np.exp(-((x - start) / 0.15)**2)\n seq_exp = np.clip(seq_exp / np.sum(seq_exp) * 0.01, 0.0, 1000.0)\n candidates.append(seq_exp)\n \n # 8. Random walk on a grid\n seq_rw = np.zeros(target_length)\n for i in range(1, target_length):\n seq_rw[i] = seq_rw[i-1] + np.random.normal(0, 0.01)\n seq_rw = np.clip(seq_rw / np.sum(seq_rw) * 0.01, 0.0, 1000.0)\n candidates.append(seq_rw)\n \n return candidates\n\n if height_sequence_1 is not None:\n initial_h = np.array(height_sequence_1, dtype=np.float32)\n initial_n = min(len(initial_h), target_length)\n x_old = np.linspace(-0.5, 0.5, len(initial_h))\n x_new = np.linspace(-0.5, 0.5, initial_n)\n h = np.interp(x_new, x_old, initial_h)\n else:\n candidates = generate_initial_candidates()\n best_c = -1.0\n best_h = candidates[0]\n for h_candidate in candidates:\n try:\n c = evaluate_sequence(h_candidate.tolist())\n if c > best_c:\n best_c = c\n best_h = h_candidate\n except:\n pass\n h = best_h\n\n # Parameters for enhanced exploration and refinement\n learning_rate = 0.1\n noise_scale_initial = 100.0\n noise_decay = 0.996\n learning_rate_decay = 0.9997\n max_steps = 200000\n upscale_steps = 50000\n refine_steps = 100000 # Increased refinement steps\n\n start_time = time.time()\n\n # Multi-scale optimization with enhanced exploration and multiple initializations\n current_length = initial_n\n scale_factor = 2\n\n for _ in range(6): # Upscale 6 times to reach 4096\n if current_length < target_length:\n h = _upsample_1d(h)\n current_length *= 2\n # Ensure sum is above 0.01\n h_sum = np.sum(h)\n if h_sum < 0.01:\n h = np.clip(h + (0.01 - h_sum) / h.shape[0], 0.0, 1000.0)\n\n # Initial optimization with dynamic noise and learning rate\n h_opt = np.copy(h)\n h_best = np.copy(h)\n best_c = -1.0\n for step in range(upscale_steps): # Increased steps for better optimization\n # Clip to non-negative\n clipped_h = np.clip(h_opt, 0.0, None)\n\n # Compute convolution\n conv = np.convolve(clipped_h, clipped_h, mode='full')\n\n # Compute objective and gradient of conv\n obj_val, grad_conv = _objective_and_grad_conv(conv)\n\n # Compute gradient with respect to h\n grad_h = _grad_h_from_conv_grad(clipped_h, grad_conv)\n\n # Adjust noise and learning rate based on step\n noise_scale = noise_scale_initial * (noise_decay ** step)\n learning_rate_current = learning_rate * (learning_rate_decay ** step)\n\n # Add noise\n noise = noise_scale * np.random.normal(size=h_opt.shape)\n\n # Update h with adaptive noise and learning\n h_opt = np.clip(h_opt + learning_rate_current * grad_h + noise, 0.0, 1000.0)\n\n # Maintain sum requirement dynamically\n h_sum_current = np.sum(h_opt)\n if h_sum_current < 0.01:\n scale_factor = 0.01 / h_sum_current\n h_opt = np.clip(h_opt * scale_factor, 0.0, 1000.0)\n\n # Periodic evaluation and update best\n if step % 200 == 0:\n try:\n current_c = evaluate_sequence(h_opt.tolist())\n if current_c > best_c:\n best_c = current_c\n h_best = h_opt.copy()\n except:\n pass\n\n # Check time remaining\n remaining_time = 1000 - (time.time() - start_time)\n if remaining_time < 10:\n print(f\"Time remaining: {remaining_time} seconds. Performing final refinement.\")\n break\n # Assign optimized h\n h = h_best\n\n # Final refined optimization with smaller learning rate and adaptive decay\n h_refined, _ = _single_candidate_finetune(h, lr=0.05, steps=refine_steps, decay_rate=0.9998, momentum=0.9, beta=0.9998)\n\n # Final check and normalization\n h_final = np.clip(h_refined, 0.0, 1000.0)\n heights = h_final.tolist()\n r_value = evaluate_sequence(heights)\n print(f\"Final C2 lower bound: {r_value}\")\n return heights\n```",
"env/all/time/policy": 578.7517282003537,
"env/all/time/policy/min": 296.86175656318665,
"env/all/time/policy/max": 786.8268971443176,
"env/all/time/env_step": 2844.6419641110115,
"env/all/time/env_step/min": 0.006276607513427734,
"env/all/time/env_step/max": 5473.894291877747,
"env/all/time/reward_compute": 3.0640512704849243e-07,
"env/all/time/reward_compute/min": 2.0489096641540527e-07,
"env/all/time/reward_compute/max": 5.103647708892822e-07,
"env/all/by_group/frac_mixed": 1.0,
"env/all/by_group/frac_all_good": 0.0,
"env/all/by_group/frac_all_bad": 0.0,
"advantage/mean": 0.03592450171709061,
"advantage/min": -0.9216421246528625,
"advantage/max": 14.113264083862305,
"time/assemble_training_data": 10.057090520858765,
"time/kl_vs_base": 155.47645163536072,
"kl_policy_base": 0.0006777639500796795,
"time/train": 1252.4783000946045,
"time/save_checkpoint": 10.449611186981201,
"time/total": 7691.673248529434
}
[2026-07-09T06:42:12+00:00] job=1812634 node=node-30 ngpu=3 ntrain=1 replicas=2 flash_attn=no
[2026-07-09T07:26:33+00:00] job=1812736 node=node-12 ngpu=3 ntrain=1 replicas=2 flash_attn=yes
[2026-07-09T09:27:32+00:00] job=1813133 node=node-14 ngpu=3 ntrain=1 replicas=2 flash_attn=yes
[2026-07-09T16:26:04+00:00] job=1813134 node=node-4 ngpu=6 ntrain=2 replicas=4 flash_attn=yes
[2026-07-11T01:56:04+00:00] job=1821290 node=node-4 ngpu=3 ntrain=1 replicas=2 flash_attn=yes