Saved in:
Bibliographic Details
Main Authors: Shao, Jiaqi, Miao, Yufeng, Zhang, Wei, Luo, Bing
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2512.22733
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915696780247040
author Shao, Jiaqi
Miao, Yufeng
Zhang, Wei
Luo, Bing
author_facet Shao, Jiaqi
Miao, Yufeng
Zhang, Wei
Luo, Bing
contents Long-horizon reinforcement learning (RL) for large language models faces critical scalability challenges from unbounded context growth, leading to context folding methods that compress interaction history during task execution. However, existing approaches treat summary actions as standard actions, overlooking that summaries fundamentally modify the agent's future observation space, creating a policy-dependent, non-stationary observation distribution that violates core RL assumptions. This introduces three fundamental challenges: (1) gradient dilution where summary tokens receive insufficient training signal, (2) self-conditioning where policy updates change summary distributions, creating a vicious cycle of training collapse, and (3) computational cost from processing unique contexts at each turn. We introduce \textbf{FoldAct}\footnote{https://github.com/SHAO-Jiaqi757/FoldAct}, a framework that explicitly addresses these challenges through three key innovations: separated loss computation for independent gradient signals on summary and action tokens, full context consistency loss to reduce distribution shift, and selective segment training to reduce computational cost. Our method enables stable training of long-horizon search agents with context folding, addressing the non-stationary observation problem while improving training efficiency with 5.19$\times$ speedup.
format Preprint
id arxiv_https___arxiv_org_abs_2512_22733
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle FoldAct: Efficient and Stable Context Folding for Long-Horizon Search Agents
Shao, Jiaqi
Miao, Yufeng
Zhang, Wei
Luo, Bing
Machine Learning
Artificial Intelligence
Long-horizon reinforcement learning (RL) for large language models faces critical scalability challenges from unbounded context growth, leading to context folding methods that compress interaction history during task execution. However, existing approaches treat summary actions as standard actions, overlooking that summaries fundamentally modify the agent's future observation space, creating a policy-dependent, non-stationary observation distribution that violates core RL assumptions. This introduces three fundamental challenges: (1) gradient dilution where summary tokens receive insufficient training signal, (2) self-conditioning where policy updates change summary distributions, creating a vicious cycle of training collapse, and (3) computational cost from processing unique contexts at each turn. We introduce \textbf{FoldAct}\footnote{https://github.com/SHAO-Jiaqi757/FoldAct}, a framework that explicitly addresses these challenges through three key innovations: separated loss computation for independent gradient signals on summary and action tokens, full context consistency loss to reduce distribution shift, and selective segment training to reduce computational cost. Our method enables stable training of long-horizon search agents with context folding, addressing the non-stationary observation problem while improving training efficiency with 5.19$\times$ speedup.
title FoldAct: Efficient and Stable Context Folding for Long-Horizon Search Agents
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2512.22733