Skip to main content
Back

Fudan Study Reveals RL-Trained AI Agents Collapse When Facing Unfamiliar Environments

A systematic study reveals reinforcement fine-tuning helps LLM agents master harder tasks in familiar environments, but transfer to new ones is fragile.

Pro

  • RFT generalizes across task difficulty within one environment but transfers poorly to unseen ones, with gains averaging only ~3 points cross-environment.
  • Training on hard tasks yields better results than easy, and an easy-to-hard curriculum further boosts performance.
  • BabyAI-trained agents lose long-horizon reasoning because they overfit to provided action lists, tanking WebShop scores from 28.6 to 10.3.
  • Sequential multi-environment RFT matches joint training and shows minimal forgetting on upstream tasks.
  • Training order acts as a curriculum: dense-feedback environments before strict-feedback ones generalize better.
  • Code and framework available in the AgentGym-RL repository with Qwen2.5 3B and 7B experiments.

Reinforcement fine-tuning has become the default recipe for turning base LLMs into agents that can browse, shop, search, and navigate. But there is a quiet assumption baked into most of the published results: the agent is tested in the same environment it was trained in. A new empirical study from Fudan University and Meituan pokes at that assumption, and finds the generalization story is messier than the leaderboards suggest.

The paper, Can RL Improve Generalization of LLM Agents? An Empirical Study, runs a large sweep across five agent environments to answer a practical question: when you RL-tune an agent on one thing, what does it actually learn, and does that learning survive contact with an unfamiliar interface?

The in-domain trap

Reinforcement fine-tuning has emerged as a promising post-training paradigm for improving LLM agents on complex interactive tasks such as web navigation and software engineering. In RFT, an agent is trained to make a sequence of intelligent decisions that maximize task-specific objectives based on environment feedback. The problem the authors flag is that most empirical evidence for RFT focuses on in-domain evaluation, where training and testing are conducted within the same environment and often even on closely overlapping tasks. In real-world deployment, however, agents frequently encounter unseen environments that differ not only in task instances, but also in background knowledge, observation spaces, and action interfaces.

To measure what actually transfers, the team designed the study around three axes: generalization across task difficulty inside one environment, zero-shot transfer to unseen environments, and sequential training across multiple environments to see what gets forgotten. The experiments use Qwen2.5-3B-Instruct and Qwen2.5-7B-Instruct trained with GRPO through the AgentGym-RL framework.

Diagram of the three generalization axes studied: intra-environment, inter-environment, and sequential multi-environment

Five environments, five personalities

The evaluation spans WebShop, an interactive web shopping environment; SearchQA, a Q&A environment augmented with context from a search engine; ALFWorld, which requires agents to explore rooms and execute tasks in a household setting; BabyAI, an interactive grid world simulator; and TextCraft, a game environment for crafting items in Minecraft. Each one stresses a different mix of dense vs binary rewards, strict vs loose action validation, and whether the environment hands the agent a list of valid actions per step.

Tasks in each environment are split into easy and hard buckets based on Qwen2.5-7B's own avg@8 success rate, so the difficulty labels reflect what the model actually finds hard rather than a human guess.

Within an environment, RFT travels well

The first axis is the friendliest news for RL. Training on the easy split transfers gracefully to the hard split and vice versa. Notably, with 7B model on WebShop, training on the easy split improves performance on the hard testset by 60.1 points, suggesting that RFT encourages agents to adapt to the environment, thereby enabling performance transfer across tasks with different difficulty levels and varying steps.

Harder tasks are the better teachers when you can only pick one. Training on the hard split yields more gains on the test set, e.g., for 3B model in AlfWorld, training on the hard split outperforms training on easy by 8.7 points. This is attributed to the richer failure signals and longer-horizon exploration induced by harder tasks, which push the RFT optimizer to seek better policies.

Curriculum ordering matters too. Training on the mixture generally does not yield optimal performance. In most cases, training on easy first, followed by hard, achieves the best results. Compared with using a single difficulty level, this easy-to-hard curriculum enables further performance improvement.

A second, quieter benefit: RFT makes exploration cheaper. When training the 3B model on the easy split in BabyAI, the average interaction turns decrease from 10.76 to 4.19, and the average trajectory length is reduced from 624.58 to 160.60 tokens. Same or better success rates in a third of the tokens is a real deployment win.

Cross-environment transfer is where it breaks

Now the hard news. When you train in one environment and evaluate in another, the picture is far less rosy. On average, the 3B and 7B models yield improvements of 3.32 and 3.44 points on unseen environments, respectively, compared to held-in gains that regularly clear 60 or 70 points.

