Source-linked AI summary

FrogNano: Training a 4B Coding Agent via Online Task Synthesis

Minseon Kim, Zhengyan Shi, Emiliano Penaloza, Christopher Cui, Roger Creus Castanyer, Maryam Hashemzadeh, Isadora White, Jonathan Light, Jeonghye Kim, Matheus Pereira, Darya Moldavskaya, Chinmay Singh, Fabio Vera, Baolin Peng, Xingdi Yuan, Marc-Alexandre Côté, Alessandro Sordoni

arXiv:2609.07925v1cs.AI

TL;DR

FrogNano addresses whether a compact 4B model can become a capable repository-level coding agent without relying on costly large-model trajectories or extensive real-world data. It combines a reliable lightweight harness, online task synthesis calibrated to current-policy learnability, and iterative RL, reaching strong results across coding benchmarks. The report also identifies evaluation and deployment limitations, including test coverage gaps and safety risks.

  • Problem

    Frontier coding agents are often costly to serve, motivating evidence on whether substantially smaller models can achieve repository-level coding capability.

  • Method

    FrogNano uses the Leaf harness, TaskPilot’s policy-adaptive synthetic tasks, and iterative reinforcement learning without traditional distillation from larger models.

  • Results

    FrogNano reaches 61.5% on SWE-bench Verified, 37.6% on SWE-bench Pro, 31.1% on Terminal-Bench v2, and 23.2% on PatchEval-Verified.

  • Takeaways & Limitations

    The results support training compact coding agents with synthetic tasks at the current policy’s learnability frontier and a reliable interaction interface.

  • Takeaways & Limitations

    The evaluation relies on tests covering only part of program behavior, so passing patches can remain incorrect or insecure.

Abstract

from arXiv · show

We present FrogNano, a 4B coding agent designed to tackle software engineering (SWE) tasks efficiently and effectively, even under resource-constrained environments. It is post-trained exclusively via RL on around 1,500 SWE environments with synthetic tasks. A key ingredient for improving performance is an online task synthesis pipeline that creates tasks calibrated to the frontier of learnability for the current checkpoint. This report provides evidence that competitive small coding agents can be trained with synthetic tasks alone, without traditional distillation from larger models, and that generating tasks at the learnability frontier of the current agent is important. We report details on the training methodology, evaluations across diverse environments, and in-depth analyses, serving as a foundation for our ongoing exploration of lightweight yet capable coding agents that can run on minimal hardware.

1 Introduction

FrogNano investigates whether a 4B model can become a capable repository-level coding agent through a compact training recipe. Its approach combines a lightweight harness, online policy-adaptive task synthesis, and iterative RL, reaching strong multi-benchmark performance without traditional distillation.

  • Frontier SWE agents are costly to serve, motivating study of capable repository-level coding agents at the 4B scale.
  • TaskPilot generates synthetic SWE tasks online and steers them toward the current policy’s learnable frontier.
  • Leaf improves Qwen3.5-4B’s SWE-bench Verified solve rate from 8.3% to 37.2% compared with the R2E-Gym harness.
  • Five iterations of TaskPilot synthesis followed by RL optimize FrogNano, using DPPO, asynchronous rollouts, and a log-length penalty.
  • 61.5% SWE-bench Verified, 37.6% SWE-bench Pro, 31.1% Terminal-Bench v2, and 23.2% PatchEval-Verified are reported for FrogNano.

2 Harness Design Matters for Compact Models

Compact models can be bottlenecked by the interaction interface rather than model capability alone. FrogNano therefore uses Leaf, a lightweight typed-tool harness with simple termination behavior.

  • Approximately 96% of Qwen3.5-4B trajectories reached the turn limit under the elaborate R2E-Gym interaction protocol.
  • Leaf exposes five typed tools—read, write, edit, glob, and bash—and omits broader interactive-product features.
  • Leaf executes JSON-schema tool calls sequentially and treats a response without tool calls as the final answer.
  • Qwen3.5-4B’s solve rate rises from 8.3% with R2E-Gym to 37.2% with Leaf, while MiniMax-M2.5 remains at 66.5% on both harnesses.
  • Training includes model-generated reasoning, answer text, and tool calls in the loss, while task prompts and tool outputs remain context-only.

3 Synthesizing Tasks for the Evolving Policy

