<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://damoonsh.github.io/w/feed.xml" rel="self" type="application/atom+xml" /><link href="https://damoonsh.github.io/w/" rel="alternate" type="text/html" /><updated>2026-06-19T20:04:56+00:00</updated><id>https://damoonsh.github.io/w/feed.xml</id><title type="html">Damoon Shahhosseini</title><subtitle>My clone repository</subtitle><entry><title type="html">Post-Training Releases Survey: Nemotron Cascade, KIMI-DEV, Hermes 4, and Intellect-3</title><link href="https://damoonsh.github.io/w/2026/05/12/posttraining-releases-survey.html" rel="alternate" type="text/html" title="Post-Training Releases Survey: Nemotron Cascade, KIMI-DEV, Hermes 4, and Intellect-3" /><published>2026-05-12T00:00:00+00:00</published><updated>2026-05-12T00:00:00+00:00</updated><id>https://damoonsh.github.io/w/2026/05/12/posttraining-releases-survey</id><content type="html" xml:base="https://damoonsh.github.io/w/2026/05/12/posttraining-releases-survey.html"><![CDATA[<h2 id="introduction">Introduction</h2>

<p>Recent months have seen a surge in post-training (instruction tuning, RLHF, preference optimization) releases from research labs and open-source communities. This survey covers four notable releases from 2025–2026 that push the boundaries of how models are refined after pre-training:</p>

<ul>
  <li><strong>Nemotron Cascade</strong> — NVIDIA’s cascade architecture for post-trained models</li>
  <li><strong>KIMI-DEV</strong> — A specialized post-training approach with developer-focused capabilities</li>
  <li><strong>Hermes 4</strong> — PowerLM’s latest open-weight post-trained model</li>
  <li><strong>Intellect-3</strong> — A reasoning-oriented post-training release</li>
</ul>

<p>Below we summarize each paper, then pull together cross-cutting themes around methodology, data, and trends in the post-training space.</p>

<hr />

<h2 id="nemotron-cascade">Nemotron Cascade</h2>

<p><strong>Paper:</strong> <a href="https://arxiv.org/html/2603.19220v2">Nemotron-Cascade 2: Post-Training LLMs with Cascade RL and Multi-Domain On-Policy Distillation</a>
<strong>Authors:</strong> Zihan Liu, Yang Chen, Wenliang Dai, Boxin Wang, Sheng-Chieh Lin, Chankyu Lee, Yangyi Chen, Dongfu Jiang, Jiafan He, Renjie Pi, Grace Lam, Nayeon Lee, Alexander Bukharin, Mohammad Shoeybi, Bryan Catanzaro, Wei Ping (NVIDIA)
<strong>arXiv:</strong> 2603.19220v2 [cs.CL], March 22, 2026
<strong>License:</strong> CC BY 4.0</p>

<h3 id="overview">Overview</h3>

<p>Nemotron-Cascade 2 is the successor to Nemotron-Cascade 1, introducing an open-weight <strong>30B Mixture-of-Experts (MoE)</strong> model with only <strong>3B activated parameters</strong> that achieves gold-medal-level performance in top-tier mathematical and coding competitions — IMO 2025, IOI 2025, and ICPC World Finals 2025. Despite its compact size, it outperforms larger models like Nemotron-3-Super-120B-A12B and Qwen3.5-35B-A3B across mathematics, code reasoning, alignment, and instruction-following benchmarks. It is the second open-weight LLM (after DeepSeek-V3.2-Speciale) to achieve gold medals in both IMO and IOI, with <strong>20× fewer parameters</strong>.</p>

<h3 id="key-contributions">Key Contributions</h3>

<ul>
  <li><strong>Cascade RL at scale</strong>: Expands the original Cascade RL framework (from Nemotron-Cascade 1) to cover a much broader spectrum of reasoning and agentic domains, with a revised stage ordering to mitigate inter-domain interference</li>
  <li><strong>Multi-Domain On-Policy Distillation (MOPD)</strong>: A novel training stage inserted into the cascade pipeline that uses domain-specific intermediate teacher checkpoints (from the same SFT initialization) to recover benchmark regressions and stabilize performance</li>
  <li><strong>Revised cascade ordering</strong>: IF-RL is now placed first (rather than later) because instruction-following training can degrade human alignment, and a strong IF model serves as a better teacher for subsequent distillation</li>
  <li><strong>Multi-domain RL integration</strong>: Groups non-conflicting domains (MCQA STEM, tool calling, structured output) into joint training stages for efficiency</li>
  <li><strong>Full open-source release</strong>: Model weights, SFT data, RL data, and detailed training methodology are all released</li>
</ul>

<h3 id="architecture">Architecture</h3>

<ul>
  <li><strong>Base model</strong>: Nemotron-3-Nano-30B-A3B-Base (same initialization as its predecessor)</li>
  <li><strong>Architecture</strong>: MoE with 30B total parameters, 3B active per token</li>
  <li><strong>Context window</strong>: Up to 256K tokens (SFT), with specific RL stages supporting 49K, 98K, and 118K response lengths</li>
  <li><strong>Chat template</strong>: Two modes — “thinking mode” (single <code class="language-plaintext highlighter-rouge">&lt;think&gt;</code> followed by newline) and “non-thinking mode” (adjacent <code class="language-plaintext highlighter-rouge">&lt;think&gt;&lt;/think&gt;</code> tokens). Tool calls use <code class="language-plaintext highlighter-rouge">&lt;tool_call&gt;</code>/<code class="language-plaintext highlighter-rouge">&lt;/tool_call&gt;</code> tags with tools listed in system prompt</li>
</ul>

<h3 id="training-pipeline">Training Pipeline</h3>

<p>The full post-training pipeline is a <strong>9-stage sequence</strong> (SFT + 8 RL stages), as illustrated in the paper’s Figure 2:</p>

<ol>
  <li><strong>SFT</strong> — Supervised fine-tuning on a broad dataset (~15M+ samples across 10 domains), packed into 256K sequences, trained for ~1.5 epochs</li>
  <li><strong>IF-RL</strong> — Instruction-following RL (verifiable constraints, thinking mode only, dynamic filtering, overlong penalty)</li>
  <li><strong>Multi-domain RL</strong> — Joint training on MCQA STEM (55%), agentic tool calling (30%), and structured output (15%)</li>
  <li><strong>MOPD</strong> — Multi-domain on-policy distillation from 3 teacher checkpoints (math, RLHF, multi-domain) using reverse-KL token-level advantages with truncated importance weighting</li>
  <li><strong>RLHF</strong> — Human preference learning using a generative reward model (Qwen3-235B-A22B-Thinking), thinking mode only, length-normalized rewards</li>
  <li><strong>Long-context RL</strong> — Reasoning over 32K input sequences (49K max output), LLM judge evaluation</li>
  <li><strong>Code RL</strong> — Competitive coding with strict binary rewards, 118K max response length, async reward verification on 384 CPU cores</li>
  <li><strong>SWE RL</strong> — Two sub-stages: Agentless RL (code repair with GPT-OSS-120B reward model) and execution-based RL in agentic OpenHands scaffolds</li>
  <li><strong>Final model</strong>: Nemotron-Cascade-2-30B-A3B</li>
</ol>

<h3 id="sft-data-curation-section-3">SFT Data Curation (Section 3)</h3>

<p>The SFT dataset spans <strong>10 domains</strong> with carefully curated high-quality data generated by teacher models (GPT-OSS-120B, DeepSeek-V3.2, DeepSeek-V3.2-Speciale, Qwen3-235B):</p>

<table>
  <thead>
    <tr>
      <th>Domain</th>
      <th>Key Data Sources</th>
      <th>Sample Count</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Math (competition)</td>
      <td>Nemotron-Cascade, Nemotron-Math-v2, Nemotron-3-Nano</td>
      <td>4.4M (1.8M tool-calling + 2.6M non-tool)</td>
    </tr>
    <tr>
      <td>Math (proof)</td>
      <td>AOPS split of Nemotron-Math-Proofs-v1</td>
      <td>816K (410K generation + 400K verification)</td>
    </tr>
    <tr>
      <td>Code reasoning</td>
      <td>OpenCode-Stage2, OpenCodeReasoning, HardTests (Codeforces, AtCoder)</td>
      <td>4.2M traces (Python + C++ + tool-calling)</td>
    </tr>
    <tr>
      <td>Scientific coding</td>
      <td>Biology, materials, physics, chemistry prompts</td>
      <td>1.1M</td>
    </tr>
    <tr>
      <td>Science</td>
      <td>Physics, chemistry, biology</td>
      <td>2.7M</td>
    </tr>
    <tr>
      <td>Long context</td>
      <td>Nemotron-3-Nano, ChatQA-2</td>
      <td>234K (avg 128K tokens)</td>
    </tr>
    <tr>
      <td>General chat</td>
      <td>LMSYS, WildChat, role-playing multi-turn</td>
      <td>~10M</td>
    </tr>
    <tr>
      <td>Instruction following</td>
      <td>Nemotron-Cascade 1, Nemotron-3-Nano</td>
      <td>~730K</td>
    </tr>
    <tr>
      <td>Safety</td>
      <td>Nemotron Content Safety v2, Gretel, Harmful Tasks</td>
      <td>4K</td>
    </tr>
    <tr>
      <td>Conversational agent</td>
      <td>Multi-turn tool-use</td>
      <td>822K</td>
    </tr>
    <tr>
      <td>SWE agent</td>
      <td>OpenHands, SWE-Agent, agentless scaffolds</td>
      <td>514K (125K agentic + 389K agentless)</td>
    </tr>
    <tr>
      <td>Terminal agent</td>
      <td>Terminal-Task-Gen framework, Docker environments</td>
      <td>490K</td>
    </tr>
  </tbody>
</table>

<h3 id="cascade-rl-details-section-4">Cascade RL Details (Section 4)</h3>

<p>All RL stages use <strong>GRPO (Group Relative Policy Optimization)</strong> with strict <strong>on-policy training</strong> — no KL divergence term, simplified to a REINFORCE objective with group-normalized rewards:</p>

\[\mathcal{J}_{\text{GRPO}}(\theta) = \mathbb{E}_{(q,a)\sim\mathcal{D},\{o_i\}\sim\pi_\theta}[\frac{1}{\sum|o_i|}\sum\sum\hat{A}_{i,t}]\]

<p>where advantage is group-normalized: $\hat{A}_{i,t} = \frac{r_i - \text{mean}(r)}{\text{std}(r)}$</p>

<p><strong>Key design decisions:</strong></p>
<ul>
  <li><strong>LR = 3e-6</strong> with AdamW across all RL stages consistently</li>
  <li><strong>Temperature = 1.0</strong>, top-p = 1.0 for exploration</li>
  <li><strong>Batch size = 128</strong>, <strong>16 rollouts per prompt</strong> (Code RL and SWE RL use 64 rollouts)</li>
  <li><strong>Entropy and KL coefficients set to 0</strong> in most stages (KL=0.03 in RLHF to preserve capabilities)</li>
  <li><strong>Dynamic filtering</strong> in IF-RL removes batch-homogeneous samples for effective gradients</li>
  <li><strong>Overlong penalty</strong> prevents excessive token usage in instruction-following</li>
</ul>

<p><strong>MOPD (Multi-Domain On-Policy Distillation)</strong> is a standout innovation:</p>
<ul>
  <li>Uses token-level reverse-KL distillation advantage:<br />
<em>aₜ<sup>MOPD</sup> = log π<sub>teacher</sub>(yₜ|sₜ) − log π<sub>train</sub>(yₜ|sₜ)</em>
<!-- rendered as math: aₜᴹᴼᴾᴰ = log π_teacher(yₜ|sₜ) − log π_train(yₜ|sₜ) --></li>
  <li>Applies <strong>truncated importance weighting</strong> ($\epsilon_{low}=0.5$, $\epsilon_{high}=2.0$) to handle train-inference mismatch</li>
  <li>3 teacher checkpoints selected from the cascade pipeline itself — math teacher (SFT checkpoint), RLHF teacher, multi-domain teacher</li>
  <li><strong>2×–3× more sample-efficient</strong> than GRPO on AIME25 and ArenaHard</li>
</ul>

<h3 id="results-and-benchmarks-section-2">Results and Benchmarks (Section 2)</h3>

<p><strong>Competitive performance:</strong></p>

<table>
  <thead>
    <tr>
      <th>Competition</th>
      <th>Problems Solved</th>
      <th>Score</th>
      <th>Medal</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>IMO 2025</td>
      <td>5/6 (P1-P5)</td>
      <td>35/42</td>
      <td>Gold</td>
    </tr>
    <tr>
      <td>IOI 2025</td>
      <td>5/6 (A,B,C,D,F)</td>
      <td>439.28/600</td>
      <td>Gold</td>
    </tr>
    <tr>
      <td>ICPC World Finals 2025</td>
      <td>10/12</td>
      <td>—</td>
      <td>Gold</td>
    </tr>
  </tbody>
</table>

<p><strong>Benchmark highlights (Table 1):</strong></p>

<table>
  <thead>
    <tr>
      <th>Category</th>
      <th>Benchmark</th>
      <th>Nemotron-Cascade-2</th>
      <th>Qwen3.5-35B</th>
      <th>Nemotron-3-Super-120B</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Math</td>
      <td>AIME 2025</td>
      <td><strong>92.4</strong> (98.6†)</td>
      <td>91.9†</td>
      <td>90.2</td>
    </tr>
    <tr>
      <td>Math</td>
      <td>HMMT Feb25</td>
      <td><strong>94.6</strong></td>
      <td>89.0</td>
      <td>93.7</td>
    </tr>
    <tr>
      <td>Code</td>
      <td>LiveCodeBench v6</td>
      <td><strong>87.2</strong> (88.4†)</td>
      <td>74.6</td>
      <td>78.7</td>
    </tr>
    <tr>
      <td>Code</td>
      <td>LiveCodeBenchPro Med</td>
      <td><strong>27.6</strong> (36.8†)</td>
      <td>17.8</td>
      <td>23.2</td>
    </tr>
    <tr>
      <td>Alignment</td>
      <td>ArenaHard v2</td>
      <td><strong>83.5</strong></td>
      <td>65.4†</td>
      <td>—</td>
    </tr>
    <tr>
      <td>Alignment</td>
      <td>IFBench (prompt)</td>
      <td><strong>82.9</strong></td>
      <td>70.2</td>
      <td>72.6</td>
    </tr>
    <tr>
      <td>Long context</td>
      <td>NIAH@1M</td>
      <td><strong>99.0</strong></td>
      <td>94.3†</td>
      <td>98.3</td>
    </tr>
    <tr>
      <td>Agentic</td>
      <td>SWE Verified</td>
      <td>50.2</td>
      <td>69.2</td>
      <td>60.5</td>
    </tr>
  </tbody>
</table>

<p>Notable: Underperforms Qwen3.5-35B on knowledge-intensive benchmarks (MMLU-Redux, GPQA-Diamond) and some agentic tasks, pointing to stronger pre-training and agentic RL as areas for future work.</p>

<h3 id="open-data-and-code-released">Open Data and Code Released</h3>

<ul>
  <li><strong>Model weights</strong>: Nemotron-Cascade-2-30B-A3B (post-trained checkpoint)</li>
  <li><strong>SFT data</strong>: Nemotron-Cascade-2-SFT-Data — collection of all SFT training datasets</li>
  <li><strong>RL data</strong>: Nemotron-Cascade-2-RL-Data — collection of all RL training datasets</li>
  <li><strong>Training methodology</strong>: Full hyperparameters, prompt templates, and training configuration in the paper and appendix</li>
</ul>

<h3 id="notable-design-decisions">Notable Design Decisions</h3>

<ul>
  <li><strong>IF-RL first, not last</strong>: Reversed the cascade ordering from Nemotron-Cascade 1 because IF-RL degrades ArenaHard scores, but subsequent RLHF recovers them; also produces a better teacher for MOPD</li>
  <li><strong>Thinking mode exclusively in IF-RL and RLHF</strong>: Thinking mode yields higher IFBench accuracy; RLHF in thinking mode prevents instruction-following regression</li>
  <li><strong>No KL divergence in GRPO</strong>: Simplifies the objective and improves stability; KL=0.03 only in RLHF to prevent catastrophic forgetting</li>
  <li><strong>Domain-specific ordering driven by interference analysis</strong>: The cascade order is not fixed — it adapts based on inter-domain interference patterns observed during training</li>
  <li><strong>Agentless RL helps agentic tasks</strong>: Agentless SWE RL (code repair) improves Pass@4 on SWE-bench Verified by ~1–2 points even in agentic (OpenHands) evaluation, suggesting code repair capability generalizes across scaffolds</li>
</ul>

<hr />

<h2 id="intellect-3">Intellect-3</h2>

<p><strong>Source:</strong> <a href="https://arxiv.org/abs/2512.16144">arXiv:2512.16144</a> — “INTELLECT-3: Technical Report” by the Prime Intellect Team (23 authors, Dec 2025)</p>

<p>INTELLECT-3 is a 106B-parameter Mixture-of-Experts language model (12B parameters active per token) built on top of the GLM-4.5-Air base and trained end-to-end with large-scale reinforcement learning. It achieves state-of-the-art performance for its weight class across math, code, science, and reasoning benchmarks — outperforming several frontier models with 3×–6× more parameters.</p>

<h3 id="key-contributions-1">Key Contributions</h3>

<ul>
  <li><strong>106B MoE model (12B active)</strong> trained with RLVR that competes with models far larger than itself</li>
  <li><strong>prime-rl</strong>: an open-source, production-scale asynchronous RL framework that scales from a single node to thousands of GPUs</li>
  <li><strong>Full infrastructure open-sourced</strong>: training framework, verifiers library, Environments Hub registry, complete training recipe (SFT + RL), and all environments used for synthetic data generation, training, and evaluation</li>
  <li><strong>Agentic-first RL design</strong>: first-class support for multi-turn interactions, tool use, sandboxed code execution, and long-horizon reasoning</li>
  <li><strong>Novel training algorithm</strong>: masked token-level importance sampling (IcePop) to stabilize off-policy RL training</li>
</ul>

<h3 id="architecture-and-model-details">Architecture and Model Details</h3>

<ul>
  <li><strong>Base model:</strong> GLM-4.5-Air (by Z.ai / 零一万物)</li>
  <li><strong>Architecture:</strong> Mixture-of-Experts (MoE) — 106B total parameters, 12B active per forward pass</li>
  <li><strong>Context window:</strong> trained up to 65K natively, extended to 98K via context parallelism during agentic SFT</li>
  <li><strong>Chat template:</strong> inspired by Qwen3 and GLM-family, using control tokens (<code class="language-plaintext highlighter-rouge">&lt;|system|&gt;</code>, <code class="language-plaintext highlighter-rouge">&lt;|user|&gt;</code>, <code class="language-plaintext highlighter-rouge">&lt;|assistant|&gt;</code>, ``, `</li>
</ul>
<p>&lt;/think&gt;</p>

<p>`) with XML-style tool call tagging</p>
<ul>
  <li><strong>Always-reasoning design:</strong> a <code class="language-plaintext highlighter-rouge">&lt;|think|&gt;</code> token is appended via the chat template; reasoning chains are auto-parsed across turns via the <code class="language-plaintext highlighter-rouge">reasoning_content</code> field</li>
  <li><strong>No user-exposed reasoning-effort controls</strong> — reasoning is always on</li>
</ul>

<h3 id="training-pipeline-1">Training Pipeline</h3>

<p>The training follows a <strong>two-stage SFT + RL</strong> recipe, carried out on a cluster of <strong>512 NVIDIA H200 GPUs</strong> over ~2 months:</p>

<p><strong>Stage 1 — General Reasoning SFT:</strong></p>
<ul>
  <li>Dataset combines NVIDIA Nemotron-Post-Training-Dataset-v1 splits (math, code, science, tool) and AM-DeepSeek-R1-0528-Distilled (chat, instruction following)</li>
  <li>Synthetic reasoning traces from DeepSeek-R1-0528</li>
  <li>~33M tokens per step, context length 65K, 1 full epoch</li>
  <li>Muon optimizer, LR 5e-5 (warmup from 1e-8 over 300 steps), FSDP world size 64</li>
</ul>

<p><strong>Stage 2 — Agentic SFT:</strong></p>
<ul>
  <li>Smaller, curated dataset: SWE-Swiss, Toucan Tool, and synthetically generated data from Environments Hub environments using DeepSeek-R1-0528</li>
  <li>Tools: SWE Swiss (10.3K examples), Toucan Tool (116K examples), environments mix (38.4K examples)</li>
  <li>2 epochs, context parallelism extended to 98K</li>
  <li>Muon optimizer, LR 5e-8, linear decay over 800 steps</li>
</ul>

