arXiv(opens in a new tab)cs.AIOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.19376

DeLoop: Repeated Actions as Self-Supervision for Long-Horizon Agents

Tianle Chen, Pushkar Singh, Ketan Todi, Biswajit Paria, Qijia He, Wenqi Wang, Yuwen Tan, Jike Zhong, Sugato Basu, Deepti Ghadiyaram, Arjun Akula

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Tianle Chen1,2^{1,2}, Pushkar Singh1,†^{1,\dagger}, Ketan Todi1^{1}, Biswajit Paria1^{1}, Qijia He1,3^{1,3}, Wenqi Wang1,2^{1,2}, Yuwen Tan1,2^{1,2}, Jike Zhong4^{4}, Sugato Basu1^{1}, Deepti Ghadiyaram2^{2}, Arjun Akula5,†^{5,\dagger}

1^{1}Google, 2^{2}Boston University, 3^{3}University of Washington, 4^{4}University of Southern California, 5^{5}Google DeepMind, †^{\dagger}Project lead

Language-model agents that run long tasks often redo work they have already done: they re-issue a tool call they made earlier and get back exactly the same observation, a step that adds no new information. We identify this failure as a loop. Loops appear natively in Qwen, Llama, and Gemini agents and become far more common once the agent's history is compressed to fit its context window. To reduce these loops, we propose DeLoop, a self-supervised training method. DeLoop builds on a simple observation: the agent's own rollout can provide the supervision needed to learn from its loops. We use a looping action as a negative example and the first later non-looping action in the same rollout as a positive example. DeLoop learns from these pairs through direct preference optimization and does not require task rewards, gold answers, or LLM judges. On CodeGym under compression, DeLoop reduces the share of Qwen3-8B tasks containing loops from 57.3% to 6.1%. It also uses about one third as many steps per task, with similar task success. On Qwen3-32B, DeLoop reduces loops and steps while raising task success from 37.7% to 44.8%. Code and data will be publicly available.

Keywords: LLM agents, long-horizon agents, agent memory, context compression, agent loops, repeated actions, preference optimization

1. Introduction

Language-model agents increasingly solve tasks over long interaction horizons: they inspect repositories, execute commands, call tools, and act on environment feedback across many steps (Du et al., 2025; Jimenez et al., 2024; Yang et al., 2024a; Yao et al., 2023). Yet they often redo work they have already done. The agent calls the same tool with the same arguments, receives the same observation, and then issues the same call again (Figure 1). Each repeated call is a looping action: it gets back an observation the agent already has and adds no new information. We formulate this failure as a loop.

The failure is already present even when the full, uncompressed history is available, but compression makes it worse. On CodeGym (Du et al., 2025), the loop rate of Qwen3-8B (Yang et al., 2025), the share of tasks with at least one loop, rises from 29.0% with the full history (no summarization) to 57.3% under summarization, while looping actions per task increase more than 3.5×!3.5 \times ! More importantly, in addition to wasted tool calls, we empirically observed that trajectories that enter a loop fail in all six Qwen3 and Gemini models we evaluate: on average, 59.5% of looping runs fail, compared with 33.4% of loop-free runs (Figure 2). Thus, context compression makes looping more likely and increases the chances of task failure.

Recent work manages growing interaction histories through external memory (Fox et al., 2026; Packer et al., 2023), hierarchical or summarized working context (Hu et al., 2025; Sun et al., 2026; Wu et al., 2025), compact learned state (Zhou et al., 2025), and learned context compression or management (Kang et al., 2026; Liu et al., 2025; Lu et al., 2026). These works study what history should an agent retain to continue acting well under a bounded context window. In contrast, we study a complementary question about how the agent's policy uses its history after compression. That is, when the history records an action, does the agent use that record to avoid repeating it? We find that most agents do so only partly.

Another way to reduce looping is to improve the agent's policy. Some methods address agent failures at inference time through reflection (Shinn et al., 2023) or early stopping (Lu et al., 2025). Others train agents using demonstrations (Chen et al., 2023; Zeng et al., 2024), search-based training data (Yuan et al., 2025), or step-level supervision (Chen and Yuille, 2026; Tang, 2026; Xiong et al., 2024). We instead ask: can the failure itself provide a useful signal to improve agent's policy?

Based on these observations, we propose De-Loop, a self-supervised training method. Our key observation is that loops can provide their own training signal. We note that a loop is a simple trajectory-level event that can be identified directly from the action-observation trace, without requiring post-hoc failure attribution (Barke et al., 2026;

© 2026 Google. All rights reserved

Google Technical Report

Figure

Qwen3-8B on CodeGym

Figure

Figure 1: Training an agent on its own loops breaks the loop. (Left) A repeated search and the later action that marks the server as visited form a preference pair. DPO trains the agent to prefer the recovery. (Right) Qwen3-8B on CodeGym: DeLoop and the baseline summarize at 4,096 tokens; full history is the uncompressed reference.

Hou et al., 2026). Within a single rollout, we pair a looping action with the first later non-looping action that differs from it. The looping action provides a natural negative, while the later action provides a positive signal. Figure 1 illustrates this. These pairs are mined directly from the interaction, without gold answers, LLM judges, external rewards, or task-success labels. We train the policy on these pairs through direct preference optimization (DPO Rafailov et al., 2023).

On Qwen3-8B, DeLoop cuts the loop rate 9.4×9.4\times while lowering interaction cost, with similar task success. On Qwen3-32B, the self-mined pairs alone reduce loop rate from 38.5% to 12.9% and raise task success from 37.7% to 44.8%, while also lowering interaction cost. Adding cross-domain pairs (DeLoop-Mix) raises Qwen3-8B task success from 25.1% to 30.3%. Our contributions are:

  1. Identifying loops in long-horizon agents: we identify and characterize loops, a simple failure in which an agent repeats an earlier action and receives the same observation. We show that loops occur even with the full history, grow sharply under compression, and are associated with task failure.

  2. Mining loop actions as self-supervision: we introduce a simple mining method that turns discovered loops into preference pairs from the agent's own rollouts, with no external supervision.

  3. Reducing loops in long-horizon agents: DeLoop reduces loops (57.3% to 6.1% on Qwen3-8B) while lowering interaction cost. The gains also extend to larger models, where there is pronounced improvement in task success (45.1% to 52.3% on Qwen3-14B and 37.7% to 44.8% on Qwen3-32B).

References (100)

Couldn't load all references. Reload the page to try again.