Retrievit: In-context Retrieval Capabilities of Transformers, State Space Models, and Hybrid Architectures
Georgios Pantazopoulos, Malvina Nikandrou, Ioannis Konstas, Alessandro Suglia

TL;DR
This paper compares Transformers, State Space Models, and hybrid architectures for in-context retrieval tasks, revealing their strengths, limitations, and emergent properties through controlled experiments and analysis.
Contribution
It introduces a comprehensive evaluation of hybrid models combining Transformers and SSMs for retrieval, highlighting their performance and representation differences.
Findings
Hybrid models outperform SSMs and match/exceed Transformers in data efficiency.
Transformers excel in position retrieval tasks.
SSMs develop locality-aware embeddings, forming interpretable structures.
Abstract
Transformers excel at in-context retrieval but suffer from quadratic complexity with sequence length, while State Space Models (SSMs) offer efficient linear-time processing but have limited retrieval capabilities. We investigate whether hybrid architectures combining Transformers and SSMs can achieve the best of both worlds on two synthetic in-context retrieval tasks. The first task, n-gram retrieval, requires the model to identify and reproduce an n-gram that succeeds the query within the input sequence. The second task, position retrieval, presents the model with a single query token and requires it to perform a two-hop associative lookup: first locating the corresponding element in the sequence, and then outputting its positional index. Under controlled experimental conditions, we assess data efficiency, length generalization, robustness to out of domain training examples, and…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsTopic Modeling · Multimodal Machine Learning Applications · Machine Learning in Healthcare
