arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2511.20194cs.LG
收藏

基于稀疏编码的上下文组合学习变换器

In-Context Compositional Learning via Sparse Coding Transformer

Purdue University(普渡大学)

Wei Chen, Jingxi Yu, Zichen Miao, Qiang Qiu

AI总结:

本文提出基于稀疏编码的变换器,通过稀疏注意力机制提升组合学习任务的性能。

摘要:

变换器架构在语言、视觉和多模态任务中取得了显著成功,人们对它们解决上下文组合学习任务的需求也在增长。在这些任务中,模型通过从上下文示例中推断组合规则来解决目标问题,这些示例由基本组件组成,由底层规则结构化。然而,一些任务仍对变换器具有挑战性,因为它们并非天生设计用于处理组合任务,且提供有限的结构归纳偏置。在本工作中,受稀疏编码原则的启发,我们提出了一种重新表述注意力的方法,以增强其处理组合任务的能力。在稀疏编码中,数据被表示为稀疏组合的字典原子,系数捕捉其组合规则。具体来说,我们将注意力块重新解释为通过投影到两个学习字典原子集的映射:编码字典和解码字典。编码字典将输入分解为一组系数,这些系数代表输入的组合结构。为了增强结构化表示,我们对这些系数施加稀疏性。然后,这些稀疏系数用于线性组合解码字典原子以生成输出。此外,为了帮助组合泛化任务,我们提出估计目标问题的系数作为上下文示例中获得的系数的线性组合。我们在S-RAVEN和RAVEN数据集上展示了我们方法的有效性。对于某些组合泛化任务,我们的方法在标准变换器失败时仍能保持性能,这是因为其能够学习并应用组合规则。

英文摘要:

Transformer architectures have achieved remarkable success across language, vision, and multimodal tasks, and there is growing demand for them to address in-context compositional learning tasks. In these tasks, models solve the target problems by inferring compositional rules from context examples, which are composed of basic components structured by underlying rules. However, some of these tasks remain challenging for Transformers, which are not inherently designed to handle compositional tasks and offer limited structural inductive bias. In this work, inspired by the principle of sparse coding, we propose a reformulation of the attention to enhance its capability for compositional tasks. In sparse coding, data are represented as sparse combinations of dictionary atoms with coefficients that capture their compositional rules. Specifically, we reinterpret the attention block as a mapping of inputs into outputs through projections onto two sets of learned dictionary atoms: an encoding dictionary and a decoding dictionary. The encoding dictionary decomposes the input into a set of coefficients, which represent the compositional structure of the input. To enhance structured representations, we impose sparsity on these coefficients. The sparse coefficients are then used to linearly combine the decoding dictionary atoms to generate the output. Furthermore, to assist compositional generalization tasks, we propose estimating the coefficients of the target problem as a linear combination of the coefficients obtained from the context examples. We demonstrate the effectiveness of our approach on the S-RAVEN and RAVEN datasets. For certain compositional generalization tasks, our method maintains performance even when standard Transformers fail, owing to its ability to learn and apply compositional rules.

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

↑