Self-Upgrading study: a 27B agent rewrites its weights in ALFWorld, raising completion by 3.6 points

Using Qwen3.5-27B in text-based ALFWorld, researchers retained one gradient-free weight edit across four rounds. Unseen-task completion rose from 41.6% to 45.2%. Finding the edit still required compute; physical robots and lifelong autonomous learning remain unverified.
The “robot” studied here is a language-model agent in ALFWorld’s text-based simulated environment, not a physical robot. Only one of four consecutive upgrading rounds retained a change, and the following two rounds preserved that gain. This does not establish indefinite or open-world continuous upgrading. “No training” means that this weight-rewriting loop performs no gradient-based training; it still starts from an already pretrained public model. No extra structure is added to each deployed action, but finding, testing, and confirming changes requires computation.
The first author, Jiajun Fan, is a PhD student in the Department of Computer Science at the University of Illinois Urbana-Champaign (UIUC), advised by UIUC’s Ge Liu. The other authors are from UIUC, Carnegie Mellon University, Brown University, Stanford University, Northeastern University, Harvard University, the University of Washington, Rutgers University, Princeton University, the University of Michigan, Columbia University, New York University, the University of California, Berkeley, and Yale University.
“There is … a certain minimum level where this degenerative characteristic ceases to be universal. At this point automata which can reproduce themselves, or even construct higher entities, become possible.”
“There is … a certain minimum level where this degenerative characteristic ceases to be universal. At this point automata which can reproduce themselves, or even construct higher entities, become possible.” — John von Neumann, The General and Logical Theory of Automata, 1951

Von Neumann published those words in 1951. Seventy-five years later, we have achieved stable, sustained self-improvement over multiple rounds in an embodied agent, without collapse. Night after night, it changes itself: between tasks, it upgrades its own weights through its own reasoning, without training or adding overhead to any step while it works.
Our earlier work “Language Models Can Rewrite Their Own Weights” demonstrated that reasoning language models can rewrite their own weights entirely through their own reasoning and keep improving. That paper, however, was limited to reasoning tasks. It also identified embodied agents and robots as potentially among the most useful applications of self-improvement, listing them as future work.

- Paper: https://arxiv.org/abs/2611.21885
- Project: https://www.jiajunfan.com/projects/self-rewriting
Now our new paper, “Self-Upgrading Embodied Agents”, takes a step forward: in a text-based simulated household environment, an embodied agent can improve task performance by rewriting its own weights. This upgrading loop adds no pre-training or post-training, nor does it add a complex harness or prompt engineering when actions are deployed. It still starts from an already trained foundation model.
To our knowledge, this is the first time an embodied robotic agent has achieved iterative self-upgrading in a long-horizon task by actively rewriting its own weights without collapsing. It also opens a new path toward stable lifelong continual learning and recursive self-improvement (RSI) in robots.
By day, it works. At night, it reads its work records, identifies its shortcomings, and rewrites its own weights. It serves as its own examiner: every change must first be compared against its previous-night self. Changes that hold up are retained; all others are rolled back. Once a change is retained, it is a stronger agent the next day, with the same cost per step. On subsequent nights, it preserves that upgrade. This capability emerges with scale.
Looking ahead, embodied agents’ training and inference need no longer be separate. Self-Upgrading Embodied Agents uses an open-source 27B model in ALFWorld, a text-based simulated household environment. The entire process involves no training, gradients, reward model, or second model.