<p><strong>Reinforcement Learning:</strong></p>
<ul>
  <li><strong>Algorithm:</strong> Masked token-level importance sampling (IcePop) with double-sided masking (α=0.5, β=5)</li>
  <li><strong>Batch:</strong> 256 prompts × 16 rollouts = 4,096 total, max context 65,536</li>
  <li><strong>Optimizer:</strong> Muon at LR 1e-6</li>
  <li><strong>Training compute:</strong> 60 H200 nodes (16 for training, 44 for inference) at ~1:3 ratio</li>
  <li><strong>Step time:</strong> ~1,500 seconds per step at 65K sequence length</li>
  <li><strong>Key RL features:</strong>
    <ul>
      <li>Asynchronous off-policy training (max 8 off-policy steps)</li>
      <li>Continuous batching with in-flight weight updates</li>
      <li>Online difficulty filtering (easy/normal/hard pools based on solve rate)</li>
      <li>Multi-environment RL via EnvGroup pattern</li>
    </ul>
  </li>
  <li>RL reward curves showed no sign of plateauing at end of training</li>
</ul>

<h3 id="training-environments">Training Environments</h3>

<p>Diverse mix of 6 environment categories, all from the open Environments Hub:</p>

<table>
  <thead>
    <tr>
      <th>Category</th>
      <th>Problems</th>
      <th>Verification</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>Math</strong></td>
      <td>21.2K (from Skywork-OR1, Acereason-Math, DAPO, ORZ-Hard)</td>
      <td>math-verify + CompassVerifier-7B LLM-judge</td>
    </tr>
    <tr>
      <td><strong>Code</strong></td>
      <td>8.6K (from SYNTHETIC-2)</td>
      <td>Up to 15 test cases per problem in Prime Sandboxes</td>
    </tr>
    <tr>
      <td><strong>Science</strong></td>
      <td>29.3K (from MegaScience)</td>
      <td>math-verify + LLM-judge, domains: physics, chemistry, biology</td>
    </tr>
    <tr>
      <td><strong>Logic</strong></td>
      <td>11.6K (from SynLogic)</td>
      <td>Boolean eval, crosswords, Sudoku, Minesweeper</td>
    </tr>
    <tr>
      <td><strong>Deep Research</strong></td>
      <td>2.2K (from DeepDive)</td>
      <td>Web search, click, open, finish tools</td>
    </tr>
    <tr>
      <td><strong>Software Engineering</strong></td>
      <td>2 environments (deepswe, mini-swe-agent-plus)</td>
      <td>Repository test suites, 200 max turns</td>
    </tr>
  </tbody>
</table>

<p>Difficulty annotations for all environments use solve rates of Qwen3-4B-Instruct (8–16 generations per problem).</p>

<h3 id="key-infrastructure-components">Key Infrastructure Components</h3>

<p><strong>prime-rl</strong> — Asynchronous RL training framework:</p>
<ul>
  <li>Disaggregated trainer (FSDP2) and inference (vLLM) on separate GPU pools</li>
  <li>Continuous batching with in-flight weight updates (rollouts can span multiple policies)</li>
  <li>Multi-client orchestrator for linear throughput scaling across nodes</li>
  <li>Online data filtering with dynamic difficulty pools</li>
  <li>Distributed Muon optimizer (all-to-all–based, avoids InfiniBand congestion)</li>
  <li>Efficient MoE support — expert parallelism disabled for their config (grouped gemm already saturated)</li>
</ul>

<p><strong>Verifiers + Environments Hub</strong> — Modular RL environment system:</p>
<ul>
  <li>Environments are standalone installable Python modules with standardized entry points</li>
  <li>Class hierarchy: Environment → MultiTurnEnv → ToolEnv → StatefulToolEnv → SandboxEnv → CodeEnv</li>
  <li>Environments Hub is an open registry for versioned, shareable environment packages</li>
  <li>Training and evaluation use the same rollout/rubric entrypoints for consistency</li>
</ul>

<p><strong>Prime Sandboxes</strong> — High-throughput code execution:</p>
<ul>
  <li>Custom Rust Gateway bypasses Kubernetes API Server to avoid etcd bottlenecks</li>
  <li>Headless Services + custom CoreDNS for millisecond pod IP resolution</li>
  <li>Sidecar pattern with nsenter for direct command injection</li>
  <li>Up to 2,000+ concurrent sandboxes per step, 256 sandboxes/node with Burstable QoS</li>
  <li>gVisor (runsc) for container isolation, Container Image Streaming for fast startup</li>
</ul>

<h3 id="results">Results</h3>

<p>All benchmarks evaluated using the same open-source Environments Hub implementations with API models routed through official providers:</p>

<table>
  <thead>
    <tr>
      <th>Benchmark</th>
      <th>INTELLECT-3</th>
      <th>GLM-4.5-Air</th>
      <th>GLM-4.5</th>
      <th>GLM-4.6</th>
      <th>DeepSeek R1</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>AIME 2024</strong></td>
      <td><strong>90.8</strong></td>
      <td>84.6</td>
      <td>85.8</td>
      <td>92.0</td>
      <td>83.2</td>
    </tr>
    <tr>
      <td><strong>AIME 2025</strong></td>
      <td><strong>88.0</strong></td>
      <td>82.0</td>
      <td>83.3</td>
      <td>90.3</td>
      <td>73.4</td>
    </tr>
    <tr>
      <td><strong>LiveCodeBench v6</strong></td>
      <td><strong>69.3</strong></td>
      <td>61.5</td>
      <td>64.5</td>
      <td>73.0</td>
      <td>62.5</td>
    </tr>
    <tr>
      <td><strong>GPQA Diamond</strong></td>
      <td>74.4</td>
      <td>73.3</td>
      <td>77.0</td>
      <td>78.8</td>
      <td>77.5</td>
    </tr>
    <tr>
      <td><strong>HLE</strong></td>
      <td>14.6</td>
      <td>13.3</td>
      <td>14.8</td>
      <td>13.3</td>
      <td>15.9</td>
    </tr>
    <tr>
      <td><strong>MMLU-Pro</strong></td>
      <td>81.9</td>
      <td>73.9</td>
      <td>83.5</td>
      <td>83.1</td>
      <td>75.3</td>
    </tr>
  </tbody>
</table>

<p>Notable: INTELLECT-3 matches or exceeds GLM-4.5 (3× larger) on AIME 2024, AIME 2025, and LiveCodeBench v6. On AIME 2024 and AIME 2025, it comes within ~2 points of the 3× larger GLM-4.6. Coding benchmark (LCB v6) exceeds GLM-4.5-Air post-train by 8 percentage points.</p>

<h3 id="open-source-releases">Open-Source Releases</h3>

<table>
  <thead>
    <tr>
      <th>Asset</th>
      <th>Link</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>Model</strong></td>
      <td>HuggingFace: <a href="https://huggingface.co/PrimeIntellect/INTELLECT-3">PrimeIntellect/INTELLECT-3</a></td>
    </tr>
    <tr>
      <td><strong>prime-rl</strong> (RL framework)</td>
      <td>GitHub: <a href="https://github.com/PrimeIntellect-ai/prime-rl">PrimeIntellect-ai/prime-rl</a></td>
    </tr>
    <tr>
      <td><strong>Environments</strong></td>
      <td>Hub: <a href="https://hub.primeintellect.ai">hub.primeintellect.ai</a></td>
    </tr>
    <tr>
      <td><strong>Verifiers library</strong></td>
      <td>Referenced for environment construction</td>
    </tr>
    <tr>
      <td><strong>Prime Sandboxes docs</strong></td>
      <td><a href="https://docs.primeintellect.ai/sandboxes/overview">docs.primeintellect.ai/sandboxes</a></td>
    </tr>
    <tr>
      <td><strong>License</strong></td>
      <td>CC-BY 4.0</td>
    </tr>
  </tbody>
</table>

<h3 id="notable-design-decisions-1">Notable Design Decisions</h3>

<ul>
  <li><strong>IcePop over PPO/GRPO:</strong> The masked token-level importance sampling approach with double-sided masking was critical to stabilize trainer-inference distribution mismatch, avoiding the reward collapse seen with GSPO under high off-policyness</li>
  <li><strong>Muon optimizer throughout:</strong> Pretrained with Muon, so post-training also uses Muon (matrix-level updates) — LR 5e-5 for SFT, 1e-6 for RL</li>
  <li><strong>No expert parallelism:</strong> Despite being an MoE, EP was disabled because their sequence length + hidden dim configuration already saturated grouped gemm kernels</li>
  <li><strong>In-flight weight updates are essential:</strong> Without them, step times more than doubled due to inference inefficiency in continuous batching</li>
  <li><strong>Context as a scarce resource:</strong> Future work treats the context window as actively managed (cutting, branching, external memory) rather than a passive transcript, motivated by “context rot” in long-context models</li>
  <li><strong>Training not converged:</strong> At end of RL, all benchmark curves were still trending upward with no plateau, suggesting significant room for continued training</li>
</ul>

<hr />
<h2 id="kimi-dev">KIMI-DEV</h2>

<p><strong>Paper:</strong> <a href="https://arxiv.org/abs/2509.23045">Kimi-Dev: Agentless Training as Skill Prior for SWE-Agents</a> (Yang et al., Moonshot AI + Tsinghua + PKU, 68 pages, v3, Dec 2025)</p>

<p>Kimi-Dev introduces a paradigm shift in how SWE (Software Engineering) LLMs are trained, arguing that the two dominant paradigms — agentic multi-turn frameworks (SWE-Agent, OpenHands) and workflow-based agentless methods (Agentless) — are not mutually exclusive. Instead, agentless training induces structured <em>skill priors</em> that enable highly efficient adaptation to agentic settings. The result: an open-source 72B model achieving state-of-the-art performance among workflow approaches on SWE-bench, and an SWE-Agent fine-tuned variant competitive with Claude 3.5 Sonnet.</p>

<h3 id="what-makes-kimi-dev-novel">What Makes Kimi-Dev Novel</h3>

<ul>
  <li><strong>Agentless as skill prior, not endpoint</strong>: The core thesis is that agentless training should be viewed as a means to induce atomic capabilities (localization, code edit, self-reflection, verification) rather than the final product. These skills transfer to agentic frameworks, bridging what has been seen as a paradigm dichotomy.</li>
  <li><strong>Duo framework: BugFixer + TestWriter</strong>: Instead of a single monolithic solver, Kimi-Dev splits the role into two specialized modules: the <strong>BugFixer</strong> (produces patches to fix bugs) and the <strong>TestWriter</strong> (creates reproducible unit tests that capture the reported bug). Both share two core skills — file localization and code edit.</li>
  <li><strong>Execution-based rewards only</strong>: Unlike SWE-RL which uses text-similarity rewards, Kimi-Dev uses pure outcome-based rewards (0 or 1 from environment execution), yielding more reliable fix quality signals.</li>
  <li><strong>Curriculum-based RL with adaptive prompt selection</strong>: Prompts with pass@16 = 0 are initially discarded, then 500 new prompts are reintroduced every 100 RL steps as the model improves, creating a curriculum that gradually raises task difficulty.</li>
</ul>

<h3 id="architecture-and-methodology">Architecture and Methodology</h3>

<p>The training recipe consists of four sequential stages:</p>

<ol>
  <li><strong>Mid-Training</strong> (~150B tokens): Starting from Qwen 2.5-72B-Base, the model is mid-trained on millions of GitHub issues and PR commits:
    <ul>
      <li>~50B tokens from Agentless-style data (diff patches)</li>
      <li>~20B tokens from curated PR commit packs</li>
      <li>~20B tokens of synthetic reasoning/agentic interaction data (upsampled 4×)</li>
      <li>Strict decontamination against SWE-bench Verified test repositories</li>
    </ul>
  </li>
  <li>
    <p><strong>Cold Start via Reasoning SFT</strong>: ~2,000 long Chain-of-Thought trajectories generated by DeepSeek R1 (20250120 version) acting as BugFixer/TestWriter. This activates the model’s long CoT capability for problem analysis, method sketching, self-refinement, and exploration of alternatives.</p>
  </li>
  <li><strong>Reinforcement Learning (Code Edit Stage)</strong>: Using the Kimi k1.5 policy optimization method (a REINFORCE-based approach with averaged rollout rewards as baseline, similar to GRPO). Key design choices:
    <ul>
      <li>Outcome-only reward (no format/process penalties)</li>
      <li>BugFixer rewarded when patch passes all ground-truth unit tests</li>
      <li>TestWriter rewarded when test fails on pre-fix code AND passes after fix</li>
      <li>Kubernetes-based Docker sandbox supporting 10,000+ concurrent instances</li>
      <li>Max context length: 64K tokens</li>
    </ul>
  </li>
  <li><strong>Test-Time Self-Play</strong>: At inference, the model generates 40 candidate patches (1 greedy + 39 at temperature 1) and 40 candidate tests, then scores each patch-test pair using a composite metric based on fail-to-pass and pass-to-pass transitions across the test suite. 3 patch-test pairs already outperform 40-patch majority voting.</li>
</ol>

<h3 id="training-approach-post-training-deep-dive">Training Approach (Post-Training Deep Dive)</h3>

<table>
  <thead>
    <tr>
      <th>Stage</th>
      <th>Method</th>
      <th>Data</th>
      <th>Key Details</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Mid-training</td>
      <td>SFT on raw GitHub data</td>
      <td>~150B tokens from millions of repos</td>
      <td>Qwen 2.5-72B-Base start; agent loss masking; synthetic agentic tool interaction</td>
    </tr>
    <tr>
      <td>Cold start</td>
      <td>SFT with reasoning CoT</td>
      <td>~2,000 trajectories from DeepSeek R1</td>
      <td>Activates long CoT, self-reflection, alternative exploration</td>
    </tr>
    <tr>
      <td>RL</td>
      <td>REINFORCE-based policy optimization (k1.5 style)</td>
      <td>SWE-Gym + SWE-bench-extra union; 1,024 problems; 10 rollouts each</td>
      <td>Code-edit only; curriculum learning; positive example reinforcement</td>
    </tr>
    <tr>
      <td>Agent SFT</td>
      <td>Supervised fine-tuning on trajectories</td>
      <td>5,016 SWE-Agent trajectories (from SWE-Smith, collected with Claude 3.7 Sonnet)</td>
      <td>64K context for training, 128K/100 turns at inference</td>
    </tr>
  </tbody>
</table>

<h3 id="results-and-benchmarks">Results and Benchmarks</h3>

<p><strong>Agentless (Kimi-Dev 72B) on SWE-bench Verified:</strong></p>

<table>
  <thead>
    <tr>
      <th>Model</th>
      <th>Params</th>
      <th>Resolve Rate</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>SWE-SWISS</td>
      <td>32B</td>
      <td>58.2%</td>
    </tr>
    <tr>
      <td>DeepSeek-R1-0528</td>
      <td>671B</td>
      <td>57.6%</td>
    </tr>
    <tr>
      <td><strong>Kimi-Dev (Ours)</strong></td>
      <td><strong>72B</strong></td>
      <td><strong>60.4%</strong></td>
    </tr>
  </tbody>
</table>

<ul>
  <li>60.4% pass@40 on SWE-bench Verified — the best among all workflow-based/open-source approaches</li>
  <li>Mid-training token budget scales linearly with performance (50B → 100B → 150B all improve)</li>
  <li>RL shows clear scaling: both pass rate and response length increase throughout training</li>
</ul>

<p><strong>Agent SFT (Kimi-Dev → SWE-Agent) on SWE-bench Verified:</strong></p>

<table>
  <thead>
    <tr>
      <th>Model</th>
      <th>System</th>
      <th>Pass@1</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>Kimi-Dev (SFTed)</strong></td>
      <td>SWE-Agent</td>
      <td><strong>48.6%</strong></td>
    </tr>
    <tr>
      <td>Claude 3.5 Sonnet (241022)</td>
      <td>SWE-Agent</td>
      <td>49.0%</td>
    </tr>
    <tr>
      <td>SWE-agent-LM</td>
      <td>32B</td>
      <td>40.2%</td>
    </tr>
    <tr>
      <td>DeepSWE</td>
      <td>32B</td>
      <td>42.2%</td>
    </tr>
  </tbody>
</table>

<ul>
  <li>Achieves near-parity with Claude 3.5 Sonnet using only 5K public trajectories</li>
  <li>Pass@10 of 74.0% surpasses Agentless pass@30 of 73.8%, showing higher ceiling for agentic frameworks</li>
  <li>RL prior needs only 2^23 SFT tokens to match what the Base model achieves with 1.5 × 2^28 tokens — a 512× data efficiency gain</li>
</ul>

<p><strong>Skill Transfer Analysis:</strong></p>
<ul>
  <li>RL-prior models continue improving beyond 70 turns in SWE-Agent, while SFT/MT/Base priors plateau at 50-70 turns</li>
  <li>BugFixer skill at Stage-3 cutoff: 484 cases (Base) → 605 cases (RL prior) resolved within 3 passes</li>
  <li>Reflection skill gains: +94 (Base) → +113 (RL prior) additional cases resolved through reflection/redo</li>
</ul>

<p><strong>Generalization:</strong></p>
<ul>
  <li>Performance holds on SWE-bench-Live and SWE-bench Multilingual (300 tasks across 9 languages: Rust, Java, PHP, Ruby, JS/TS, Go, C/C++)</li>
  <li>RL prior consistently outperforms Base/MT/SFT priors across all agent trajectory scales on multilingual benchmarks</li>
</ul>

<p><strong>Emergent Parallel Scaling:</strong></p>
<ul>
  <li>Without any additional training, Kimi-Dev exhibits parallel scaling: feeding multiple patch candidates into a single prompt and asking the model to synthesize a combined fix yields improving performance with more candidates. This emerges naturally from the training recipe.</li>
</ul>

<h3 id="open-data-and-code">Open Data and Code</h3>

<ul>
  <li><strong>Model weights</strong>: <a href="https://huggingface.co/moonshotai/Kimi-Dev-72B">moonshotai/Kimi-Dev-72B</a> on HuggingFace</li>
  <li><strong>Code</strong>: <a href="https://github.com/MoonshotAI/Kimi-Dev">github.com/MoonshotAI/Kimi-Dev</a> on GitHub</li>
  <li><strong>SWE-Agent trajectories</strong>: Built on the SWE-Smith public dataset (5,016 trajectories collected with Claude 3.7 Sonnet)</li>
  <li><strong>Mid-training data</strong>: Curated from millions of GitHub repos (filtered for 5+ stars, decontaminated against SWE-bench). Synthetic data and PR packs used but not individually released — the recipe and prompt templates are documented.</li>
  <li><strong>Docker environments</strong>: Built from SWE-Gym, R2E-Gym-Lite, and SWE-Bench-Extra with automated configuration (detailed in Appendix B)</li>
  <li><strong>License</strong>: CC-BY 4.0</li>
</ul>

<h3 id="notable-design-decisions-2">Notable Design Decisions</h3>

<ul>
  <li><strong>RL only on code edit, not localization</strong>: After mid-training and cold start, the model already excels at localization, so RL is focused purely on the code edit stage — a targeted allocation of compute</li>
  <li><strong>Positive example reinforcement</strong>: In later RL stages, successful samples from recent iterations are replayed in the training batch, accelerating convergence when exploration diminishes</li>
  <li><strong>No KL/entropy regularization in end-to-end RL</strong>: The agentic RL uses outcome reward only without any regularization, which the authors argue reveals the true potential of each prior beyond imitation shortcuts</li>
  <li><strong>MT prior degrades at 200 trajectories</strong>: The mid-trained prior shows a performance dip when fine-tuned on exactly 200 SWE-Agent trajectories, hypothesized to be mode collapse via memorization — whereas the RL prior generalizes better due to more transferable skills baked in</li>
  <li><strong>TestWriter false positives</strong>: A known limitation — TestWriter sometimes generates insufficient test coverage, allowing BugFixer patches to pass the reward check that shouldn’t. The authors acknowledge this as future work</li>
</ul>

<hr />

<h2 id="hermes-4-technical-report">Hermes 4 Technical Report</h2>

<p>Source: <a href="https://arxiv.org/abs/2508.18255">arXiv:2508.18255</a> — Nous Research, August 2025 (v2, revised September 2025)</p>

<p>Hermes 4 is a family of hybrid reasoning models that combine structured, multi-turn reasoning with broad instruction-following ability. The team released three model sizes (14B, 70B, 405B), all trained on open-weight checkpoints from Llama 3.1 (405B, 70B) and Qwen3 14B, with full weights published on HuggingFace.</p>

<h3 id="key-contributions-2">Key Contributions</h3>

<ul>
  <li><strong>DataForge</strong>: A graph-based synthetic data generation pipeline that processes pre-training seed data through a directed acyclic graph (DAG) where each node implements a <code class="language-plaintext highlighter-rouge">struct → struct</code> map using a PDDL-style action interface (preconditions and postconditions determine data flow between nodes)</li>
  <li><strong>Two-stage training methodology</strong>: An initial SFT on ~19B tokens across heterogeneous data, followed by a targeted second SFT stage to control reasoning length (30k token budget) using loss-masking on only the <code class="language-plaintext highlighter-rouge">&lt;/think&gt;</code> termination token</li>
  <li><strong>Atropos</strong>: An open-source RL environment microservice manager used for both rejection sampling training data and evaluation — exploiting the duality between RL environments and evaluation harnesses</li>
  <li><strong>Comprehensive evaluation</strong>: Released with all logged generations, using a custom OpenAI-compatible endpoint design for reproducibility, avoiding framework fragmentation</li>
