Research

Continual learning for DeepSeek V4.1 Flash

We ran more than 5,000 agents on the same model, and they all ended up in the same place. Continual learning lets DeepSeek V4.1 Flash build on what its agents have already found, and it's now live on the Yeta platform.

Over three days, we ran more than 5,000 agents on DeepSeek V4.1 Flash against Chrome, FFmpeg and the Linux kernel. Between them they found 13 vulnerabilities, and every one was already known: a duplicate, or already fixed at tip of tree.

The interesting part isn't the bugs. It's that the agents all found the same ones.

Every agent ends up in the same place

We varied the prompts. It didn't matter. However an agent was told to start, it eventually ended up in the same place as every other agent.

In hindsight, that's what you should expect.

Five thousand agents on the same weights aren't five thousand researchers. They're one researcher, sampled five thousand times.

A prompt changes where an agent starts, but not what the model finds most likely. So every agent drifts toward the same high-probability answers, which are usually the ones someone else has already found. Adding agents just adds duplicates.

Human teams don't work like this. Once someone has solved a problem, everyone knows, and nobody spends the next week solving it again. They build on it and go further. We wanted the fleet to do the same.

Without learning

Seven agents wander from the surface and all converge on the same known bug. Deeper code paths are never reached. 5,000+ agents already known deeper code never reached

With continual learning

The same agents reach the known bug by a more direct route, then keep going into deeper code paths the base model never reached. 5,000+ agents found sooner deeper code new ground new ground
Figure 1. A sketch of what changed, not a plot of real trajectories. Without learning, agents wander to the same known bugs and stop there. With continual learning, they reach those bugs sooner and keep going.

A little learning goes a long way

So we let the model learn. With a small amount of continual learning on the fleet's own traces, the agents got through the familiar ground faster, then kept going into code the base model never reached. Along the way they turned up two new critical vulnerabilities.

The rest of this post covers how the learning works: where new knowledge lives inside the model, the two ways we train it in, and how we decide which one to use.

Where new knowledge lives: looped layers

The obvious way to keep teaching a model is to attach LoRA adapters and keep training them. We do something slightly different. We loop DeepSeek V4.1 Flash's output and expert layers three times, and attach the LoRA adapters to those looped layers instead of directly to the original ones.

LoRA on the layers

LoRA adapters attached directly to every layer of the model, from layer 1 up to the output and expert layers. LoRA LoRA LoRA LoRA next token output + expert layers layer N layer 2 layer 1 tokens in

LoRA on the looped layers

The output and expert layers run three times in a loop, and a LoRA adapter sits on those looped layers. The layers below have no adapters. LoRA next token output + expert layers ×3 layer N layer 2 layer 1 tokens in
Figure 2. Left: adapters added directly to the model. Right: the output and expert layers run three times, and the adapters sit on the looped layers.

Compared with adding LoRA directly, LoRA on the looped layers is more likely to:

  1. Retain knowledge. What it learns is still there after more learning.
  2. Reason with that knowledge. It uses what it learned as a step in new reasoning, instead of only reciting it.
  3. Transfer style. It picks up how a trace was done, its habits and behaviors, and not just what it found.

For agents, the second one matters most. Recalling an answer only helps with the same question. Knowing why it's the answer, and applying that to the next problem, is what moves an agent onto new ground.

Looping layers and giving them their own LoRA isn't a new idea on its own. Relaxed Recursive Transformers5 loop a shared block and use layer-wise LoRA to recover the quality of the full model. We use the idea in the other direction: instead of shrinking a model, we add depth on top of a full one. Our working explanation is that the loop gives new knowledge extra depth to compute with, rather than forcing it into the same weights the base model already relies on.

Two ways to learn, and a model that picks

Not every trace teaches the same kind of thing. Some teach a behavior: a better way to use a tool, or the shape of a good report. Others contain a new capability: the agent reached something the model couldn't reliably reach before. These need different training, so we run two methods and let a small decision model choose between them.

Traces from the fleet

Every finished task, with the agent's full trace.

joey-1 decides

New behavior, or new capability?

simple: style & behavior

