用连续隐状态让Transformer高效实现在线学习,比大模型更省力
Continuous Latent Contexts Enable Efficient Online Learning in Transformers

- 用少量隐状态令牌存储算法中间结果,实现在线决策
- 在长序列任务中表现超越更大更复杂的LLM,如Qwen-3-14B
- 适合需要持续适应反馈的交互式系统,如强化学习场景
大型语言模型具备强大的上下文学习能力:给定标注样本即可生成良好预测,无需参数更新。但在许多交互场景中,需求已超出静态预测,进入需长期多轮响应反馈的在线决策领域,高效算法必须使用紧凑的表示方式保存所学知识。近期,具有连续隐思维链的Transformer架构在离线迭代任务(如有向图可达性)中展现出潜力。受此启发,本文研究连续隐状态是否能有效支持Transformer实现在线学习。我们构造了固定深度的Transformer,通过将特征嵌入的线性组合作为状态表示,实现了加权多数算法与$Q$-learning两种基础在线决策方法。进一步,采用多课程目标训练一个类似GPT-2的小型变压器,不直接监督隐状态。在长合成在线预测序列上,该模型性能优于更大更复杂的模型,包括Qwen-3-14B和DeepSeek-V3。结果表明,连续隐状态为Transformer实现在线学习算法提供了简单而高效的持久状态。
原文摘要 · Abstract (English)
Large language models (LLMs) exhibit a strong capacity for in-context learning: Given labeled examples, they can generate good predictions without parameter updates. However, many interactive settings go beyond static prediction to online decision-making, in which effective behavior demands adaptation over long multi-turn horizons in response to feedback, and efficient algorithms in these domains must use compact representations of what they have learned. Recently, continuous transformer architectures with latent chain of thought have shown promise for offline iterative tasks such as directed graph-reachability. Motivated by this, we study whether continuous latent context tokens equip transformers to more effectively realize online learning. We give explicit constructions of constant-depth transformers that implement two foundational online decision-making procedures -- the weighted majority algorithm and $Q$-learning -- by storing their algorithmic state as linear combinations of feature embeddings, using a small number of latent context tokens. We further train a small GPT-2-style transformer with latent contexts using a multi-curriculum objective that does not directly supervise the latent states. On long synthetic online prediction sequences, this model outperforms larger and more complex LLMs, including Qwen-3-14B and DeepSeek-V3. Our results suggest that continuous latent contexts provide a simple and effective persistent state for transformers to implement online learning algorithms.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。