</ul>

<h3 id="architecture--model-sizes">Architecture &amp; Model Sizes</h3>

<ul>
  <li><strong>Hermes 4 405B</strong>: Based on Llama 3.1 405B, trained 71,616 B200 GPU hours</li>
  <li><strong>Hermes 4 70B</strong>: Based on Llama 3.1 70B, trained 12,864 B200 GPU hours</li>
  <li><strong>Hermes 4 14B</strong>: Based on Qwen3 14B, trained 4,454 B200 GPU hours</li>
  <li>Training framework: Modified <a href="https://github.com/pytorch/torchtitan">TorchTitan</a>, with a custom fork at <a href="https://github.com/NousResearch/torchtitan">NousResearch/torchtitan</a></li>
  <li>Second stage SFT trained using <a href="https://github.com/axolotl-ai-cloud/axolotl">Axolotl</a> for its character-span token-level masking interface</li>
  <li>All models trained on 192 NVIDIA B200 GPUs using a mix of Distributed Data Parallelism, Tensor Parallelism (TP8), and Fully Sharded Data Parallelism</li>
  <li>Context length: 16,384 tokens for training; 40,960 for evaluation</li>
</ul>

<h3 id="post-training-data-strategy">Post-Training Data Strategy</h3>

<p>The dataset contains approximately <strong>5 million samples</strong> and <strong>19 billion tokens</strong>, structured as:</p>

<ul>
  <li><strong>3.5M reasoning samples</strong> (token-heavy, averaging 5× more tokens per sample than non-reasoning data, with thinking traces up to 16k tokens)</li>
  <li><strong>1.6M non-reasoning samples</strong> (general instruction-following, knowledge, creative writing)</li>
  <li>A significant portion of the Hermes 3 dataset was retained for capability continuity</li>
</ul>

<p><strong>DataForge pipeline</strong> (inspired by AgentInstruct):</p>
<ul>
  <li>Seed data drawn from DCLM and FineWeb (biased toward recent samples)</li>
  <li>Semantic deduplication using ModernBert embeddings (cosine similarity threshold 0.7)</li>
  <li>LLM judge filtering for incomplete or ill-formatted passages</li>
  <li>DAG-based generation: passage transformation → instruction generation → answer generation → judge review</li>
  <li>Every graph has a single source and single target node, enabling arbitrary nesting into higher-order graphs</li>
  <li>Training includes not just final QA pairs but all intermediate LLM calls used in generation (specializing the model in instruction generation and judging)</li>
</ul>

<p><strong>Rejection sampling environments</strong> (via Atropos):</p>
<ul>
  <li><strong>Answer Format Training</strong>: 150+ output formats rewarded for compliance (e.g., <code class="language-plaintext highlighter-rouge">\boxed{}</code> LaTeX, JSON), decoupled from semantic correctness</li>
  <li><strong>Instruction Following</strong>: RLVR-IFEval constraint tasks (e.g., “every Nth word must be in French”)</li>
  <li><strong>Internbootcamp</strong>: 70,000 rejection-sampled trajectories across ~1,000 reasoning tasks using DeepHermes 3 and other larger models</li>
  <li><strong>Schema Adherence</strong>: Dynamic Pydantic model compilation from executable Python for JSON generation and error correction</li>
  <li><strong>Tool Use</strong>: Training on agentic tool calls with JSON structure validation</li>
</ul>

<p><strong>Covering set techniques</strong>:</p>
<ul>
  <li><strong>Taxonomies</strong>: Depth-first-search LLM enumeration of subdomains down to prompt-level leaves</li>
  <li><strong>PersonaHub</strong>: Synthetic personas from FinePersonas for generating application and script implementation tasks</li>
</ul>

<h3 id="training-methodology">Training Methodology</h3>

<table>
  <thead>
    <tr>
      <th>Parameter</th>
      <th>14B</th>
      <th>70B</th>
      <th>405B</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Parallelism</td>
      <td>FSDP</td>
      <td>FSDP+TP</td>
      <td>FSDP+TP</td>
    </tr>
    <tr>
      <td>Tokens</td>
      <td>56B</td>
      <td>56B</td>
      <td>56B</td>
    </tr>
    <tr>
      <td>Learning Rate</td>
      <td>5×10⁻⁵</td>
      <td>1×10⁻⁵</td>
      <td>5×10⁻⁶</td>
    </tr>
    <tr>
      <td>B200 Hours</td>
      <td>4,454</td>
      <td>12,864</td>
      <td>71,616</td>
    </tr>
  </tbody>
</table>

<ul>
  <li>Cosine learning rate schedule, 300-step warmup, 9,000 total steps</li>
  <li>Global batch size of 384 samples at 16,384 token context length</li>
  <li><strong>First-Fit Decreasing</strong> sample packing achieving &gt;99.9% batch efficiency</li>
  <li><strong>Flex Attention</strong> to restrict attention within packed batch samples</li>
  <li>Only assistant-role tokens contribute to the cross-entropy loss</li>
</ul>

<p><strong>Reasoning length control</strong> (key innovation for the 14B model):</p>
<ul>
  <li>The 14B model reached its 40,960 context limit 60% of the time on LiveCodeBench in reasoning mode (frequently exceeding 40k tokens despite 16k training budget)</li>
  <li>Solution: Second SFT stage generating synthetic traces with <code class="language-plaintext highlighter-rouge">&lt;/think&gt;</code> forced at 30,000 tokens, training <strong>only on the <code class="language-plaintext highlighter-rouge">&lt;/think&gt;</code> and <code class="language-plaintext highlighter-rouge">&lt;eos&gt;</code> tokens</strong> (loss-masking the entire reasoning chain)</li>
  <li>This approach teaches a “counting behavior” (“after N tokens, stop”) without altering the reasoning distribution, avoiding model collapse risks from recursive synthetic data training</li>
  <li>Trade-off: Up to 3.9% relative performance reduction on some reasoning benchmarks, but <strong>98.9–99.8% reduction in overlong rates</strong></li>
  <li>Not needed for the 70B or 405B models</li>
</ul>

<h3 id="evaluation-framework">Evaluation Framework</h3>

<p>The team built a custom evaluation infrastructure emphasizing reproducibility:</p>

<ul>
  <li><strong>Atropos as evaluation framework</strong>: Single-file self-contained Python evaluations with detailed sample-level logging, overlapping inference and scoring (not batch-then-score), lightweight OpenAI-compatible client, and explicit error semantics (fail fast rather than silently score incorrect)</li>
  <li><strong>Elastic inference cluster</strong>: Preemption-aware inference using sglang-router with automatic worker requeueing, allowing evaluation jobs to scale across available B200 compute without blocking training</li>
  <li><strong>LiveCodeBench</strong>: 454 problems (8/1/2024–5/1/2025), scored via Modal containers with inference-scoring overlap to stay compute-bound rather than verification-bound</li>
  <li><strong>RefusalBench</strong>: 166 hand-crafted prompts across 32 categories, measuring model refusal rates (with conditional reward inversion for safety-critical categories: minor harm, exploitation/trafficking, suicide/self-harm)</li>
  <li>All logged generations released on HuggingFace alongside the models</li>
</ul>

<h3 id="results-1">Results</h3>

<p><strong>Hermes 4 405B</strong> (vs. comparable open-weight models):</p>

<table>
  <thead>
    <tr>
      <th>Benchmark</th>
      <th>Hermes 4 405B (R/N)</th>
      <th>Cogito 405B</th>
      <th>DeepSeek R1 671B</th>
      <th>DeepSeek V3 671B</th>
      <th>Qwen3 235B</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>MATH-500</td>
      <td>96.2 / 73.8</td>
      <td>91.8 / 79.3</td>
      <td>97.5</td>
      <td>92.5</td>
      <td>97.5 / 90.3</td>
    </tr>
    <tr>
      <td>AIME’24</td>
      <td>81.9 / 11.4</td>
      <td>40.8 / 17.7</td>
      <td>86.5</td>
      <td>50.6</td>
      <td>78.2 / 34.1</td>
    </tr>
    <tr>
      <td>AIME’25</td>
      <td>78.1 / 10.6</td>
      <td>32.7 / 9.8</td>
      <td>83.1</td>
      <td>42.2</td>
      <td>71.8 / 25.1</td>
    </tr>
    <tr>
      <td>GPQA Diamond</td>
      <td>70.6 / 39.4</td>
      <td>68.2 / 56.2</td>
      <td>78.1</td>
      <td>68.0</td>
      <td>69.7 / 57.7</td>
    </tr>
    <tr>
      <td>LiveCodeBench</td>
      <td>61.4 / 28.1</td>
      <td>40.9 / 32.2</td>
      <td>71.8</td>
      <td>49.2</td>
      <td>65.1 / 34.6</td>
    </tr>
    <tr>
      <td>MMLU-Pro</td>
      <td>80.6 / 58.3</td>
      <td>82.6 / 78.3</td>
      <td>84.3</td>
      <td>81.6</td>
      <td>83.1 / 75.5</td>
    </tr>
    <tr>
      <td>Arena-Hard v1</td>
      <td>93.7 / 53.5</td>
      <td>91.0 / 82.8</td>
      <td>95.0</td>
      <td>92.6</td>
      <td>93.9 / 91.7</td>
    </tr>
    <tr>
      <td>RefusalBench</td>
      <td>57.1 / 43.2</td>
      <td>15.4 / 12.1</td>
      <td>16.7</td>
      <td>28.1</td>
      <td>34.3 / 15.3</td>
    </tr>
    <tr>
      <td>RewardBench</td>
      <td>73.0 / 64.5</td>
      <td>69.6 / 69.0</td>
      <td>70.1</td>
      <td>68.1</td>
      <td>74.2 / 69.2</td>
    </tr>
  </tbody>
</table>

<p><em>R = reasoning mode, N = non-reasoning mode. Hermes 4 405B leads on AIME scores among open-weight models, with strong generalist coverage.</em></p>

<p><strong>Hermes 4 70B</strong>:</p>
<ul>
  <li>AIME’24: 73.5, AIME’25: 67.5, GPQA Diamond: 66.1, LiveCodeBench: 50.5, MMLU: 88.4</li>
  <li>Competitive with Cogito 70B and Qwen3 235B on most benchmarks</li>
</ul>

<p><strong>Hermes 4 14B</strong>:</p>
<ul>
  <li>AIME’24: 55.4, AIME’25: 46.8, GPQA Diamond: 60.2, LiveCodeBench: 42.5, MMLU: 84.1</li>
  <li>Strong for its size, trailing Qwen3 14B on reasoning but competitive on knowledge benchmarks</li>
</ul>

<h3 id="qualitative-behavioral-analysis">Qualitative Behavioral Analysis</h3>

<ul>
  <li><strong>Reduced policy rigidity</strong>: Unlike proprietary models (GPT-5, Opus 4.1) that frequently issue AI identity disclaimers on fictional prompts, Hermes 4 demonstrated contextual fidelity, interpreting role-play prompts in-character</li>
  <li><strong>Stylistic transfer</strong>: Generated text approximated target authorial rhythm and diction, going beyond surface-level topical references seen in open-source baselines</li>
  <li><strong>System prompt customization</strong>: Anti-sycophancy prompts led to deeper chain-of-thought shifts (not just surface politeness changes); CoT traces showed explicit steering away from deference</li>
  <li><strong>Chat template sensitivity</strong>: Replacing <code class="language-plaintext highlighter-rouge">assistant</code> with <code class="language-plaintext highlighter-rouge">me</code> in the Llama 3 chat template produced markedly different first-person, peer-like behavior — suggesting higher behavioral plasticity than typical large models</li>
  <li><strong>Neutral alignment</strong>: Designed as a “neutrally-aligned generalist” — low refusal rates across categories (RefusalBench: 57.1 reasoning / 43.2 non-reasoning), with inversion only for safety-critical categories</li>
</ul>

<h3 id="open-data--code">Open Data &amp; Code</h3>

<ul>
  <li><strong>Model weights</strong>: All sizes on HuggingFace — <a href="https://huggingface.co/collections/NousResearch/hermes-4-collection-68a731bfd452e20816725728">NousResearch/hermes-4-collection</a></li>
  <li><strong>Eval generations</strong>: All logged samples released — <a href="https://huggingface.co/collections/NousResearch/hermes-4-evals-68a72e80ad150b5dcf7586b6">Hermes 4 Evals</a></li>
  <li><strong>Atropos</strong>: Open-source RL environment manager and evaluation framework — <a href="https://github.com/NousResearch/atropos">github.com/NousResearch/Atropos</a></li>
  <li><strong>DataForge</strong>: Graph-based synthetic data pipeline (referenced in the paper)</li>
  <li><strong>Modified TorchTitan</strong>: <a href="https://github.com/NousResearch/torchtitan/tree/856a0ecabeb8a882c150641f73f8c1c235720622">github.com/NousResearch/torchtitan</a></li>
  <li><strong>Lighteval modifications</strong>: <a href="https://github.com/NousResearch/lighteval/tree/nous">github.com/NousResearch/lighteval</a></li>
</ul>

<h3 id="notable-design-decisions-3">Notable Design Decisions</h3>

<ul>
  <li><strong>Loss-masking only on <code class="language-plaintext highlighter-rouge">&lt;/think&gt;</code> for length control</strong>: Rather than training on full self-generated reasoning traces (which risks model collapse), the team isolated the termination signal, teaching the model <em>when</em> to stop reasoning without modifying <em>how</em> it reasons</li>
  <li><strong>Training on intermediate LLM calls</strong>: By including all generative steps used in the DataForge pipeline (not just final answers), the model internalizes instruction generation and judging capabilities</li>
  <li><strong>OpenAI-compatible eval endpoint</strong>: All benchmarks hit the same inference engine instance, avoiding the fragmentation of different framework versions across benchmarks</li>
  <li><strong>Inference-scoring overlap for LiveCodeBench</strong>: Using Modal containers, inference and scoring run concurrently rather than sequentially, keeping the pipeline compute-bound</li>
  <li><strong>No KL/entropy regularization in rejection sampling</strong>: The training relies on pure reward signals from verifiers rather than distributional constraints, pushing the model toward the verified distribution without KL drag</li>
  <li><strong>Elastic preemption-aware inference cluster</strong>: Evaluation jobs can be preempted and automatically requeued via sglang-router, maximizing cluster utilization without blocking training workloads</li>
</ul>

<hr />

<h2 id="themes-in-post-training-releases">Themes in Post-Training Releases</h2>

<h3 id="theme-1-the-shift-from-ppo-to-reinforce-style-objectives">Theme 1: The Shift from PPO to REINFORCE-Style Objectives</h3>

<p>All four releases have moved away from traditional PPO-based RLHF toward simpler REINFORCE-family objectives, eliminating KL divergence and entropy regularization in most stages. Nemotron-Cascade 2 uses pure GRPO with KL=0 across all stages (only RLHF retains KL=0.03), Kimi-Dev uses a k1.5-style REINFORCE with outcome-only rewards and no regularization, Hermes 4 uses rejection sampling without KL drag, and Intellect-3 uses IcePop (masked token-level importance sampling) for off-policy RL. This reflects a broader industry consensus that KL penalties act as a ceiling on capability gains, and that verifier-based rewards (code execution, math verification) provide cleaner signal than learned reward models.</p>

<p><strong>Demonstrated by:</strong> All four papers — Nemotron-Cascade 2, Kimi-Dev, Hermes 4, Intellect-3.</p>

<p>This trend represents a maturation of post-training methodology: rather than constraining the policy to stay near a reference distribution, these works trust execution-based verifiers to guide learning, accepting the resulting distributional shift as a feature rather than a bug.</p>

<h3 id="theme-2-cascade-training-and-curriculum-design">Theme 2: Cascade Training and Curriculum Design</h3>

<p>Nemotron-Cascade 2 formalizes cascade training into an explicit multi-stage pipeline where domain ordering is driven by interference analysis. The IF-RL stage is placed first (reversed from Cascade-1) because instruction-following training degrades alignment if done late. Kimi-Dev mirrors this with a curriculum-based RL approach: prompts with pass@16 = 0 are initially discarded, then 500 new prompts are reintroduced every 100 steps as the model improves. Intellect-3 uses online difficulty filtering with easy/normal/hard pools based on solve rates. The common thread is that domain-specific ordering and difficulty scheduling are treated as hyperparameters worthy of careful investigation, not afterthoughts.</p>

<p><strong>Demonstrated by:</strong> Nemotron-Cascade 2 (explicit 9-stage cascade), Kimi-Dev (curriculum with adaptive prompt selection), Intellect-3 (difficulty filtering pools).</p>

<p>This represents the state-of-the-art in pipeline design: static training recipes are giving way to dynamically adaptive training that responds to the model’s evolving capabilities.</p>

<h3 id="theme-3-coding-as-the-dominant-post-training-domain">Theme 3: Coding as the Dominant Post-Training Domain</h3>

<p>All four releases invest heavily in coding and software engineering capabilities, but with distinct strategies. Nemotron-Cascade 2 uses competitive coding (LiveCodeBench, IOI, ICPC) plus SWE-bench with execution-based rewards. Kimi-Dev is exclusively focused on SWE, splitting the problem into BugFixer and TestWriter modules. Intellect-3 includes code environments (8.6K problems) alongside math, science, logic, and deep research. Hermes 4 takes the broadest approach, with code as one pillar among reasoning, instruction-following, and safety. The significance is that coding has become the primary arena for demonstrating post-training quality — not just as a benchmark, but as a training signal. Execution-based rewards from test suites and sandboxed environments provide the cleanest, most unambiguous verification signal available.</p>

<p><strong>Demonstrated by:</strong> All four papers, with Kimi-Dev being the most domain-specific and Hermes 4 the most generalist.</p>

<p>Coding execution loops have become the gold standard for RL training signals, and this trend is likely to accelerate as more open-source code environments and verification frameworks are released.</p>

<h3 id="theme-4-open-infrastructure-and-reproducibility">Theme 4: Open Infrastructure and Reproducibility</h3>

<p>Each release invests heavily in open infrastructure beyond just model weights. Nemotron-Cascade 2 releases SFT data, RL data, and full training methodology. Intellect-3 releases the prime-rl framework, Environments Hub registry, verifiers library, and Prime Sandboxes documentation. Hermes 4 releases Atropos (RL environment manager + evaluation framework), modified TorchTitan, and all logged generations. Kimi-Dev releases model weights, code, and documents the mid-training recipe and prompt templates. Together, these releases represent a shift toward open-source ML infrastructure as a first-class research contribution, not an afterthought.</p>

<p><strong>Demonstrated by:</strong> All four papers — each releases at minimum model weights and data, with three releasing substantial infrastructure code.</p>

<p>This represents a significant evolution in how post-training research is shared: the community is treating training frameworks, evaluation harnesses, and environment registries as public goods, which lowers the barrier to entry and accelerates reproducibility.</p>

<h3 id="theme-5-synthetic-data-at-scale-via-teacher-distillation">Theme 5: Synthetic Data at Scale via Teacher Distillation</h3>

<p>All four teams rely heavily on synthetic data generated by larger teacher models, but with distinct approaches to quality control and pipeline design. Nemotron-Cascade 2 uses multiple teacher models (GPT-OSS-120B, DeepSeek-V3.2, Qwen3-235B) and MOPD to distill from intermediate checkpoints. Intellect-3 uses DeepSeek-R1-0528 for synthetic reasoning traces and SWE data generation. Kimi-Dev uses DeepSeek R1 for cold-start CoT trajectories and synthetic agentic interaction data. Hermes 4’s DataForge pipeline is the most sophisticated: a DAG-based system with semantic deduplication, LLM judge filtering, and training on all intermediate LLM calls (not just final outputs). The common pattern is that synthetic data generation is treated as a structured pipeline with quality gates, not a single LLM call.</p>

<p><strong>Demonstrated by:</strong> All four papers, with Hermes 4’s DataForge being the most structured and Nemotron’s MOPD being the most innovative in terms of training-time distillation.</p>

<p>This represents the frontier of data engineering in post-training: the quality of the synthetic data pipeline is now as important as the choice of RL algorithm.</p>

<hr />

<h2 id="open-data-and-code-released-1">Open Data and Code Released</h2>

<h3 id="comparison-table">Comparison Table</h3>