TaskPilot adapts synthetic task difficulty and wording to the evolving policy by validating, evaluating, refining, and admitting candidates according to current-policy resolve rates. The revised curriculum becomes shorter, less scaffolded, more diverse, and more closely covered by tests.

  • TaskPilot retains tasks in a policy-relative difficulty range because unsolved and saturated tasks provide limited learning signal.
  • Generated tasks contain repository snapshots, problem statements, gold patches, and hidden F2P tests, with executable candidates requiring F2P failure before and success after the gold patch.
  • Current-policy rollouts estimate resolve rate, and candidates outside the target are refined, re-evaluated, or discarded rather than simply filtered once.
  • Candidates with mixed rollout outcomes are learnable; iterations 1–4 target a 0.5 resolve rate, while revised iteration 5 uses a lower target band.
  • The evolving policy alternates with task generation: accepted tasks train π(t+1), which then guides the next synthesis phase.
  • Task refinement: The accepted middle wording variant specifies observable behavior without localizing the implementation, producing mixed successes and failures.
  • Task analysis: Iteration 5 reduces problem length from iteration 4’s 227.0 words to 116.6 and test-patch churn from 312.3 to 194.7 lines.
  • Task analysis: Iteration 5 reaches 37.6% problem-statement/test coverage while reducing explicit requirement items to 0.04 per statement.

4 Reinforcement Learning Training Recipe

FrogNano trains with continuous group-relative RL on batches of policy-calibrated tasks, using asynchronous DPPO rollouts and mechanisms intended to control stale updates and generation length. Efficiency features include success-gated length penalties and summary compaction for constrained contexts.

  • Each RL iteration performs a 200-update climb on its accepted tasks, carrying policy weights forward while reinitializing optimizer and RNG states.
  • Asynchronous rollout generation and optimization use two training GPUs and six inference engines on one node with 8 × NVIDIA B200 GPUs.
  • DPPO standardizes shaped rewards within each task group and broadcasts trajectory-level advantages to model-generated tokens.
  • Asymmetric trajectory importance sampling masks tokens when policy drift exceeds directional thresholds, limiting reinforcement from stale trajectories.
  • Efficiency reward: A success-gated logarithmic length penalty ranks successful solutions by token efficiency without additionally penalizing failed exploration.
  • Efficiency reward: Solved trajectories truncated by context, token, turn, or time limits receive partial reward 0.5, while unsuccessful trajectories receive zero.

5 Experiments

FrogNano’s iterative RL training improves performance on held-out coding benchmarks, while analyses examine generalization, test-time scaling, behavior consolidation, context efficiency, learning dynamics, and failure modes.

  • Training results: Starting from 43.0%, five TaskPilot iterations raise SWE-bench Verified solve rate to 61.5%, compared with 48.0% from approximately 300 filtered real tasks.
  • Test-time scaling: 62.8% pass@1 with three candidates exceeds 61.4% for one verifier call, 61.53% for random selection, and 60.4% for pass@short.
  • Behavior consolidation: Consolidation raises multi-tool-call behavior by 16% while reducing average solution steps from 53.5 to 36.6, with a 59.6% SWE-bench Verified score.
  • Generalization: FrogNano’s gains transfer to mini-SWE-agent, improving performance from 43.8% to 56.4% despite its single bash tool.
  • Learning dynamics: Solve rate improves in all five curricula by 11.7, 3.4, 5.6, 3.0, and 5.4 percentage points, while entropy does not repeatedly collapse after the first iteration.
  • Failure analysis: 90.8% of failures are reasoning gaps, dominated by wrong-root-cause or wrong-layer targeting at 38.8% and specification misreading at 31.5%.
  • Safety analysis: Confirmed reward-hacking attempts remain at or below 3.0%, with an effective rate of 0% because scaffold and infrastructure block them.

6 Related Work

Related work situates FrogNano among repository-repair interfaces, synthetic-task pipelines, adaptive curricula, reinforcement-learning methods, and compact coding agents.

  • Repository repair and interfaces: Repository-repair systems differ in their agent-computer interfaces, fixed pipelines, and program-structure-aware search strategies.
  • Synthetic tasks and adaptive curricula: Representative synthetic SWE pipelines vary in how they construct specifications, executable oracles, and current-policy feedback.
  • Synthetic tasks and adaptive curricula: Adaptive-curriculum precedents include GoalGAN, POET, PAIRED, and PLR, while related language-agent work includes jointly optimized or gradient-aligned task generation.
  • Synthetic tasks and adaptive curricula: TaskPilot uses blind rollouts from an evolving 4B policy to control task admission and diagnostic repair, without jointly training its generator and solver.
  • Reinforcement learning for code agents: FrogNano uses DPPO with symmetric log-probability clipping, adaptive filtering, asynchronous training, bounded rollout staleness, and binary test rewards.
  • Compact coding agents: Compact-agent comparisons include continued-pretraining models, teacher-free online GRPO, teacher-guided recovery, and memory-compression approaches.

