Evaluating Long-Context Reasoning in LLM-Based WebAgents

Andy Chung, Yichi Zhang, Kaixiang Lin, Aditya Rawal, Qiaozi Gao, Joyce Chai

TL;DR

While modern Large Language Models (LLMs) boast massive context windows, their ability to act as effective web agents over long interaction histories is severely limited. This paper introduces a new benchmark that simulates multi-session web tasks by injecting irrelevant "noise" trajectories, revealing that even top-tier models experience a dramatic drop in success rates—often falling below 10%—as context scales up to 150,000 tokens.

What Problem Does This Paper Address?

LLM-based web agents are moving beyond simple chatbots to execute complex, multi-step actions online, such as booking flights or managing shopping carts. To provide true personalization, these agents must remember and reason across long histories of past user sessions.

However, while standard long-context "needle-in-a-haystack" tests evaluate passive information retrieval, they fail to capture the challenges of active, sequential decision-making. Operating in a live web environment requires an agent to maintain a state, follow complex instructions, and filter out irrelevant past actions. This paper investigates the massive gap between an LLM's theoretical context window and its practical reasoning capabilities when acting as a long-context web agent.

Methods

The authors propose a novel evaluation framework that splits a web task into two sequentially dependent subtasks ($A_1$ and $A_2$). Subtask $A_2$ is intentionally under-specified, forcing the agent to retrieve information from the history of $A_1$ (for example, if $A_1$ involves finding a specific hotel, $A_2$ might ask to find restaurants near "that hotel"). To simulate the passage of time and multi-session interactions, the framework injects irrelevant task trajectories (noise) between $A_1$ and $A_2$, scaling the total context length from 25,000 to 150,000 tokens.

Figure 1: Benchmark framework and evaluation overview. The left column shows the setup of the multi-session context. The middle column provides examples of the split subtasks as well as the (irrelevant) multi-session tasks. The right flowchart demonstrates benchmark and evaluation process for the trajectory the agent takes.

To mitigate the resulting performance drops, the authors introduce Implicit Retrieval-Augmented Generation (iRAG). Instead of forcing the agent to directly execute actions from a massive history, the iRAG step prompts the agent to first generate a concise summary of the current subtask, its state, and the relevant history. This effectively breaks a complex instruction down into manageable sub-instructions before an action is taken.

Datasets

The authors leverage WebCanvas, an existing dataset containing 543 annotated web tasks across diverse domains like travel, shopping, and entertainment. Because the live internet changes rapidly, many original tasks are no longer executable. The authors filtered and curated a robust set of 56 tasks that successfully executed using Claude-3.5 and 3.7 as baselines, subsequently splitting them into the dependent $A_1$ and $A_2$ subtasks.

Key Insights and Ideas

  • The Agentic Long-Context Penalty: Passive retrieval is a solved problem, but active execution is not. Long contexts don't just make models "forget" facts; they actively disrupt the agent's planning and instruction-following capabilities.
  • Distraction and Goal Loss: When faced with long histories, agents frequently lose track of the primary objective. Instead of returning to the main task after a noise injection, they often continue executing the irrelevant, injected trajectories.
  • The Loop Trap: A primary failure mode in long-context settings is getting stuck in loops. Agents repeatedly perform the same ineffective action until they hit the step limit, unable to self-correct despite explicit prompt instructions.
  • Reasoning Models Excel: Reasoning-focused models (like o4-mini) significantly outperform standard architectures in long-context environments, suggesting that internal chain-of-thought mechanisms provide better resilience against context noise.

Key Results

Across all tested models (Claude-3.7, GPT-4.1, Llama 4, and o4-mini), performance degraded sharply as context length increased. Success rates plummeted from baseline levels of 40–50% (with no noise) to less than 10% for several models at extended context lengths.

Figure 4: Success rate of task completion at vary- ing context lengths

Claude 3.7 proved to be the most robust, though its success rate still dropped from ~48% to ~22% at 150k tokens. GPT-4.1 suffered the most severe drop, falling to a mere 2.7% success rate under the same conditions.

The iRAG approach provided a modest but consistent boost: at 150k tokens, Claude 3.7's success rate improved from 22% to 31%, and o4-mini improved from 21% to 28%, demonstrating that decomposing complex context processing helps stabilize agent behavior.

Figure 3: Comparison of performance of baseline vs implicit RAG at 150k context length.

Limitations and Future Work

  • Evaluation Bottlenecks: Testing agents in live web environments is incredibly slow due to API rate limits and network latency; a single experimental run took the authors roughly 16 days.
  • Artificial Task Splitting: Artificially dividing atomic web tasks into sequential subtasks ($A_1$ and $A_2$) may not perfectly mirror organic, long-term human-agent interactions.
  • Dynamic Web Environments: The live internet is inherently non-deterministic. Changing layouts, shifting ads, and anti-bot measures introduce external variance into agent trajectories that are hard to control.

Future Directions: The authors emphasize that simply expanding raw LLM context windows is insufficient for agentic workflows. Future work must focus on developing more robust memory architectures, explicit context filtering mechanisms, and advanced planning capabilities.

Summary updated

Abstract

As large language model (LLM)-based agents become increasingly integrated into daily digital interactions, their ability to reason across long interaction histories becomes crucial for providing personalized and contextually aware assistance. However, the performance of these agents in long context scenarios, particularly for action-taking WebAgents operating in realistic web environments, remains largely unexplored. This paper introduces a benchmark for evaluating long context reasoning capabilities of WebAgents through sequentially dependent subtasks that require retrieval and application of information from extended interaction histories. We develop a novel evaluation framework that simulates multi-session user interactions by injecting irrelevant task trajectories between dependent subtasks, creating contexts ranging from 25,000 to 150,000 tokens. Through extensive evaluation of four popular models, Claude-3.7, GPT-4.1, Llama 4, and o4-mini, we observe a dramatic performance degradation as context length increases, with success rates dropping from 40-50\% in baseline conditions to less than 10\% in long context scenarios. Our detailed error analysis reveals that agents primarily fail due to getting stuck in loops and losing track of original task objectives. We further propose an implicit RAG approach that provides modest improvements by generating task-relevant summaries, though fundamental limitations in long context reasoning persist. These findings highlight critical challenges for deploying WebAgents in realistic, long-term user interaction scenarios and provide insights for developing more robust agent architectures capable of maintaining coherent task execution across extended contexts.
BibTeX
@misc{chung2025evaluating,
  author = {Andy Chung and Yichi Zhang and Kaixiang Lin and Aditya Rawal and Qiaozi Gao and Joyce Chai},
  title = {{Evaluating Long-Context Reasoning in LLM-Based WebAgents}},
  year = {2025},
  eprint = {2512.04307},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.04307},
}
Figure