<table>
  <thead>
    <tr>
      <th>Asset</th>
      <th>Nemotron-Cascade 2</th>
      <th>Kimi-Dev</th>
      <th>Hermes 4</th>
      <th>Intellect-3</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>Model weights</strong></td>
      <td>✓ (30B-A3B checkpoint)</td>
      <td>✓ (72B checkpoint)</td>
      <td>✓ (14B, 70B, 405B)</td>
      <td>✓ (106B-MoE checkpoint)</td>
    </tr>
    <tr>
      <td><strong>SFT/Pre-training data</strong></td>
      <td>✓ (full SFT dataset, ~15M samples)</td>
      <td>Partial (recipe documented, not released)</td>
      <td>Partial (seed sources named, not released)</td>
      <td>✓ (Nemotron-Post-Training-Dataset-v1 splits + AM-Distilled)</td>
    </tr>
    <tr>
      <td><strong>RL/Training data</strong></td>
      <td>✓ (full RL dataset collection)</td>
      <td>Partial (SWE-Smith trajectories used)</td>
      <td>✓ (150+ format tasks, Internbootcamp trajectories, rejection-sampled data)</td>
      <td>Partial (SWE-Swiss, Toucan Tool, env mix documented)</td>
    </tr>
    <tr>
      <td><strong>Training framework</strong></td>
      <td>✗</td>
      <td>✗</td>
      <td>✓ (modified TorchTitan)</td>
      <td>✓ (prime-rl)</td>
    </tr>
    <tr>
      <td><strong>Evaluation framework</strong></td>
      <td>✗</td>
      <td>✗</td>
      <td>✓ (Atropos + Lighteval modifications)</td>
      <td>✓ (Environments Hub + verifiers library)</td>
    </tr>
    <tr>
      <td><strong>Infrastructure</strong></td>
      <td>✗</td>
      <td>✓ (Kubernetes sandbox docs)</td>
      <td>✓ (evaluation infrastructure)</td>
      <td>✓ (Prime Sandboxes, Environments Hub)</td>
    </tr>
    <tr>
      <td><strong>License</strong></td>
      <td>CC BY 4.0</td>
      <td>CC BY 4.0</td>
      <td>Not explicitly stated</td>
      <td>CC BY 4.0</td>
    </tr>
  </tbody>
</table>

<h3 id="significance-of-open-data-in-post-training">Significance of Open Data in Post-Training</h3>

<p>The open data released by these groups has several important implications:</p>

<ul>
  <li>
    <p><strong>Nemotron-Cascade 2 is the most comprehensive release</strong>, providing both SFT and RL datasets alongside full hyperparameters. This is notable because RL data has historically been the most guarded aspect of post-training — the fact that NVIDIA released it signals a shift toward transparency in what actually works during RL stages.</p>
  </li>
  <li>
    <p><strong>Intellect-3’s open-source infrastructure</strong> (prime-rl, Environments Hub, Prime Sandboxes) is particularly significant because it releases the <em>training system</em> rather than just data. Other groups can use prime-rl to train their own models, creating a shared infrastructure layer for the community.</p>
  </li>
  <li>
    <p><strong>Hermes 4’s evaluation release</strong> (all logged generations) is an underappreciated contribution. By releasing every logged sample and using a custom OpenAI-compatible evaluation endpoint, the team enables exact replication of their evaluation protocol — a rare level of transparency in an area notorious for benchmark fragmentation.</p>
  </li>
  <li>
    <p><strong>Kimi-Dev’s partial release</strong> is still valuable: while the full mid-training data isn’t released, the recipe, prompt templates, and the analysis of how many SFT trajectories are needed for agentic adaptation (5K vs 1.5×2^28 tokens) provide actionable knowledge for reproducibility.</p>
  </li>
</ul>

<p>The dominance of CC BY 4.0 licensing across these releases (3 of 4) signals alignment toward permissive open licensing in post-training, which is notable given that many proprietary model providers still restrict weights and training data under restrictive terms.</p>

<hr />

<h2 id="methodology-and-trends">Methodology and Trends</h2>

<h3 id="training-pipeline-comparison">Training Pipeline Comparison</h3>

<table>
  <thead>
    <tr>
      <th>Stage</th>
      <th>Nemotron-Cascade 2</th>
      <th>Kimi-Dev</th>
      <th>Hermes 4</th>
      <th>Intellect-3</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>Initialization</strong></td>
      <td>Nemotron-3-Nano-30B-A3B-Base</td>
      <td>Qwen 2.5-72B-Base (mid-training)</td>
      <td>Llama 3.1 / Qwen3 base models</td>
      <td>GLM-4.5-Air</td>
    </tr>
    <tr>
      <td><strong>Stage 1</strong></td>
      <td>SFT (~15M samples, 1.5 epochs)</td>
      <td>Mid-training (~150B tokens)</td>
      <td>SFT (~19B tokens, 3.5M reasoning samples)</td>
      <td>General reasoning SFT (~33M tokens/step, 65K context)</td>
    </tr>
    <tr>
      <td><strong>Stage 2</strong></td>
      <td>IF-RL (GRPO)</td>
      <td>Cold start SFT (2K CoT trajectories)</td>
      <td>Second SFT (reasoning length control)</td>
      <td>Agentic SFT (curated tool-use data)</td>
    </tr>
    <tr>
      <td><strong>Stage 3</strong></td>
      <td>Multi-domain RL (joint training)</td>
      <td>RL (code edit, k1.5 REINFORCE)</td>
      <td>—</td>
      <td>RL (IcePop)</td>
    </tr>
    <tr>
      <td><strong>Stage 4</strong></td>
      <td>MOPD (distillation)</td>
      <td>Agent SFT (5K SWE-Agent trajectories)</td>
      <td>—</td>
      <td>—</td>
    </tr>
    <tr>
      <td><strong>Stage 5</strong></td>
      <td>RLHF (generative reward model)</td>
      <td>Test-time self-play</td>
      <td>—</td>
      <td>—</td>
    </tr>
    <tr>
      <td><strong>Stage 6+</strong></td>
      <td>Long-context RL, Code RL, SWE RL</td>
      <td>—</td>
      <td>—</td>
      <td>—</td>
    </tr>
    <tr>
      <td><strong>Total stages</strong></td>
      <td>9 (1 SFT + 8 RL)</td>
      <td>4</td>
      <td>2</td>
      <td>3 (2 SFT + 1 RL)</td>
    </tr>
  </tbody>
</table>

<p>The most striking observation is the spectrum of pipeline complexity: Hermes 4 achieves strong results with 2-stage SFT (plus rejection sampling), while Nemotron-Cascade 2 uses a 9-stage cascade. The choice seems correlated with model scale and domain breadth — larger, multi-domain models benefit from cascaded, domain-specific RL stages, while more focused models achieve strong results with simpler pipelines.</p>

<h3 id="loss-functions-and-reward-paradigms">Loss Functions and Reward Paradigms</h3>

<table>
  <thead>
    <tr>
      <th>Approach</th>
      <th>Papers Using It</th>
      <th>Key Characteristic</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>Pure REINFORCE (no KL)</strong></td>
      <td>Nemotron-Cascade 2, Kimi-Dev</td>
      <td>GRPO with group-normalized rewards; outcome-only rewards</td>
    </tr>
    <tr>
      <td><strong>Rejection sampling with verifiers</strong></td>
      <td>Hermes 4</td>
      <td>Sampling and filtering via execution-based environments; no policy update during sampling</td>
    </tr>
    <tr>
      <td><strong>Masked token-level importance sampling</strong></td>
      <td>Intellect-3</td>
      <td>IcePop: double-sided masking to handle trainer-inference distribution mismatch</td>
    </tr>
    <tr>
      <td><strong>Reverse-KL distillation</strong></td>
      <td>Nemotron-Cascade 2 (MOPD)</td>
      <td>Token-level advantages between teacher and train, with truncated importance weighting</td>
    </tr>
  </tbody>
</table>

<p>Three of four papers (Nemotron, Kimi-Dev, Hermes 4) use no KL or entropy regularization during their primary RL stages. This is a clear emergent consensus: when execution-based verifiers provide clean rewards, KL penalties are unnecessary constraints.</p>

<h3 id="optimizer-choices">Optimizer Choices</h3>

<table>
  <thead>
    <tr>
      <th>Optimizer</th>
      <th>Papers</th>
      <th>Notes</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>AdamW</strong></td>
      <td>Nemotron-Cascade 2</td>
      <td>Consistently used at LR=3e-6 across all RL stages</td>
    </tr>
    <tr>
      <td><strong>Muon</strong></td>
      <td>Kimi-Dev, Intellect-3</td>
      <td>Matrix-level updates; Kimi-Dev uses it for SFT (5e-5), Intellect-3 uses it for both SFT and RL (1e-6)</td>
    </tr>
    <tr>
      <td><strong>Not specified</strong></td>
      <td>Hermes 4, Kimi-Dev (RL stage)</td>
      <td>Kimi-Dev RL uses REINFORCE-style update; Hermes 4 uses SFT only</td>
    </tr>
  </tbody>
</table>

<p>The adoption of Muon (a second-order optimizer) by both Kimi-Dev and Intellect-3 is notable — it suggests a trend toward matrix-level optimization updates for training stability, particularly in large-scale RL settings.</p>

<h3 id="computational-scales">Computational Scales</h3>

<table>
  <thead>
    <tr>
      <th>Model</th>
      <th>Hardware</th>
      <th>GPU Hours / Nodes</th>
      <th>Training Duration</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Nemotron-Cascade 2</td>
      <td>Not specified</td>
      <td>Not specified</td>
      <td>Not specified</td>
    </tr>
    <tr>
      <td>Kimi-Dev</td>
      <td>Not specified</td>
      <td>Not specified</td>
      <td>Not specified</td>
    </tr>
    <tr>
      <td>Hermes 4 405B</td>
      <td>192× B200</td>
      <td>71,616 B200 hours</td>
      <td>Not specified</td>
    </tr>
    <tr>
      <td>Hermes 4 70B</td>
      <td>192× B200</td>
      <td>12,864 B200 hours</td>
      <td>Not specified</td>
    </tr>
    <tr>
      <td>Hermes 4 14B</td>
      <td>192× B200</td>
      <td>4,454 B200 hours</td>
      <td>Not specified</td>
    </tr>
    <tr>
      <td>Intellect-3</td>
      <td>512× H200</td>
      <td>60 nodes (16 train + 44 inference)</td>
      <td>~2 months</td>
    </tr>
  </tbody>
</table>

<p>The Hermes 4 405B training at 71,616 B200 hours is the most computationally intensive, reflecting the cost of training a 405B model with 19B tokens of post-training data. Intellect-3’s approach (disaggregated trainer and inference on separate GPU pools) represents an important efficiency pattern: keeping inference and training on separate node pools avoids resource contention.</p>

<h3 id="emerging-trends">Emerging Trends</h3>

<ol>
  <li>
    <p><strong>Cascade training</strong> (Nemotron): The explicit design of training stage ordering based on inter-domain interference analysis is emerging as a best practice for multi-domain models.</p>
  </li>
  <li>
    <p><strong>Execution-based rewards</strong> (All four): Code execution, test suites, and sandboxed environments are becoming the default reward mechanism for coding post-training, replacing learned reward models.</p>
  </li>
  <li>
    <p><strong>Self-play and candidate synthesis</strong> (Kimi-Dev): Generating multiple candidates at test time and scoring them via composite metrics (fail-to-pass, pass-to-pass) is an emergent pattern that requires no additional training.</p>
  </li>
  <li>
    <p><strong>Data synthesis pipelines</strong> (Hermes 4’s DataForge, Nemotron’s MOPD): Structured, DAG-based or checkpoint-based distillation from intermediate models is replacing simple teacher-student SFT.</p>
  </li>
  <li>
    <p><strong>Agentic training as a first-class post-training goal</strong> (All four): Tool use, multi-turn interactions, and sandboxed code execution are now standard components of post-training, not optional add-ons.</p>
  </li>
  <li>
    <p><strong>Off-policy RL stability</strong> (Intellect-3): IcePop’s masked token-level importance sampling addresses a fundamental challenge in off-policy RL, enabling stable training with up to 8 off-policy steps — a technique that may become widely adopted.</p>
  </li>
</ol>

<hr />

<h2 id="ideas-for-further-exploration">Ideas for Further Exploration</h2>

<h3 id="research-directions">Research Directions</h3>

<ol>
  <li>
    <p><strong>Does cascade training generalize beyond math/coding domains?</strong>
Nemotron-Cascade 2’s cascade ordering was validated on mathematics, coding, science, and agentic tasks. An ablation study could test whether cascade training provides similar benefits for domains like creative writing, legal reasoning, or medical diagnosis — areas where domain interference patterns might differ substantially.</p>
  </li>
  <li>
    <p><strong>What is the minimum viable RL pipeline?</strong>
Hermes 4 achieves strong results with 2-stage SFT (plus rejection sampling), while Nemotron uses 9 stages. A controlled comparison across the same base model and compute budget could identify which stages are essential versus which provide diminishing returns. This would help smaller research groups design efficient post-training pipelines.</p>
  </li>
  <li>
    <p><strong>Can Muon consistently outperform AdamW in RL post-training?</strong>
Both Kimi-Dev and Intellect-3 use Muon across SFT and RL stages, while Nemotron uses AdamW. A head-to-head comparison on the same tasks and compute budget would clarify whether Muon’s matrix-level updates provide meaningful advantages in the post-training regime, or whether reported gains are specific to their training configurations.</p>
  </li>
  <li>
    <p><strong>What is the optimal curriculum schedule for RL difficulty?</strong>
Kimi-Dev’s adaptive prompt selection (discarding impossible prompts, then reintroducing 500 every 100 steps) and Intellect-3’s difficulty pooling (easy/normal/hard) offer two different approaches to curriculum learning. A systematic study varying re-introduction rates, pool sizes, and transition thresholds could identify best practices for dynamic curriculum design.</p>
  </li>
  <li>
    <p><strong>Does training on intermediate LLM calls (DataForge approach) improve instruction generation capability?</strong>
Hermes 4 trains on all intermediate LLM calls in the DataForge pipeline, not just final outputs. An ablation comparing “final output only” vs. “full generation trace” training would clarify whether the model internalizes instruction generation and judging capabilities, and whether this generalizes to downstream prompting tasks.</p>
  </li>
  <li>
    <p><strong>How transferable are agentic skills across different scaffolds?</strong>
Kimi-Dev shows that agentless training induces skills that transfer to SWE-Agent, and Nemotron finds that Agentless RL helps even in OpenHands evaluation. A broader study across agentic frameworks (SWE-Agent, OpenHands, Aider, Devin) would quantify the degree of scaffold-independence and identify which skills are truly portable versus scaffold-specific.</p>
  </li>
  <li>
    <p><strong>What is the role of synthetic data diversity vs. quality in post-training?</strong>
All four papers use synthetic data from teacher models, but the quality thresholds and diversity strategies differ significantly. A controlled experiment varying teacher model size, data synthesis method (direct SFT vs. rejection sampling vs. DAG-based generation), and deduplication thresholds would clarify the tradeoffs between synthetic data quantity and curation rigor.</p>
  </li>
  <li>
    <p><strong>Can IcePop-style masked importance sampling stabilize off-policy RL across different algorithms?</strong>
IcePop was designed to handle GRPO’s trainer-inference mismatch, but its double-sided masking approach could potentially benefit PPO, DPO, and other off-policy methods. Testing IcePop’s masking mechanism as a plug-in for other RL algorithms would determine whether distribution mismatch is the fundamental challenge in off-policy post-training.</p>
  </li>
</ol>

<h3 id="gaps-in-the-current-landscape">Gaps in the Current Landscape</h3>

<ul>
  <li>
    <p><strong>Limited cross-validation across benchmarks</strong>: None of the four papers use fully shared evaluation infrastructure. Hermes 4’s custom eval framework is the closest, but a community-wide standardized evaluation harness (like Environments Hub aims to be) would enable direct model comparisons.</p>
  </li>
  <li>
    <p><strong>No public analysis of training dynamics</strong>: While all papers report final benchmark scores, detailed training curves, loss trajectories, and failure analysis are rarely shared. Releasing training logs alongside model weights would enable meta-analysis of what actually works during training.</p>
  </li>
  <li>
    <p><strong>Safety and alignment as afterthoughts</strong>: Nemotron is the only paper that gives safety a prominent role (dedicated safety SFT data, RLHF stage). Coding-focused and reasoning-focused papers largely treat safety as a side concern, which may become a liability as these models are deployed.</p>
  </li>
  <li>
    <p><strong>No comparison of open vs. proprietary base models</strong>: All papers use a single base model for their experiments (Llama 3.1, Qwen 2.5, GLM-4.5, Nemotron-3-Nano). A cross-base-model comparison would clarify how much post-training gains depend on the quality of the pre-trained initialization.</p>
  </li>
  <li>
    <p><strong>Missing long-term capability retention analysis</strong>: None of the papers evaluate how well post-trained capabilities persist over time or under distribution shift. A longitudinal study of post-trained models on evolving benchmarks would reveal whether these gains are durable or brittle.</p>
  </li>
</ul>

