Downloads · 30 days
0
EdwardoSunny/ttt-discover-v3-qwen3-8b-ac2-step47
ttt-discover-v3-qwen3-8b-ac2-step47 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 46 (0-indexed). Strict upstream eval parity: 1100s hard…
Downloads · 30 days
0
Access
Public
Updated Jul 12, 2026
Repo size
349 MB
Likes
0
Public
Click a slice to open those files.
.safetensors349 MB · 100%
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 46 (0-indexed). Strict upstream eval parity:
1100s hard kill, verbatim prompts/entrypoints, group 64x8, T=1.0, kl 0.1.
{
"step": 46,
"progress/batch": 46,
"optim/lr": 4e-05,
"progress/done_frac": 0.94,
"puct/buffer_size": 742,
"puct/sampled_size": 8,
"puct/T": 23552,
"puct/scale_last": 0.4406390578632754,
"puct/buffer_value/mean": 0.9354643309490143,
"puct/buffer_value/std": 0.036275049185779916,
"puct/buffer_value/min": 0.5041471954736918,
"puct/buffer_value/max": 0.9447862533369672,
"puct/buffer_timestep/mean": 22.257412398921833,
"puct/buffer_timestep/std": 13.441388902281638,
"puct/buffer_timestep/min": -1.0,
"puct/buffer_timestep/max": 45.0,
"puct/buffer_construction_len/mean": 3231.0808625336927,
"puct/buffer_construction_len/std": 2122.077398852998,
"puct/buffer_construction_len/min": 1024.0,
"puct/buffer_construction_len/max": 32768.0,
"puct/sampled_value/mean": 0.9447830434402296,
"puct/sampled_value/std": 2.621943099323218e-06,
"puct/sampled_value/min": 0.9447779123381479,
"puct/sampled_value/max": 0.9447862533369672,
"puct/sampled_timestep/mean": 45.0,
"puct/sampled_timestep/std": 0.0,
"puct/sampled_timestep/min": 45.0,
"puct/sampled_timestep/max": 45.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": 5347.578675985336,
"env/all/ac_tokens_per_turn": 10143.83203125,
"env/all/ob_tokens_per_turn": 4567.75,
"env/all/turns_per_episode": 1.0,
"env/all/total_episodes": 512,
"env/all/total_turns": 512,
"env/all/total_ac_tokens": 5193642,
"env/all/total_ob_tokens": 2338688,
"env/all/time/sampling_mean": 753.3722008396871,
"env/all/time/sampling_max": 1102.9939210414886,
"env/all/time/env_step_mean": 2135.6566612920724,
"env/all/time/env_step_max": 4256.592245578766,
"env/all/reward/mean": 0.8436541254273124,
"env/all/reward/max": 0.9447943446003426,
"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.8436541254273124,
"env/all/correctness": 0.904296875,
"env/all/correctness/min": 0.0,
"env/all/correctness/max": 1.0,
"env/all/raw_score": 0.9329393352457537,
"env/all/raw_score/min": 0.14392456637040876,
"env/all/raw_score/max": 0.9447943446003426,
"env/all/initial_raw_score": 0.9447830434402297,
"env/all/initial_raw_score/min": 0.9447779123381479,
"env/all/initial_raw_score/max": 0.9447862533369672,
"env/all/msg": "Success; raw_score=0.9447471301674113",
"env/all/parsed_code": "```python\nimport numpy as np\nimport time\nfrom typing import Tuple\nimport random\n\ndef _simpson_l2sq(conv: np.ndarray) -> Tuple[float, np.ndarray]:\n \"\"\"Compute ||f*f||_2^2 via Simpson's rule with endpoint zeros and 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\ndef _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\ndef _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\ndef _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\ndef _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 = np.convolve(g_conv, h_rev, mode=\"full\")\n N = len(h)\n gradient = g_h[N-1 : N-1 + N]\n return gradient\n\ndef scale_sequence(seq):\n \"\"\"Scale the sequence to meet sum 0.01 and max 1000.\"\"\"\n seq = seq.copy()\n sum_seq = np.sum(seq)\n max_seq = np.max(seq)\n \n if sum_seq == 0:\n # Set each element to ensure sum is 0.01\n scale = 0.01 / float(len(seq))\n scaled_seq = seq * scale\n sum_scaled = np.sum(scaled_seq)\n max_scaled = np.max(scaled_seq)\n else:\n if sum_seq > 0:\n scale_sum = 0.01 / sum_seq\n else:\n scale_sum = 1.0\n scaled_seq = seq * scale_sum\n sum_scaled = np.sum(scaled_seq)\n max_scaled = np.max(scaled_seq)\n \n if max_scaled <= 1000:\n return scaled_seq\n else:\n scale_max = 1000.0 / max_scaled\n scaled_seq = scaled_seq * scale_max\n sum_scaled = np.sum(scaled_seq)\n if sum_scaled < 0.01:\n scale_sum = 0.01 / sum_scaled\n scaled_seq = scaled_seq * scale_sum\n sum_scaled = np.sum(scaled_seq)\n \n return scaled_seq\n\ndef construct_function():\n \"\"\"\n Construct a sequence of non-negative heights for a step function to maximize the evaluation function.\n Uses a combination of diverse initialization, adaptive upsampling, and optimized gradient ascent\n with constraint maintenance.\n \"\"\"\n # Parameters for the algorithm\n n_start = 128\n target_length = 4096\n max_seconds = 1000\n num_initializations = 4\n\n # Initialize from available height_sequence_1 if it exists\n initial_sequences = []\n if 'height_sequence_1' in globals():\n initial_sequences.append(np.array(height_sequence_1, dtype=np.float32))\n else:\n pass # Proceed with generated sequences\n\n # Generate diverse initial sequences\n for _ in range(num_initializations):\n # Gaussian-like sequence\n seq = np.zeros(n_start, dtype=np.float32)\n center = n_start // 2\n std = n_start // 6\n for i in range(n_start):\n seq[i] = np.exp(-((i - center) ** 2) / (2 * std**2))\n seq = scale_sequence(seq)\n initial_sequences.append(seq)\n\n # Random sequence\n seq_rand = np.random.rand(n_start) * 0.1\n seq_rand = scale_sequence(seq_rand)\n initial_sequences.append(seq_rand)\n\n # Uniform sequence\n seq_uniform = np.ones(n_start, dtype=np.float32) * (0.01 / n_start)\n seq_uniform = scale_sequence(seq_uniform)\n initial_sequences.append(seq_uniform)\n\n # Multi-peak sequence\n seq_multi = np.zeros(n_start, dtype=np.float32)\n peak_positions = [n_start // 4, n_start // 2, n_start * 3 // 4]\n for pos in peak_positions:\n seq_multi[pos] += 0.01 / len(peak_positions)\n seq_multi = scale_sequence(seq_multi)\n initial_sequences.append(seq_multi)\n\n # Single-peak sequence\n seq_single = np.zeros(n_start, dtype=np.float32)\n seq_single[0] = 0.01\n seq_single = scale_sequence(seq_single)\n initial_sequences.append(seq_single)\n\n # Evaluate initial sequences to find the best one\n best_seq = None\n best_value = -float('inf')\n for seq in initial_sequences:\n try:\n current_value = evaluate_sequence(seq.tolist())\n except Exception as e:\n print(f\"Error evaluating initial sequence: {e}\")\n continue\n if current_value > best_value:\n best_value = current_value\n best_seq = seq.copy()\n\n if best_seq is None:\n # Fallback to a single-peak sequence\n seq = np.zeros(n_start, dtype=np.float32)\n seq[0] = 0.01\n seq = scale_sequence(seq)\n best_seq = seq.copy()\n best_value = evaluate_sequence(best_seq.tolist())\n\n # Gradually upscale the sequence length with exact length scaling\n current_len = len(best_seq)\n while current_len < target_length:\n # Double the length\n upsampling_factor = 2\n upsampled_seq = np.repeat(best_seq, upsampling_factor)\n upsampled_seq = scale_sequence(upsampled_seq)\n best_seq = upsampled_seq.copy()\n current_len = len(best_seq)\n\n # Final length adjustment to target_length\n best_seq = best_seq[:target_length]\n\n # Final optimization with refined gradient ascent\n start_time = time.time()\n best_seq = best_seq.copy()\n best_value = evaluate_sequence(best_seq.tolist())\n\n # Parameters for optimization\n max_iter = 100000 # Increased iterations for deeper exploration\n learning_rate = 0.005 # Adjusted learning rate for stability\n decay_rate = 0.999 # Slow decay for more detailed exploration\n min_lr = 1e-5 # Minimum learning rate\n decay_steps = 30 # Reduced for more frequent decay\n step_counter = 0\n beta1 = 0.9\n beta2 = 0.999\n epsilon = 1e-8\n\n # Adam parameters\n m = np.zeros_like(best_seq)\n v = np.zeros_like(best_seq)\n t = 0\n\n for _ in range(max_iter):\n step_counter += 1\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\n grad_h = _grad_h_from_conv_grad(best_seq, g_conv)\n\n # Adam update\n t += 1\n m = beta1 * m + (1 - beta1) * grad_h\n v = beta2 * v + (1 - beta2) * (grad_h ** 2)\n m_hat = m / (1 - beta1 ** t)\n v_hat = v / (1 - beta2 ** t)\n step = learning_rate * m_hat / (np.sqrt(v_hat) + epsilon)\n best_seq = best_seq + step\n\n # Ensure values are within bounds\n best_seq = np.clip(best_seq, 0.0, 1000.0)\n\n # Maintain minimum sum requirement\n sum_seq = np.sum(best_seq)\n if sum_seq < 0.01:\n scale = 0.01 / sum_seq\n best_seq = best_seq * scale\n best_seq = np.clip(best_seq, 0.0, 1000.0)\n sum_seq = np.sum(best_seq)\n if sum_seq < 0.01:\n best_seq = np.zeros_like(best_seq)\n best_seq[0] = 0.01\n if np.max(best_seq) > 1000:\n scale = 1000 / np.max(best_seq)\n best_seq = best_seq * scale\n\n # Track best value\n if step_counter % 50 == 0:\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 # Check time limit\n if time.time() - start_time > max_seconds - 5:\n break\n\n # Decay learning rate\n if step_counter % decay_steps == 0:\n learning_rate *= decay_rate\n\n # Final evaluation\n final_value = evaluate_sequence(best_seq.tolist())\n print(f\"Final C2 lower bound: {final_value:.6f}\")\n return best_seq.tolist()\n```",
"env/all/time/policy": 753.3722008396871,
"env/all/time/policy/min": 354.62204217910767,
"env/all/time/policy/max": 1102.9939210414886,
"env/all/time/env_step": 2135.6566612920724,
"env/all/time/env_step/min": 0.00680088996887207,
"env/all/time/env_step/max": 4256.592245578766,
"env/all/time/reward_compute": 5.583278834819794e-07,
"env/all/time/reward_compute/min": 1.8998980522155762e-07,
"env/all/time/reward_compute/max": 1.3224780559539795e-06,
"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.02013421058654785,
"advantage/min": -1.0,
"advantage/max": 6.3081278800964355,
"time/assemble_training_data": 12.969272375106812,
"time/kl_vs_base": 180.7917559146881,
"kl_policy_base": 0.0006393897347152233,
"time/train": 1483.6611614227295,
"time/save_checkpoint": 18.200313091278076,
"time/total": 7049.183141946793
}
[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
[2026-07-12T09:30:52+00:00] job=1829971 node=node-7 ngpu=3 ntrain=1 replicas=2 flash_attn=yes