Downloads · 30 days
0
EdwardoSunny/ttt-discover-v3-qwen3-8b-ac2-step11
ttt-discover-v3-qwen3-8b-ac2-step11 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 10 (0-indexed). Strict upstream eval parity: 1100s hard…
Downloads · 30 days
0
Access
Public
Updated Jul 10, 2026
Repo size
354 MB
Likes
0
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 10 (0-indexed). Strict upstream eval parity:
1100s hard kill, verbatim prompts/entrypoints, group 64x8, T=1.0, kl 0.1.
{
"step": 10,
"progress/batch": 10,
"optim/lr": 4e-05,
"progress/done_frac": 0.22,
"puct/buffer_size": 168,
"puct/sampled_size": 8,
"puct/T": 5120,
"puct/scale_last": 0.43720195436973397,
"puct/buffer_value/mean": 0.9129105608310281,
"puct/buffer_value/std": 0.06686473661957397,
"puct/buffer_value/min": 0.5041471954736918,
"puct/buffer_value/max": 0.9413491498434258,
"puct/buffer_timestep/mean": 4.238095238095238,
"puct/buffer_timestep/std": 3.0379310300450633,
"puct/buffer_timestep/min": -1.0,
"puct/buffer_timestep/max": 9.0,
"puct/buffer_construction_len/mean": 2360.6369047619046,
"puct/buffer_construction_len/std": 1109.9400156764975,
"puct/buffer_construction_len/min": 1024.0,
"puct/buffer_construction_len/max": 7414.0,
"puct/sampled_value/mean": 0.939924503727931,
"puct/sampled_value/std": 0.0007781879079245196,
"puct/sampled_value/min": 0.9389812735305938,
"puct/sampled_value/max": 0.9412776341920083,
"puct/sampled_timestep/mean": 9.0,
"puct/sampled_timestep/std": 0.0,
"puct/sampled_timestep/min": 9.0,
"puct/sampled_timestep/max": 9.0,
"puct/sampled_construction_len/mean": 2304.0,
"puct/sampled_construction_len/std": 677.3123356325352,
"puct/sampled_construction_len/min": 2048.0,
"puct/sampled_construction_len/max": 4096.0,
"time/sampling": 5648.943610906601,
"env/all/ac_tokens_per_turn": 8642.20703125,
"env/all/ob_tokens_per_turn": 4226.125,
"env/all/turns_per_episode": 1.0,
"env/all/total_episodes": 512,
"env/all/total_turns": 512,
"env/all/total_ac_tokens": 4424810,
"env/all/total_ob_tokens": 2163776,
"env/all/time/sampling_mean": 332.55639649229124,
"env/all/time/sampling_max": 429.9778757095337,
"env/all/time/env_step_mean": 2618.250516897533,
"env/all/time/env_step_max": 5220.426249742508,
"env/all/reward/mean": 0.34311412842002065,
"env/all/reward/max": 0.9405947376993923,
"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.34311412842002065,
"env/all/correctness": 0.388671875,
"env/all/correctness/min": 0.0,
"env/all/correctness/max": 1.0,
"env/all/raw_score": 0.8827860992515104,
"env/all/raw_score/min": 0.1688389253991586,
"env/all/raw_score/max": 0.9405947376993923,
"env/all/initial_raw_score": 0.939924503727931,
"env/all/initial_raw_score/min": 0.9389812735305938,
"env/all/initial_raw_score/max": 0.9412776341920083,
"env/all/msg": "Evaluation timed out after 1100 seconds.",
"env/all/parsed_code": "```python\nimport numpy as np\nfrom typing import Tuple\nimport time\nimport random\nfrom collections import deque\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\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\n lhs = y[:-1]\n rhs = y[1:]\n l2_sq = (dx / 3.0) * np.sum(lhs * lhs + lhs * rhs + rhs * rhs)\n\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\n if l1 <= 0.0 or linf <= 0.0:\n return 0.0, np.zeros_like(conv)\n\n denom = l1 * linf\n c_value = l2_sq / denom\n\n num_grad = g_l2 * denom - l2_sq * (g_l1 * linf + l1 * g_linf)\n g_conv = num_grad / (denom * denom)\n\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=\"valid\")\n return 2.0 * g_h\n\nclass _Adam:\n \"\"\"Lightweight Adam optimizer for numpy arrays (per-candidate).\"\"\"\n def __init__(self, shape, lr=3e-2, beta1=0.9, beta2=0.999, eps=1e-8, dtype=np.float32):\n self.m = np.zeros(shape, dtype=dtype)\n self.v = np.zeros(shape, dtype=dtype)\n self.t = 0\n self.lr = lr\n self.b1 = beta1\n self.b2 = beta2\n self.eps = eps\n\n def step(self, params, grad):\n self.t += 1\n self.m = self.b1 * self.m + (1 - self.b1) * grad\n self.v = self.b2 * self.v + (1 - self.b2) * (grad * grad)\n m_hat = self.m / (1 - self.b1 ** self.t)\n v_hat = self.v / (1 - self.b2 ** self.t)\n return params + self.lr * m_hat / (np.sqrt(v_hat) + self.eps)\n\ndef _batch_objective(h_batch: np.ndarray) -> Tuple[np.ndarray, list[np.ndarray]]:\n \"\"\"Vectorized evaluation of objective and gradient.\"\"\"\n bsz = h_batch.shape[0]\n c_vals = np.zeros(bsz, dtype=np.float32)\n conv_grads = [None] * bsz\n for b in range(bsz):\n h = np.clip(h_batch[b], 0.0, None)\n conv = np.convolve(h, h, mode=\"full\")\n c_val, g_conv = _objective_and_grad_conv(conv)\n c_vals[b] = c_val\n conv_grads[b] = g_conv\n return c_vals, conv_grads\n\ndef _phase_update(h_batch, opt_list, lr, add_noise=False, t=0, eta=5e-2, gamma=0.3):\n \"\"\"Update all candidates in the batch.\"\"\"\n bsz = h_batch.shape[0]\n c_vals, conv_grads = _batch_objective(h_batch)\n grads = np.zeros_like(h_batch, dtype=h_batch.dtype)\n for b in range(bsz):\n clipped = np.clip(h_batch[b], 0.0, None)\n grads[b] = _grad_h_from_conv_grad(clipped, conv_grads[b])\n\n if add_noise:\n sigma = eta / ((t + 1) ** gamma)\n grads = grads + sigma * np.random.normal(size=grads.shape).astype(grads.dtype)\n\n for b in range(bsz):\n opt = opt_list[b]\n opt.lr = lr\n h_new = opt.step(h_batch[b], grads[b].astype(h_batch.dtype))\n h_batch[b] = np.clip(h_new, 0.0, None)\n\n return h_batch, c_vals\n\ndef _elitist_respawn(h_batch, c_vals, keep_frac, init_sampler, opt_list):\n \"\"\"Keep top fraction and respawn the rest.\"\"\"\n bsz = h_batch.shape[0]\n keep_n = max(1, int(bsz * keep_frac))\n idx = np.argsort(c_vals)[-keep_n:]\n survivors = h_batch[idx].copy()\n\n fresh = init_sampler(bsz - keep_n)\n new_batch = np.concatenate([survivors, fresh], axis=0)\n\n new_opts = [opt_list[i] for i in idx]\n for _ in range(bsz - keep_n):\n new_opts.append(_Adam(shape=h_batch.shape[1:], lr=opt_list[0].lr, dtype=h_batch.dtype))\n\n return new_batch, new_opts\n\ndef _upsample_1d(h: np.ndarray) -> np.ndarray:\n \"\"\"2x upsampling with structured replication.\"\"\"\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=3e-3, steps=500_000) -> Tuple[np.ndarray, float]:\n \"\"\"Refine a single candidate using Adam with projection.\"\"\"\n h = h0.astype(np.float32).copy()\n opt = _Adam(h.shape, lr=lr, dtype=h.dtype)\n last_c = 0.0\n for _ 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 h = np.clip(opt.step(h, g_h.astype(h.dtype)), 0.0, None)\n last_c = c_val\n return h, float(last_c)\n\ndef construct_function():\n \"\"\"\n Enhanced Adaptive Pattern-Based Evolutionary Gradient Ascent (APEGA)\n Key improvements:\n - Increased exploration with multi-pattern initialization\n - Adaptive noise and learning rate scheduling\n - Strategic fine-tuning with progressive upsampling\n - Structured upsampling to preserve key features\n - Dynamic diversity maintenance\n \"\"\"\n n_start = 256 # Smaller base to enable effective upsampling\n bsz = 32 # Moderate batch size for exploration\n total_iter = 120_000 # Reduced to better balance exploration and exploitation\n explore_steps = 50_000 # More exploration phase\n drop_every = 10_000 # Frequent diversity maintenance\n keep_frac = 0.3 # Higher diversity maintenance\n lr_explore = 0.1 # Lower exploration learning rate\n lr_exploit = 1e-3 # Steady optimization rate\n eta, gamma = 1e-1, 0.2 # Higher noise earlier, slower decay\n\n # Get initial sequence from provided variable\n if 'height_sequence_1' in globals():\n prev = np.array(height_sequence_1, dtype=np.float32)\n else:\n prev = np.ones(n_start, dtype=np.float32)\n \n # Resample to initial length\n prev = np.clip(prev, 0.0, 1000.0)\n if prev.shape[0] != n_start:\n x_old = np.linspace(-0.5, 0.5, prev.shape[0])\n x_new = np.linspace(-0.5, 0.5, n_start)\n prev = np.interp(x_new, x_old, prev).astype(np.float32)\n\n # Define initialization function with diverse structured patterns\n def init_sampler(m):\n out = np.random.uniform(0.0, 1.0, size=(m, n_start)).astype(np.float32)\n out[0] = prev # Include previous best\n \n # Add diverse patterns to enhance diversity\n for i in range(1, m):\n if i % 5 == 1:\n # Multi-peak random pattern\n peaks = np.random.randint(0, n_start-1, size=5)\n peak_heights = np.random.uniform(0.6, 1.0, size=5)\n out[i] = np.zeros_like(prev)\n for p, h in zip(peaks, peak_heights):\n out[i][p] = h\n elif i % 5 == 2:\n # Sine wave with randomized frequency and phase\n freq = np.random.uniform(0.05, 0.3)\n phase = np.random.uniform(0, 2 * np.pi)\n t = np.linspace(-0.5, 0.5, n_start)\n out[i] = 0.5 * (1 + np.sin(2 * np.pi * freq * t + phase)).astype(np.float32)\n elif i % 5 == 3:\n # Exponential decay with controlled shape\n exp_scale = np.random.uniform(0.3, 0.7)\n decay_start = np.random.uniform(0.1, 0.3)\n out[i] = np.random.exponential(scale=exp_scale, size=n_start).astype(np.float32)\n out[i] *= (1 - decay_start) * np.linspace(1.0, 0.1, n_start)\n elif i % 5 == 4:\n # Triangle wave with randomized frequency\n freq = np.random.uniform(0.1, 0.5)\n t = np.linspace(-0.5, 0.5, n_start)\n out[i] = (1 + np.abs(2 * np.pi * freq * t - np.pi)).astype(np.float32) / 2.0\n elif i % 5 == 0:\n # Gaussian-like pattern\n sigma = np.random.uniform(0.1, 0.5)\n center = np.random.uniform(0, n_start)\n x = np.linspace(-0.5, 0.5, n_start)\n out[i] = np.exp(- (x - center)**2 / (2 * sigma**2))\n out[i] = (out[i] - np.min(out[i])) / (np.max(out[i]) - np.min(out[i])) * 0.5 + 0.5\n else:\n # Random mixture of structured components\n comp1 = np.random.uniform(0.3, 0.7, n_start).astype(np.float32)\n comp2 = np.random.uniform(0.2, 0.5, n_start).astype(np.float32)\n comp3 = np.random.uniform(0.1, 0.3, n_start).astype(np.float32)\n out[i] = comp1 * 0.5 + comp2 * 0.3 + comp3 * 0.2\n\n return out\n\n h_batch = init_sampler(bsz)\n opt_list = [_Adam(shape=(n_start,), lr=lr_explore, dtype=np.float32) for _ in range(bsz)]\n best_h = h_batch.copy()\n best_c = np.full(bsz, -np.inf, dtype=np.float32)\n\n start_time = time.time()\n\n # Main optimization loop\n for t in range(total_iter):\n if t < explore_steps:\n # Explosive phase with high noise during early steps\n h_batch, c_vals = _phase_update(\n h_batch, opt_list, lr=lr_explore, add_noise=True, t=t, eta=eta, gamma=gamma\n )\n else:\n # Exploitation phase with moderate noise\n h_batch, c_vals = _phase_update(\n h_batch, opt_list, lr=lr_exploit, add_noise=True, t=t, eta=eta, gamma=gamma\n )\n\n # Update best candidates\n improved = c_vals > best_c\n best_c = np.where(improved, c_vals, best_c)\n best_h[improved] = h_batch[improved]\n\n # Periodic elitist respawn for diversity maintenance\n if (t + 1) % drop_every == 0:\n h_batch, opt_list = _elitist_respawn(\n h_batch, c_vals, keep_frac=keep_frac, init_sampler=init_sampler, opt_list=opt_list\n )\n\n # Track progress and ensure we stay within time limit\n if t % 1000 == 0:\n elapsed = time.time() - start_time\n print(f\"Iteration {t} (elapsed: {elapsed:.1f}s) - Best score: {best_c[np.argmax(best_c)]:.6f}\")\n if elapsed > 950: # Safety check to prevent overrunning time\n print(\"Reached time limit, stopping early.\")\n break\n\n # Select best candidate and perform thorough refinement\n idx = np.argmax(best_c)\n h_star = np.clip(best_h[idx].astype(np.float32), 0.0, None)\n\n # First upsampling with extended fine-tuning\n h_up1 = _upsample_1d(h_star)\n h_up1, _ = _single_candidate_finetune(h_up1, lr=3e-3, steps=500_000)\n\n # Second upsampling with more refinement\n h_up2 = _upsample_1d(h_up1)\n h_up2, _ = _single_candidate_finetune(h_up2, lr=3e-3, steps=500_000)\n\n # Final upsampling to max length with extended fine-tuning\n h_up3 = _upsample_1d(h_up2)\n h_up3, _ = _single_candidate_finetune(h_up3, lr=3e-3, steps=500_000)\n\n # Final refinement with clipping\n h_final = np.clip(h_up3, 0.0, 1000.0)\n heights = h_final.tolist()\n r_value = evaluate_sequence(heights)\n print(f\"Final C2 lower bound: {r_value:.6f}\")\n return heights\n```",
"env/all/time/policy": 332.55639649229124,
"env/all/time/policy/min": 146.52192783355713,
"env/all/time/policy/max": 429.9778757095337,
"env/all/time/env_step": 2618.250516897533,
"env/all/time/env_step/min": 0.009935379028320312,
"env/all/time/env_step/max": 5220.426249742508,
"env/all/time/reward_compute": 3.632158041000366e-07,
"env/all/time/reward_compute/min": 2.1606683731079102e-07,
"env/all/time/reward_compute/max": 7.37607479095459e-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.029159579426050186,
"advantage/min": -1.0,
"advantage/max": 11.101572036743164,
"time/assemble_training_data": 6.187422513961792,
"time/kl_vs_base": 95.96426200866699,
"kl_policy_base": 0.0006243913667276502,
"time/train": 679.7317028045654,
"time/save_checkpoint": 5.4947240352630615,
"time/total": 6443.156280040741
}
[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