- Paper: https://arxiv.org/abs/2611.31117
- Project: https://www.jiajunfan.com/projects/self-upgrading/
Background: working a lifetime with factory-set weights
Embodied agents built on language models begin work with weights fixed at deployment. However much work they subsequently do, those weights remain unchanged.
That is not how people learn skills. A new cook is slow in the first week, but becomes efficient after a year on the job, without anyone sending them back to school in between.
There are two common approaches to making agents stronger.
One is retraining: the agent must first be taken off the job, while rewards, gradients, and a full training infrastructure are prepared alongside it. Care is also needed to prevent newly learned material from wiping out existing skills.
The other is to add reflection, memory, or search while it works: each step incurs their additional overhead, and they compete with descriptions of the environment for an already crowded context window. Remove them, and nothing remains, because the policy itself has learned nothing.
A self-upgrading embodied agent needs neither. Like that cook, it learns on the job.
Changing weights through reasoning rather than training is called weight-space programming. It points in the same direction, but previous work either used a much larger commercial model to change a small network or stopped at models that only reason. Here, an agent that acts rewrites its own weights without needing a larger model.
The self-upgrading loop: work by day, rewrite its own weights at night
Self-upgrading is a loop wrapped around an agent already at work. The agent works normally with its current weights. Between tasks, it pauses to study itself; afterward, it either leaves one change in its weights or changes nothing. We call its working period “day” and the time spent on itself “night,” regardless of the clock. Subsequent work and the next night both continue from the weights left by this night.
At night, the agent has three things at its disposal.
First, its own weights: the network’s weights are divided into more than a thousand blocks, each called a tensor. It can read every tensor and rewrite most of them, so a change can be expressed as a short program.
Second, its own experience: at the start of the night, it first performs a batch of practice tasks using its existing weights. One task from start to finish counts as an episode. It has the complete records of these opening episodes, including the prompt seen at every step, its response, and the environment’s feedback.
Third, the ability to run itself: within a call limit, it can perform forward passes through its own network—that is, run the network normally to produce responses. For example, it can run its modified self and its previous-night self on the same tasks with the same random seeds.
At the start of the night, it receives counts, not causes. The initial instructions say nothing about why the problem occurs, which layer to inspect, which direction to change, or how large a change to make. No reward model scores each step, and no stronger model supplies suggestions. The outside world tells it only whether a task was completed.
The agent in the paper is Qwen3.5-27B, using the publicly released weights. Its work comes from ALFWorld, the text-based version of ALFRED household tasks. An episode ends when the task is completed, with a maximum of 50 steps; each response is limited to 512 tokens.
There is no training or human intervention within this loop. It uses only forward passes, which the agent already performs continually as it works.

Schematic of the self-upgrading loop. The top row alternates day and night; the bottom row breaks one night into four steps: diagnosis, rewriting, testing, and confirmation. The outcomes of the nights shown are illustrative. In the experiment’s four consecutive nights, only night two retained a change.
One night: diagnose its own problem and change just one tensor
Let us examine night two—the night that retained a change—in more detail.
The opening-episode statistics were presented to it at the outset: of 4,418 steps across 128 episodes, 1,366 did not produce an action. The figures did not explain why, so it wrote code to inspect the episode records, then wrote: “All 1366 invalid steps hit exactly 512 tokens - the token limit. The model generates too much verbose reasoning before the action, gets cut off, and produces malformed actions.”
All these responses filled the 512-token limit. The reasoning was cut off before finishing, so no action was produced. The problem could also snowball: the tail of a truncated response remained in the short history seen at the next step, making the following response more likely to reach the limit too.
Having found the symptom, it looked for the cause: what inside itself was pushing it to write so much? It selected steps with concise responses and steps that reached the limit, read the hidden states from each group—the numbers computed internally by the network—and used their difference as a direction.
The record of this night reads like a careful lab notebook. Its first few changes produced no measurable difference. Looking back at its own responses, it noticed that those reaching the limit had already gone astray in their opening words, so it shifted its target to an earlier attention layer. Its first intervention there went in the wrong direction: responses became longer, although the difference remained within the noise.
It wrote: “The edit made things worse - increased verbosity. Let me try the opposite direction.” Reversing the direction and increasing the strength produced the first change beyond the noise. But on unused practice tasks, the effect shrank back within the noise. It then compared four strengths side by side, each against its unmodified self. The strongest made actions prone to repetition, so it backed off to a milder strength. That milder strength held up over complete episodes on the same batch of tasks.

The night that retained a change, from left to right: its three resources, diagnosis, rewriting, 13 paired tests, one confirmation on reserved practice tasks, and the final decision. Below is the change it retained, reproduced exactly from the code it wrote.
The final retained change was small. Of the network’s 1,184 tensors, it modified only one: the output projection of linear attention in layer 16. It applied a rank-one update along the direction it had found itself, leaving the rest of the network untouched. The entire change takes only a few lines of code and can be read, strengthened, weakened, or deleted like any other program change.
The entire night ran on the same GPU normally used to run the agent, taking 7.7 hours, without computing gradients or calling another model.

