用动态树结构管理对话历史,提升复杂对话的连贯性与效率
Context-Agent: Dynamic Discourse Trees for Non-Linear Dialogue

- 将对话历史建模为可动态更新的树形结构,支持多话题并行处理
- 在长对话中实现更高任务完成率和更优的令牌使用效率
- 专为非线性对话设计评估基准,适合研究复杂交互的开发者
大型语言模型在诸多语言任务中表现优异,但在处理人类对话的非线性流动时仍面临根本挑战。当前普遍将对话历史视为扁平、线性的序列,这与自然话语内在的层次化和分支结构不匹配,导致上下文利用效率低下,长期交互中易丧失连贯性,尤其在话题切换或指令细化时更为明显。为此,我们提出 Context-Agent 框架,将多轮对话历史建模为动态树结构,模拟对话的固有非线性特征,使模型能够维护并导航对应不同话题的多个对话分支。此外,为支持稳健评估,我们构建了非线性任务多轮对话(NTM)基准,专门用于测试模型在长周期、非线性场景下的表现。实验表明,Context-Agent 在多种 LLM 上均提升了任务完成率并改善了令牌效率,凸显了结构化上下文管理对复杂动态对话的价值。代码与数据集已开源于 GitHub。
原文摘要 · Abstract (English)
Large Language Models demonstrate outstanding performance in many language tasks but still face fundamental challenges in managing the non-linear flow of human conversation. The prevalent approach of treating dialogue history as a flat, linear sequence is misaligned with the intrinsically hierarchical and branching structure of natural discourse, leading to inefficient context utilization and a loss of coherence during extended interactions involving topic shifts or instruction refinements. To address this limitation, we introduce Context-Agent, a novel framework that models multi-turn dialogue history as a dynamic tree structure. This approach mirrors the inherent non-linearity of conversation, enabling the model to maintain and navigate multiple dialogue branches corresponding to different topics. Furthermore, to facilitate robust evaluation, we introduce the Non-linear Task Multi-turn Dialogue (NTM) benchmark, specifically designed to assess model performance in long-horizon, non-linear scenarios. Our experiments demonstrate that Context-Agent enhances task completion rates and improves token efficiency across various LLMs, underscoring the value of structured context management for complex, dynamic dialogues. The dataset and code is available at GitHub.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。