Some source environments are net-negative. Agents trained on TextCraft and BabyAI may struggle to generalize to other environments. After training on BabyAI, the 7B models show average negative improvements of -3.23 on held-out tasks, and even drop sharply from 28.59 to 10.25 on WebShop. The diagnosis is telling: because the BabyAI environment provides available actions at each step, the agent gradually becomes dependent on this information during training, leading to a decline in long-horizon reasoning capability. The agent effectively learned to lean on a crutch that no other environment provides.

The target side of the equation has a pattern too. Agents trained on nearly all source environments generalize effectively to TextCraft and BabyAI, as these domains rely less on specific background knowledge, thereby allowing acquired skills to transfer more readily. The stubborn targets are AlfWorld and SearchQA. This is attributed to the strict action validation and sparse feedback inherent in these two environments. For instance, AlfWorld responds uniformly with "Nothing happens." to all invalid actions, offering no instructional guidance for improvement.

Sequential training beats what you would expect

The most useful finding for anyone building a general agent shows up in the third axis. Rather than mixing everything at once, the team trains through environments one after another and watches how much of the earlier skill survives.

When the WebShop-pretrained agent is further trained on TextCraft, it boosts performance on TextCraft from the single-task baseline of 80.88 to 82.50. Meanwhile, performance on WebShop experiences only a minor fluctuation, shifting from 86.5 to 86.32. That is close to catastrophic-forgetting-free continual learning without any special replay buffer or regularizer.

Order still matters, and again it looks like a curriculum. When evaluated on TextCraft and AlfWorld, BA+SQ outperforms SQ+BA by 15.63 and 10.00 points, respectively. Starting with the environment that gives generous feedback (BabyAI) and moving to the one with strict feedback (SearchQA) works better than the reverse. The BA+SQ order naturally creates an "easy-to-hard" curriculum, which in turn facilitates better generalization performance.

Stretching to five stages: sequential training achieves performance comparable to joint training, even after training on five distinct tasks. That matters practically, because it means teams can bolt new environments onto an existing agent without paying the compute cost of rerunning a full multi-task mixture.

Where the agents actually fail

The paper does not stop at aggregate numbers. It categorizes failure trajectories with GPT-5-mini into eight patterns. Two show up loudly:

  • Errors related to "Confirmation Bias" are prevalent across all scenarios (over 10 percent). Agents tend to exhibit overconfidence, neglecting further verification and lacking the capacity for self-reflection based on environmental feedback.
  • In SearchQA, errors categorized as "Guessing or Fabrication" are widespread among both held-in (23.8%) and held-out (21.2%) settings, highlighting a critical deficiency in tool utilization.
  • In WebShop, the proportion of "State or Memory Inconsistency" errors rises from 4.3% in held-in to 21.9% in held-out settings. When the observation format changes, agents lose the thread.
Comparison of a base model looping on WebShop versus a SearchQA-trained model completing the task with structured search queries

What actually transferred, in one example

The most illustrative positive-transfer case is SearchQA to WebShop. The base agent tends to blindly input the entire instruction into the search bar, and struggles to accurately extract key information from the voluminous HTML content, resulting in the retrieval and selection of irrelevant items. In contrast, the agent trained on SearchQA learns to effectively search for key details and extract information, successfully selecting the correct item. The transferable skill was not domain knowledge about shopping; it was query formulation and information extraction, which happens to be the shared subroutine.

The mirror case explains negative transfer. The AlfWorld-trained agent falls into a degenerate loop, repeatedly issuing near-duplicate searches, returning the same responses, and ultimately failing. AlfWorld rarely rewards iterative refinement of a query, so that skill was never learned to begin with.

What this means if you are building agents

A few takeaways worth internalizing:

  1. In-domain RFT numbers massively overstate what your agent will do in a new environment. Budget for a large drop.
  2. Pick training environments that force the agent to formulate its own actions rather than picking from a provided list. Otherwise you are optimizing a crutch.
  3. Sequential fine-tuning is a viable path to a multi-environment agent. Forgetting is much milder than the SFT literature would predict.
  4. Order your environments easy-feedback to strict-feedback. Same reason curriculum learning works within a single environment.
  5. Sparse, strict-validation environments (AlfWorld, SearchQA) are the ones you have to train on directly. Do not expect transfer to bail you out.

The training code lives in the AgentGym-RL repository used for the experiments, and the task data comes from the earlier AgentGym benchmark suite. The paper itself is on arXiv, with full appendix tables covering all 20 two-stage sequential runs and the failure mode breakdown per environment.