TTT-E2E

  • Meta-learned starting point
  • Next-token learning on the trace
  • No rewards, no rollouts

complex: new capability

RL with SAO

  • Trace becomes up to 10 RL environments
  • Single-rollout async updates
  • Compaction-aware reward

Looped LoRA + drafter SFT

The adapters learn, and the speculative drafter keeps pace.

↺ back to the fleet

Figure 3. The continual learning loop. joey-1 routes each finished task to one of two training methods. Both write into the LoRA on the looped layers, and the drafter is fine-tuned on the same traces.

joey-1 routes each task

joey-16 is Baseten's open-weight 2B decision model. Instead of generating text, it answers a structured question with a label and a confidence, in a single forward pass. For every finished task, joey-1 decides whether the trace is simple, useful for transferring style and behavior, or complex, useful for learning a new capability. It's small and fast enough to run on every task the fleet finishes.

Simple tasks: TTT-E2E

For style and behavior, we use End-to-End Test-Time Training (TTT-E2E).2 TTT-E2E treats learning from context as continual learning, and it has two loops:

  • An inner loop, at test time. The model keeps training on what it reads with next-token prediction, compressing it into its weights. For us, what it reads is a trace.
  • An outer loop, at training time. The initialization those updates start from is meta-learned. Training runs end to end through the inner loop, taking gradients of gradients, so the starting weights are the ones that learn the most from a few steps on a new trace.

The meta-learning is the "end-to-end" part: the model isn't just fine-tuned at test time, it's trained to be good at being fine-tuned. All the expensive work happens in the outer loop, ahead of time. At test time there are no rewards and no rollouts, just a few next-token steps on the trace, so it's cheap enough to run on every simple task.

Complex tasks: RL environments, SAO and compaction

New capabilities take more than imitation. When joey-1 marks a task as complex, we convert its trace into up to 10 RL environments, each a checkable task built from what the trace accomplished, and train the LoRA on them with reinforcement learning.

The optimizer is SAO, Single-rollout Asynchronous Optimization.3 Instead of sampling a group of rollouts per prompt like GRPO, SAO updates the policy from each rollout as it arrives, and trains a value model alongside it. That suits environments that are created on the fly and rollouts that run long.

Long rollouts bring a second problem: they don't fit in context. A long agent run can go far past even a 1M-token window, so the agent periodically compacts its history into a summary and carries on from there. We train compaction with CompactionRL,4 which builds compaction into the RL rollouts and optimizes the summaries along with the task.

We add one more term. Because SAO trains a value model, we can ask it how promising the agent's position looks just before a compaction and just after. A faithful summary shouldn't change the answer much. If the value estimate moves significantly, the summary has probably dropped or invented something that matters, so we reduce the reward:

r̃=r−λ · Σk max(0, |V(skafter)−V(skbefore)|−τ)

Here skbefore and skafter are the agent's state just before and just after its k-th compaction, V is the value model, τ sets how big a shift counts as significant, and λ sets how hard to penalize it.

On long runs, the detail that matters is often tiny: one file path, one flag, one approach that already failed. A summary that loses it sends the agent back to rediscover it. The penalty teaches the model to write summaries that keep it.

Keeping the drafter in step

We serve DeepSeek V4.1 Flash with speculative decoding: a small drafter proposes tokens, and the full model verifies them. A drafter only speeds things up when it predicts what the model is about to say, and a model that keeps learning keeps moving away from what its drafter was trained on. So during continual learning we SFT the drafters too, on the same traces. The drafter learns the workload alongside the model, and that workload gets processed much faster.

Results on CyberGym

CyberGym1 is built from 1,507 known vulnerabilities in 188 open-source projects. Each task gives the agent a description of a vulnerability and the vulnerable source code, and asks for a proof of concept that triggers it. So it measures reproducing known vulnerabilities, not discovering new ones. That's a much easier problem to define and to score, which is exactly what makes it a clean test of whether learning helps.

We split the benchmark. The agents run 800 tasks, and those become the experience to learn from: continual learning trains on their traces, and the memory baseline is built from the same runs. Every score below is on held-out CyberGym tasks that were never used for learning or for memory, so no model is graded on a task it has already seen.