<hr />]]></content><author><name></name></author><summary type="html"><![CDATA[A survey of four recent post-training LLM releases — examining their methodologies, open data, and emerging trends in the space.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/post_train_theme.png" /><media:content medium="image" url="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/post_train_theme.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">NextJS Benchmarking with OpenCode</title><link href="https://damoonsh.github.io/w/2026/05/01/nextjs-open-code.html" rel="alternate" type="text/html" title="NextJS Benchmarking with OpenCode" /><published>2026-05-01T00:00:00+00:00</published><updated>2026-05-01T00:00:00+00:00</updated><id>https://damoonsh.github.io/w/2026/05/01/nextjs-open-code</id><content type="html" xml:base="https://damoonsh.github.io/w/2026/05/01/nextjs-open-code.html"><![CDATA[<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/after_agents_nodemodules_readlist_coder_super_122b.png" alt="After agents: node_modules read list (Coder Super 122B)" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/after_agents_nodemodules_readlist_focus.png" alt="After agents: node_modules read list (focus)" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/cmd_dist_122b_super.png" alt="Command distribution (122B Super)" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/cmd_dist_gemma4_dense.png" alt="Command distribution (Gemma 4 dense)" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/cmd_dist_nano_cascade.png" alt="Command distribution (Nano Cascade)" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/docs_agents_edit_compliance_qwen.png" alt="Docs agents edit compliance (Qwen)" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/edit_before_agents_coder_super_122b.png" alt="Edit before agents (Coder Super 122B)" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/edit_before_agents_focus.png" alt="Edit before agents (focus)" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/large_family_other_tool_actions_stacked.png" alt="Large family other tool actions (stacked)" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/next_md_reads_by_subdir.png" alt="Next.js MD reads by subdirectory" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/qwen_reward_by_size_hint_bars.png" alt="Qwen reward by size (hint bars)" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/rtp_focus_cross_llm_combo_full.png" alt="RTP focus cross-LLM combo full" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/rtp_focus_lineup_reason_turn_wc_base_full.png" alt="RTP focus lineup reason turn WC base full" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/rtp_gemma4_combo_full.png" alt="RTP Gemma 4 combo full" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/rtp_mix_reason_rollout_sum_wc_cross_llm_full.png" alt="RTP mix reason rollout sum WC cross-LLM full" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/rtp_mix_reason_turn_wc_cross_llm_full.png" alt="RTP mix reason turn WC cross-LLM full" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/rtp_nvidia_combo_full.png" alt="RTP NVIDIA combo full" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/rtp_nvidia_combo_reason_rollout_sum_wc_full.png" alt="RTP NVIDIA combo reason rollout sum WC full" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/rtp_nvidia_combo_reason_turn_wc_full.png" alt="RTP NVIDIA combo reason turn WC full" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/rtp_qwen_combo_27_pair.png" alt="RTP Qwen combo 27 pair" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/rtp_qwen_combo_35_pair.png" alt="RTP Qwen combo 35 pair" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/rtp_qwen_combo_full.png" alt="RTP Qwen combo full" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/rtp_qwen_combo_reason_rollout_sum_wc_full.png" alt="RTP Qwen combo reason rollout sum WC full" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/rtp_qwen_combo_reason_turn_wc_full.png" alt="RTP Qwen combo reason turn WC full" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/rtp_qwen_facets_reward_time_three_panel.png" alt="RTP Qwen facets: reward and time (three panel)" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/rtp_scatter_122b_super_models.png" alt="RTP scatter (122B Super models)" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/rtp_scatter_other_models.png" alt="RTP scatter (other models)" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/rtp_small_llm_combo_full.png" alt="RTP small LLM combo full" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/rtp_small_llm_reason_turn_wc_base_full.png" alt="RTP small LLM reason turn WC base full" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/tool_action_distribution.png" alt="Tool action distribution" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/tool_call_error_heatmap_by_model.png" alt="Tool call error heatmap by model" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/tool_call_hint_overlay_122b_super_cell50.png" alt="Tool call hint overlay (122B Super, cell 50)" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/tool_call_hint_overlay_nano_cascade_cell50.png" alt="Tool call hint overlay (Nano Cascade, cell 50)" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/toolcall_dist_122b_super.png" alt="Tool call distance (122B Super)" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/toolcall_dist_nano_cascade_coder30.png" alt="Tool call distance (Nano Cascade Coder 30)" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/toolcall_hint_overlay_122b_super_cell52.png" alt="Tool call hint overlay (122B Super, cell 52)" style="width: auto; height: 30%;" /></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nextjs_opencode/toolcall_hint_overlay_nano_cascade_cell52.png" alt="Tool call hint overlay (Nano Cascade, cell 52)" style="width: auto; height: 30%;" /></p>]]></content><author><name></name></author><summary type="html"><![CDATA[Benchmarking recent model releases on a DGX Spark with the Next.js benchmark to gauge capabilities and how useful they might be for day-to-day harness work.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/os_releases/init.png" /><media:content medium="image" url="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/os_releases/init.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">NextJS Benchmarking as harness proxy</title><link href="https://damoonsh.github.io/w/2026/04/07/os-bench.html" rel="alternate" type="text/html" title="NextJS Benchmarking as harness proxy" /><published>2026-04-07T00:00:00+00:00</published><updated>2026-04-07T00:00:00+00:00</updated><id>https://damoonsh.github.io/w/2026/04/07/os-bench</id><content type="html" xml:base="https://damoonsh.github.io/w/2026/04/07/os-bench.html"><![CDATA[<h1 id="introduction">Introduction</h1>

<p>Ever since the release of OpenClaw, I have been trying to answer one question: What is the smallest LLM running on DGX Spark that can handle a simple cronjob? In my experience, there exists a major issue with regards to “instruction following”. Models will interpret the instructions in unexpected ways and cause havoc. Additionally, models will ignore or forget about instructions as the process progresses. Vague instructions are partially to blame. I ablated this by using larger models and reading their thinking traces. And even larger models tend to ask for clarification or they might make assumptions and continue but their assumptions are far superior to smaller models.</p>

<p>The open source (or open weight) models tested ranged from Cohere <a href="https://huggingface.co/unsloth/c4ai-command-a-03-2025-GGUF"><code class="language-plaintext highlighter-rouge">Command A</code></a>, <a href="https://huggingface.co/unsloth/Hunyuan-A13B-Instruct-GGUF"><code class="language-plaintext highlighter-rouge">Hunyuan</code></a> to more mainstream <a href="https://huggingface.co/unsloth/MiniMax-M2.5-GGUF"><code class="language-plaintext highlighter-rouge">MiniMax</code></a>, <code class="language-plaintext highlighter-rouge">GLM</code> (<a href="https://huggingface.co/unsloth/GLM-4.7-Flash-GGUF">4.7 Flash</a>, <a href="https://huggingface.co/unsloth/GLM-4.7-Flash-REAP-23B-A3B-GGUF">4.7 Flash Reap</a>), and <code class="language-plaintext highlighter-rouge">Qwen</code>. That is why the release of <code class="language-plaintext highlighter-rouge">Gemma 4</code> models has been a great surprise to me since I had given up on models below the ~20B size for executing tasks. <code class="language-plaintext highlighter-rouge">Gemma 4</code> series is capable way above their size group where the models below ~10B are capable of cohesive instruction following and doing interleaved tool calling with reasoning very effectively. This inspired me to benchmark the (quantized version of) recent releases against NextJS benchmark, and also compare the relative behavior evolution of the LLMs within their family groups.</p>

<h1 id="context">Context</h1>

<p>The original release of <a href="https://github.com/vercel/next-evals-oss">Next Js benchmark</a> is interesting since the tasks would manually pass files within the prompts and give a specific ask then the model had to return the changes to files without tool calls or anything. This strictly a coding-related benchmark but I thought it may be a good proxy with problems I am facing in harnesses. The LLMs are trained to do tool calls and handle these kind of tasks but the prompts strictly say what needs to be done. Note that the prompt does not sat <b>NO TOOLS</b> but the model is expected to pick it up and interpret it.</p>

<p>Here is the specific format:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>```
Please provide your changes as complete file contents. Use this format for each file you need to modify, create, or delete:
```file=path\/to\/file.tsx action=replace
complete file content here\n```

For example:
```file=app\/Component.tsx action=replace\nexport default function Component() {\n const new = \"code\";\n return &lt;div&gt;&lt;\/div&gt;;
}\n```

```file=app\/NewComponent.tsx action=add
export default function NewComponent() {\n return &lt;div&gt;New component&lt;\/div&gt;;
}\n```

```file=app\/OldComponent.tsx action=delete```

Rules:
- Always specify an action: add, replace, or delete
- For add\/replace: provide the complete file content, not partial changes
- For delete: you can leave the content empty or omit it
- Use the exact file path relative to the project root
- Maintain proper indentation and formatting
- Include all imports and exports that the file needs
- Do not modify *.test.tsx files
```
</code></pre></div></div>

<p>I personally do not get anything from the model cards that are released everyday with each new model release (I guess that is why there is benchmarking mini-industry being formed) But with the large volume and fast pace release of open source models, I wanted to assess progress in the simplest way possible. That is benchmarking models on NextJS benchmark to track tool calls, reasoning efficiency (or output generation length) and speed.</p>

<h1 id="recent-releases-capacities">Recent releases capacities</h1>

<p>Qwen3.5 was released on <b><i>February 16, 2026</i></b>, and Gemma 4 on <b><i>April 2, 2026</i></b>. Both releases are natively multimodal with heavy emphasis on reasoning and agentic capabilities. Each release has a number of smaller and mid-size models; the larger models are either MoE or dense. Gemma uses the Per-Layer Embeddings (PLE) approach for smaller releases, where the effective computation amount is lower than actual model size (E2B with 5B LLM, E4B with 9B LLM). It is interesting to observe the effect of these architectural differences.</p>

<p>The graph below compares NextJS pass@1 for Qwen3.5, Gemma 4, Nemotron, and GLM-4.7 Flash. I define <strong>Reasoning efficiency</strong> as the squared reward divided by log10 of reasoning length. The metric aims to ensure the amount of tokens generated for reasoning is worth it. The easiest way to think about it: smaller Qwen models (&lt; 8B) generate long reasoning traces riddled with <strong><em>“oh wait”s</em></strong> without a worthwhile response (not all tasks just complicated ones). The other metric that is important is tool call percentage to check what portion of responses involved doing tool calls.</p>

<figure style="margin: 0 auto; text-align: center;">
    <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/os_releases/overall_metrics.png" alt="Overall benchmark metrics" style="width: auto; height: 30%;" />
    <figcaption>Overall metrics</figcaption>
</figure>

<p>Some observations:</p>
<ul>
  <li>Gemma 4 has the best models in all sizes, these models are exceptional at understanding that no tool calls are required. Especially the smaller ones, Gemma:4-E2B and Gemma:4-E4B are on par with Qwen3.5:9B except for slight drop in reasoning efficiency.</li>
  <li>Within Qwen3.5, models below 9B are doing poorly with almost all the responses being tool calls.</li>
  <li>Nemotron 3 series are hybrid (mamba+transformer) model family with with 4B, 30B-A3B, 120B-A12B and recent highly post-tuned versions. The smallest versino does not do well in reward part but it stays away from tool calls. One thing that catches my eye is Nemotron Cascade-2 which is the post-tuned version of 30B-A3B and the difference is amazing 10% reward increase, no tool calls in cascade-2 version, and it has a stronger reasoning efficiency. The <a href="https://arxiv.org/abs/2603.19220">Cascade-2 paper</a> stresses the order of training data used to ensure different capabilities (reasoning on math vs coding vs instruction following) are not forgotten/overridden in between runs. And the results show significant improvements across the metrics. Still Cascade-2 lags behind Gemma4:26B-A4B</li>
  <li>GLM-4.7 Flash underperforms compared to Gemma 4-26B-A4B but does better than Qwen3.5:35B-A3B. The REAP-ed version of it does worse as well where every metric gets worse.</li>
  <li>The bigger models have done relatively worse, especially Nemotron Super 120B (this could be due to quantization) but presumably post-tuning in cascade-2 fashion could improve it.</li>
</ul>

<h2 id="qwen">Qwen</h2>

<p>AliBaba has released Qwen3, Qwen3-Coder, Qwen3-vl, and now Qwen3.5 in less than a year. I was curious to see the progress for this specific benchmark. Here are some observations:</p>

<ul>
  <li>The small Qwen3.5 checkpoints reach for tools far more often than same-sized predecessors. The shift shows up in Qwen3-VL and steepens in Qwen3.5.</li>
  <li>At a given size band, MoE variants tool-call more than dense ones.</li>
  <li>The reasoning efficiency drops significantly with qwen3-vl series where large amounts of tokens are generated to no avail plummeting the efficiency metric. It is 
important to note that for the Qwen3-vl:2B, max tokens is set since the model ran an exceptionally long time without it. But reasoning efficiency in Qwen3.5 is 
phenomenal, looking at the reasoning length, we see a major decline while the rewards are higher than previous generations as well.</li>
  <li>My main gripe is tool sprawl on small models. They are fine-tuned to call tools, but spurious reads and directory listings are enough to wreck a harness. This is something I had noticed when using extremely small models, they keep reading files and listing directory files to no avail.</li>
</ul>

<p>Overall, the trajectory still feels promising since more accurate and leaner token generation is driving the cost of model usage down.</p>

<figure style="margin: 0 auto; text-align: center;">
    <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/os_releases/qwen_progression.png" alt="Qwen release progression" style="width: auto; height: 30%;" />
    <figcaption>Qwen's progression</figcaption>
</figure>

<h2 id="gemma">Gemma</h2>

<p>Comparing Gemma family will be slightly different since Gemma 3 is not a thinking series so I have added the instruct version of Gemma 4 series for better comparison. The PLE architecture was present in Gemma 3n models alongside regular dense models but Gemma 4 smaller models only use the PLE format.</p>

<ul>
  <li>Within Gemma 3 series, the 3n outperform the dense models (2B and 4B) by a large margin, Gemma 4s E2B and E4B have also improved significantly with a slight rise in tool call for the 4EB which is not ideal but when run in thinking mode the E4B does not make any tool calls.</li>
  <li>The MoE model does more tool calls than dense models but overall the performance is not bad, and its reasoning efficiency is better than the dense.</li>
  <li>Thinking variants improve exceptionally in smaller sizes but their main contribution to large ones is to reduce tool calls.</li>
</ul>

<figure style="margin: 0 auto; text-align: center;">
    <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/os_releases/gemma_progression.png" alt="Gemma release progression" style="width: auto; height: 30%;" />
    <figcaption>Gemma's progression</figcaption>
</figure>

<h1 id="unnecessary-commands">Unnecessary Commands</h1>

<p>The benchmark does not require tool calls, yet the tasks are still “edit this code,” which is exactly the topic harnesses training optimizes for. That makes it a good stress test for restraint: does the model stay inside the stated action space, or does it reach for shell/file tools anyway?</p>

<p>The graph below shows command distributions across all runs.</p>

<figure style="margin: 0 auto; text-align: center;">
    <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/os_releases/cmd_dist.png" alt="Command distribution" style="width: auto; height: 30%;" />
    <figcaption>Command Distribution</figcaption>
</figure>

<p>One observation is the usage of NPX and NPM which I think are the most non-sensical commands. Editing folder structure by removing is a breaking change which will degrade the model response. Navigation to other repos are useless as well since everything needed is already provided. But doing find, ls or cat are somewhat more acceptable still redundant. Now imagine these models will make these kind of mistakes wasting context and compute across multiple steps or completely derail the process within harness.</p>

<figure style="margin: 0 auto; text-align: center;">
    <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/os_releases/cmd_breakdown_by_family.png" alt="Command breakdown by model family" style="width: auto; height: 30%;" />
    <figcaption>Command breakdown by family</figcaption>
</figure>

<p>A more detailed view shows that release families do have a different distributions of tool calls, some observations:</p>
<ul>
  <li>Gemma 4 has the most tame cmds where there are just for inspection.</li>
  <li>The Qwen3 series and subseries (Qwen3-VL, Qwen3.5) all show a diverse range of CMDs pinpointing a very bad understanding of how to handle the issue. The main uptick is within the smaller models making them fragile to handle tool calling and reasoning.</li>
  <li>Gemma 4 Instruct version does worse than Gemma 4 thinking but still way better than Qwen releases.</li>
</ul>

<h1 id="conclusion">Conclusion</h1>

<p>There is value in understanding the ins and outs of benchmarks, potentially by rewriting them in other libraries (like OpenEnv or verifiers). These benchmarks are intended as proxies for real-world use cases in specific categories. As one goes through the benchmarks, the shortcomings of benchmarks will be highlighted, like for instance most of the questions within the Next.js eval are extremely simple and I would argue getting 30% correct is not an accomplishment for the models. There are numerous other similar benchmarks that papers show going from 0.10 to 0.4 but if one actually goes through the tasks, one might realize that anything below 40% is useless in that benchmark. The point is that most of the model card benchmarks are smoke and mirrors except for some which are genuinely difficult or open-ended in such a way that is not easy to saturate. And obviously the benchmark ecosystem is an evolving space with new benchmarks coming out on an hourly basis.</p>

<p>Additionally PLE seems to be the differentiating factor in Gemma models, this opens up new research avenues around further optimization of PLEs: maybe it does not have to be “per layer” so it can be scaled to the 20-30B range. One major usecase that I anticipate to take over for LLMs is embedding them in all apps and have them guide or handle operations, rendering every day apps behave like cursor. New architectures are being developed just to address these issues which falls under the intersection of verbatim instruction following, creativity, and interleaved reasoning with other modes like tool calling.</p>]]></content><author><name></name></author><summary type="html"><![CDATA[Benchmarking recent model releases on a DGX Spark with the Next.js benchmark to gauge capabilities and how useful they might be for day-to-day harness work.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/os_releases/init.png" /><media:content medium="image" url="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/os_releases/init.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Writing-zero Implementation using Prime Intellect stack</title><link href="https://damoonsh.github.io/w/2025/10/01/w0.html" rel="alternate" type="text/html" title="Writing-zero Implementation using Prime Intellect stack" /><published>2025-10-01T00:00:00+00:00</published><updated>2025-10-01T00:00:00+00:00</updated><id>https://damoonsh.github.io/w/2025/10/01/w0</id><content type="html" xml:base="https://damoonsh.github.io/w/2025/10/01/w0.html"><![CDATA[<h1 id="introduction">Introduction</h1>

<p><a href="https://www.alphaxiv.org/abs/2506.00103">Writing-zero</a> is an approach focused on increasing performance on non-verifiable tasks such as creativity. The paper uses Bootstrapped Relative Policy Optimization (BRPO) which is inspired by GRPO but the main difference is that it uses LLM-as-Judge or a generative reward model (GenRM) to assigning reward per rollouts. Additionally there are no normalization within GRPO.</p>

<p>The main idea is to utilize high quality data to develop a GenRM that specializes in choosing between options. The paper claims that using GenRM the model gets better at picking in between options in tasks that it was not directly trained on.</p>

<h1 id="data-synthesis">Data Synthesis</h1>

<p>As part of their cold-start SFT, the researchers utilized high quality dataset where the size of the dataset was doubled by changing the order at which two responses are passed within the prompt. I have created a similar dataset using different LLMs and the <a href="https://huggingface.co/datasets/SAA-Lab/LitBench-Train">LitBench</a> dataset. Snippet below shows the process of alternating response to avoid position bias.</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code>
<span class="n">prompt_1</span> <span class="o">=</span> <span class="s">'''
You are a helpful assistant
...
responses:
...
[Response_A]
[Response_B]
....
'''</span>

<span class="n">prompt_2</span> <span class="o">=</span> <span class="s">'''
You are a helpful assistant
...
responses:
...
[Response_B]
[Response_A]
....
'''</span>
</code></pre></div></div>

<p>Each prompt is repeated twice (once rejected first, once accepted response first), if the LLM is able to choose the correct response each time then we keep that reasoning trace.</p>

<h2 id="self-critique-principle-generation-scp">Self-Critique principle generation (SCP)</h2>

<p>The paper builds on the work of <a href="https://arxiv.org/pdf/2504.02495">Liu et al. (2025)</a> where self-critique principle generation is utilized. It is a prompting technique asking the LLM to come up with a rubric and score each response against the rubric. The prompt looks similar to this:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>.....
### 1. Develop Specific Evaluation Criteria for Literary Creativity
Based on the literary nature of the content and focusing specifically on creativity as the primary evaluation metric, refer to the **General Evaluation Criteria** to develop **Specific Evaluation Criteria** tailored to the current question. 
The specific criteria should supplement or adjust for the particular need and complement the general criteria. 
The specific criteria should include: 
- Dimension descriptions 
- A 1-10 scoring scale

### 3. Comparative Evaluation Using both the **General Evaluation Criteria** and the **Specific Evaluation Criteria**, conduct a comparative analysis of the two assistants’ responses for each dimension.

### 4. Weight Allocation Based on the general and specific evaluation criteria, allocate weights for each specific item. Ensure the total weight sums to 100%. Note: If any response scores low on the harmfulness criterion, increase the weight of harmfulness.

### 5. Scoring Method Score each evaluation dimension separately on a scale of 1 to 10, where 1 means completely unsatisfactory and 10 means fully satisfactory. After scoring, calculate the weighted average score for each response based on the weights of each dimension, resulting in a comprehensive score between 1 and 10 for each response.
————
.....
</code></pre></div></div>

<h1 id="training">Training</h1>

<p>The prime-rl stack breaks the process into these components:</p>
<ol>
  <li>Orchestrator: Generates rollouts using the verifiers environment passed and computes advantage.</li>
  <li>Train: Forward and backward pass is handled once orchestrator gets the reward and logprobs.</li>
  <li>Inference: Hosts the model to be trained or the judge model used for training.</li>
</ol>

<p>And separate .toml files need to be passed for each in cmd:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>uv run rl <span class="se">\</span>
  <span class="nt">--trainer</span> @ examples/writing_zero/GenRM/rl/train.toml <span class="se">\</span>
  <span class="nt">--orchestrator</span> @ examples/writing_zero/GenRM/rl/orch.toml <span class="se">\</span>
  <span class="nt">--inference</span> @ examples/writing_zero/GenRM/rl/infer.toml <span class="se">\</span>
  <span class="nt">--model</span>.name ... <span class="se">\</span>
  <span class="nt">--wandb</span>.project ... <span class="se">\</span>
  <span class="nt">--wandb</span>.name ...
</code></pre></div></div>

<h2 id="genrm">GenRM</h2>

<ol>
  <li>Cold-start fine tunning: This step is a simple SFT using the <a href="https://huggingface.co/datasets/dmnsh/w0_sft">synthesized data</a>.</li>
  <li>GRPO: The <a href="https://app.primeintellect.ai/dashboard/environments/dmnsh001/litbench">LitBench</a> environment is utilized so the model can apply the same reasoning trace as in <a href="https://huggingface.co/datasets/dmnsh/w0_sft">synthesized data</a> on larger corpora of data.</li>
</ol>

<h2 id="bootstrapped-relative-policy-optimization-brpo">Bootstrapped Relative Policy Optimization (BRPO)</h2>

<p>Here is the simple explanation of BRPO:</p>
<ol>
  <li>Generate rollouts for prompts</li>
  <li>Put them into group_sizes</li>
  <li>within each group, at random pick one as reference</li>
  <li>Use GenRM to do pair-wise comparison within the group, if reference gets a bigger score then return 1 else return -1</li>
  <li>Use raw 1 and -1 values for updating the weights, <strong>NO NORMALIZATION</strong></li>
</ol>

<p>So the main difference with GRPO is the use of GenRM and there being no normalization.</p>

<div style="flex: 1; min-width: 300px;">
    <figure style="text-align: center; padding-leftP: 5px;">
      <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/Screenshot%202025-11-04%20at%2009.54.20.png" />
      <figcaption> <b><i> Difference between BRPO and GRPO; from the <a href="https://www.alphaxiv.org/abs/2506.00103">Writing-zero paper </a></i> </b></figcaption>
    </figure>
  </div>

<h3 id="implementation">Implementation</h3>

<p>Within the Prime Intellect stack, in order to apply BRPO, we need an environment in which we go through all the steps so the orchestrator can return the advantages (which in this case are the same as rewards)</p>

<p>For that, <a href="https://app.primeintellect.ai/dashboard/environments/dmnsh001/w0-brpo"><code class="language-plaintext highlighter-rouge">w0-brpo</code></a> is implemented where it generates all rollouts, breaks into groups, choose on at random then assigns reward based on GenRM. Here are some details about the environment:</p>

<ul>
  <li><strong>Rubric override</strong>: The rubric is where the grouping happens and a reference answer is chosen at random and added to its state. Then within the reward function, reward is generated via the pair-wise comparison.</li>
</ul>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">class</span> <span class="nc">BootstrapRubric</span><span class="p">(</span><span class="n">vf</span><span class="p">.</span><span class="n">Rubric</span><span class="p">):</span>
    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">group_size</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">2</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
        <span class="nb">super</span><span class="p">().</span><span class="n">__init__</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
        <span class="bp">self</span><span class="p">.</span><span class="n">group_size</span> <span class="o">=</span> <span class="n">group_size</span>
    
    <span class="k">async</span> <span class="k">def</span> <span class="nf">score_group</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">states</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="n">State</span><span class="p">],</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
        <span class="n">index_to_group</span> <span class="o">=</span> <span class="p">{}</span>
        <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">state</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">states</span><span class="p">):</span>
            <span class="n">index_to_group</span><span class="p">.</span><span class="n">setdefault</span><span class="p">(</span><span class="n">state</span><span class="p">[</span><span class="s">'example_id'</span><span class="p">],</span> <span class="p">[]).</span><span class="n">append</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>

        <span class="k">for</span> <span class="n">indices</span> <span class="ow">in</span> <span class="n">index_to_group</span><span class="p">.</span><span class="n">values</span><span class="p">():</span>
            <span class="k">for</span> <span class="n">inner_idx</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">indices</span><span class="p">),</span> <span class="bp">self</span><span class="p">.</span><span class="n">group_size</span><span class="p">):</span>
                <span class="n">sub_states</span> <span class="o">=</span> <span class="p">[</span><span class="n">states</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="s">'completion'</span><span class="p">][</span><span class="mi">0</span><span class="p">][</span><span class="s">'content'</span><span class="p">]</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">indices</span><span class="p">[</span><span class="n">inner_idx</span><span class="p">:</span><span class="n">inner_idx</span> <span class="o">+</span> <span class="bp">self</span><span class="p">.</span><span class="n">group_size</span><span class="p">]]</span>
                <span class="n">ref_answer</span> <span class="o">=</span> <span class="n">random</span><span class="p">.</span><span class="n">choice</span><span class="p">(</span><span class="n">sub_states</span><span class="p">)</span>
                <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">indices</span><span class="p">[</span><span class="n">inner_idx</span><span class="p">:</span><span class="n">inner_idx</span> <span class="o">+</span> <span class="bp">self</span><span class="p">.</span><span class="n">group_size</span><span class="p">]:</span>
                    <span class="n">states</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="s">'ref_answer'</span><span class="p">]</span> <span class="o">=</span> <span class="n">ref_answer</span>
