Provable In-Context Vector Arithmetic via Retrieving Task Concepts

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Bu, Dake, Huang, Wei, Han, Andi, Nitanda, Atsushi, Zhang, Qingfu, Wong, Hau-San, Suzuki, Taiji
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866911103721668608
author Bu, Dake
Huang, Wei
Han, Andi
Nitanda, Atsushi
Zhang, Qingfu
Wong, Hau-San
Suzuki, Taiji
author_facet Bu, Dake
Huang, Wei
Han, Andi
Nitanda, Atsushi
Zhang, Qingfu
Wong, Hau-San
Suzuki, Taiji
contents In-context learning (ICL) has garnered significant attention for its ability to grasp functions/tasks from demonstrations. Recent studies suggest the presence of a latent task/function vector in LLMs during ICL. Merullo et al. (2024) showed that LLMs leverage this vector alongside the residual stream for Word2Vec-like vector arithmetic, solving factual-recall ICL tasks. Additionally, recent work empirically highlighted the key role of Question-Answer data in enhancing factual-recall capabilities. Despite these insights, a theoretical explanation remains elusive. To move one step forward, we propose a theoretical framework building on empirically grounded hierarchical concept modeling. We develop an optimization theory, showing how nonlinear residual transformers trained via gradient descent on cross-entropy loss perform factual-recall ICL tasks via vector arithmetic. We prove 0-1 loss convergence and show the strong generalization, including robustness to concept recombination and distribution shifts. These results elucidate the advantages of transformers over static embedding predecessors. Empirical simulations corroborate our theoretical insights.
format Preprint
id arxiv_https___arxiv_org_abs_2508_09820
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Provable In-Context Vector Arithmetic via Retrieving Task Concepts
Bu, Dake
Huang, Wei
Han, Andi
Nitanda, Atsushi
Zhang, Qingfu
Wong, Hau-San
Suzuki, Taiji
Machine Learning
Artificial Intelligence
In-context learning (ICL) has garnered significant attention for its ability to grasp functions/tasks from demonstrations. Recent studies suggest the presence of a latent task/function vector in LLMs during ICL. Merullo et al. (2024) showed that LLMs leverage this vector alongside the residual stream for Word2Vec-like vector arithmetic, solving factual-recall ICL tasks. Additionally, recent work empirically highlighted the key role of Question-Answer data in enhancing factual-recall capabilities. Despite these insights, a theoretical explanation remains elusive. To move one step forward, we propose a theoretical framework building on empirically grounded hierarchical concept modeling. We develop an optimization theory, showing how nonlinear residual transformers trained via gradient descent on cross-entropy loss perform factual-recall ICL tasks via vector arithmetic. We prove 0-1 loss convergence and show the strong generalization, including robustness to concept recombination and distribution shifts. These results elucidate the advantages of transformers over static embedding predecessors. Empirical simulations corroborate our theoretical insights.
title Provable In-Context Vector Arithmetic via Retrieving Task Concepts
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2508.09820