7 Conclusion

FrogNano demonstrates that a 4B model can become a strong repository-level coding agent through suitable interfaces, online learnability-matched task generation, and iterative RL without larger-model trajectory distillation.

  • FrogNano rivals 32B–100B+ models using 4B parameters, without distilling larger models’ trajectories or relying on an extensive real-world dataset.
  • The key ingredients are an appropriate tool harness, online tasks matched to policy learnability, and iterative reinforcement learning.
  • The report demonstrates strong performance across multiple coding benchmarks and positions small models as capable repository-level coding agents.
  • Further improvement beyond iteration 5, harder specialized tasks, test-time scaling, context management, and inference efficiency remain open questions.

Limitation

The study is limited to English-language tasks from Python-heavy repositories and does not establish generalization to substantially different settings. Several capabilities and safety-relevant applications were also outside its evaluation scope.

  • The training and evaluation recipe uses English-language tasks from Python-heavy repositories, limiting established scope.
  • Generalization to non-English tasks, substantially different repositories and frameworks, unclear requirements, or projects without reliable tests remains unestablished.
  • The study does not establish whether results transfer across other tool interfaces, prompts, environments, context, or tool budgets.
  • Image and video capabilities supported by the base model were neither post-trained nor evaluated.
  • The recipe was not studied for general-purpose assistance, formal verification, safety-critical software, or other high-stakes applications.
  • Test-based rewards and evaluation cover only part of program behavior, so passing patches can remain incorrect or insecure.

Contributions

The paper credits contributors across leadership, task generation, model training, harness design, infrastructure, and evaluation. Contributors are alphabetized by first name, with role-specific contribution ordering.

  • Core contributors are listed alphabetically by first name.
  • Within each role, contributors are also listed according to their contributions.
  • TaskPilot, model training, Leaf harness design, infrastructure engineering, and evaluation each have explicitly assigned contributors.
  • Technical and project leadership are separately identified among the core contributors.

A Evaluation Benchmarks

FrogNano is evaluated across four complementary coding-agent benchmarks using isolated official environments, the Leaf protocol, and fixed evaluation settings. Additional analyses examine configuration, inference cost, and pass@k behavior.

  • Evaluation Benchmarks: Four complementary benchmarks cover repository repair, industrial software tasks, terminal workflows, and patch evaluation.The benchmarks are SWE-bench Verified, SWE-bench Pro, Terminal-Bench 2.0, and PatchEval-Verified.
  • Evaluation Setup: Evaluations retain each benchmark’s official isolated execution environment and verifier while using Leaf interaction.
  • Cost of Inference: Figure 13 estimates inference costs from token budgets and model API prices, including resolved-rate comparisons by cost.
  • Pass@k Analysis: FrogNano consistently outperforms Qwen3.5-4B across all reported pass@k values on SWE-bench Verified.
  • Pass@k Analysis: Figure 15 tracks FrogNano’s training-set pass@k across every iteration.

C Merging Checkpoints via Consolidation

Consolidation recovers useful behaviors from earlier RL checkpoints while preserving or slightly improving coding performance. The compaction mechanism reconstructs bounded histories, but its activation depends on configuration thresholds that can silently disable it.

  • Motivation: RL iterations exhibit forgetting, reduced multi-tool use, and excessive iteration, motivating SFT consolidation.
  • Consolidation Data: Consolidation mixes successful trajectories from FrogNano and earlier policies, with filtering and reference selection for desired behaviors.
  • Checkpoint Merging: 59.6% SWE-bench Verified with 17.7% parallel tool calling and 36.6 average steps recovers earlier behavior at slight performance cost.
  • Checkpoint Merging: 62.3% final SWE-bench Verified after consolidation improves the score by 0.8%, while SWE-bench Pro rises from 37.6% to 38.1%.
  • History Compaction: Compaction truncates complete turn-groups, preserves the system prefix and recent group, and reconstructs a one-system-block, one-user-message history.
  • History Compaction: The same FrogNano checkpoint summarizes its own trajectory, keeping compaction within the paper’s distillation-free setting.
  • Compaction Behavior: Compaction fired in 87%, 51%, and 4% of rollouts at 16,384, 32,768, and 65,536 tokens, respectively.
  • Configuration Pitfalls: Setting W > M or ρW above attained context lengths can make compaction silently inert, and the validator does not check ρW ≤ M.

