arXiv:2605.05413cs.AI2026-05被引 3

让大模型代理用固定大小状态代替长历史,提升隐私与效率。

From History to State: Constant-Context Skill Learning for LLM Agents

论文配图:From History to State: Constant-Context Skill Learning for LLM Agents
图 1 · 摘自论文原文
  • 将重复任务的上下文转为可复用的模块权重,仅用紧凑状态块推理
  • 在ALFWorld等任务中,未见任务成功率超89%,提示词量减少2-7倍
  • 适合追求隐私保护和低延迟的本地部署智能助手场景

大型语言模型(LLM)代理正广泛用于浏览器、文件、代码和工具操作,是个人助手的理想选择。但个人代理面临隐私-成本-能力的权衡:云端模型执行多步流程效果好,却暴露敏感中间上下文;本地模型保隐私,但可靠性差。两者都因长技能提示和不断增长的历史而重复消耗资源。本文提出恒定上下文技能学习,一种将上下文转化为权重的框架:可复用的流程由轻量级任务族模块学习,推理时仅依赖当前观测和紧凑状态块。确定性追踪器从任务进度生成该状态块,并提供对齐的子目标奖励,使每个模块可通过步骤级监督微调(SFT)训练并在线强化学习(RL)优化。在ALFWorld、WebShop和SciWorld上,使用Qwen3-4B、Qwen3-8B和Llama-3.1-8B模型,表现优异。以Qwen3-8B为例,SFT+RL在未见任务中达到89.6%成功率(ALFWorld)、76.8%(WebShop)和66.4%(SciWorld)。性能匹配或超越已有先进结果,同时相比受控ReAct提示基线,每轮提示词数减少2–7倍,证明程序性上下文可从提示移入权重。

原文摘要 · Abstract (English)

Large language model (LLM) agents are increasingly used to operate browsers, files, code and tools, making personal assistants a natural deployment target. Yet personal agents face a privacy-cost-capability tension: cloud models execute multi-step workflows well but expose sensitive intermediate context to external APIs, while local models preserve privacy but remain less reliable. Both settings also pay repeatedly for long skill prompts and growing histories. We propose constant-context skill learning, a context-to-weights framework for recurring agent workflows: reusable procedures are learned in lightweight task-family modules, while inference conditions only on the current observation and a compact state block. A deterministic tracker renders this state block from task progress and supplies aligned subgoal rewards, so each module can be trained with step-level SFT and refined through online RL. Across ALFWorld, WebShop, and SciWorld, our agents achieve strong performance across Qwen3-4B, Qwen3-8B and Llama-3.1-8B. With Qwen3-8B, SFT+RL reaches 89.6\% unseen success on ALFWorld, 76.8\% success on WebShop, and 66.4\% unseen success on SciWorld. They match or exceed strong published agent-training results while reducing prompt tokens per turn by 2--7$\times$ relative to controlled ReAct prompting baselines, showing that procedural context can be moved from prompts into weights.

大模型代理技能学习上下文压缩隐私保护

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。