Introduction
In-Context Learning (ICL) allows large language models to solve novel tasks through prompt-based examples without explicit weight updates. While Transformers have demonstrated remarkable proficiency in ICL, the rapid evolution of architectural designs—such as the adoption of RMSNorm and Rotary Positional Embeddings (RoPE) in Llama, or the emergence of non-Transformer architectures like Mamba—has outpaced our systematic understanding of their impact on ICL. This paper investigates whether these modern architectural "improvements" facilitate or hinder a model's ability to learn in-context, identifying the specific inductive biases introduced by different components.
Methods
To isolate the effects of specific design choices, we constructed a modular framework consisting of 12 distinct models, including three baselines and nine hybrids. The variations focused on three primary axes: positional embeddings (Absolute, RoPE, or None), feed-forward networks (GELU MLP, SwiGLU, or Mamba Mixer), and normalization schemes (LayerNorm vs. RMSNorm).
Performance was quantified using a novel ICL regression score. This metric evaluates a model's error across varying context lengths relative to a "zero estimator" baseline, normalized against standard statistical benchmarks such as Least Squares or LASSO.
Experimental Setup
Models were evaluated on a suite of synthetic tasks designed to isolate algorithmic reasoning capabilities:
- Linear & Sparse Linear Regression: Testing weight identification in noisy or sparse systems.
- 2-Layer MLP & Decision Trees: Assessing the ability to learn non-linear, hierarchical functions.
- Sparse Parity: A logic-heavy task requiring the identification of specific bits that determine output.
- Vector Multi-Query Associative Recall (MQAR): Specifically designed to test dense retrieval and memory capabilities.
Results and Discussion
The "RMSNorm Trap" and Architectural Failures
A significant finding was the catastrophic failure of certain hybrids on specific tasks. Most notably, replacing standard LayerNorm with RMSNorm in GPT-2 architectures led to a near-total inability to solve Decision Tree tasks. While the baseline GPT-2 achieved a perfect ICL regression score of 1.0, the RMSNorm variant dropped to 0.114, suggesting that certain normalization schemes interfere with the representation of branching logic.
Suboptimal Convergence and "Learning to Escape"
Models often converged on suboptimal "good enough" algorithms. In Sparse Linear Regression, several GPT-2 hybrids initially settled for a standard Least Squares solution, failing to exploit the data's sparsity. However, models utilizing SwiGLU demonstrated a capacity to "escape" these local minima over extended training periods, eventually unlearning the general solution in favor of the optimal sparse (LASSO) approach.
Mamba’s Memory Bottleneck
While Mamba architectures offer efficiency, they struggled significantly with the Vector MQAR task and showed lower training efficiency on Decision Trees. This reinforces the hypothesis that explicit attention mechanisms remain superior for tasks requiring dense associative recall and complex hierarchical reasoning within the 500k-step training window used in this study.
Conclusion
Our results indicate that Llama-style hybrids (incorporating RoPE and SwiGLU) are generally robust, while other popular modifications like RMSNorm can introduce unexpected failures in specific reasoning domains. These findings highlight that ICL capability is not a guaranteed byproduct of scale but is deeply influenced by architectural inductive biases. Future work will explore whether these biases persist in multi-billion parameter models trained on natural language and whether extended training horizons allow models to overcome initial algorithmic suboptimality.
Summary updated