A Subgoal-driven Framework for Improving Long-Horizon LLM Agents
Organizations: Google DeepMind
Abstract
Large language model (LLM)-based agents have emerged as powerful autonomous controllers for digital environments, including mobile interfaces, operating systems, and web browsers. Web navigation, for example, requires handling dynamic content and long sequences of actions, making it particularly challenging. Existing LLM-based agents struggle with long-horizon planning in two main ways. During online execution, they often lose track as new information arrives, lacking a clear and adaptive path toward the final goal. This issue is further exacerbated during reinforcement learning (RL) fine-tuning, where sparse and delayed rewards make it difficult for agents to identify which actions lead to success, preventing them from maintaining coherent reasoning over extended tasks. To address these challenges, we propose two contributions. First, we introduce an agent framework that leverages proprietary models for online planning through subgoal decomposition. Second, we present MiRA (Milestoning your Reinforcement Learning Enhanced Agent), an RL training framework that uses dense, milestone-based reward signals. The real-time planning mechanism improves proprietary models such as Gemini by approximately a 10% absolute increase in success rate (SR) on the WebArena-Lite benchmark. Meanwhile, applying MiRA to the open Gemma3-12B model increases its success rate from 6.4% to 43.0%. This performance surpasses proprietary systems such as GPT-4-Turbo (17.6%) and GPT-4o (13.9%), as well as the previous open-model state of the art, WebRL (38.4%). Overall, our findings demonstrate that combining explicit inference-time planning with milestone-based rewards significantly improves an agent's long-horizon capabilities, paving the way for more robust and general-purpose autonomous systems.
Figures & tables
| Category | Hardcoded Rules |
| Stop at Wrong Page ( Wrong Termination ) | The agent called the exit() function or terminated, but the message was judged incorrect by the final benchmark rules. |
| Get Stuck Midway | The agent failed and exhibited repetition, characterized by identical last actions or a short action-state sequence repeating times. |
| Fail to Make Reasonable Attempt | The agent already reached the right page, but didn’t attempt to exit() OR The agent failed very early, either by an immediate, short exit() call or by clicking a nonsensical, distracting element as its first action. |
| Others ( System error, etc. ) | The agent failed, but did not trigger Rules A, B, or C, indicating a general deviation from the success path. |
| Failure Type | Score |
| Stuck in Midway | 10/10 |
| Wrong Termination | 10/10 |
| Fail Attempt | 8/10 |
| Others | 9/10 |
| Models | #Params | Gitlab | CMS | Map | OSS | Avg. SR | |
| Proprietary LLMs | |||||||
| GPT-4-Turbo | N/A | 10.5 | 16.7 | 14.3 | 36.7 | 13.3 | 17.6 |
| GPT-4o | N/A | 10.5 | 10.0 | 20.0 | 20.0 | 11.1 | 13.9 |
| Gemini-2.5-flash | N/A | 21.1 | 33.3 | 14.3 | 11.5 | 24.4 | 20.6 |
| Gemini-2.5-pro | N/A | 31.6 | 30.0 | 34.3 | 15.4 | 13.3 | 23.0 |
| Gemini-2.5-pro-SGO (ours) | N/A | 26.3 | 50.0 | 37.1 | 23.1 | 28.9 | 32.1 |
| Failure Mode | Gemini 2.5 Flash | Gemini 2.5 Pro | Gemini 2.5 SGO |
| Stuck Midway | 45.12 | 48.41 | 39.87 |
| Wrong Termination | 10.98 | 9.52 | 12.03 |
| Fail Attempt | 12.20 | 6.35 | 6.96 |
| Others | 10.37 | 11.11 | 8.86 |
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
| Website | User Intent | Generated Subgoals |
|---|---|---|
| Ask for product recommendations for running shoes within a budget of $100 in r/sports | 1. Navigate to the “r/sports” subreddit. 2. Initiate the creation of a new post. 3. Write a title and body asking for shoes under $100. 4. Submit the post. | |
| Like all submissions created by CameronKelsey in subreddit earthporn | 1. Navigate to the subreddit ‘earthporn’. 2. Search for posts by user ‘CameronKelsey’. 3. Click the ‘like‘ button on the first post. 4. Repeat for all other visible posts. | |
| Gitlab | Create a new public project “awesome-llms” and add primer, convexegg, abishek as members | 1. Navigate to new project creation page. 2. Enter “awesome-llms”, set visibility to public. 3. Finalize project creation. 4. Add primer, convexegg, and abishek in members page. |
| Display issues in kkroening and ffmpeg-python with labels related to questions | 1. Navigate to kkroening/ffmpeg-python repo. 2. Go to the “Issues” tab. 3. Open “Labels” filter menu. 4. Select label related to “questions”. | |
| Shopping Admin (CMS) | Tell me the grand total of invoice 000000002 | 1. Navigate to sales/invoices section. 2. Search for invoice 000000002. 3. Open details for the invoice. 4. Identify grand total amount. |
| Tell me the status of my latest order and when will it arrive | 1. Navigate to “My Account” or “Profile”. 2. Go to “Orders” or “Order History”. 3. Identify most recent order. 4. Extract status and estimated arrival date. |
| Method | Hyperparameter | Value |
| SFT | learning rate | |
| lr scheduler type | cosine | |
| warmup ratio | 0.1 | |
| batch size | 128 | |
| training epoch | 1 | |
| cutoff length | 16384 |
| 0.0 | 0.1 | 0.3 | 0.5 | 0.8 | |
| SR (%) | 30.9 | 31.5 | 36.4 | 28.5 | 25.5 |
| Rank Score ( ) | ||||
| PPL Range | Full Range | |||
| SR (%) | 27.9 | 36.4 | 23.6 | 29.1 |
Long-Horizon LLM Agents
Long-horizon large language model agents plan, use tools, and preserve task state across extended, multi-step interactions.
See all 429 papers