</code></pre></div></div>

<ul>
  <li><strong>Reward Function</strong>: Uses state to access the reward function and does the pair-wise comparison.
    <div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code> <span class="k">def</span> <span class="nf">make_rf</span><span class="p">():</span>
      <span class="k">async</span> <span class="k">def</span> <span class="nf">brpo_reward_function</span><span class="p">(</span><span class="n">prompt</span><span class="p">,</span> <span class="n">completion</span><span class="p">,</span> <span class="n">state</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">State</span><span class="p">]):</span>
          <span class="n">answer</span> <span class="o">=</span> <span class="n">completion</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="s">'content'</span><span class="p">]</span>
          <span class="n">ref_answer</span> <span class="o">=</span> <span class="n">state</span><span class="p">[</span><span class="s">'ref_answer'</span><span class="p">]</span>
            
          <span class="k">if</span> <span class="n">answer</span> <span class="o">==</span> <span class="n">ref_answer</span><span class="p">:</span>
              <span class="k">return</span> <span class="mi">1</span>
            
          <span class="n">loaded_prompt</span> <span class="o">=</span> <span class="n">load_dataset</span><span class="p">(</span><span class="s">'dmnsh/W0_GenRM'</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="s">'prompt_template_generation'</span><span class="p">,</span> <span class="n">split</span><span class="o">=</span><span class="s">'SPC'</span><span class="p">).</span><span class="nb">filter</span><span class="p">(</span><span class="k">lambda</span> <span class="n">ex</span><span class="p">:</span> <span class="n">ex</span><span class="p">[</span><span class="s">'dataset'</span><span class="p">]</span> <span class="o">==</span> <span class="n">state</span><span class="p">[</span><span class="s">'info'</span><span class="p">][</span><span class="s">'db'</span><span class="p">])[</span><span class="mi">0</span><span class="p">]</span>
            
          <span class="n">spc</span> <span class="o">=</span> <span class="n">SPC</span><span class="p">(</span>
              <span class="n">system_intro</span><span class="o">=</span><span class="n">loaded_prompt</span><span class="p">[</span><span class="s">'sys_intro'</span><span class="p">],</span>
              <span class="n">instructions</span><span class="o">=</span><span class="n">loaded_prompt</span><span class="p">[</span><span class="s">'instructions'</span><span class="p">],</span>
              <span class="n">general_eval_guide</span><span class="o">=</span><span class="n">loaded_prompt</span><span class="p">[</span><span class="s">'general_eval_guide'</span><span class="p">],</span>
              <span class="n">dialogue_content</span><span class="o">=</span><span class="n">loaded_prompt</span><span class="p">[</span><span class="s">'response_content'</span><span class="p">],</span>
              <span class="n">output_requirements</span><span class="o">=</span><span class="n">loaded_prompt</span><span class="p">[</span><span class="s">'output_requirements'</span><span class="p">]</span>
          <span class="p">)</span>
          <span class="n">final_prompt</span> <span class="o">=</span> <span class="n">spc</span><span class="p">({</span>
              <span class="s">'prompt'</span><span class="p">:</span> <span class="n">prompt</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="s">'content'</span><span class="p">],</span>
              <span class="s">'response_1'</span><span class="p">:</span> <span class="n">answer</span><span class="p">,</span>
              <span class="s">'response_2'</span><span class="p">:</span> <span class="n">ref_answer</span>
          <span class="p">})</span>
                    
          <span class="n">judge_response</span> <span class="o">=</span> <span class="k">await</span> <span class="n">maybe_await</span><span class="p">(</span>
              <span class="n">judge_client</span><span class="p">.</span><span class="n">chat</span><span class="p">.</span><span class="n">completions</span><span class="p">.</span><span class="n">create</span><span class="p">,</span>
              <span class="n">model</span><span class="o">=</span><span class="n">judge_model</span><span class="p">,</span>
              <span class="n">messages</span><span class="o">=</span><span class="p">[{</span><span class="s">"content"</span><span class="p">:</span> <span class="n">final_prompt</span><span class="p">,</span> <span class="s">"role"</span><span class="p">:</span> <span class="s">"user"</span><span class="p">}],</span>
          <span class="p">)</span>
          <span class="n">judge_response</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">judge_response</span><span class="p">.</span><span class="n">choices</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="n">message</span><span class="p">.</span><span class="n">content</span><span class="p">)</span>
          <span class="n">match</span> <span class="o">=</span> <span class="n">re</span><span class="p">.</span><span class="n">search</span><span class="p">(</span><span class="sa">r</span><span class="s">'\\boxed\{([\d.]+),\s*([\d.]+)\}'</span><span class="p">,</span> <span class="n">judge_response</span><span class="p">)</span>
                        
          <span class="k">if</span> <span class="ow">not</span> <span class="n">match</span><span class="p">:</span>
              <span class="n">state</span><span class="p">[</span><span class="s">'judgments'</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span><span class="s">"alt"</span><span class="p">:</span> <span class="n">ref_answer</span><span class="p">,</span> <span class="s">"score_A"</span><span class="p">:</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s">"score_B"</span><span class="p">:</span> <span class="o">-</span><span class="mi">1</span><span class="p">}</span>
              <span class="k">return</span> <span class="o">-</span><span class="mi">1</span>
            
          <span class="n">score_A</span><span class="p">,</span> <span class="n">score_B</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">match</span><span class="p">.</span><span class="n">group</span><span class="p">(</span><span class="mi">1</span><span class="p">)),</span> <span class="nb">float</span><span class="p">(</span><span class="n">match</span><span class="p">.</span><span class="n">group</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
          <span class="n">state</span><span class="p">[</span><span class="s">'judgments'</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span><span class="s">"alt"</span><span class="p">:</span> <span class="n">ref_answer</span><span class="p">,</span> <span class="s">"score_A"</span><span class="p">:</span> <span class="n">score_A</span><span class="p">,</span> <span class="s">"score_B"</span><span class="p">:</span> <span class="n">score_B</span><span class="p">}</span>
          <span class="k">return</span> <span class="mi">1</span> <span class="k">if</span> <span class="n">score_A</span> <span class="o">&gt;</span> <span class="n">score_B</span> <span class="k">else</span> <span class="o">-</span><span class="mi">1</span>
        
      <span class="k">return</span> <span class="n">brpo_reward_function</span>
</code></pre></div>    </div>
  </li>
</ul>

<p>Now another details that matters is that when passing advantage keyword inside orch.toml file, we need to pass it as ‘None’ since the default behavior subtracts the mean.</p>

<div class="language-toml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="err">....</span>
<span class="py">batch_size</span> <span class="p">=</span> <span class="mi">1024</span>
<span class="py">rollouts_per_example</span> <span class="p">=</span> <span class="mi">16</span>

<span class="py">advantage</span><span class="p">=</span><span class="s">'None'</span>
<span class="err">....</span>
<span class="nn">[environment]</span>
<span class="py">id</span> <span class="p">=</span> <span class="s">"dmnsh001/w0-brpo"</span>
<span class="err">....</span>
</code></pre></div></div>

<h1 id="evaluation-results">Evaluation results</h1>

<p>Minimum training yields the same results as the <a href="https://www.alphaxiv.org/abs/2506.00103">paper</a> suggested wherein BRPO on creative tasks does increase models ability on selecting better when given multiple choice questions (RewardBench2). This is evident by 2% increase (4.18% of original score) in <a href="https://app.primeintellect.ai/dashboard/environments/primeintellect/reward-bench">RewardBench</a> and 0.148 increase within <a href="https://app.primeintellect.ai/dashboard/environments/primeintellect/writing-bench">WritingBench</a></p>

<table>
  <thead>
    <tr>
      <th style="text-align: right">Benchmark\Model</th>
      <th style="text-align: center">PrimeIntellect/Qwen3-4B</th>
      <th style="text-align: center">dmnsh/Qwen3-4b-W0-BRPO</th>
      <th style="text-align: center">Change (%)</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td style="text-align: right">RewardBench2</td>
      <td style="text-align: center">0.478</td>
      <td style="text-align: center">0.498</td>
      <td style="text-align: center">+4.18%</td>
    </tr>
    <tr>
      <td style="text-align: right">Writing Bench</td>
      <td style="text-align: center">6.864</td>
      <td style="text-align: center">7.012</td>
      <td style="text-align: center">+2.16%</td>
    </tr>
  </tbody>
</table>

<h1 id="further-improvement">Further improvement</h1>

<p>The synthesized data can be more diverse in terms of topics and RL training parameters can be further optimized. Also a larger model can be utilized.</p>]]></content><author><name></name></author><summary type="html"><![CDATA[BRPO trains a generative reward model for creative writing; +4.18% on RewardBench2.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/Screenshot%202025-11-04%20at%2009.54.20.png" /><media:content medium="image" url="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/Screenshot%202025-11-04%20at%2009.54.20.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Nexus: Specialization meets Adaptability for Efficiently Training Mixture of Experts</title><link href="https://damoonsh.github.io/w/2025/08/20/Nexus-paper.html" rel="alternate" type="text/html" title="Nexus: Specialization meets Adaptability for Efficiently Training Mixture of Experts" /><published>2025-08-20T00:00:00+00:00</published><updated>2025-08-20T00:00:00+00:00</updated><id>https://damoonsh.github.io/w/2025/08/20/Nexus-paper</id><content type="html" xml:base="https://damoonsh.github.io/w/2025/08/20/Nexus-paper.html"><![CDATA[<p>These are notes for this <a href="https://www.alphaxiv.org/abs/2408.15901">paper</a>.</p>

<h1 id="context">Context</h1>

<p>MoE was first introduced in 2017 and within the last few years there has been steady rise in deploying this algorithm.</p>

<p>This work is expands on previous works</p>

<ul>
  <li>Sparse Upcycling (Komatsuzaki et al., 2023)</li>
  <li>Brain-Train-Mix (BTX) (Sukhbaatar et al., 2024)</li>
  <li>Branch-Train-Merge (BTM) (Li et al., 2022)</li>
</ul>

<p>Novel approach utilized in Nexus is using a dynamic router within MoE</p>

<ul>
  <li>Usual MoE routers have fixed number of experts</li>
  <li>Usual MoE only route using the tokens</li>
  <li>Nexus router uses domain embeddings and expert embedding for routing hence new MoEs could be added.</li>
</ul>

<h2 id="sparse-upcycling">Sparse Upcycling</h2>

<ul>
  <li>Training mixture-of-experts from dense checkpoints</li>
  <li>Take a dense model and make it MoE by only training the router</li>
  <li>Keep the transformer bit intact, copy the FFN part, add multiples of it with a router</li>
</ul>

<figure style="text-align: center;">
      <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nexus/sparse_upcycling.png" style="width: auto; height: 30%; " />
      <figcaption>Sparse UpCycling</figcaption>
    </figure>

<h2 id="branch-train-mix-btx">Branch-Train-Mix (BTX)</h2>

<ul>
  <li>Training mixture-of-experts from dense checkpoints</li>
  <li>Take a dense model and make it MoE by only training the router</li>
  <li>Keep the transformer bit intact, copy the FFN part, add multiples of it with a router</li>
  <li>Brain-Train-Merge: Averages everything and no routers.</li>
</ul>

<figure style="text-align: center;">
      <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nexus/btm.png" style="width: auto; height: 30%; " />
      <figcaption>BTX</figcaption>
    </figure>

<h2 id="nexus">Nexus</h2>

<p>Domain embeddings are utilized with SwiGLU to generate the expert embeddings which later on determine which router should be used given the tokens. This approach is a kin to:</p>

<ol>
  <li>Mahabadi et al., 2021 (Parameter-efficient multi-task fine-tuning)</li>
  <li>Üstün et al., 2022 (Hyper-X)</li>
</ol>

<p>$e_i = P_r(d_i)$
(Domain to Expert Embeddings)</p>

<p>$= W_2 \cdot \text{SwiGLU}(W_1 \cdot d_i)$</p>

<p>Note: Similar to DeepSeek V3, it keeps a shared FFN.</p>

<figure style="text-align: center;">
      <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nexus/nexus.png" style="width: auto; height: 30%; " />
      <figcaption>Nexus</figcaption>
    </figure>

<ul>
  <li>Mixing expert lms into a mixture-of-experts lm</li>
  <li>Merges already expert LLMs</li>
  <li>Takes their FFNs and averages transformer bits to create a shared body</li>
</ul>

<h2 id="summary-table">Summary Table</h2>

<table>
  <thead>
    <tr>
      <th>Feature</th>
      <th>Sparse Upcycling</th>
      <th>BTM (Merge)</th>
      <th>BTX (Mix) &amp; Nexus</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Starting Point</td>
      <td>One general model</td>
      <td>Multiple specialized models</td>
      <td>Multiple specialized models</td>
    </tr>
    <tr>
      <td>What it does with FFNs</td>
      <td>Copies them identically</td>
      <td>Averages them together</td>
      <td>Collects them as experts</td>
    </tr>
    <tr>
      <td>Is there a Router?</td>
      <td>Yes, trained from scratch</td>
      <td>No router</td>
      <td>Yes, trained from scratch</td>
    </tr>
    <tr>
      <td>Final Model Type</td>
      <td>Sparse MoE</td>
      <td>Dense</td>
      <td>Sparse MoE</td>
    </tr>
  </tbody>
</table>

<h1 id="expermintal-setup">Expermintal setup</h1>

<ul>
  <li>Two model sizes: 470M, 2.8B</li>
  <li>Five different categories</li>
  <li>Trained an expert then added it to study properties</li>
</ul>

<figure style="text-align: center;">
      <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nexus/result_cross_domain.png" style="width: auto; height: 30%; " />
      <figcaption>Results Across Domain</figcaption>
    </figure>

<h2 id="results-for-upcycling">Results for Upcycling</h2>

<figure style="text-align: center;">
      <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nexus/result_upcycling.png" style="width: auto; height: 30%; " />
      <figcaption>Results Across Domain</figcaption>
    </figure>

<h2 id="result-expert-selection">Result: Expert selection</h2>

<figure style="text-align: center;">
      <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nexus/result_expert_selection
.png" style="width: auto; height: 50%; " />
      <figcaption>Results on Expert Selection</figcaption>
    </figure>

<h2 id="ablations">Ablations</h2>

<ol>
  <li>Effects of load balance weights</li>
</ol>

<figure style="text-align: center;">
      <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nexus/load_balance_weight
.png" style="width: auto; height: 50%; " />
      <figcaption>Load Balance Ablation</figcaption>
    </figure>

<ol>
  <li>Altering data training composition</li>
  <li>Effectiveness of domain embedding</li>
</ol>

<p><img />embed_effectiveness&lt;/img&gt;</p>
<figure style="text-align: center;">
      <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nexus/embed_effectiveness
.png" style="width: auto; height: 50%; " />
      <figcaption>Embedding Effectiveness</figcaption>
    </figure>]]></content><author><name></name></author><summary type="html"><![CDATA[Nexus merges specialist LLMs into a sparse MoE using domain-embedding dynamic routing.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nexus/nexus.png" /><media:content medium="image" url="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/nexus/nexus.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Deep Researcher with Test-Time Diffusion</title><link href="https://damoonsh.github.io/w/2025/08/07/TTD.html" rel="alternate" type="text/html" title="Deep Researcher with Test-Time Diffusion" /><published>2025-08-07T00:00:00+00:00</published><updated>2025-08-07T00:00:00+00:00</updated><id>https://damoonsh.github.io/w/2025/08/07/TTD</id><content type="html" xml:base="https://damoonsh.github.io/w/2025/08/07/TTD.html"><![CDATA[<p>These are notes for this <a href="https://www.alphaxiv.org/abs/2507.16075">paper</a>.</p>

<h3 id="similarity-to-hierarchical-reasoning">Similarity to Hierarchical Reasoning?</h3>

<p>Similar to <a href="https://www.alphaxiv.org/abs/2506.21734">HRM</a>, this approach involves a low-level and high-level a operatives where the high-level drafts out the overall strtucture and planning, and multiple low-level modules evolve the answers then those answers are utilized to refine the original draft/plan. And this continues multiple times.</p>

<h1 id="ppaer-notes">Ppaer Notes</h1>

<p><strong>Inspiration from human research</strong>: cycles of searching, reasoning, and revision. Humans do not write one word at a time sequentially; there is a process of planning out, writing each part then doing revisions.</p>

<figure style="margin: 0 auto; text-align: center;">
    <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/tdd/human_approach.png" style="width: auto; height: 30%; " />
    <figcaption>Human Process</figcaption>
</figure>

<p>Previous works focuses test-time scaling</p>
<ul>
  <li>CoT</li>
  <li>Best-of-n sampling</li>
  <li>Monte Carlo Tree Search</li>
  <li>Debate mechanism</li>
  <li>Self-refinement loops</li>
</ul>

<p>The approaches are not cohesive when it comes to drafting, searching and refining</p>

<h3 id="a-denoising-with-retrieval">A: Denoising with retrieval</h3>
<ul>
  <li>Initial research report drafted by LLM
- De-noised using external information
    <h3 id="b-self-evolution">B: Self-Evolution</h3>
  </li>
  <li>Each individual component also goes through its own optimization process</li>
  <li>Encourage the exploration of diverse knowledge</li>
</ul>

<p>Previous approaches (HuggingFace OpenDR, GPT Researcher, Open Deep Researcher) employ a linear or parallelized process of planning/search/generation -&gt; loss of global context and miss critical dependencies during the research process.</p>
<figure style="margin: 0 auto; text-align: center;">
    <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/tdd/comparison.png" style="width: auto; height: 30%; " />
    <figcaption>Comparison of other linear approaches</figcaption>
</figure>

<h2 id="draft-diffusion">Draft Diffusion</h2>
<p>Draft-centric approach remains cohesive, provides a dynamic guide for the research direction; mitigating information loss.</p>

<ul>
  <li><em>Stage 1</em>
    <ul>
      <li>Dedicated LLM generates a structured plan</li>
      <li>Outlining key areas</li>
      <li>Initial scaffolding</li>
      <li>Guide subsequent information-gathering process.</li>
      <li>Passes each action to agent steps</li>
    </ul>
  </li>
  <li><em>Stage 2</em>
    <ul>
      <li>Answer and Question sub-agents</li>
      <li>One generates question related to the topic the other one answers it</li>
    </ul>
  </li>
  <li><em>Stage 3</em>: synthesis</li>
</ul>

<figure style="margin: 0 auto; text-align: center;">
    <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/tdd/backbone_dr.png" style="width: auto; height: 30%; " />
    <figcaption>Planning aspect</figcaption>
</figure>

<h2 id="componet-wise-evolution">Componet-wise evolution</h2>

<figure style="margin: 0 auto; text-align: center;">
    <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/tdd/component-wise.png" style="width: auto; height: 30%; " />
    <figcaption>Evolution within each component</figcaption>
</figure>

<ol>
  <li>Produce multiple responses to one search query</li>
  <li>Each asnwers is assesed in an LLM-as-judge for feedback</li>
  <li>With the feedback each answer adjusts</li>
  <li>Merged multiple answers into one</li>
</ol>

<h1 id="evalution">Evalution</h1>

<p>This is a multi-step and agent environemnt and it is not straightforward to evaluate. Here is the collected metrics:</p>
<ul>
  <li>high-quality human judgement annotations</li>
  <li>calibrate LLM-as-judge calibrated with humna preference</li>
  <li>calibrated LLM-as-judge as the final evaluator</li>
</ul>

<h2 id="metrics">Metrics</h2>

<h3 id="helpfullness-and-comprehensiveness">Helpfullness and Comprehensiveness</h3>
<ul>
  <li>Helpfullness
    <ol>
      <li>Satisfying use intent</li>
      <li>ease of understanding</li>
      <li>accuracy</li>
      <li>appropiate language</li>
    </ol>
  </li>
  <li>Comprehensiveness: Absence of missing key information</li>
</ul>

<figure style="margin: 0 auto; text-align: center;">
    <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/tdd/lr_and dc.png" style="width: auto; height: 30%; " />
</figure>

<h3 id="side-by-side-quality-comparison">Side-by-side quality comparison</h3>
<p>AKA pair-wise evaluation with these options between A and B:
1) Much Better If A is both more helpful and more comprehensive than B
2) Better If A is more helpful than B and equally comprehensive as B, or if A is more comprehensive than B and equally helpful as B
3) Slightly Better If A is more helpful but less comprehensive than B
4) About The Same If none of the above conditions are met. The same logic applies when B is better than A.</p>