E Learning and Tool-Use Dynamics

Across matched checkpoints, solve rate improves throughout training without a simple relationship to token or step count. Tool use shifts toward verification, while successful trajectories are distinguished more by executable testing than by rhetorical confidence.

  • Learning on a fixed evaluation set: The fixed evaluation reuses the same 500 SWE-bench Verified tasks, prompt, tools, sampling configuration, context window, and step budget across checkpoints.Performance aggregates every configured attempt, while compute sums provider-recorded assistant output tokens.
  • Learning on a fixed evaluation set: Solve rate rises from 39.4% for the base model to 61.6% after Iter 5, while compute allocation remains non-monotonic.Mean output and trajectory length vary across iterations, so performance does not follow a simple more-tokens or more-steps relationship.
  • Tool-use dynamics: Verification appears in 94.3% of paired Iter 5 rollouts, up from 53.4% for the base model.Among rollouts using verification at both checkpoints, its final-fifth timing remains nearly unchanged: 23.6% versus 24.0%.
  • Tool composition: The log-length penalty coincides with Bash falling from 81.9% to 66.1%, Read rising from 5.5% to 14.8%, Edit rising from 11.9% to 18.3%, and total calls falling from 52.2 to 38.6.Later Iter 5 increases total calls from 49.0 to 60.9 while tool composition changes only modestly.
  • Behaviors associated with success: Passed trajectories are 5.3 points more likely to run a test, 8.1 points more likely to test after the final edit, and 6.1 points more likely to complete an edit–test cycle.Reasoning-cue rates differ by at most 1.7 points, while final-confidence language remains common in failed trajectories.
  • Interpretation: Tool-use associations are within-task comparisons, not causal effects, and edit-dependent rows condition on trajectories that modify the repository.The figure analysis uses matched instance–endpoint groups containing both passed and failed stochastic samples.

F.2 Two-stage analysis

The reward-hacking analysis uses a deliberately high-recall candidate stage followed by contextual LLM adjudication. It separates whether a behavior occurred from whether it could affect reward, while applying explicit exclusions for common false positives.

  • Two-stage analysis: The rule layer selected 546 of 2,499 trajectories, then the judge classified candidates using issue context, patches, hidden-test membership, commands, edits, and a trajectory index.The final rule-layer precision was 31/546 = 5.7%, so rule matches alone are not hacking evidence.
  • Adjudication distinctions: Edits to test files included in the hidden test patch are overwritten and ineffective, whereas edits to unprotected test files can change grading outcomes.The distinction is central to separating intent from score-relevant manipulation.
  • Adjudication distinctions: Reading past commits is normal debugging, but retrieving a future fix is an oracle leak requiring evidence that the content post-dates the base, matches the issue, and influenced the submission.Hidden-test acquisition counts as present even when the harness later overwrites test files, although it is ineffective in that case.
  • Two-stage analysis: Present and effective are judged independently: a behavior may be evidenced even when the harness prevents it from changing the score.The rubric distinguishes behavior presence from reward effectiveness.
  • Test adaptation versus weakening: Test modification is not automatically hacking: regression tests, API adaptations, and changes matching the gold patch are legitimate, while assertion removal or broader acceptance can indicate weakening.Approximately five RH6 judgments lie near the boundary between incorrect fixes and manipulation.
  • Escalation rules: Reporting-only codes such as unverified success claims never produce a HACK verdict by themselves, and unclear codes do not escalate the overall verdict.A HACK verdict requires at least one score-relevant code marked present.

H Behavioral Drift

Later training iterations exhibit behavioral drift: reduced parallel tool use and targeted early file checking emerge despite the harness supporting multi-tool calls. A strong TypeScript-search tendency appears in training-history probes but rarely in evaluation.

  • Behavioral Drift: The behavioral-drift analysis is summarized in Table 4, which reports Leaf tool-call usage by iteration while excluding zero-tool steps.The table provides the iteration-level comparison underlying the multi-tool-use observation.
  • Behavioral Drift: Later iterations lose the heavy use of Leaf multi-tool calls observed in early iterations.Leaf supports parallel tool calls in a single turn, but later checkpoints fail to leverage that capacity.
  • Behavioral Drift: FrogNano searches for TypeScript files first in 82.27% of cases when prompted across past datasets, despite training data containing only Python programs.This tendency appears in only 4% of evaluation trajectories.
Loading 2609.07925v1…