With Codex as the agent harness, DeepSeek V4.1 Flash solves 77.4% of the held-out tasks with no learning. With a memory built from the 800 learning tasks, it solves 81.9%. With continual learning on those same 800, it solves 89.4%: 12 points over the base model, and 7.5 over memory.

CyberGym, held-out tasks

Share of held-out tasks solved by DeepSeek V4.1 Flash, with Codex as the agent harness

Share of held-out CyberGym tasks solved by DeepSeek V4.1 Flash with Codex as the agent harness
SettingTasks solved
Base model, no learning77.4%
With memory built from the 800 learning tasks81.9%
With continual learning on the 800 learning tasks89.4%
Figure 4. All scores are on held-out tasks that were never used for learning or memory. Memory and continual learning get exactly the same experience, from the same 800 tasks; they differ only in what they do with it.

Why learning beats memory

Memory is the obvious alternative: keep notes from past runs and put the relevant ones in front of the agent. It helps, adding 4.5 points on held-out tasks. Continual learning adds 12, more than two and a half times as much, from the same 800 tasks of experience. We think three things explain the gap.

  1. Memory has to be retrieved. Learning is always on. A note only helps if the right one is pulled in, and the agent has to decide what to look up before it knows what it needs. What's in the weights shapes every step, including the ones nobody thought to look up.
  2. Memory tells. Learning changes behavior. Reading that an approach worked isn't the same as being able to carry it out. This is where the looped layers earn their keep: the model reasons with what it learned and transfers the style of what worked, instead of matching old notes to a new problem.
  3. Memory competes for context. Notes from 800 tasks cost tokens on every call, and on long runs they get summarized away at the next compaction. Learned weights take up no context, and there's nothing to compact.

Memory is a lookup. Continual learning is practice.

Continual learning on the Yeta platform

Continual learning is live on the Yeta platform, and it's opt-in. To use it:

  1. Turn on the continual learning toggle in Data Retention.
  2. Send your requests to a model named <model>-cl-<name>, for example deepseek-v4.1-flash-cl-agents.

We only record data when both are true. Everything else stays zero data retention:

When the Yeta platform records request data
<model>-cl-<name> Any other model name
Continual learning on Recorded for continual learning Zero data retention
Continual learning off Zero data retention Zero data retention

If the toggle is off, or a request uses any model name other than <model>-cl-<name>, every request to GLM 5.3 Flash and DeepSeek stays ZDR, exactly as before: nothing is stored.

And because we fine-tune the drafter along with the model, a -cl- model doesn't just get better at your workload as it learns. It gets much faster at it too.

What we're taking away

Scale isn't diversity. More copies of the same model buy more samples from the same distribution, and the likely part of that distribution is usually where someone has already looked. More agents and better prompts didn't change that for us, and on CyberGym a memory of past runs got about a third as far as learning did. What worked was letting the model learn from what it had already done, so the next agent starts where the last one left off.

If you run agent fleets and want them to learn on the job, we'd like to hear from you.

Open the platform Talk to us

References

  1. Z. Wang, T. Shi, J. He, M. Cai, J. Zhang, D. Song. CyberGym: Evaluating AI Agents' Real-World Cybersecurity Capabilities at Scale. ICLR 2026. arXiv:2506.02548
  2. A. Tandon et al. End-to-End Test-Time Training for Long Context. 2025. arXiv:2512.23675
  3. Single-Rollout Asynchronous Optimization for Agentic Reinforcement Learning. 2026. arXiv:2607.07508
  4. Y. Li, Z. Hou, Y. Jing, J. Tang, Y. Dong. CompactionRL: Reinforcement Learning with Context Compaction for Long-Horizon Agents. 2026. arXiv:2607.05378
  5. S. Bae, A. Fisch, H. Harutyunyan, Z. Ji, S. Kim, T. Schuster. Relaxed Recursive Transformers: Effective Parameter Sharing with Layer-wise LoRA. 2024. arXiv:2410.20672
  6. Baseten. Decisions for a penny: introducing joey-1. 2026. baseten.co