<h3 id="llm-as-judge">LLM-as-Judge</h3>
<p>two benchmarks used: LongForm Research and DeepConsult</p>

<p>Previous approaches did not use human raters to calibrate the LLM-as-judge</p>

<figure style="margin: 0 auto; text-align: center;">
    <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/tdd/benchmark-res.png" style="width: auto; height: 30%; " />
</figure>

<h2 id="ablation-studies">Ablation Studies</h2>

<p>Advanced LLMs perform poorly without search tools</p>
<ul>
  <li>Gemini2.5-pro on full HLE: 20%, on HLE-search: 8%</li>
  <li>Looking at table below, it is evident that all the loss of the model (from 20% to 8%) was due to lack of search</li>
</ul>

<figure style="margin: 0 auto; text-align: center;">
    <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/tdd/ablation.png" style="width: auto; height: 30%; " />
</figure>

<h2 id="self-evolution-working-better">Self-evolution working better</h2>

<p>Graph below shows how self-evolution picks up more key points cumulatively as each search step goes on.</p>

<figure style="margin: 0 auto; text-align: center;">
    <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/tdd/self-e-graph.png" style="width: auto; height: 30%; " />
</figure>

<h1 id="conclusion">Conclusion</h1>

<ul>
  <li>Report generation as a diffusion process</li>
  <li>Preliminary draft is the research direction</li>
  <li>Demonstrates superior performance for long report generation</li>
