让手机上的大模型高效处理多轮任务,不重复计算。
CIFLEX: Contextual Instruction Flow for Sub-task Execution in Multi-Turn Interactions with a Single On-Device LLM
- 用缓存复用主任务上下文,仅注入任务指令到独立路径。
- 实验显示计算量大幅降低,任务表现无下降。
- 适合资源受限设备上复杂对话系统的部署。
我们提出CIFLEX(上下文指令流),一种用于单设备大语言模型多轮交互中高效子任务执行的新系统。随着大模型能力增强,单一模型需处理多样子任务以更全面响应用户请求。传统方法在主任务与子任务间切换时重复处理全部对话上下文(如查询重写、摘要生成),带来显著计算开销。CIFLEX通过复用主任务的键值缓存(KV cache),仅将特定任务指令注入隔离的侧路径,子任务完成后通过缓存上下文回滚至主路径,避免冗余预填充计算。为支持子任务选择,我们还设计了一种适配小规模模型的分层分类策略,将多选决策分解为二元判断。实验表明,CIFLEX显著降低计算成本且不降低任务性能,实现设备端可扩展、高效的多任务对话。
原文摘要 · Abstract (English)
We present CIFLEX (Contextual Instruction Flow for Sub-task Execution), which is a novel execution system for efficient sub-task handling in multi-turn interactions with a single on-device large language model (LLM). As LLMs become increasingly capable, a single model is expected to handle diverse sub-tasks that more effectively and comprehensively support answering user requests. Naive approach reprocesses the entire conversation context when switching between main and sub-tasks (e.g., query rewriting, summarization), incurring significant computational overhead. CIFLEX mitigates this overhead by reusing the key-value (KV) cache from the main task and injecting only task-specific instructions into isolated side paths. After sub-task execution, the model rolls back to the main path via cached context, thereby avoiding redundant prefill computation. To support sub-task selection, we also develop a hierarchical classification strategy tailored for small-scale models, decomposing multi-choice decisions into binary ones. Experiments show that CIFLEX significantly reduces computational costs without degrading task performance, enabling scalable and efficient multi-task dialogue on-device.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。