arXiv:2506.05672cs.LGcs.CL2025-06

让大模型根据上下文自动调整自身权重,无需额外提示。

Contextually Guided Transformers via Low-Rank Adaptation

  • 在每个位置维护上下文摘要,动态更新模型权重
  • 在上下文学习和语言建模任务上表现优于传统方法
  • 提升可解释性,适合需要快速适应的新场景

基于Transformer的大语言模型在文本处理中表现出色,但依赖显式提示来实现特定行为,带来计算开销。本文提出一种修改后的Transformer架构——上下文引导变压器(CGT),通过将上下文编码到模型权重中,消除对显式提示的需求。CGT在每个序列位置保持一个上下文摘要,能够根据前序内容实时更新权重,实现模型自我定制,为给定前缀后的信息处理生成专属模型。我们在合成的上下文学习任务和语言建模基准上验证了该方法的有效性。此外,我们引入技术增强学习到的上下文表示的可解释性,与变分自编码器建立联系,促进更平滑、一致的上下文编码。本工作为高效且可适应的语言建模提供了新方向,将上下文直接融入模型结构。

原文摘要 · Abstract (English)

Large Language Models (LLMs) based on Transformers excel at text processing, but their reliance on prompts for specialized behavior introduces computational overhead. We propose a modification to a Transformer architecture that eliminates the need for explicit prompts by learning to encode context into the model's weights. Our Contextually Guided Transformer (CGT) model maintains a contextual summary at each sequence position, allowing it to update the weights on the fly based on the preceding context. This approach enables the model to self-specialize, effectively creating a tailored model for processing information following a given prefix. We demonstrate the effectiveness of our method on synthetic in-context learning tasks and language modeling benchmarks. Furthermore, we introduce techniques for enhancing the interpretability of the learned contextual representations, drawing connections to Variational Autoencoders and promoting smoother, more consistent context encoding. This work offers a novel direction for efficient and adaptable language modeling by integrating context directly into the model's architecture.

大模型自适应上下文编码

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