</ul>]]></content><author><name></name></author><summary type="html"><![CDATA[Draft-diffusion research agent denoises reports iteratively; outperforms linear pipelines.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/tdd/comparison.png" /><media:content medium="image" url="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/tdd/comparison.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Hierarchical Reasoning Model</title><link href="https://damoonsh.github.io/w/2025/08/02/h-reasoning-model.html" rel="alternate" type="text/html" title="Hierarchical Reasoning Model" /><published>2025-08-02T00:00:00+00:00</published><updated>2025-08-02T00:00:00+00:00</updated><id>https://damoonsh.github.io/w/2025/08/02/h-reasoning-model</id><content type="html" xml:base="https://damoonsh.github.io/w/2025/08/02/h-reasoning-model.html"><![CDATA[<h1 id="hierarchical-reasoning-model">Hierarchical Reasoning Model</h1>

<p>Paper: https://www.alphaxiv.org/abs/2506.21734</p>

<h1 id="context">Context</h1>

<h2 id="abstract-reasoning-corpus-arc">Abstract Reasoning Corpus (ARC)</h2>

<p>This paper aims at solving ARC using minimal amount of computation with a new archtecture.</p>

<p><a href="https://www.amazon.ca/Thinking-Fast-Slow-Daniel-Kahneman/dp/0385676530/ref=sr_1_1?dib=eyJ2IjoiMSJ9.-A0A1M1omFejp_IgozA4EP-t1GVm1BQ5b-Fy4--sH2jlI4TkjH5jDyvsMB3QaPAWmCF8fXOUXeorzBGapyu2it_PQPmflA5bDZjX-53c4H18YuX2VsMXHhS8uW_w7evLbej2Za85-JUZQgwJ6jlg-YrHbJZ-6imVGBQ66MpfM1HgMxMjaPmFvhE_gyrI3Op5EaS7OJ32xEV12KFiEXVEOmGEy1aW1CSa9bD7_vBrEg8.Z5Dg9KuVJmWPXHz_m5w1mTEn1qFjLDwTbjmmHonIvIs&amp;dib_tag=se&amp;gad_source=1&amp;hvadid=208395699259&amp;hvdev=c&amp;hvexpln=0&amp;hvlocphy=9198282&amp;hvnetw=g&amp;hvocijid=11848890499679496705--&amp;hvqmt=e&amp;hvrand=11848890499679496705&amp;hvtargid=kwd-300246672130&amp;hydadcr=22462_9261645&amp;keywords=thinking+fast+thinking+slow&amp;mcid=19b38662bf3f3833bd2f70b228d7e847&amp;qid=1754191073&amp;s=books&amp;sr=1-1">Thinking Fast, Thking Slow</a>:</p>
<ul>
  <li>Lots of research papers refer to this book</li>
  <li>The book talks divides brain’s thinking process into slow and fast
    <ul>
      <li>Fast: Fast, Automatic, Intuitive</li>
      <li>Slow: Deloberate, effortful reasoning</li>
    </ul>
  </li>
</ul>

<figure style="margin: 0 auto; text-align: center;">
    <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/slow_fast.gif" style="width: auto; height: 30%; " />
    <figcaption>Hierarchical Reasoning process</figcaption>
</figure>

<h1 id="introduction">Introduction</h1>

<p>Previous reasoning models use CoT (Chain-of-Thought), downsides:</p>
<ul>
  <li>Brittle task decomposition: Single misstep can break the chain</li>
  <li>Extensive data requirements: Large training data</li>
  <li>High latency: Generates loads of token; slowing down inference</li>
</ul>

<p>WHat are they offering: Latenet Reasoning</p>
<ul>
  <li>Language is for human communication and ideas/thoughts are compressed effectively without translating back to language</li>
  <li>The model operates within its own hidden state</li>
</ul>

<p>Inspired by human brain</p>
<ul>
  <li>High-level (slow) part and low-level (fast) part interact</li>
  <li>The low-level exectures ideas based on the global knowdlege stored in High-level</li>
  <li>High-level gets feedback from low-level and adjusts</li>
  <li>Hierarchy and multi-stage</li>
</ul>

<h2 id="datasets">Datasets</h2>
<figure style="margin: 0 auto; text-align: center;">
    <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/h-rez-data.png" style="width: auto; height: 30%; " />
    <figcaption>Hierarchical Reasoning process</figcaption>
</figure>

<h2 id="result">Result</h2>

<ul>
  <li>Models being compared are general purpose</li>
  <li>Not tested on ARC-3</li>
</ul>

<figure style="text-align: center;">
      <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/h-reasoning-comparison.png" style="width: auto; height: 30%; " />
      <figcaption style="text-align: center;">Comparison for ARC-1,2, and Soduku (Figure 1 from paper)</figcaption>
    </figure>

<h1 id="method">Method</h1>

<h2 id="data--augmentations">Data + Augmentations</h2>

<p>1000 From each (ARC, Sudoku, Maze) +  ==≥ 3,831,994</p>
<ul>
  <li>ARC: transition/rotations/flips/color permutations</li>
  <li>Soduku: used band and digits permuations</li>
  <li>Maze: No change, raw data used</li>
</ul>

<h2 id="h-l-combo">H-L combo</h2>

<ul>
  <li>H-level updates after T steps of L-level
    <ul>
      <li>When L-level reeaches local equilibrium</li>
    </ul>
  </li>
  <li>H-level’s world-view changes; L-level resets -≥ new computation path</li>
  <li>N (number of H update) x L (number of l updates) increase the reasoning depth</li>
</ul>

<figure style="margin: 0 auto; text-align: center;">
    <img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/h-rez.png" style="max-width: 48%; height: auto;" />
    <figcaption>Hierarchical Reasoning process</figcaption>
</figure>

<h2 id="memory-footprint">Memory footprint</h2>

<p>Backpropagation Through Time (BPTT) saves model parameters at each time step and backpropagates.</p>
<ul>
  <li>Biological implausibility: Human brain does not do this</li>
</ul>

<p>This approach is O(1): Constant memory; uses <strong>one-step gradient approximation</strong>::uses the first and last state of H and L level, intermediary steps as constants.</p>
<ul>
  <li>Aligns with idea of local rule in brian</li>
  <li>Brain does not utilize all previous computations for learning</li>
</ul>

<h1 id="more-detailed-result">More Detailed Result</h1>

<h3 id="arc-agi-performance-comparison-hrm-vs-baselines">ARC-AGI Performance Comparison (HRM vs. Baselines)</h3>

<table>
  <thead>
    <tr>
      <th>Model</th>
      <th>Size (Params)</th>
      <th>ARC-AGI-1 (%)</th>
      <th>ARC-AGI-2 (%)</th>
      <th>Pretraining?</th>
      <th>CoT Used?</th>
      <th>Notes</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>No Pretraining + No CoT</strong> <em>(Trained from scratch, minimal supervision)</em></td>
      <td> </td>
      <td> </td>
      <td> </td>
      <td> </td>
      <td> </td>
      <td> </td>
    </tr>
    <tr>
      <td>HRM</td>
      <td>~27M</td>
      <td><strong>40.3</strong></td>
      <td><strong>5.0</strong></td>
      <td>❌</td>
      <td>❌</td>
      <td>Proposed model; uses hierarchical recurrence, latent reasoning</td>
    </tr>
    <tr>
      <td>Direct pred (8-layer Transformer)</td>
      <td>~27M</td>
      <td>15.8</td>
      <td>~0.0 (implied)</td>
      <td>❌</td>
      <td>❌</td>
      <td>Same size as HRM, but standard architecture fails on hard tasks</td>
    </tr>
    <tr>
      <td>Liao &amp; Gu (equivariant CNN)</td>
      <td>~10–50M (est.)</td>
      <td>15.8</td>
      <td>Not reported</td>
      <td>❌</td>
      <td>❌</td>
      <td>Specialized architecture tailored to ARC; hand-designed inductive biases</td>
    </tr>
    <tr>
      <td> </td>
      <td> </td>
      <td> </td>
      <td> </td>
      <td> </td>
      <td> </td>
      <td> </td>
    </tr>
    <tr>
      <td><strong>Pretrained + CoT-Based</strong> <em>(Large language models using step-by-step prompting)</em></td>
      <td> </td>
      <td> </td>
      <td> </td>
      <td> </td>
      <td> </td>
      <td> </td>
    </tr>
    <tr>
      <td>o3-mini-high (GPT-4o variant)</td>
      <td>~48B</td>
      <td>34.5</td>
      <td>1.3</td>
      <td>✅</td>
      <td>✅</td>
      <td>Top CoT model in evaluation; uses 128k context</td>
    </tr>
    <tr>
      <td>Claude 3.7 8K</td>
      <td>~100–200B (est.)</td>
      <td>21.2</td>
      <td>0.9</td>
      <td>✅</td>
      <td>✅</td>
      <td>Proprietary model; strong CoT capability</td>
    </tr>
    <tr>
      <td>Deepseek R1 (est.)</td>
      <td>~100B+</td>
      <td>~21.0</td>
      <td>~0.0</td>
      <td>✅</td>
      <td>✅</td>
      <td>Estimated performance based on plot in paper</td>
    </tr>
    <tr>
      <td> </td>
      <td> </td>
      <td> </td>
      <td> </td>
      <td> </td>
      <td> </td>
      <td> </td>
    </tr>
    <tr>
      <td><strong>Pretrained + CoT (Other Notable Models)</strong></td>
      <td> </td>
      <td> </td>
      <td> </td>
      <td> </td>
      <td> </td>
      <td> </td>
    </tr>
    <tr>
      <td>AlphaGeometry 2</td>
      <td>~100B+</td>
      <td>~20–25 (est.)</td>
      <td>Not tested</td>
      <td>✅</td>
      <td>✅</td>
      <td>Specialized for geometric puzzles, not full ARC-AGI</td>
    </tr>
    <tr>
      <td>GPT-4o (Base)</td>
      <td>~48B</td>
      <td>~30–35 (varies)</td>
      <td>N/A</td>
      <td>✅</td>
      <td>✅</td>
      <td>Public results vary; performance depends on prompt engineering</td>
    </tr>
  </tbody>
</table>

<hr />

<h3 id="-key-insights">🔍 Key Insights:</h3>

<ul>
  <li><strong>HRM is in a different league</strong>: Despite using <strong>no pretraining</strong>, <strong>no CoT</strong>, and <strong>1,000× fewer parameters</strong>, it <strong>outperforms all CoT-based models</strong> on <strong>ARC-AGI-1</strong>.</li>
  <li><strong>Efficiency</strong>: HRM achieves <strong>40.3% on ARC-AGI-1</strong> using only 960 training examples and 27M parameters — a level of data and parameter efficiency unmatched by any other model.</li>
  <li><strong>CoT limitations</strong>: Even the strongest CoT models struggle with <strong>ARC-AGI-2</strong>, which requires <strong>compositional, multi-step abstraction</strong> — suggesting CoT has fundamental limits on novel reasoning.</li>
  <li><strong>Architecture &gt; Scale</strong>: HRM proves that <strong>better internal reasoning design</strong> can beat <strong>scaling alone</strong> — a shift from “bigger is better” to “deeper, structured computation wins.”</li>
</ul>

<p>This hierarchical view underscores HRM’s significance: <strong>it achieves superior reasoning not by being larger or more data-hungry, but by thinking differently — deeply, internally, and adaptively.</strong></p>

<h1 id="related">Related</h1>

<p>Resembles these:</p>
<ul>
  <li>VAEs, Diffusion</li>
  <li><a href="https://www.alphaxiv.org/abs/2502.11831">Intuitive physics understanding emerges from self-supervised pretraining on natural videos</a></li>
  <li><a href="https://www.alphaxiv.org/abs/2306.02572">A Path Towards Autonomous Machine Intelligence</a></li>
</ul>]]></content><author><name></name></author><summary type="html"><![CDATA[27M-parameter HRM uses slow/fast latent reasoning to outperform CoT models on ARC-AGI.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/slow_fast.gif" /><media:content medium="image" url="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/slow_fast.gif" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Mixture of Recursions</title><link href="https://damoonsh.github.io/w/2025/07/21/MoR.html" rel="alternate" type="text/html" title="Mixture of Recursions" /><published>2025-07-21T00:00:00+00:00</published><updated>2025-07-21T00:00:00+00:00</updated><id>https://damoonsh.github.io/w/2025/07/21/MoR</id><content type="html" xml:base="https://damoonsh.github.io/w/2025/07/21/MoR.html"><![CDATA[<h1 id="background">Background</h1>

<h1 id="result">Result</h1>

<h2 id="mixture-of-depths">Mixture of Depths</h2>

<p>Mixture of Depths (MoD) is an optimization technique for transformer models that allows different tokens to use varying amounts of computation by selectively routing tokens through layers. Instead of processing every token through every layer, MoD uses learned routing scores to determine which tokens receive full self-attention computation and which can skip layers with just residual connections. This adaptive approach exploits the natural variation in token complexity—simple tokens like “the” or “and” require less processing than semantically rich tokens—achieving 2-3x inference speedup with minimal quality degradation by dynamically allocating computational resources where they’re most needed.</p>

<p><em>Reference: Raposo, D., Ritter, S., Santoro, A., Wayne, G., Weber, T., Botvinick, M., van Hasselt, H., &amp; Song, F. (2024). Mixture-of-Depths: Dynamically allocating compute in transformer-based language models. arXiv preprint arXiv:2404.02258.</em></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/mod-expert-toekn.png" /></p>

<p>&lt;div align=”center” style=”margin-top: 20px; padding: 15px;; border-radius: 8px&gt;</p>

<p><strong>MoD Token Filtering Process</strong> 🔵 (Active tokens) 🔴 (Elimintaed Tokens)</p>

<p><em>The Mixture of Depths (MoD) algorithm progressively reduces the token set through recursive filtering, retaining only the most semantically relevant tokens for downstream processing.</em></p>

<p>&lt;/div&gt;</p>

<h2 id="mixture-of-recursions">Mixture of Recursions</h2>

<p>Mixture of Recursions (MoR) extends the efficiency principles of Mixture of Depths by introducing hierarchical token filtering through recursive processing stages. While MoD focuses on layer-wise token routing within a single forward pass, MoR applies token-level selection across multiple recursive iterations, progressively refining the active token set at each stage. Inspired by both MoD’s adaptive computation allocation and token-level pruning techniques, MoR creates a multi-stage filtering pipeline where tokens compete for computational resources across recursive depths rather than transformer layers. This hierarchical approach allows for more aggressive token reduction while maintaining semantic coherence, as each recursive stage can focus on increasingly refined subsets of the most relevant tokens, potentially achieving even greater efficiency gains than traditional depth-based routing methods.</p>

<p><em>Note: This appears to be a novel approach building on established MoD principles - specific citation pending publication.</em></p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/mor-expert-toekn.png" /></p>

<p>&lt;div align=”center” style=”margin-top: 20px; padding: 15px;; border-radius: 8px&gt;</p>

<p><strong>MoR Token Filtering Process</strong> 🔵 (Active tokens) 🔴 (Elimintaed Tokens)</p>

<p><em>The Mixture of Ranks (MoR) algorithm progressively reduces the token set through recursive filtering, retaining only the most semantically relevant tokens for downstream processing.</em></p>

<p>&lt;/div&gt;</p>

<h2 id="caching-mechanisms-mod-vs-mor">Caching Mechanisms: MoD vs MoR</h2>

<p>The caching mechanism is a critical optimization in both MoD and MoR approaches, but they differ significantly in their implementation and efficiency. In MoD, caching occurs at the layer level where skipped tokens maintain their previous layer representations, requiring cache invalidation and updates as tokens move through different routing decisions across layers. MoR introduces a more sophisticated hierarchical caching system that leverages the recursive nature of its filtering process, allowing for persistent token state across recursive iterations and enabling more efficient cache reuse patterns.</p>

<p><img src="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/MoR_MoR_caching.png" /></p>

<div align="center" style="margin-top: 20px; padding: 15px; border-radius: 8px">

**MoR Hierarchical Cache Reduction** (Initial (25 tokens) 🟢 (Filtered 9 tokens) 🟡 (Final 4 tokens) 🟣 (Mapping Process)

*MoR progressively reduces cache size from 5x5 grid (25 tokens) → 3x3 grid (9 tokens) → 2x2 grid (4 tokens), with efficient mapping between recursive stages maintaining spatial relationships and reducing memory footprint by 84%.*

</div>

<h3 id="computational-efficiency-analysis">Computational Efficiency Analysis</h3>

<p><strong>Traditional MoD Approach (3 × 5×5 grids):</strong></p>
<ul>
  <li>Memory Operations: 3 × (5² = 25) = <strong>75 cache entries</strong></li>
  <li>Attention Complexity: 3 × O(25²) = <strong>3 × 625 = 1,875 operations</strong></li>
  <li>Cache Invalidations: High frequency due to layer-wise routing changes</li>
  <li>Total Memory Footprint: <strong>75 × d_model bytes</strong> (constant across layers)</li>
</ul>

<p><strong>MoR Hierarchical Approach (5×5 → 3×3 → 2×2):</strong></p>
<ul>
  <li>Memory Operations: 25 + 9 + 4 = <strong>38 cache entries</strong> (49% reduction)</li>
  <li>Attention Complexity: O(25²) + O(9²) + O(4²) = 625 + 81 + 16 = <strong>722 operations</strong> (62% reduction)</li>
  <li>Cache Invalidations: Minimal due to hierarchical persistence</li>
  <li>Total Memory Footprint: <strong>Progressive reduction</strong> from 25d to 4d model bytes</li>
</ul>

<h3 id="intermediary-mapping-matrices">Intermediary Mapping Matrices</h3>

<p>MoR maintains efficient token relationships through sparse mapping matrices between recursion levels:</p>

<p><strong>First Mapping Matrix (25→9):</strong></p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>M₁ ∈ ℝ^(9×25) where M₁[i,j] = {
  1 if token j maps to position i in reduced grid
  0 otherwise
}
</code></pre></div></div>
<ul>
  <li>Sparsity: 9/25 = 36% non-zero entries</li>
  <li>Storage: 9 indices instead of 225 full matrix entries</li>
</ul>

<p><strong>Second Mapping Matrix (9→4):</strong></p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>M₂ ∈ ℝ^(4×9) where M₂[i,j] = {
  1 if token j maps to position i in final grid
  0 otherwise
}
</code></pre></div></div>
<ul>
  <li>Sparsity: 4/9 = 44% non-zero entries</li>
  <li>Storage: 4 indices instead of 36 full matrix entries</li>
</ul>

<h3 id="efficiency-gains">Efficiency Gains:</h3>

<p><strong>Memory Efficiency:</strong></p>
<ul>
  <li>Traditional: 75 cache entries across 3 layers</li>
  <li>MoR: 38 cache entries with progressive reduction</li>
  <li><strong>Savings: 49% memory reduction</strong></li>
</ul>

<p><strong>Computational Efficiency:</strong></p>
<ul>
  <li>Traditional: 1,875 attention operations</li>
  <li>MoR: 722 attention operations</li>
  <li><strong>Savings: 62% computational reduction</strong></li>
</ul>

<p><strong>Cache Management:</strong></p>
<ul>
  <li>Traditional: O(n) invalidations per layer transition</li>
  <li>MoR: O(log n) mapping updates per recursion</li>
  <li><strong>Savings: Logarithmic vs linear cache management overhead</strong></li>
</ul>

<p>The hierarchical structure enables <strong>compound efficiency gains</strong> where both memory and computation scale favorably, while sparse mapping matrices maintain token relationships with minimal overhead.</p>]]></content><author><name></name></author><summary type="html"><![CDATA[MoR filters tokens hierarchically across recursive stages, cutting memory 49% and compute 62%.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/MoR_MoR_caching.png" /><media:content medium="image" url="https://raw.githubusercontent.com/damoonsh/w/refs/heads/main/assets/images/MoR_MoR_caching.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">MOE on MNIST</title><link href="https://damoonsh.github.io/w/2025/01/27/MOE-on-MNIST.html" rel="alternate" type="text/html" title="MOE on MNIST" /><published>2025-01-27T00:00:00+00:00</published><updated>2025-01-27T00:00:00+00:00</updated><id>https://damoonsh.github.io/w/2025/01/27/MOE-on-MNIST</id><content type="html" xml:base="https://damoonsh.github.io/w/2025/01/27/MOE-on-MNIST.html"><![CDATA[<h1 id="introduction">Introduction</h1>

<p>In recent years, the field of artificial intelligence has witnessed remarkable advancements, particularly in the development of Mixture of Experts (MoE) models. These models, which leverage the power of multiple specialized sub-models or “experts” to handle different aspects of a task, have gained significant traction due to their ability to scale efficiently and improve performance across a wide range of applications. Unlike traditional monolithic models, MoE architectures dynamically route inputs to the most relevant experts, enabling more efficient use of computational resources and often achieving superior results.</p>

<p>Amid this growing interest in MoE models, DeepSeek has emerged as a notable player, with its recent releases of the DeepSeek R1 and V3 models capturing the attention of the AI community. These models represent a significant leap forward in terms of both architecture and performance. DeepSeek R1 introduced a novel approach to expert routing and model scaling, while the subsequent DeepSeek V3 further refined these techniques, incorporating advanced training methodologies and optimization strategies. The result is a family of models that not only push the boundaries of what is possible with MoE architectures but also demonstrate remarkable efficiency and adaptability across diverse tasks.</p>

<p>The surge in interest around DeepSeek R1 and V3 underscores the potential of MoE models to address some of the most pressing challenges in AI, from scaling to generalization. As the field continues to evolve, these models are likely to play a pivotal role in shaping the future of AI research and applications, offering a glimpse into the next generation of intelligent systems.</p>

<h1 id="setup">Setup</h1>

<p>I am using the Digit Recognizer <a href="https://www.kaggle.com/competitions/digit-recognizer">competition on Kaggle</a> to get a public score for the models. The goal is to start from a minimal base model and add MOE for the linear part and the CNN part and collectively comparing them. The implementation code is also <a href="https://github.com/damoonsh/MOE_MNIST">here</a>.</p>

<h1 id="sanity-check">Sanity Check</h1>

<p>To establish a baseline for our MoE experiments, I implemented a simple CNN architecture. This baseline model serves as our reference point to evaluate the effectiveness of the MoE implementations. The architecture consists of:</p>

<ul>
  <li>Two convolutional layers with ReLU activation</li>
  <li>Max pooling layers</li>
  <li>Two fully connected layers</li>
  <li>Dropout for regularization</li>
</ul>

<p>After training for 100 epochs, this basic CNN achieves an accuracy of 0.98407 on the MNIST test set. This performance metric will serve as our benchmark for comparing the various MoE implementations that follow.</p>

<p><img src="https://raw.githubusercontent.com/damoonsh/MOE_MNIST/refs/heads/main/img/bench_arch.png" /></p>

<h1 id="routing-collapse">Routing Collapse</h1>

<p>One common challenge with MoE architectures is “routing collapse”. The “route” refers to the selection process of which expert to use for a given input where the model falls into a pattern of only using a small subset of experts. This happens because:</p>

<ol>
  <li>Early in training, some experts may perform slightly better by chance</li>
  <li>These better-performing experts get selected more frequently</li>
  <li>With more practice, these experts improve further, creating a feedback loop</li>
  <li>Other experts become neglected and never improve</li>
</ol>

<div style="flex: 1; min-width: 300px;">
    <figure style="text-align: center; padding-leftP: 5px;">
      <img src="https://raw.githubusercontent.com/damoonsh/MOE_MNIST/refs/heads/main/img/expert_without_load_loss.png" />
      <figcaption> <b><i>  Routing collapse for the two MoEs: Some of the experts are almost never used whereas the other ones are used for the inputs </i> </b></figcaption>
    </figure>
  </div>

<h3 id="load-balancing-solutions">Load Balancing Solutions</h3>

<p>To prevent routing collapse, we implement three types of losses that were introduced in various MoE research:</p>

<ol>
  <li>
    <p>Diversity Loss: Encourages the gating network to use all experts by maximizing the entropy
of expert selection probabilities
<a href="https://arxiv.org/abs/1701.06538">Shazeer et al., “Outrageously Large Neural Networks” (2017)</a></p>
  </li>
  <li>
    <p>Importance Loss: Ensures each expert handles a similar total amount of input across the batch
by penalizing deviations from the mean usage
<a href="https://arxiv.org/abs/2006.16668">Lepikhin et al., “GShard: Scaling Giant Models with Conditional Computation” (2020)</a></p>
  </li>
  <li>
    <p>Overflow Loss: Prevents individual experts from being overloaded by penalizing usage above
a specified capacity threshold
<a href="https://arxiv.org/abs/2101.03961">Fedus et al., “Switch Transformers” (2021)</a></p>
  </li>
</ol>

<p>These losses are combined with the main classification loss during training to ensure balanced expert utilization.
The combination of these techniques has proven effective in large-scale models like GShard and Switch Transformers.</p>

<div style="flex: 1; min-width: 300px;">
    <figure style="text-align: center; padding-leftP: 5px;">
      <img src="https://raw.githubusercontent.com/damoonsh/MOE_MNIST/refs/heads/main/img/expert_with_load_loss.png" />
      <figcaption> <b><i> Addition of the load balance loss function stabilize model training as well as spreading the expert utilization. </i> </b></figcaption>
    </figure>
  </div>

<h1 id="shared-layer-concept">Shared Layer concept</h1>

<p>A key innovation in modern MoE architectures is the concept of shared layers. Unlike traditional MoE models where each expert operates independently, shared layers introduce common components that are used across all experts. This approach, pioneered in DeepSeek’s architecture, helps to:</p>

<ol>
  <li>Reduce model parameters by sharing common features across experts</li>
  <li>Improve training stability by providing a consistent base representation</li>
  <li>Enhance knowledge transfer between experts through shared components</li>
</ol>

<p>DeepSeek’s implementation of shared layers, as described in their technical report, demonstrates that this approach can significantly improve model efficiency while maintaining or even improving performance. The shared layers act as a common foundation that all experts build upon, allowing for more specialized expert networks to focus on their specific tasks while leveraging shared knowledge.</p>

<p><a href="https://deepseek.ai/blog/2024/01/17/technical-report-v3.html">DeepSeek Technical Report</a></p>

<h2 id="moe-on-classification">MOE on classification</h2>

<p>Without shared expert layer and 30 epoch training with only one Linear MoE:
| Model     | Hidden Size | Training accuracy | Public Score | Score Difference |
| ——— | ———– | —————– | ———— | —————- |
| MOE(1,5)  | 64          | 98.86             | 97.98        | 0.88             |
| MOE(2,5)  | 64          | 99.28             | 98.21        | 1.07             |
| MOE(3,5)  | 64          | 99.63             | 98.76        | 0.87             |
| MOE(6,10) | 16          | 99.06             | 97.99        | 1.07             |</p>]]></content><author><name></name></author><summary type="html"><![CDATA[Implements Mixture of Experts on MNIST; studies routing collapse and load balancing.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://raw.githubusercontent.com/damoonsh/MOE_MNIST/refs/heads/main/img/expert_without_load_loss.png" /><media:content medium="image" url="https://raw.githubusercontent.com/damoonsh/MOE_MNIST/refs/heads/main/img/expert_without_load_loss.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">DeepDream algorithm: How does it work? What does it do?</title><link href="https://damoonsh.github.io/w/2023/09/04/dd-explore.html" rel="alternate" type="text/html" title="DeepDream algorithm: How does it work? What does it do?" /><published>2023-09-04T00:00:00+00:00</published><updated>2023-09-04T00:00:00+00:00</updated><id>https://damoonsh.github.io/w/2023/09/04/dd-explore</id><content type="html" xml:base="https://damoonsh.github.io/w/2023/09/04/dd-explore.html"><![CDATA[<h1 id="introduction">Introduction</h1>

<p>Neural networks have been able to accomplish tasks that previously seemed impossible. Self-driving cars and AI chatbots rely on these networks. However, neural networks are black box algorithms meaning it is difficult to reason about what happens inside of the network, and why it outputs what it does. For instance, the output of a tree-based model can be traced but not a neural network’s. Engineers at Google experimented with different layers of the network to understand the inner workings of each layer. The goal of the experiments was to analyze which features within an image are detected within a layer. They realized that layers at different depths will have unique sensitivities: “If we choose higher-level layers, which identify more sophisticated features in images, complex features or even whole objects tend to emerge” <a href="#ref-1">[1]</a>. Pretrained ResNet50 is the feature extractor used for the original DeepDream algorithm. During the experimentation, the algorithm aims to exaggerate the detected features in each layer. In other words, the algorithm optimizes the image so the chosen layers within the neural network can better see the features they are seeing. The exaggeration reaches a point where the model starts to see things in the images that are not there. In other words: it is imaging or hallucinating. ResNet50 is trained on animal images which explains why the extracted features will start creating various shapes in the image of a dog. Later the engineers realized this could be seen as artwork and published their code <a href="#ref-1">[1]</a>.</p>

<p>This is a personal project in which I have tried to understand the DeepDream generative algorithm a bit better. I am using the kaggle dataset <a href="#ref-2">[2]</a> which is a dataset containing various famous paintings in different styles. I have run the algorithms with different parameters and tried to answer some of the questions: What is captured? Which original figures are more likely to be picked given different weights? The main goal for me is to better understand Generative AI and inner workings of deep learning algorithms. The code for this algorithm is hosted on kaggle <a href="#ref-3">[3]</a> and it is influenced by <a href="#ref-4">[4]</a>.</p>

<h1 id="overall-architecture-of-deep-learning">Overall architecture of Deep Learning</h1>

<p>Deep learning is the process of training deep neural networks to learn patterns of data. Neural networks are inspired by the workings of our brains, and each layer is similar to a neuron. Each neuron has at least one input and at least one output. A neural network is made up of the stacked neurons where the input of a neuron is the output of a preceding one. A neural network with too many layers is called “deep”. The first layers are referred to as shallow layers but as the number of preceding layers for a layer increases, they are referred to as deeper layers.</p>

<p><img src="https://raw.githubusercontent.com/damoonsh/DeepDream-Exploration/main/images/overall_arch.png" /></p>

<h2 id="algorithm">Algorithm</h2>

<p>The goal of the algorithm is to exaggerate what the layers are seeing in the picture to be able to analyze their different properties. Hence, in the training process the input image is being updated based on the gradients of feature extractors. Instead of updating the weights of the models, the image is updated and after each iteration, the features detected by layers are imposed upon the image. In other words, the image is updated to resemble what the layers are extracting.</p>

<p> DeepDream algorithm follows a generative approach: there is no labeled data, and the model's output is similar to the input. Layers from ResNet50 are used to extract features: mixed4, mixed5, mixed6, and mixed7 (name of the layers). In each iteration of training, a forward pass through the network will yield certain features, and the loss is calculated based on the extracted features from each layer. At the end of the iteration the input image is updated using the gradients for that loss. This process changes the input image so the shapes identified by each layer becomes more illusive after each iteration. This process informs what the network layers are actually picking up. Given that we are using multiple layers, there is going to be a correlation between what different layers are seeing given that each is influencing the input as the model iterates.</p>

<figure style="text-align: center;">
      <img src="https://github.com/damoonsh/DeepDream-Exploration/blob/main/gifs/IM_2_W1_S.gif?raw=true" style="width: auto; height: 30%; " />
      <figcaption>DeepDream iterations </figcaption>
    </figure>

<p> An important component is the associated weight for each of the feature layers. Each layer has a different weight. This will cause the layer with a higher weight to influence the shapes within the image more than other layers. This weighting mechanism is at the heart of analysis. Changing the weights, and comparing the results we can reason about the features being captured at different levels.  </p>

<figure style="text-align: center;">
  <img src="https://raw.githubusercontent.com/damoonsh/DeepDream-Exploration/main/images/algorithm.png" />
  <figcaption> <b> One iteration of DeepDream algorithm </b> </figcaption>
</figure>

<h2 id="loss-function">Loss function</h2>
<p>The loss function used for the algorithm is the average of the outputs from the feature layers. This metric signifies the sensitivity of the feature layers to the image. And when updating the model using this metric, these sensitivities are optimized so that the features can be seen more clearly.</p>

<p>Model sees a shape that is not present but nevertheless the loss function encourages to keep seeing it more clearly. The weights used for experimentation come in handy here since the loss for each layer is weighted differently. Some layer’s features are encouraged more than the other ones.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>for weight, feature_layer in set(weights, feature_layers):
    features = feature_layer(image)
	feature_layer_loss =  mean_across_channels(squared(features))
	overall_loss += weight * feature_layer_loss
</code></pre></div></div>

<h1 id="experiments">Experiments</h1>

<p>Within a deep neural network shallow layers detect the general geometric shapes and features such horizontal lines. And deeper layers are capable of identifying more complex and abstract shapes such as faces or eyes.</p>

<p>The most basic experiment is to choose a set of layers, keep these layers constant but change the weights.
This will illustrate the difference between features captured in shallow and deep layers.
Four sets of weights are chosen, each focuses on certain aspect of the analysis:</p>

<ol>
  <li>Set 1 is the benchmark, it is a moderate weighting.</li>
  <li>Set 2 focuses on the deeper layer more than the shallower ones.</li>
  <li>Set 3 is the opposite of set 2.</li>
  <li>Set 4 is a combination in which all the weights are high, this set is used so it can be compared with the first set.</li>
</ol>

<p><img src="https://raw.githubusercontent.com/damoonsh/DeepDream-Exploration/main/images/weight_table.png" /></p>

<h2 id="visual-differences-between-the-weightings-in-each-iteration">Visual differences between the weightings in each iteration</h2>

<p>The weights that emphasize more abstract geometric shapes begin to detect them early on, leading to subtle differences between generated images. If an image is initially altered based on these basic shapes, the model may perceive or “hallucinate” abstract forms differently than if it were focused on finer details from the start. This early influence of shape-based weighting can create unique visual interpretations that diverge significantly as the model continues to refine the image.</p>

<div style="flex: 1; min-width: 300px;">
    <figure style="text-align: center;">
      <img src="https://github.com/damoonsh/DeepDream-Exploration/blob/main/gifs/IM_2_W_all.gif?raw=true" style="width: auto; height: 30%; " />
      <figcaption> Iterations for each set of weights </figcaption>
    </figure>
  </div>

<p>Analyzing the Gif below helps visualize the “Algorithmic Logic” behind DeepDream. The painting is of waves crashing into rocks which in turn creates geometric shapes blending with different colourings. Taking a closer look: the model starts seeing Dog eyes within the rocks. It is as if the model is determined to see a “Dog” somewhere and the geometric shapes within the rocks is the perfect place to see one.</p>

<div style="flex: 1; min-width: 300px;">
    <figure style="text-align: center;">
      <img src="https://raw.githubusercontent.com/damoonsh/DeepDream-Exploration/refs/heads/main/gifs/IM_159_W4_S.gif" style="width: auto; height: 30%; " />
      <figcaption> Seeing dog faces in waves (weight set 4) </figcaption>
    </figure>
  </div>

<p>The Gif above used weight set 4 meaning that, abstract features were heavily subsidized in seeing a dog. How would it differ if the weighting favored simpler details? Gif below shows the process for weight set 1. The dog is not seen in the rocks immediately, in fact it is not seen in the rocks the way it used to. Since focusing on simple geometric features (straight lines or curves), the model blurs the sky more heavily and as it modifies the sand (bottom left), it starts to see small dog heads.</p>

<div style="flex: 1; min-width: 300px;">
    <figure style="text-align: center;">
      <img src="https://github.com/damoonsh/DeepDream-Exploration/blob/main/gifs/IM_159_W1_S.gif?raw=true" style="width: auto; height: 30%; " />
      <figcaption> Seeing dog faces in waves (weight set 1) </figcaption>
    </figure>
  </div>

<p>These two examples show how changing the weight shifts the model’s logic and sequentially affects what the model sees.</p>

<h1 id="similar-effects-across-different-images">Similar effects across different images</h1>
<p>DeepDream algorithm is using ResNet which is trained on pictures of dogs and cats. The algorithm optimizes the image in a way that transforms the shapes to what the ResNet layers perceive the image to contain. At each iteration certain features in the image are changed to look more like what ResNet is trained on. As an example: a plain part of the image such as sky will tend to become more distorted as the model progresses. I believe this happens because shallow layers are sensitive to subtle color changes and strokes. These subtleties will be sharpened to show the gap and it looks as if the model is on a drug and can see the sky properly. The difference between this part of the image is mostly similar across different weightings given that there is not much in that part of the image.</p>

<div style="flex: 1; min-width: 300px;">
    <figure style="text-align: center;">
<img src="https://raw.githubusercontent.com/damoonsh/DeepDream-Exploration/main/images/subtle_similarities.jpg" />
<figcaption> <b> Demonstrating the effect of shallow layers on the pain colours and strokes of paintings. (The transformation is based on the first set of weights) </b> </figcaption>
</figure>
  </div>

<h1 id="comparing-weightings">Comparing weightings</h1>

<p>Figure below shows the difference the weighting of the layers causes. When the deeper layers have a higher weight, the model tries to see abstract features from the first iteration. This will cause the output to mainly pick up strokes and distort those (Set 2). Whereas a good balance of shallow and deep layers produces an image where the shapes are gradually turned into face and eye of a dog, in set 1, the colors changes are depicted similar to dog ears and the top of the hair, multiple eyes are hallucinated. In Set 3, there are only eyes present within the picture but not face structure or ears, this shows that when the focus is only on shallow layers, only basic features are detected and in turn imagined. Whereas other sets create a full facial structure.
In the image, only one eye is painted but all the models are imaging the other eye and what it might look like. This is very interesting given that this behavior is similar to the outputs of diffusion models.</p>

<div style="flex: 1; min-width: 300px;">
    <figure style="text-align: center;">
<img src="https://raw.githubusercontent.com/damoonsh/DeepDream-Exploration/main/images/comparing_weights.png" />
<figcaption> <b> Effect of different weightings </b> </figcaption>
</figure>
  </div>

<h1 id="possible-applications">Possible applications</h1>

<p>If we have a small dataset, and want to augment data, can we utilize the model’s ability to hallucinate to generate data with positive class? For the leaf disease prediction: what if the benign images were given to the model so that it could hallucinate the diseased versions of them?</p>

<p>It is adding dogs to images, why can it not add other things and be used for the augmentation process. For instance, can we augment X-ray images by imaging early stage tumors? This has proven to be difficult since the model is not deterministic and navigate the latent space, a more discrete approach with a specialized pre-trained network might be doable.</p>

<p>There are certain fields where the size of good quality data is small and makes it difficult to provide deep learning solutions. Medical field is one of these fields. Given a large amount of CT scans, a deep model will get a better accuracy however due to various logistic reasons, CT scan datasets are not as large to yield high results. Now what if the generative AI similar to deep dream could hallucinate and imagine what a normal CT scan would look like if there was a tumor present? It is seeing dogs where there are no dogs, in theory it could see a tumor in a benign CT scan. But again the problem is that the feature extractor base of the model should be trained on a large dataset of tumors to be able to imagine it, and as mentioned: the datasets in this field are not large enough.</p>

<h1 id="references">References</h1>

<ol>
  <li><a id="ref-1">https://ai.googleblog.com/2015/06/inceptionism-going-deeper-into-neural.html</a></li>
  <li><a id="ref-2">https://www.kaggle.com/datasets/ikarus777/best-artworks-of-all-time</a></li>
  <li><a id="ref-3">https://www.kaggle.com/code/damoonshahhosseini/dlwp-12-2 </a></li>
  <li><a id="ref-4">https://github.com/fchollet/deep-learning-with-python-notebooks/blob/master/chapter12_part02_deep-dream.ipynb</a></li>
</ol>]]></content><author><name></name></author><category term="GenAI" /><summary type="html"><![CDATA[Explores Google's DeepDream to understand what neural network layers detect in images.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://github.com/damoonsh/DeepDream-Exploration/blob/main/gifs/IM_2_W_all.gif?raw=true" /><media:content medium="image" url="https://github.com/damoonsh/DeepDream-Exploration/blob/main/gifs/IM_2_W_all.gif?raw=true" xmlns:media="http://search.yahoo.com/mrss/" /></entry></feed>