Left: the one tensor modified among the network’s 1,184 tensors, in layer 16. Right: during the night that retained a change, the agent compared response lengths at several strengths against its unmodified self. Stronger changes yielded shorter responses. Each point is the mean measured at one strength that night; the larger point lies beyond two standard errors. The retained change had strength 10.
Acting as its own examiner: retain only what holds up
An agent that can modify itself must first ensure that it does not damage itself. Nobody would let a robot keep updating itself if an update made it even slightly worse. Letting an agent change its weights is not difficult; retaining only changes that hold up is. Stable self-improvement is much harder than reckless self-improvement.
It therefore has to act as its own examiner, with two gates.
The first gate is a control for every test. Whenever it runs its modified self, its previous-night self runs alongside it on the same tasks with the same random seeds. Its previous-night self is its state at the end of the preceding night. Before any night has retained a change, that is its unmodified self, using the initial weights. If the difference between the two is within two standard errors—no larger than the measurement’s own fluctuations—the loop explicitly tells it: this is noise.
The second gate is a confirmation. Some practice tasks are reserved before the night begins and remain inaccessible throughout it. When the agent thinks a change is worth keeping, it can request one confirmation, and only one, on 256 reserved practice tasks. The change is retained only if the targeted problem clearly improves and task completion does not clearly decline. Otherwise it is rolled back, leaving the agent exactly as it was.
On the night that retained a change, five of 13 paired tests clearly supported it, and none clearly opposed it. In confirmation, the proportion of steps without an action was 6.3 percentage points lower for the modified self than for the unmodified self, with a standard error of 1.1. Task completion did not decline.

Four consecutive nights. Each square represents a batch of forward passes it requested. Night two retained a change; the other three rolled back, leaving it exactly as before. The confirmation column shows the one retained change. The quotation beneath the figure is what the agent said on night three.
Most nights ended in rollback, and that is the other half of the result. We report four consecutive nights: night one started from the initial weights, and every later night started from the weights left by the previous night. One night retained a change; three rolled back. Night four is particularly revealing. Its own small-scale tests showed higher task completion, but never beyond two standard errors. It requested confirmation, and the reserved practice tasks did not substantiate the increase. It trusted the reserved tasks, rolled back the change, and explained the reason itself: the change had merely fit the practice tasks used to tune it.
Changes that are not confirmed, or do not hold up in confirmation, cannot enter the weights. This confirmation adds only one run over 256 reserved practice tasks per night. With it, self-modification becomes self-improvement without collapse.
Once a change is retained: a stronger agent the next day, with the same cost per step
First, consider one episode. The task was to examine an alarm clock by the light of a desk lamp. The unmodified agent reached the clock at step three, but then produced 17 consecutive truncated responses. It wasted 41 of its 50 steps and did not finish. On the same task with the same random seed, the modified agent picked up the clock, turned on the lamp, and completed the task in five steps. No night had encountered this task.

A step-by-step comparison of the two agents on the same unseen task with the same random seed. Each bar represents a step, with height indicating the response’s token count. Pink marks a step that reached the limit and was truncated without producing an action. The unmodified agent is above; the modified agent is below.
Now consider the full comparison. We fixed a set of tasks in advance that, like the alarm-clock task, had never been encountered during any night. Each agent ran thousands of episodes, with 48 new random seeds per task. The two agents were compared episode by episode in pairs on identical tasks and random seeds. Tasks, seeds, and testing methods were all specified in advance. All five metrics improved.
More tasks completed. The modified agent completed 45.2% of tasks, versus 41.6% for its unmodified self: a gain of 3.6 percentage points, with a 95% interval of +1.9 to +5.2 percentage points and p < 10⁻⁴. The improvement was not driven by just a few tasks. The modified agent completed more episodes on 60% of tasks, fewer on 29%, and the same number on 11%. The improvement also held in rooms it had not practiced in.
Fewer steps used. The modified agent used an average of 37.2 steps per episode, versus 38.5 for its unmodified self. It completed 40.0% of tasks within 40 steps, versus 36.5% for its unmodified self.
Fewer wasted steps and fewer tokens. Steps without an action accounted for 39.5%, versus 45.9% for its unmodified self. This decrease was widespread: the share of wasted steps was lower on 98% of tasks and for almost every random seed. The decrease was significant when each of the six task categories was examined separately. Tokens per episode fell by about 8%, and the saved steps were spent acting.
Nighttime measurements matched daytime results. On the reserved practice tasks used for confirmation, the nighttime change in the share of steps without an action was −6.3 percentage points. By day, on unseen tasks with new random seeds, it was −6.4 percentage points.

