Can Custom Models Learn In-Context? An Exploration of Hybrid Architecture Performance on In-Context Learning Tasks

Ryan Campbell, Nelson Lojo, Kesava Viswanadha, Christoffer Grondal Tryggestad, Derrick Han Sun +3 more
11/6/2024
cs.LGcs.AI

No official code found. Best implementation: in-context-learning-2024/in-context (6 stars, last commit 2024-08-13).

Abstract

In-Context Learning (ICL) is a phenomenon where task learning occurs through a prompt sequence without the necessity of parameter updates. ICL in Multi-Headed Attention (MHA) with absolute positional embedding has been the focus of more study than other sequence model varieties. We examine implications of architectural differences between GPT-2 and LLaMa as well as LlaMa and Mamba. We extend work done by Garg et al. (2022) and Park et al. (2024) to GPT-2/LLaMa hybrid and LLaMa/Mamba hybrid models - examining the interplay between sequence transformation blocks and regressive performance in-context. We note that certain architectural changes cause degraded training efficiency/ICL accuracy by converging to suboptimal predictors or converging slower. We also find certain hybrids showing optimistic performance improvements, informing potential future ICL-focused architecture modifications. Additionally, we propose the "ICL regression score", a scalar metric describing a model's whole performance on a specific task. Compute limitations impose restrictions on our architecture-space, training duration, number of training runs, function class complexity, and benchmark complexity. To foster reproducible and extensible research, we provide a typed, modular, and extensible Python package on which we run all experiments.

View on arXivView PDF

Code Implementations(1)

62Python, Jupyter NotebookFeb 8, 20242 years ago

Similar Papers

Cite this paper

@article{campbell2024custom,
  title  = {Can Custom Models Learn In-Context? An Exploration of Hybrid Architecture Performance on In-Context Learning Tasks},
  author = {Ryan Campbell and Nelson Lojo and Kesava Viswanadha and Christoffer Grondal Tryggestad and Derrick Han Sun and Sriteja Vijapurapu and August Rolfsen and Anant Sahai},
  year   = {2024},
  eprint = {2411.03945},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2411.03945v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2411.03945.svg)](https://codeofpaper.com/paper/2411.03945)

Discussion