arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2511.00413cs.LG
收藏

树训练:通过共享前缀重用加速代理LLM训练

Tree Training: Accelerating Agentic LLMs Training via Shared Prefix Reuse

Jinghui Wang, Shaojie Wang, Yinghan Cui, Xuxing Chen, Chao Wang, Liang Huang, Xiaojiang Zhang, Junyi Peng, Li Wan, Haotian Zhang, Bin Chen

AI总结:

本文提出Tree Training框架,通过DFS序列化和树分区策略,高效处理树状token轨迹,实现LLM训练速度提升6.2倍。

摘要:

代理大语言模型(LLM)训练常涉及多轮交互轨迹,因并发工具使用、思考模式、子代理、上下文管理等运行时设计而分支成多个执行路径。由此产生的token自然形成树状结构,而非线性序列。现有训练流水线将此类轨迹线性化并独立处理每个分支,导致正向和反向传递中出现大量冗余计算。本文推导出在所有分支上平均损失等同于每个token的加权损失,其中每个token的权重等于通过该token的分支比例。因此问题转化为精确计算前缀树中每个token的log概率,不重复计算共享前缀:本文提出DFS序列化树,确保每个token仅被访问一次,并适应全注意力和SSM层以确保最终log概率与独立分支计算完全一致。在实践中,单个轨迹树可能太大无法容纳在GPU内存中;因此提出树分区策略,一种内存高效的分隔策略,将树分割为每个子树都能容纳在GPU内存中,同时保持高前缀重用。这些贡献共同构成了Tree Training,一种高效的LLM训练框架,针对树状轨迹实现LLM训练,达到密集和MOE模型在监督微调和强化学习中的端到端训练速度提升6.2倍。

英文摘要:

Agentic large language model (LLM) training often involves multi-turn interaction trajectories that branch into multiple execution paths due to concurrent tool use, think-mode, sub-agent, context management and other runtime designs. As a result, the tokens produced by a single task naturally form a tree-structured token trajectory with shared prefixes, rather than a linear sequence. Existing training pipelines linearize such trajectories and treat each branch independently, leading to substantial redundant computation in both forward and backward passes. We derive that averaging the loss over all branches independently is algebraically identical to a per-token weighted loss, where each token's weight equals the fraction of branches passing through it. The problem therefore reduces to computing the log-probability of every token in the prefix tree exactly once, with no repeated computation across shared prefixes: we propose DFS serialization of the tree, which visits every token exactly once, and adapt full-attention and SSM layers to ensure the resulting log-probabilities match independent per-branch calculation exactly. In practice, a single trajectory tree can be too large to fit in GPU memory; we therefore propose Tree Partitioning, a memory-efficient partitioning strategy that splits the tree into subtrees each fitting within GPU memory while preserving high prefix reuse. Together, these contributions form Tree Training, an efficient framework for training LLMs on tree-structured trajectories, achieving up to 6.2x end-to-end training speedup on dense and MOE models for both supervised fine-tuning and reinforcement learning.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