In-Context Compositional Learning via Sparse Coding Transformer
Not on the map. Why?
Abstract (arXiv)
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.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 35 of its 44 references that are in the map. First posted on arXiv 25 Nov 2025.
Builds on
35 of 44 references.
References · 35
- 2017Attention Is All You Needcited by 59,932
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
- 2021High-Resolution Image Synthesis with Latent Diffusion Modelscited by 18,694
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2023Segment Anythingcited by 8,158
- 2020Longformer: The Long-Document Transformercited by 3,362
- 2022Beyond the Imitation Game: Quantifying and extrapolating the capabilities of language modelscited by 1,970
- 2020Big Bird: Transformers for Longer Sequencescited by 1,673
- 2020Reformer: The Efficient Transformercited by 1,658
- 2020Rethinking Attention with Performerscited by 1,584
- 2020Linformer: Self-Attention with Linear Complexitycited by 1,462
- 2022Measuring and Narrowing the Compositionality Gap in Language Modelscited by 1,054
23 more
- 2020Efficient Transformers: A Surveycited by 784
- 2024DoRA: Weight-Decomposed Low-Rank Adaptationcited by 740
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
- 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 496
- 2020Efficient Content-Based Sparse Attention with Routing Transformerscited by 469
- 2022Language Models Are Greedy Reasoners: A Systematic Formal Analysis of Chain-of-Thoughtcited by 334
- 2023Function Vectors in Large Language Modelscited by 292
- 2019RAVEN: A Dataset for Relational and Analogical Visual rEasoNingcited by 225
- 2025OpenRubrics: Towards Scalable Synthetic Rubric Generation for Reward Modeling and LLM Alignmentcited by 118
- 2020Compositional Generalization in Semantic Parsing: Pre-training vs. Specialized Architecturescited by 95
- 2024BlendFilter: Advancing Retrieval-Augmented Large Language Models via Query Generation Blending and Knowledge Filteringcited by 29
- 2025LLMs Can Generate a Better Answer by Aggregating Their Own Responsescited by 27
- 2024Tuning Timestep-Distilled Diffusion Model Using Pairwise Sample Optimizationcited by 25
- 2022On the Compositional Generalization Gap of In-Context Learningcited by 24
- 2024RoseLoRA: Row and Column-wise Sparse Low-rank Adaptation of Pre-trained Language Model for Knowledge Editing and Fine-tuningcited by 20
- 2025Unlocking Efficient, Scalable, and Continual Knowledge Editing with Basis-Level Representation Fine-Tuningcited by 17
- 2024Attention as a Hypernetworkcited by 12
- 2024Large Convolutional Model Tuning via Filter Subspacecited by 11
- 2025RoseRAG: Robust Retrieval-augmented Generation with Small-scale LLMs via Margin-aware Preference Optimizationcited by 9
- 2024Learning to Customize Text-to-Image Diffusion In Diverse Contextcited by 5
- 2023Im-Promptu: In-Context Composition from Image Promptscited by 4
- 2025Coeff-Tuning: A Graph Filter Subspace View for Tuning Attention-Based Large Modelscited by 2
- 2025Sparse Fine-Tuning of Transformers for Generative Taskscited by 1
Built on by
Not cited yet.