Left: task completion, with whiskers showing 95% intervals over 48 random seeds. The horizontal bar divides tasks into those where the modified agent completed more, the same number, or fewer episodes. Right: the other four metrics, with the agents side by side. Bottom: the more work it does, the further it pulls ahead of its unmodified self.
None of this was purchased with longer prompts or additional tools. After the night, it remains an ordinary set of weights, with the same cost per step as before.
Night after night: the upgrade held, without collapse
Across four consecutive nights, it upgraded itself on night two and preserved that upgrade on every subsequent night, without ever collapsing. Night one rolled back; night two retained one change; and night three started from those modified weights.
Some responses in the opening episodes still reached the limit, so it attacked the same problem again. It read its hidden states four times, wrote changes for five layers, and compared them with the self retained from night two. None was clearly better, so it rolled them back and explained why: the night-two edit to the attention output projection in layer 16 was already present and formed that night’s starting point. It had not managed to advance beyond it. Night four tried again and likewise rolled back.
On the three nights that rolled back, the weights did not change. In each case, that was the agent’s own decision after inspecting its measurements. What night two gave it was still there on night four. That is how the loop is designed: weights change only when it can produce evidence that it has improved.
The paper describes this sequence as “stable, sustained self-improvement over multiple rounds, without collapse.” Each term has a specific meaning.
- Multiple rounds: modifying itself night after night.
- Stable: on nights when a change does not hold up, it remains exactly as before, and it never collapses.
- Sustained: what is retained stays in place, benefiting every subsequent episode. The more work it does, therefore, the further it pulls ahead of its unmodified self. Across 48 episodes per task, on average it wastes 145 fewer steps, generates 57,000 fewer tokens, and completes 1.7 more episodes.

Three metrics on unseen tasks for the agent working the day after each night. Night two retained a change; subsequent nights did not alter it.
This capability emerges with scale
We applied the same procedure to three smaller models in the Qwen3.5 family: 9B, 4B, and 2B.
The 2B model made no change: it completed too few tasks for any test to measure a difference. The 4B agent measured carefully; 14 of its 15 paired tests clearly opposed its edit. It rolled back without requesting confirmation and wrote: “The edit I made (scaling up MLP weights in layer 31) consistently made things worse”. The 9B agent modified itself but never requested a single test—a reckless approach. It wrote a forward-pass request into a variable, then slept while waiting for a result that would never arrive. When the night’s allowed conversation turns ran out, its change underwent confirmation and did not hold up.
Diagnosing itself, finding a change through measurement, and retaining only the one that holds up: among four sizes in the same family, only the 27B agent achieved this. This capability emerges with scale.

Four sizes in the same family, following the same procedure. Each card shows its test squares, its own words or code, and the outcome. The 27B card shows the night that retained a change. Purple squares represent batches of forward passes reading its own hidden states. The tenth square in the 27B row is a batch comparing several candidate edits side by side, labeled c in the four-night figure. Neither kind counts as a test.
What makes this route different
The paper compares approaches to making agents stronger across six properties. Reinforcement learning and lifelong learning change weights but require gradients; an external optimizer updates the learner. Here, the learner updates itself. Each update is an explicit change that can be read, tested, and rolled back. Reflection, memory, and search do not touch weights, at the cost of extra overhead at every step. Researchers or a second model can change weights without gradients, but the agent itself is not making the change.

Approaches to making agents stronger, compared across six properties, from Table 1 of the paper. A check mark means that work cited by the paper for that approach has the property.
Self-rewriting had previously been demonstrated in a model that solved mathematics problems—a model that thought but did not act. That work, “Language Models Can Rewrite Their Own Weights,” arXiv 2611.21885, noted that embodied agents and robots might be among the most useful applications of self-rewriting.
This paper applies it to an agent that must act in long-horizon tasks. In the table, self-upgrading alone combines these properties: changing an acting agent’s policy through its own work, without training or adding overhead to any step. The computation needed to search for and test changes in each round is paid for at “night.” Once a change is retained, subsequent actions incur no additional per-step overhead from extra reflection or tool structures.
Outlook: training and inference need no longer be separate
Previously, learning took place between deployments and was done for the agent by others. Here, it moves between tasks and is done by the agent itself. In the future, embodied agents’ training and inference need no longer be separate: they can accumulate their own experience and upgrade themselves as they work. The upgrading loop tested here adds no separate pre-training or post-training stage and requires no human intervention within the loop. It still relies on an already trained model and an environment, tools, and testing protocol designed in advance by researchers.
Nothing in this loop is unique to household tasks. It asks only three things of the agent: the ability to read its work records; to run with and without a change on the same tasks with the same random seeds; and to reserve some tasks for confirmation. An embodied system that records its episodes, can rerun tasks between periods of work, and can reserve some tasks has all three.
Our experiments used an open-source 27B model in a text-based simulated household environment. The agent entering the next night is precisely the one left by the preceding night. By construction, this is recursive self-improvement: stable, sustained, and without collapse. It is also an already functioning form of lifelong continual learning.
Our argument is: embodied agents that, like people, do not separate training from working can upgrade themselves throughout their lifetimes.
We believe this marks the beginning of lifelong continual learning in robots: stable, sustained, recursive self-improvement.
The era of self-upgrading embodied agents begins here.
This article is from “Synced,” by “Jiajun Fan.”
Related topics
After reading
Join the AINRK community
Read how to join the community and connect with people working in AI.




