Gradient-free Task-Conditioned Retrieval for On-Device In-Context Learning
摘要
This paper proposes CoRA, a gradient-free framework for task-conditioned retrieval in on-device in-context learning, using frozen encoders and closed-form ridge regression to build compact retrieval bases without fine-tuning or backpropagation.
查看缓存全文
缓存时间: 2026/07/31 10:02
# Gradient-free Task-Conditioned Retrieval for On-Device In-Context Learning
Source: [https://arxiv.org/html/2607.27766](https://arxiv.org/html/2607.27766)
\\correspondingauthor
###### Abstract\.
On\-device in\-context learning \(ICL\) relies on pre\-inference retrieval to select demonstrations for useful context before downstream model inference\. This retrieval must exploit task\-specific information while operating over local memories under limited computation, memory, and data\-exposure budgets\. We propose*Conditional Retrieval Alignment*\(CoRA\), a gradient\-free framework that converts a frozen encoder into a task\-conditioned retriever using paired candidate inputs and outputs\. CoRA selects complementary encoder layers, constructs an output\-derived conditioning space from candidate memory, and aligns candidate input representations to this space through closed\-form ridge regression\. Low\-rank factorization then produces a compact retrieval basis where candidate outputs are used only during offline index construction, whereas query\-time retrieval requires only the query input and precomputed index\. We show that CoRA’s rank\-constrained basis is the optimal low\-rank compression of the output\-conditioned fitted representation, and derive an exact two\-pass streaming construction that avoids materializing the full fitted matrix\. We further extend the framework to multimodal exemplar retrieval by incorporating visual representations into the conditioning and retrieval spaces\. Experiments across ten textual datasets and four multimodal benchmarks with Llama\-3\.2\-1B, MobileLLM\-Pro, OpenFlamingo\-3B, and Qwen3\.5\-2B, as well as end\-to\-end Raspberry Pi 5 deployment demonstrate that CoRA supports effective task\-conditioned retrieval without retriever fine\-tuning, backpropagation, or target\-model calls\.
††ccs:Information systems Query representation††ccs:Information systems Learning to rank††ccs:Information systems Retrieval efficiency††ccs:Information systems Top\-k retrieval in databases††ccs:Information systems Retrieval on mobile devices††ccs:Information systems Question answering## 1\.Introduction
Foundation models are increasingly deployed in settings that require efficient adaptation to diverse downstream tasks and user needs\(Kuduguntaet al\.,[2024](https://arxiv.org/html/2607.27766#bib.bib71); Linet al\.,[2020](https://arxiv.org/html/2607.27766#bib.bib70); Zhanget al\.,[2024](https://arxiv.org/html/2607.27766#bib.bib69)\)\. One lightweight adaptation mechanism is*test\-time context construction*: a retriever selects a small set of textual or multimodal exemplars from a candidate pool to condition a model through in\-context learning \(ICL\)\(Brownet al\.,[2020](https://arxiv.org/html/2607.27766#bib.bib2); Dinget al\.,[2024](https://arxiv.org/html/2607.27766#bib.bib44); OpenClaw contributors,[2026](https://arxiv.org/html/2607.27766#bib.bib45); Zhaoet al\.,[2026](https://arxiv.org/html/2607.27766#bib.bib1)\)\. Because this selection occurs before the downstream model is invoked, we refer to it as*pre\-inference retrieval*\. Retrieval quality can affect the utility and efficiency of ICL\(Anet al\.,[2023](https://arxiv.org/html/2607.27766#bib.bib3); Luet al\.,[2022](https://arxiv.org/html/2607.27766#bib.bib8); Voronovet al\.,[2024](https://arxiv.org/html/2607.27766#bib.bib46); Zhouet al\.,[2024](https://arxiv.org/html/2607.27766#bib.bib9)\)\. The problem is particularly relevant in personal and on\-device deployments, where retrieval is performed over local memories containing potentially sensitive information and must operate under limited compute and memory budgets\(Gaoet al\.,[2024](https://arxiv.org/html/2607.27766#bib.bib73); Shaoet al\.,[2024](https://arxiv.org/html/2607.27766#bib.bib72); Sunet al\.,[2024](https://arxiv.org/html/2607.27766#bib.bib48); Wanget al\.,[2023](https://arxiv.org/html/2607.27766#bib.bib47); Zhanget al\.,[2023](https://arxiv.org/html/2607.27766#bib.bib76)\)\. In this setting, practical retrieval systems must jointly consider the quality of selected exemplars, the cost of constructing their representations and index, and the latency of query\-time search\(Leonhardtet al\.,[2024](https://arxiv.org/html/2607.27766#bib.bib78)\)\.
The central difficulty is that input similarity alone does not fully determine the utility of an ICL exemplar\. Useful demonstrations should be related to the query while also reflecting task\-specific regularities in their input\-output relations\(Huanget al\.,[2024](https://arxiv.org/html/2607.27766#bib.bib49); Liet al\.,[2025](https://arxiv.org/html/2607.27766#bib.bib43); Rubinet al\.,[2022](https://arxiv.org/html/2607.27766#bib.bib4)\)\. Existing approaches address this requirement in two main ways\. One line adapts the retriever or representation space using task\-specific learning signals\(Dovehet al\.,[2024](https://arxiv.org/html/2607.27766#bib.bib42); Yeet al\.,[2023](https://arxiv.org/html/2607.27766#bib.bib5); Zhaoet al\.,[2024a](https://arxiv.org/html/2607.27766#bib.bib37)\)\. Another involves a stronger target model through rewriting, reranking, pseudo\-labeling, or target\-guided retrieval\(Chenet al\.,[2025a](https://arxiv.org/html/2607.27766#bib.bib39); Liet al\.,[2023](https://arxiv.org/html/2607.27766#bib.bib6)\)\. These approaches can capture task\-specific behavior, but their training procedures, repeated model calls, or backbone modifications may be difficult to accommodate when retrieval must remain local\. By contrast, lightweight retrievers such as BM25\(Robertsonet al\.,[1995](https://arxiv.org/html/2607.27766#bib.bib15)\)and frozen embedding similarity offer inexpensive search and compact representations\(Lin and Lin,[2023](https://arxiv.org/html/2607.27766#bib.bib77); Zhaoet al\.,[2024b](https://arxiv.org/html/2607.27766#bib.bib80)\), but they primarily rely on input\-side similarity and do not explicitly use the output regularities available in paired candidate memories\(Alayracet al\.,[2022](https://arxiv.org/html/2607.27766#bib.bib40); Anet al\.,[2023](https://arxiv.org/html/2607.27766#bib.bib3); Chenet al\.,[2025b](https://arxiv.org/html/2607.27766#bib.bib41); Liuet al\.,[2022](https://arxiv.org/html/2607.27766#bib.bib11)\)\. This leaves an open design tension between task\-conditioned exemplar selection and efficient local retrieval\.
To understand this tension, our prior conference work\(Liuet al\.,[2025b](https://arxiv.org/html/2607.27766#bib.bib10)\)analyzed the mechanisms underlying learning\-based demonstration selection\. We found that their effectiveness can be related to two complementary signals: multi\-level input similarity, which captures different types of lexical, syntactic, and semantic correspondence, and task\-specific output similarity, which favors exemplars whose outputs are related to the desired task behavior\. Based on these findings, that work introduced MLSM, which selects representative encoder layers and combines their task\-agnostic similarity signals through lightweight optimization, and TTF, which injects task\-specific information through retriever parameter updates\. These methods established the importance of the two signals, but addressed them separately\. MLSM does not explicitly condition its retrieval space on exemplar outputs, whereas TTF obtains task\-specific information through parameter updates\. The conference work therefore leaves open whether input\-output information can be incorporated directly into a compact retrieval space without heavy retriever fine\-tuning or target\-model involvement\.
This article addresses this question with*Conditional Retrieval Alignment*\(CoRA\), a gradient\-free framework for task\-conditioned exemplar retrieval\. CoRA selects complementary frozen\-encoder layers, aligns their candidate\-input representations to a conditioning space constructed from paired candidate inputs and outputs, and extracts a compact low\-rank retrieval basis through closed\-form linear algebra\. Candidate outputs are used only when constructing the index\. Query\-time retrieval requires only the query input representation and the precomputed index\. CoRA thus makes output\-informed exemplar selection compatible with local pre\-inference retrieval, without retriever parameter updates, backpropagation, or target\-model calls\. CoRA further admits an exact streaming index\-construction procedure that avoids materializing the full fitted representation matrix, and it extends naturally to multimodal retrieval by incorporating visual features into the conditioning and retrieval spaces\.
Our contributions are as follows:
- •We introduce CoRA, a gradient\-free task\-conditioned retrieval framework that uses paired candidate memories to align multi\-level frozen input representations with output\-derived structure and derive a compact low\-rank retrieval basis in closed form, thereby enabling task\-conditioned demonstration selection without retriever fine\-tuning or target\-model interaction\.
- •We derive an exact two\-pass streaming realization of CoRA and characterize its construction\-time working\-memory cost\. The procedure separates offline output\-conditioned index construction from lightweight query\-time projection and nearest\-neighbor search, supporting local deployment over growing candidate pools\.
- •We develop CoRA\-M, which extends the framework to multimodal exemplar retrieval by incorporating visual candidate representations into the output\-conditioned alignment while retaining the text\-layer selection mechanism, enabling a unified retrieval formulation across text\-only and visual\-language tasks\.
- •We evaluate retrieval effectiveness, construction efficiency, and deployment behavior across ten textual datasets, four multimodal benchmarks, and an end\-to\-end Raspberry Pi 5 retrieval\-and\-inference pipeline\.
#### Organization\.
Section[2](https://arxiv.org/html/2607.27766#S2)reviews related work and clarifies the relationship to our preliminary conference study\. Section[3](https://arxiv.org/html/2607.27766#S3)presents CoRA’s textual and multimodal formulations and analyzes its low\-rank retrieval basis\. Section[4](https://arxiv.org/html/2607.27766#S4)derives the streaming index\-construction procedure and discusses hardware compatibility\. Section[5](https://arxiv.org/html/2607.27766#S5)reports the experimental setup, results, and analyses\. Section[6](https://arxiv.org/html/2607.27766#S6)concludes the article and discusses its limitations\.
## 2\.Related Work
### 2\.1\.Exemplar Retrieval for Textual In\-Context Learning
Textual exemplar retrieval builds on lexical and dense relevance matching\. BM25\(Robertsonet al\.,[1995](https://arxiv.org/html/2607.27766#bib.bib15)\)ranks candidates according to lexical overlap, whereas pretrained\-language\-model\-based dense retrieval represents queries and candidates in a latent semantic space\.Zhaoet al\.\([2024b](https://arxiv.org/html/2607.27766#bib.bib80)\)organize dense retrieval methods along four dimensions: architecture, training, indexing, and integration with other retrieval signals\. DHR combines dense lexical and semantic representations for more efficient hybrid retrieval\(Lin and Lin,[2023](https://arxiv.org/html/2607.27766#bib.bib77)\)\. These methods provide relevance matching, but do not directly model whether a retrieved example is useful as an ICL demonstration\.
ICL\-specific methods adapt retrieval to demonstration selection\. KATE\(Liuet al\.,[2022](https://arxiv.org/html/2607.27766#bib.bib11)\)retrieves nearest neighbors using sentence representations, showing that semantically related demonstrations outperform random selection\. Skill\-KNN\(Anet al\.,[2023](https://arxiv.org/html/2607.27766#bib.bib3)\)prompts a language model to describe skills required by candidate inputs and test queries, then retrieves demonstrations using these descriptions\. This reduces sensitivity to task\-irrelevant surface features without fine\-tuning, but requires an additional generation stage and does not use candidate\-memory outputs\.
Learning\-based methods obtain stronger task signals from downstream model behavior\. EPR\(Rubinet al\.,[2022](https://arxiv.org/html/2607.27766#bib.bib4)\)uses the language\-model likelihood of the gold output to label candidate prompts as positive or negative, and trains a dense retriever on the resulting supervision\. CEIL\(Yeet al\.,[2023](https://arxiv.org/html/2607.27766#bib.bib5)\)models demonstration selection as a subset problem using a conditional determinantal point process, thereby accounting for both query relevance and interactions among selected examples\. UDR\(Liet al\.,[2023](https://arxiv.org/html/2607.27766#bib.bib6)\)unifies supervision from heterogeneous tasks through multi\-task list\-wise ranking and iterative candidate mining\. These methods capture richer notions of demonstration utility than fixed input similarity, but require language\-model\-derived supervision, retriever training, or both, thereby increasing offline data\-construction and optimization costs\.
### 2\.2\.Exemplar Retrieval for Multimodal In\-Context Learning
Multimodal ICL requires a VLM to process prompts containing interleaved images, textual inputs, and outputs\. Flamingo\(Alayracet al\.,[2022](https://arxiv.org/html/2607.27766#bib.bib40)\)established the effectiveness of interleaved multimodal demonstrations across vision\-language tasks\.Dovehet al\.\([2024](https://arxiv.org/html/2607.27766#bib.bib42)\)introduce a curriculum\-based ICL instruction\-tuning approach that improves a VLM’s ability to follow multimodal demonstrations\. MMICL\(Zhaoet al\.,[2024a](https://arxiv.org/html/2607.27766#bib.bib37)\)develops a multimodal context scheme and instruction\-tuning dataset for prompts containing multiple images\. These methods primarily improve how the downstream model consumes multimodal demonstrations rather than how a standalone retriever selects them\.
Retrieval methods determine which multimodal demonstrations to include in the prompt\. MMICES\(Chenet al\.,[2025b](https://arxiv.org/html/2607.27766#bib.bib41)\)first filters candidate demonstrations according to visual similarity and then ranks them using language similarity\. TACO\(Liet al\.,[2025](https://arxiv.org/html/2607.27766#bib.bib43)\)interprets each demonstration as a local task mapping and configures demonstration sequences that support a coherent global mapping for the query\.Chenet al\.\([2025a](https://arxiv.org/html/2607.27766#bib.bib39)\)formulate selection as an exploration\-exploitation process, using VLM\-derived rewards and policy\-gradient optimization to learn demonstration combinations\. These approaches demonstrate the value of cross\-modal and set\-level selection, but depend on fixed fusion strategies, learned selection modules, or repeated downstream\-model interaction\.
Privacy is an additional concern when visual and textual retrieval data contain user\-specific information\.Zhanget al\.\([2023](https://arxiv.org/html/2607.27766#bib.bib76)\)proactively transform cross\-modal data into adversarially protected versions before release, causing malicious retrieval models to produce erroneous retrieval results on the protected data\. Our setting considers privacy at a different stage of the retrieval pipeline: paired memories and their representations remain on device, and retrieval is performed locally without transferring them to an external service\. These approaches respectively protect data intended for release and reduce data exposure through local storage and computation\.
### 2\.3\.On\-Device Retrieval and Index Efficiency
Resource\-constrained retrieval must account for representation computation, index storage and maintenance, and query\-time ranking\. Fast\-Forward indexes\(Leonhardtet al\.,[2024](https://arxiv.org/html/2607.27766#bib.bib78)\)combine precomputed representations, lightweight encoders, lexical\-semantic score interpolation, and index\-reduction techniques to support low\-latency neural reranking without GPU acceleration\. Although developed for document ranking, this separation between offline representation construction and online scoring is also relevant to on\-device exemplar retrieval\.
On\-device retrieval has also been studied in retrieval\-augmented generation, where stored representations and generation contexts compete for limited memory\. ECG models\(Killingbacket al\.,[2026](https://arxiv.org/html/2607.27766#bib.bib74)\)use shared representations for document retrieval, context compression, and response generation\. Our setting instead retrieves input\-output ICL demonstrations and uses stored outputs to condition a frozen input representation space\. It must therefore consider task\-conditioned index construction in addition to query\-time nearest\-neighbor search\.
### 2\.4\.Relationship to Our Preliminary Conference Work
Our preliminary conference work\(Liuet al\.,[2025b](https://arxiv.org/html/2607.27766#bib.bib10)\)investigated which similarity signals are acquired by learning\-based demonstration retrievers\. It formulated and empirically examined two hypotheses:
- •H1:a learning\-based retriever adaptively integrates task\-agnostic input similarities encoded at different representational levels;
- •H2:beyond input similarity, a learning\-based retriever implicitly favors demonstrations whose outputs are similar to the unknown output associated with the test query\.
H1 was examined by comparing the retrieval behavior of different pretrained encoder layers and measuring their CKA similarity to the final representations of pretrained retrievers\. H2 was examined by comparing the output similarities of positive and negative training examples and of demonstrations selected by learned and task\-agnostic retrievers\.
The conference work introduced MLSM and TTF as separate realizations of these hypotheses\. MLSM addresses H1 while keeping the underlying BERT encoder frozen\. It first computes pairwise CKA scores among encoder layers on an unlabeled subset of the demonstration set, clusters the resulting layer\-similarity profiles withkk\-means, and selects the central layer from each cluster as a representative similarity expert\. For a query, each selected layer produces a temperature\-scaled distribution over a sampled set of candidate demonstrations according to cosine similarity\. MLSM then aggregates these distributions with normalized layer weights, which are optimized on a sampled validation set by minimizing an agreement loss between the aggregated and layer\-wise distributions, with early stopping\. The weights may be estimated for an individual query or updated using a batch of queries\. MLSM therefore combines complementary input\-side similarities, but neither candidate outputs nor target\-task labels enter its retrieval objective\.
TTF addresses H2 through task\-specific retriever adaptation\. It fine\-tunes a retriever jointly with an auxiliary prediction module using labeled examples from the target demonstration set\. For classification tasks, the auxiliary module is a classification head\. The retrieval representation is trained to support label prediction, such that examples associated with the same output are encouraged to be close to the corresponding label\-specific classifier representation\. For generation tasks, TTF adopts an encoder–decoder architecture, where the decoder supplies sequence\-generation supervision and average\-pooled final\-layer encoder representations are used for retrieval\. This supervision jointly shapes the predictive module and the retrieval representation\. Thus, TTF injects task\-specific input\-output relations into the retriever through gradient\-based parameter fine\-tuning\.
Although MLSM and TTF validated the complementary roles of multi\-level input similarity and output\-related task information, they treated these signals separately\. MLSM requires query\- or batch\-level weight optimization and remains output\-agnostic, whereas TTF obtains task specificity through labeled fine\-tuning of the retriever\. The conference study was also limited to textual retrieval and did not address compact index construction, multimodal conditioning, or end\-to\-end deployment under edge resource constraints\.
## 3\.Methodology
### 3\.1\.Problem Setup and Preliminaries
#### On\-device Exemplar Retrieval for ICL
We consider exemplar retrieval as a local pre\-inference operation performed before invoking the downstream model in on\-device ICL\. Given a test input𝐱t\\mathbf\{x\}^\{t\}and a local candidate pool𝒟=\{\(𝐱ic,𝐲ic\)\}i=1n\\mathcal\{D\}=\\\{\(\\mathbf\{x\}\_\{i\}^\{c\},\\mathbf\{y\}\_\{i\}^\{c\}\)\\\}\_\{i=1\}^\{n\}of input\-output pairs, the goal is to select a subset𝒮\(𝐱t\)⊆𝒟\\mathcal\{S\}\(\\mathbf\{x\}^\{t\}\)\\subseteq\\mathcal\{D\}with\|𝒮\(𝐱t\)\|=k≪n\|\\mathcal\{S\}\(\\mathbf\{x\}^\{t\}\)\|=k\\ll nthat best supports the downstream large modelℳ\\mathcal\{M\}for the target query\. The retrieved exemplars are then combined with𝐱t\\mathbf\{x\}^\{t\}to form the promptp\(𝐱t,𝒮\)p\(\\mathbf\{x\}^\{t\},\\mathcal\{S\}\), which is provided to the downstream model to produce𝐲t=ℳ\(p\(𝐱t,𝒮\)\)\\mathbf\{y\}^\{t\}=\\mathcal\{M\}\(p\(\\mathbf\{x\}^\{t\},\\mathcal\{S\}\)\)\.
The retriever has access to a frozen pretrained encoderffon device\. Here,𝐱\\mathbf\{x\}denotes either a textual input or, more generally, a multimodal instance\. We use*gradient\-free*to mean that CoRA performs no gradient\-based retriever optimization\. The method nevertheless conducts task\-conditioned adaptation by constructing a retrieval basis in closed\-form from paired candidate memory\. It does not backpropagate throughℳ\\mathcal\{M\}or invoke the target model during index construction or exemplar selection\. All retrieval computations run locally under the available memory and latency budgets\. We first present the textual formulation and subsequently extend it to multimodal retrieval\.
#### Layerwise Representations as Retrieval Anchors\.
Probing studies on pretrained transformers have shown that linguistic information is distributed hierarchically across layers, with lower layers capturing surface\-level cues, middle layers encoding syntactic regularities, and upper layers emphasizing higher\-level semantics\(Jawaharet al\.,[2019](https://arxiv.org/html/2607.27766#bib.bib12); Maet al\.,[2019](https://arxiv.org/html/2607.27766#bib.bib13)\)\. Recent analyses of dense retrieval further suggest that retrieval effectiveness is often associated with a task\-dependent combination of layerwise similarities, rather than a universal reliance on the final\-layer embedding alone\(Liuet al\.,[2025b](https://arxiv.org/html/2607.27766#bib.bib10)\)\. Taken together, these observations indicate that intermediate representations can provide complementary retrieval cues, and that the most informative layers may vary across tasks, datasets, and application domains\.
Motivated by this evidence, we treat layerwise encoder states as candidate retrieval anchors rather than assuming that the final\-layer representation is universally sufficient\. For a textual sequence𝐬\\mathbf\{s\}, letℐ\(𝐬\)\\mathcal\{I\}\(\\mathbf\{s\}\)denote the set of its non\-padding token indices\. We define its layer\-ℓ\\ellrepresentation as
\(1\)𝐡ℓ\(𝐬\)=1\|ℐ\(𝐬\)\|∑q∈ℐ\(𝐬\)𝐡ℓ,q\(𝐬\),\\mathbf\{h\}\_\{\\ell\}\(\\mathbf\{s\}\)=\\frac\{1\}\{\|\\mathcal\{I\}\(\\mathbf\{s\}\)\|\}\\sum\_\{q\\in\\mathcal\{I\}\(\\mathbf\{s\}\)\}\\mathbf\{h\}\_\{\\ell,q\}\(\\mathbf\{s\}\),where𝐡ℓ,q\(𝐬\)\\mathbf\{h\}\_\{\\ell,q\}\(\\mathbf\{s\}\)is the hidden state of tokenqqat layerℓ\\ell\. The same frozen encoderffis used to encode candidate inputs, candidate outputs, and test inputs\. CoRA uses these layerwise representations to construct an output\-conditioned retrieval basis without updating the encoder parameters\.
Method Desiderata\.The above setup and preliminaries suggest three desiderata for our retrieval alignment:ii\) task\-aware retrieval under frozen\-encoder constraints,iiii\) effective use of complementary signals across layers, andiiiiii\) minimal additional overhead for on\-device deployment\. The next subsection presents CoRA, a gradient\-free multi\-layer retrieval alignment method designed to satisfy these desiderata\.
### 3\.2\.CoRA: Task\-Conditioned Multi\-Layer Retrieval Alignment
Figure 1\.Left:Shortcomings of existing retrieval methods\.Right:Overview of CoRA framework, which consists of three main stages\. By projecting representations into a task\-conditioned subspace without gradient\-based parameter updates, it enables effective textual and multimodal retrieval on edge devices\.Research gap and the main schematic diagram\.#### Framework Overview\.
As shown in Figure[1](https://arxiv.org/html/2607.27766#S3.F1), CoRA converts a frozen pretrained encoder into a task\-conditioned multi\-layer retriever through three stages\. First, it applies representative\-layer selection to retain complementary input\-side features while reducing inter\-layer redundancy\. Second, it uses the paired candidate outputs to construct a conditioning matrix and fits the selected input representations to this matrix through closed\-form ridge regression\. A low\-rank basis is then estimated from the resulting fitted representation matrix\. Third, candidate and query inputs are mapped through this basis and ranked by similarity\. Candidate outputs are required only during index construction and an unseen query is encoded using its input alone\. The formulation extends to multimodal retrieval, and all computations reduce to lightweight closed\-form linear algebra suitable for on\-device deployment\.
#### Representative Layer Selection\.
CoRA adopts the representative\-layer construction introduced by MLSM in our preliminary conference work\(Liuet al\.,[2025b](https://arxiv.org/html/2607.27766#bib.bib10)\)\. This inherited component uses inter\-layer similarity to retain complementary input\-side representations while reducing the redundancy caused by residual propagation\(Dalviet al\.,[2020](https://arxiv.org/html/2607.27766#bib.bib54); Liuet al\.,[2025b](https://arxiv.org/html/2607.27766#bib.bib10); Min and Wang,[2025](https://arxiv.org/html/2607.27766#bib.bib55)\)\. CoRA builds on this construction by introducing the output\-conditioned alignment described in the following paragraph\. Let the frozen retriever encoderffhaveLLtransformer layers, indexed byℓ∈\{1,…,L\}\\ell\\in\\\{1,\\dots,L\\\}\. We draw a small calibration subset𝒟s=\{\(𝐱ic,𝐲ic\)\}i=1ns⊂𝒟,\\mathcal\{D\}\_\{s\}=\\\{\(\\mathbf\{x\}\_\{i\}^\{c\},\\mathbf\{y\}\_\{i\}^\{c\}\)\\\}\_\{i=1\}^\{n\_\{s\}\}\\subset\\mathcal\{D\},and use only the inputs\{𝐱ic\}i=1ns\\\{\\mathbf\{x\}\_\{i\}^\{c\}\\\}\_\{i=1\}^\{n\_\{s\}\}in this stage to estimate inter\-layer redundancy\. For each sample𝐱ic\\mathbf\{x\}\_\{i\}^\{c\}and each layerℓ\\ell, we instantiate the layerwise token\-average representation𝐡ℓ\(𝐱ic\)∈ℝd\.\\mathbf\{h\}\_\{\\ell\}\(\\mathbf\{x\}\_\{i\}^\{c\}\)\\in\\mathbb\{R\}^\{d\}\.Stacking these vectors across the subset gives
\(2\)𝐇\(ℓ\)=\[𝐡ℓ\(𝐱1c\);…;𝐡ℓ\(𝐱nsc\)\]∈ℝns×d,\\mathbf\{H\}^\{\(\\ell\)\}=\[\\mathbf\{h\}\_\{\\ell\}\(\\mathbf\{x\}\_\{1\}^\{c\}\);\\dots;\\mathbf\{h\}\_\{\\ell\}\(\\mathbf\{x\}\_\{n\_\{s\}\}^\{c\}\)\]\\in\\mathbb\{R\}^\{n\_\{s\}\\times d\},which summarizes the empirical behavior of layerℓ\\ell\.
We quantify the similarity between layers using linear Centered Kernel Alignment \(CKA\)\(Kornblithet al\.,[2019](https://arxiv.org/html/2607.27766#bib.bib16)\)\. Specifically, we form a similarity matrix𝐒∈ℝL×L\\mathbf\{S\}\\in\\mathbb\{R\}^\{L\\times L\}with entries
\(3\)𝐒ℓ,ℓ′=CKA\(𝐇\(ℓ\),𝐇\(ℓ′\)\)\.\\mathbf\{S\}\_\{\\ell,\\ell^\{\\prime\}\}=\\mathrm\{CKA\}\(\\mathbf\{H\}^\{\(\\ell\)\},\\mathbf\{H\}^\{\(\\ell^\{\\prime\}\)\}\)\.Each row𝐒ℓ,⋅\\mathbf\{S\}\_\{\\ell,\\cdot\}represents the similarity profile of layerℓ\\ellwith respect to all other layers\. Because adjacent layers are often highly similar, selecting layers directly from raw pairwise similarities would favor neighboring and thus redundant layers\. To encourage diversity, we treat each row vector𝐒ℓ,⋅\\mathbf\{S\}\_\{\\ell,\\cdot\}as a layer feature and cluster\{𝐒ℓ,⋅\}ℓ=1L\\\{\\mathbf\{S\}\_\{\\ell,\\cdot\}\\\}\_\{\\ell=1\}^\{L\}intonln\_\{l\}groups usingkk\-means\. For each cluster𝒞j\\mathcal\{C\}\_\{j\}, we then choose as its representative the layer with the largest average similarity to the layers in the same cluster\. This yields the representative layer setℒkey=\{ℓj\}j=1nl,\\mathcal\{L\}\_\{\\mathrm\{key\}\}=\\\{\\ell\_\{j\}\\\}\_\{j=1\}^\{n\_\{l\}\},which suppresses redundancy while retaining diverse layerwise retrieval cues for the subsequent task\-conditioned alignment stage\.
#### Task\-Conditioned Retrieval Alignment\.
Representative layer selection suppresses redundancy, but the resulting features remain task\-agnostic with respect to the downstream objective\. They reflect the geometry of the frozen encoder rather than the input\-output relation induced by the task for which exemplars are retrieved\. In on\-device ICL, learning this relation with gradient updates, downstream heads, or target\-model feedback is infeasible, since the downstream modelℳ\\mathcal\{M\}is invoked only after retrieval and all intermediate computation must remain local\. We therefore seek a closed\-form alignment mechanism that uses only the local exemplar pairs in𝒟\\mathcal\{D\}while preserving the frozen nature of the encoder\. Our key intuition is to identify the components of the input representations that are systematically associated with the output\-side structure of the candidate pairs\. This relation provides an output\-conditioned retrieval space without requiring any update to the encoder parameters\.
For eachℓj∈ℒkey\\ell\_\{j\}\\in\\mathcal\{L\}\_\{\\mathrm\{key\}\}, we encode both the candidate inputs and their textual outputs using the same frozen encoderff, apply mean pooling over non\-padding token representations, and form𝐇x\(ℓj\),𝐇y\(ℓj\)∈ℝn×d\\mathbf\{H\}\_\{x\}^\{\(\\ell\_\{j\}\)\},\\,\\mathbf\{H\}\_\{y\}^\{\(\\ell\_\{j\}\)\}\\in\\mathbb\{R\}^\{n\\times d\}, where theii\-th rows of𝐇x\(ℓj\)\\mathbf\{H\}\_\{x\}^\{\(\\ell\_\{j\}\)\}and𝐇y\(ℓj\)\\mathbf\{H\}\_\{y\}^\{\(\\ell\_\{j\}\)\}are the layer\-ℓj\\ell\_\{j\}features of𝐱ic\\mathbf\{x\}\_\{i\}^\{c\}and𝐲ic\\mathbf\{y\}\_\{i\}^\{c\}, respectively\. We standardize each feature dimension via Z\-score normalization within each layer and obtain𝐇~x\(ℓj\),𝐇~y\(ℓj\)\.\\tilde\{\\mathbf\{H\}\}\_\{x\}^\{\(\\ell\_\{j\}\)\},\\,\\tilde\{\\mathbf\{H\}\}\_\{y\}^\{\(\\ell\_\{j\}\)\}\.To aggregate task signals from exemplar outputs across layers, we construct the conditioning matrix
\(4\)𝐂=\[1\|𝐇~y\(ℓ1\)\|…\|𝐇~y\(ℓnl\)\]∈ℝn×p,\\mathbf\{C\}=\\big\[\\,\\mathbf\{1\}\\;\\big\|\\;\\tilde\{\\mathbf\{H\}\}\_\{y\}^\{\(\\ell\_\{1\}\)\}\\;\\big\|\\;\\dots\\;\\big\|\\;\\tilde\{\\mathbf\{H\}\}\_\{y\}^\{\(\\ell\_\{n\_\{l\}\}\)\}\\,\\big\]\\in\\mathbb\{R\}^\{n\\times p\},where𝟏∈ℝn\\mathbf\{1\}\\in\\mathbb\{R\}^\{n\}is the all\-ones column vector\. For notational convenience, letdcat=nldd\_\{\\mathrm\{cat\}\}=n\_\{l\}ddenote the concatenated input\-feature dimension andp=1\+dcatp=1\+d\_\{\\mathrm\{cat\}\}the column dimension of𝐂\\mathbf\{C\}\.
For each selected layerℓj\\ell\_\{j\}, we obtain the component of its input representations fitted from the output\-derived conditioning matrix through ridge regression:
\(5\)𝐇^x\(ℓj\)=𝐏𝐂𝐇~x\(ℓj\),𝐏𝐂=𝐂\(𝐂⊤𝐂\+λ𝐈\)−1𝐂⊤,\\hat\{\\mathbf\{H\}\}\_\{x\}^\{\(\\ell\_\{j\}\)\}=\\mathbf\{P\}\_\{\\mathbf\{C\}\}\\tilde\{\\mathbf\{H\}\}\_\{x\}^\{\(\\ell\_\{j\}\)\},\\qquad\\mathbf\{P\}\_\{\\mathbf\{C\}\}=\\mathbf\{C\}\\left\(\\mathbf\{C\}^\{\\top\}\\mathbf\{C\}\+\\lambda\\mathbf\{I\}\\right\)^\{\-1\}\\mathbf\{C\}^\{\\top\},whereλ\>0\\lambda\>0is the ridge regularization coefficient\. Here,𝐏𝐂\\mathbf\{P\}\_\{\\mathbf\{C\}\}is the regularized fitting operator induced by𝐂\\mathbf\{C\}\. Accordingly, the fitted matrix𝐇^x\(ℓj\)\\hat\{\\mathbf\{H\}\}\_\{x\}^\{\(\\ell\_\{j\}\)\}captures the component of the layerwise input representations explained by the output\-derived conditioning matrix, while leaving the encoder parameters unchanged\.
We then consolidate the fitted components and the corresponding standardized input representations from all representative layers by concatenation
\(6\)𝐇^x=\[𝐇^x\(ℓ1\)\|…\|𝐇^x\(ℓnl\)\]∈ℝn×dcat,𝐇~x=\[𝐇~x\(ℓ1\)\|…\|𝐇~x\(ℓnl\)\]∈ℝn×dcat\.\\hat\{\\mathbf\{H\}\}\_\{x\}=\\big\[\\,\\hat\{\\mathbf\{H\}\}\_\{x\}^\{\(\\ell\_\{1\}\)\}\\;\\big\|\\;\\dots\\;\\big\|\\;\\hat\{\\mathbf\{H\}\}\_\{x\}^\{\(\\ell\_\{n\_\{l\}\}\)\}\\,\\big\]\\in\\mathbb\{R\}^\{n\\times d\_\{\\mathrm\{cat\}\}\},\\qquad\\tilde\{\\mathbf\{H\}\}\_\{x\}=\\big\[\\,\\tilde\{\\mathbf\{H\}\}\_\{x\}^\{\(\\ell\_\{1\}\)\}\\;\\big\|\\;\\dots\\;\\big\|\\;\\tilde\{\\mathbf\{H\}\}\_\{x\}^\{\(\\ell\_\{n\_\{l\}\}\)\}\\,\\big\]\\in\\mathbb\{R\}^\{n\\times d\_\{\\mathrm\{cat\}\}\}\.Finally, to obtain a compact retrieval space suitable for on\-device deployment, we perform a spectral decomposition𝐇^x=𝐔𝚺𝐕⊤,\\hat\{\\mathbf\{H\}\}\_\{x\}=\\mathbf\{U\}\\mathbf\{\\Sigma\}\\mathbf\{V\}^\{\\top\},and retain the top\-rrright singular vectors𝐕1:r∈ℝdcat×r\\mathbf\{V\}\_\{1:r\}\\in\\mathbb\{R\}^\{d\_\{\\mathrm\{cat\}\}\\times r\}\. The resulting aligned representation is
\(7\)𝐙=𝐇~x𝐕1:r∈ℝn×r,\\mathbf\{Z\}=\\tilde\{\\mathbf\{H\}\}\_\{x\}\\mathbf\{V\}\_\{1:r\}\\in\\mathbb\{R\}^\{n\\times r\},whose columns span a compact task\-conditioned subspace for retrieval\. The matrix𝐙\\mathbf\{Z\}forms the compact candidate index used for retrieval\. Because𝐕1:r\\mathbf\{V\}\_\{1:r\}is estimated from𝐇^x\\hat\{\\mathbf\{H\}\}\_\{x\}, the retained feature directions are determined by the dominant structure of the output\-conditioned fit, while candidate and query representations are projected from their standardized input\-side features\. This also remains fully gradient\-free and lightweight enough for on\-device deployment\.
#### Retrieval in the Aligned Space\.
CoRA performs retrieval in the learned aligned space\. Let𝐙¯=rownorm\(𝐙\)\\bar\{\\mathbf\{Z\}\}=\\mathrm\{rownorm\}\(\\mathbf\{Z\}\)be its row\-wiseℓ2\\ell\_\{2\}\-normalized form\. For a test query𝐱t\\mathbf\{x\}^\{t\}, we extract layerwise token\-average representations from representative layersℒkey\\mathcal\{L\}\_\{\\mathrm\{key\}\}, standardize them using the alignment statistics, and obtain its aligned embedding
\(8\)𝐳t=norm\(\[𝐡~ℓ1\(𝐱t\)\|…\|𝐡~ℓnl\(𝐱t\)\]𝐕1:r\)∈ℝr,\\mathbf\{z\}^\{t\}=\\mathrm\{norm\}\\\!\\left\(\\big\[\\tilde\{\\mathbf\{h\}\}\_\{\\ell\_\{1\}\}\(\\mathbf\{x\}^\{t\}\)\\;\|\\;\\dots\\;\|\\;\\tilde\{\\mathbf\{h\}\}\_\{\\ell\_\{n\_\{l\}\}\}\(\\mathbf\{x\}^\{t\}\)\\big\]\\mathbf\{V\}\_\{1:r\}\\right\)\\in\\mathbb\{R\}^\{r\},wherenorm\(⋅\)\\mathrm\{norm\}\(\\cdot\)denotesℓ2\\ell\_\{2\}normalization\. Although𝐕1:r\\mathbf\{V\}\_\{1:r\}is learned through target\-conditioned alignment, applying it to a test query requires only its input features, since the task signal is already encoded in the basis\. We then compute the cosine similarity between𝐳t\\mathbf\{z\}^\{t\}and each row𝐙¯i,:\\bar\{\\mathbf\{Z\}\}\_\{i,:\}, and select the top\-kkexemplars to form the ICL prompt\. Because𝐙¯\\bar\{\\mathbf\{Z\}\}can be precomputed offline, query\-time retrieval only involves a lightweight projection and nearest\-neighbor search inℝr\\mathbb\{R\}^\{r\}, making it compatible with standard ANN indexing and the pre\-inference on\-device setting\.
#### Extension to Multimodal Retrieval\.
Prior work on multimodal ICL suggests that textual content often plays a stronger role than visual content\(Baldassiniet al\.,[2024](https://arxiv.org/html/2607.27766#bib.bib56); Chenet al\.,[2025b](https://arxiv.org/html/2607.27766#bib.bib41)\)\. We therefore extend CoRA to multimodal retrieval in a text\-centric manner, denoted asCoRA\-M\. Representative layer selection remains unchanged and is applied only to the textual transformer layers, yielding the same setℒkey\\mathcal\{L\}\_\{\\mathrm\{key\}\}\. Visual information is introduced through the final pooled representation produced by the frozen vision encoder and multimodal projector\.
For a multimodal exemplar𝐱ic\\mathbf\{x\}\_\{i\}^\{c\}, let𝐯\(𝐱ic\)∈ℝd\\mathbf\{v\}\(\\mathbf\{x\}\_\{i\}^\{c\}\)\\in\\mathbb\{R\}^\{d\}denote its projected visual embedding in the shared semantic space\. Stacking these embeddings across𝒟\\mathcal\{D\}gives
\(9\)𝐇x\(vis\)=\[𝐯\(𝐱1c\);…;𝐯\(𝐱nc\)\]∈ℝn×d,\\mathbf\{H\}\_\{x\}^\{\(\\mathrm\{vis\}\)\}=\[\\mathbf\{v\}\(\\mathbf\{x\}\_\{1\}^\{c\}\);\\dots;\\mathbf\{v\}\(\\mathbf\{x\}\_\{n\}^\{c\}\)\]\\in\\mathbb\{R\}^\{n\\times d\},and let𝐇~x\(vis\)\\tilde\{\\mathbf\{H\}\}\_\{x\}^\{\(\\mathrm\{vis\}\)\}be its standardized form\. On the target side, unlike the text\-only case, we do not concatenate the selected layerwise representations of𝐲ic\\mathbf\{y\}\_\{i\}^\{c\}\. Instead, we encode each target response with the frozen text encoder and use its mean\-pooled final\-layer representation
\(10\)𝐇y\(out\)=\[𝐡L\(𝐲1c\);…;𝐡L\(𝐲nc\)\]∈ℝn×d,\\mathbf\{H\}\_\{y\}^\{\(\\mathrm\{out\}\)\}=\[\\mathbf\{h\}\_\{L\}\(\\mathbf\{y\}\_\{1\}^\{c\}\);\\dots;\\mathbf\{h\}\_\{L\}\(\\mathbf\{y\}\_\{n\}^\{c\}\)\]\\in\\mathbb\{R\}^\{n\\times d\},with standardized form𝐇~y\(out\)\\tilde\{\\mathbf\{H\}\}\_\{y\}^\{\(\\mathrm\{out\}\)\}\. The reason is that, in the multimodal setting, the target response already serves as a compact semantic summary of the answer, while visual grounding is supplied separately by𝐇~x\(vis\)\\tilde\{\\mathbf\{H\}\}\_\{x\}^\{\(\\mathrm\{vis\}\)\}\. Reintroducing multiple target\-side text layers would therefore mainly enlarge the conditioning space and add redundant variation, rather than provide complementary task signal\. We thus define
\(11\)𝐂mm=\[1\|𝐇~y\(out\)\|𝐇~x\(vis\)\]∈ℝn×\(1\+2d\)\.\\mathbf\{C\}\_\{\\mathrm\{mm\}\}=\\big\[\\,\\mathbf\{1\}\\;\\big\|\\;\\tilde\{\\mathbf\{H\}\}\_\{y\}^\{\(\\mathrm\{out\}\)\}\\;\\big\|\\;\\tilde\{\\mathbf\{H\}\}\_\{x\}^\{\(\\mathrm\{vis\}\)\}\\,\\big\]\\in\\mathbb\{R\}^\{n\\times\(1\+2d\)\}\.For each selected text layerℓj∈ℒkey\\ell\_\{j\}\\in\\mathcal\{L\}\_\{\\mathrm\{key\}\}, we compute the target\-conditioned component following Eq\.[5](https://arxiv.org/html/2607.27766#S3.E5)with𝐂\\mathbf\{C\}replaced by𝐂mm\\mathbf\{C\}\_\{\\mathrm\{mm\}\}\. The multimodal aligned representation is then formed by concatenating the target\-conditioned textual blocks with the visual block
\(12\)𝐇^xmm=\[𝐇^x\(ℓ1\)\|…\|𝐇^x\(ℓnl\)\|𝐇~x\(vis\)\]∈ℝn×\(nl\+1\)d\.\\hat\{\\mathbf\{H\}\}\_\{x\}^\{\\mathrm\{mm\}\}=\\big\[\\,\\hat\{\\mathbf\{H\}\}\_\{x\}^\{\(\\ell\_\{1\}\)\}\\;\\big\|\\;\\dots\\;\\big\|\\;\\hat\{\\mathbf\{H\}\}\_\{x\}^\{\(\\ell\_\{n\_\{l\}\}\)\}\\;\\big\|\\;\\tilde\{\\mathbf\{H\}\}\_\{x\}^\{\(\\mathrm\{vis\}\)\}\\,\\big\]\\in\\mathbb\{R\}^\{n\\times\(n\_\{l\}\+1\)d\}\.We then apply the same spectral decomposition and low\-rank projection as in the text\-only case \(referring to Eq\.[7](https://arxiv.org/html/2607.27766#S3.E7)\)\. For a test query𝐱t\\mathbf\{x\}^\{t\}, the retrieval embedding becomes
\(13\)𝐳mmt=norm\(\[𝐡~ℓ1\(𝐱t\)\|…\|𝐡~ℓnl\(𝐱t\)\|𝐯~\(𝐱t\)\]𝐕1:r\)\.\\mathbf\{z\}\_\{\\mathrm\{mm\}\}^\{t\}=\\mathrm\{norm\}\\\!\\left\(\\big\[\\tilde\{\\mathbf\{h\}\}\_\{\\ell\_\{1\}\}\(\\mathbf\{x\}^\{t\}\)\\;\|\\;\\dots\\;\|\\;\\tilde\{\\mathbf\{h\}\}\_\{\\ell\_\{n\_\{l\}\}\}\(\\mathbf\{x\}^\{t\}\)\\;\|\\;\\tilde\{\\mathbf\{v\}\}\(\\mathbf\{x\}^\{t\}\)\\big\]\\mathbf\{V\}\_\{1:r\}\\right\)\.This extension preserves CoRA’s original text\-centric retrieval backbone while allowing visual cues to enter the same target\-conditioned subspace\. The subsequent low\-rank projection can therefore adapt the combined text\-visual representation for retrieval while retaining a unified representation space across the two modalities\.
### 3\.3\.Analytical Characterization of the Low\-Rank Basis
We characterize the rank\-constrained compression performed in CoRA’s basis\-estimation step\. Recall that
𝐇^x=𝐏𝐂𝐇~x∈ℝn×dcat\\hat\{\\mathbf\{H\}\}\_\{x\}=\\mathbf\{P\}\_\{\\mathbf\{C\}\}\\tilde\{\\mathbf\{H\}\}\_\{x\}\\in\\mathbb\{R\}^\{n\\times d\_\{\\mathrm\{cat\}\}\}is the representation matrix fitted from the output\-derived conditioning matrix\. Consider its full singular value decomposition
𝐇^x=𝐔𝚺𝐕⊤,\\hat\{\\mathbf\{H\}\}\_\{x\}=\\mathbf\{U\}\\mathbf\{\\Sigma\}\\mathbf\{V\}^\{\\top\},where𝐕∈ℝdcat×dcat\\mathbf\{V\}\\in\\mathbb\{R\}^\{d\_\{\\mathrm\{cat\}\}\\times d\_\{\\mathrm\{cat\}\}\}is orthogonal andσ1≥⋯≥σdcat≥0\\sigma\_\{1\}\\geq\\cdots\\geq\\sigma\_\{d\_\{\\mathrm\{cat\}\}\}\\geq 0are the singular values, padded with zeros when necessary\. Let𝐕1:r\\mathbf\{V\}\_\{1:r\}contain the firstrrright singular vectors\.
###### Proposition 3\.1 \(Optimal Rank\-rrCompression of the Output\-Conditioned Fit\)\.
For1≤r≤dcat1\\leq r\\leq d\_\{\\mathrm\{cat\}\},𝐕1:r\\mathbf\{V\}\_\{1:r\}is an optimal solution to
\(14\)max𝐖∈ℝdcat×r𝐖⊤𝐖=𝐈r‖𝐇^x𝐖‖F2,\\max\_\{\\begin\{subarray\}\{c\}\\mathbf\{W\}\\in\\mathbb\{R\}^\{d\_\{\\mathrm\{cat\}\}\\times r\}\\\\ \\mathbf\{W\}^\{\\top\}\\mathbf\{W\}=\\mathbf\{I\}\_\{r\}\\end\{subarray\}\}\\left\\\|\\hat\{\\mathbf\{H\}\}\_\{x\}\\mathbf\{W\}\\right\\\|\_\{F\}^\{2\},and the optimal value is
\(15\)‖𝐇^x𝐕1:r‖F2=∑i=1rσi2\.\\left\\\|\\hat\{\\mathbf\{H\}\}\_\{x\}\\mathbf\{V\}\_\{1:r\}\\right\\\|\_\{F\}^\{2\}=\\sum\_\{i=1\}^\{r\}\\sigma\_\{i\}^\{2\}\.Equivalently,𝐕1:r\\mathbf\{V\}\_\{1:r\}solves
\(16\)min𝐖∈ℝdcat×r𝐖⊤𝐖=𝐈r‖𝐇^x−𝐇^x𝐖𝐖⊤‖F2,\\min\_\{\\begin\{subarray\}\{c\}\\mathbf\{W\}\\in\\mathbb\{R\}^\{d\_\{\\mathrm\{cat\}\}\\times r\}\\\\ \\mathbf\{W\}^\{\\top\}\\mathbf\{W\}=\\mathbf\{I\}\_\{r\}\\end\{subarray\}\}\\left\\\|\\hat\{\\mathbf\{H\}\}\_\{x\}\-\\hat\{\\mathbf\{H\}\}\_\{x\}\\mathbf\{W\}\\mathbf\{W\}^\{\\top\}\\right\\\|\_\{F\}^\{2\},with minimum value∑i=r\+1dcatσi2\\sum\_\{i=r\+1\}^\{d\_\{\\mathrm\{cat\}\}\}\\sigma\_\{i\}^\{2\}\.
###### Proof\.
For any feasible𝐖\\mathbf\{W\}, define𝐐=𝐕⊤𝐖\\mathbf\{Q\}=\\mathbf\{V\}^\{\\top\}\\mathbf\{W\}\. Since𝐕\\mathbf\{V\}is orthogonal and𝐖⊤𝐖=𝐈r\\mathbf\{W\}^\{\\top\}\\mathbf\{W\}=\\mathbf\{I\}\_\{r\}, we have𝐐⊤𝐐=𝐈r\\mathbf\{Q\}^\{\\top\}\\mathbf\{Q\}=\\mathbf\{I\}\_\{r\}\. Using the SVD of𝐇^x\\hat\{\\mathbf\{H\}\}\_\{x\}, the retained fitted energy is
‖𝐇^x𝐖‖F2=‖𝚺𝐐‖F2=∑i=1dcatσi2‖𝐪i,:‖22,\\left\\\|\\hat\{\\mathbf\{H\}\}\_\{x\}\\mathbf\{W\}\\right\\\|\_\{F\}^\{2\}=\\left\\\|\\mathbf\{\\Sigma\}\\mathbf\{Q\}\\right\\\|\_\{F\}^\{2\}=\\sum\_\{i=1\}^\{d\_\{\\mathrm\{cat\}\}\}\\sigma\_\{i\}^\{2\}\\left\\\|\\mathbf\{q\}\_\{i,:\}\\right\\\|\_\{2\}^\{2\},where𝐪i,:\\mathbf\{q\}\_\{i,:\}is theii\-th row of𝐐\\mathbf\{Q\}\. The column orthonormality of𝐐\\mathbf\{Q\}implies
0≤‖𝐪i,:‖22≤1,∑i=1dcat‖𝐪i,:‖22=r\.0\\leq\\left\\\|\\mathbf\{q\}\_\{i,:\}\\right\\\|\_\{2\}^\{2\}\\leq 1,\\qquad\\sum\_\{i=1\}^\{d\_\{\\mathrm\{cat\}\}\}\\left\\\|\\mathbf\{q\}\_\{i,:\}\\right\\\|\_\{2\}^\{2\}=r\.Becauseσ12≥⋯≥σdcat2\\sigma\_\{1\}^\{2\}\\geq\\cdots\\geq\\sigma\_\{d\_\{\\mathrm\{cat\}\}\}^\{2\}, the weighted sum is maximized by assigning unit weight to the firstrrsingular directions and zero weight to the remaining directions\. Therefore,
‖𝐇^x𝐖‖F2≤∑i=1rσi2,\\left\\\|\\hat\{\\mathbf\{H\}\}\_\{x\}\\mathbf\{W\}\\right\\\|\_\{F\}^\{2\}\\leq\\sum\_\{i=1\}^\{r\}\\sigma\_\{i\}^\{2\},with equality attained by𝐖=𝐕1:r\\mathbf\{W\}=\\mathbf\{V\}\_\{1:r\}\.
For the equivalent reconstruction objective,𝐖𝐖⊤\\mathbf\{W\}\\mathbf\{W\}^\{\\top\}is an orthogonal projector, and hence
‖𝐇^x−𝐇^x𝐖𝐖⊤‖F2=‖𝐇^x‖F2−‖𝐇^x𝐖‖F2\.\\left\\\|\\hat\{\\mathbf\{H\}\}\_\{x\}\-\\hat\{\\mathbf\{H\}\}\_\{x\}\\mathbf\{W\}\\mathbf\{W\}^\{\\top\}\\right\\\|\_\{F\}^\{2\}=\\left\\\|\\hat\{\\mathbf\{H\}\}\_\{x\}\\right\\\|\_\{F\}^\{2\}\-\\left\\\|\\hat\{\\mathbf\{H\}\}\_\{x\}\\mathbf\{W\}\\right\\\|\_\{F\}^\{2\}\.Thus, minimizing the reconstruction error is equivalent to maximizing the retained fitted energy\. Substituting𝐖=𝐕1:r\\mathbf\{W\}=\\mathbf\{V\}\_\{1:r\}and using‖𝐇^x‖F2=∑iσi2\\\|\\hat\{\\mathbf\{H\}\}\_\{x\}\\\|\_\{F\}^\{2\}=\\sum\_\{i\}\\sigma\_\{i\}^\{2\}gives the minimum reconstruction error∑i=r\+1dcatσi2\\sum\_\{i=r\+1\}^\{d\_\{\\mathrm\{cat\}\}\}\\sigma\_\{i\}^\{2\}\. ∎
Interpretation\.Proposition[3\.1](https://arxiv.org/html/2607.27766#S3.Thmtheorem1)characterizes the compression step used to estimate CoRA’s retrieval basis\. The fitted matrix𝐇^x\\hat\{\\mathbf\{H\}\}\_\{x\}summarizes input\-side variation associated with the output\-derived conditioning matrix, and its leading right singular subspace provides the most faithfulrr\-dimensional representation of this fitted structure\. The trailing spectral energy∑i=r\+1dcatσi2\\sum\_\{i=r\+1\}^\{d\_\{\\mathrm\{cat\}\}\}\\sigma\_\{i\}^\{2\}is the exact approximation error under the rank constraint\.
For anyrr\-dimensional orthogonal basis𝐖\\mathbf\{W\}, define the normalized retained fitted energy as
\(17\)ρr\(𝐖\)=‖𝐇^x𝐖‖F2‖𝐇^x‖F2\.\\rho\_\{r\}\(\\mathbf\{W\}\)=\\frac\{\\left\\\|\\hat\{\\mathbf\{H\}\}\_\{x\}\\mathbf\{W\}\\right\\\|\_\{F\}^\{2\}\}\{\\left\\\|\\hat\{\\mathbf\{H\}\}\_\{x\}\\right\\\|\_\{F\}^\{2\}\}\.Proposition[3\.1](https://arxiv.org/html/2607.27766#S3.Thmtheorem1)implies that CoRA’s basis satisfies
\(18\)ρr\(𝐕1:r\)=max𝐖⊤𝐖=𝐈rρr\(𝐖\)=∑i=1rσi2∑i=1dcatσi2\.\\rho\_\{r\}\(\\mathbf\{V\}\_\{1:r\}\)=\\max\_\{\\mathbf\{W\}^\{\\top\}\\mathbf\{W\}=\\mathbf\{I\}\_\{r\}\}\\rho\_\{r\}\(\\mathbf\{W\}\)=\\frac\{\\sum\_\{i=1\}^\{r\}\\sigma\_\{i\}^\{2\}\}\{\\sum\_\{i=1\}^\{d\_\{\\mathrm\{cat\}\}\}\\sigma\_\{i\}^\{2\}\}\.Section[5\.3](https://arxiv.org/html/2607.27766#S5.SS3)compares this quantity across alternative bases under the same rank budget and examines its relation to downstream retrieval performance\.
## 4\.On\-Device Realization of the Retrieval Pipeline
### 4\.1\.On\-Device Streaming Construction of the Retrieval Representation
We show that the final retrieval representation𝐙\\mathbf\{Z\}can be computed in two sequential passes over the exemplar pool without materializing the full fitted matrix𝐇^x\\hat\{\\mathbf\{H\}\}\_\{x\}\. Collect the layerwise ridge\-regression coefficients as
\(19\)𝐁=\[𝐁\(ℓ1\)\|⋯\|𝐁\(ℓnl\)\]∈ℝp×dcat\.\\mathbf\{B\}=\\big\[\\mathbf\{B\}^\{\(\\ell\_\{1\}\)\}\\;\\big\|\\;\\cdots\\;\\big\|\\;\\mathbf\{B\}^\{\(\\ell\_\{n\_\{l\}\}\)\}\\big\]\\in\\mathbb\{R\}^\{p\\times d\_\{\\mathrm\{cat\}\}\}\.The layerwise regularized regressions can then be written jointly as
\(20\)𝐁=argmin𝐁‖𝐇~x−𝐂𝐁‖F2\+λ‖𝐁‖F2,𝐇^x=𝐂𝐁\.\\mathbf\{B\}=\\arg\\min\_\{\\mathbf\{B\}\}\\left\\\|\\tilde\{\\mathbf\{H\}\}\_\{x\}\-\\mathbf\{C\}\\mathbf\{B\}\\right\\\|\_\{F\}^\{2\}\+\\lambda\\\|\\mathbf\{B\}\\\|\_\{F\}^\{2\},\\qquad\\hat\{\\mathbf\{H\}\}\_\{x\}=\\mathbf\{C\}\\mathbf\{B\}\.
#### Pass 1: Sufficient Statistics and Global Solve\.
Partition𝒟\\mathcal\{D\}into chunks\{𝒟b\}b=1m\\\{\\mathcal\{D\}\_\{b\}\\\}\_\{b=1\}^\{m\}, and let𝐂b∈ℝ\|𝒟b\|×p\\mathbf\{C\}\_\{b\}\\in\\mathbb\{R\}^\{\|\\mathcal\{D\}\_\{b\}\|\\times p\}and𝐇~x,b∈ℝ\|𝒟b\|×dcat\\tilde\{\\mathbf\{H\}\}\_\{x,b\}\\in\\mathbb\{R\}^\{\|\\mathcal\{D\}\_\{b\}\|\\times d\_\{\\mathrm\{cat\}\}\}denote the corresponding row blocks of𝐂\\mathbf\{C\}and𝐇~x\\tilde\{\\mathbf\{H\}\}\_\{x\}\. A first streaming pass accumulates the two sufficient\-statistic matrices
\(21\)𝐆=∑b=1m𝐂b⊤𝐂b∈ℝp×p,𝐓=∑b=1m𝐂b⊤𝐇~x,b∈ℝp×dcat\.\\mathbf\{G\}=\\sum\_\{b=1\}^\{m\}\\mathbf\{C\}\_\{b\}^\{\\top\}\\mathbf\{C\}\_\{b\}\\in\\mathbb\{R\}^\{p\\times p\},\\qquad\\mathbf\{T\}=\\sum\_\{b=1\}^\{m\}\\mathbf\{C\}\_\{b\}^\{\\top\}\\tilde\{\\mathbf\{H\}\}\_\{x,b\}\\in\\mathbb\{R\}^\{p\\times d\_\{\\mathrm\{cat\}\}\}\.After the first pass,𝐁\\mathbf\{B\}is obtained by solving
\(22\)\(𝐆\+λ𝐈p\)𝐁=𝐓\.\(\\mathbf\{G\}\+\\lambda\\mathbf\{I\}\_\{p\}\)\\mathbf\{B\}=\\mathbf\{T\}\.The dimensions of this system depend onppanddcatd\_\{\\mathrm\{cat\}\}, but not on the number of exemplarsnn\. The low\-rank basis required for Eq\.[7](https://arxiv.org/html/2607.27766#S3.E7)can likewise be obtained without forming𝐇^x\\hat\{\\mathbf\{H\}\}\_\{x\}\. Since𝐇^x=𝐂𝐁\\hat\{\\mathbf\{H\}\}\_\{x\}=\\mathbf\{C\}\\mathbf\{B\},
\(23\)𝐇^x⊤𝐇^x=\(𝐂𝐁\)⊤\(𝐂𝐁\)=𝐁⊤𝐆𝐁∈ℝdcat×dcat\.\\hat\{\\mathbf\{H\}\}\_\{x\}^\{\\top\}\\hat\{\\mathbf\{H\}\}\_\{x\}=\(\\mathbf\{C\}\\mathbf\{B\}\)^\{\\top\}\(\\mathbf\{C\}\\mathbf\{B\}\)=\\mathbf\{B\}^\{\\top\}\\mathbf\{G\}\\,\\mathbf\{B\}\\in\\mathbb\{R\}^\{d\_\{\\mathrm\{cat\}\}\\times d\_\{\\mathrm\{cat\}\}\}\.The top\-rrright singular vectors𝐕1:r\\mathbf\{V\}\_\{1:r\}are therefore the leading eigenvectors of𝐁⊤𝐆𝐁\\mathbf\{B\}^\{\\top\}\\mathbf\{G\}\\,\\mathbf\{B\}, adcat×dcatd\_\{\\mathrm\{cat\}\}\\times d\_\{\\mathrm\{cat\}\}matrix whose size is independent ofnn\.
#### Pass 2: Chunkwise Index Construction\.
After obtaining𝐕1:r\\mathbf\{V\}\_\{1:r\}, a second sequential pass re\-encodes each chunk, applies the input\-side standardization statistics, and directly constructs its retrieval vectors as
\(24\)𝐙b=𝐇~x,b𝐕1:r∈ℝ\|𝒟b\|×r\.\\mathbf\{Z\}\_\{b\}=\\tilde\{\\mathbf\{H\}\}\_\{x,b\}\\mathbf\{V\}\_\{1:r\}\\in\\mathbb\{R\}^\{\|\\mathcal\{D\}\_\{b\}\|\\times r\}\.Concatenating the chunkwise results yields𝐙∈ℝn×r\\mathbf\{Z\}\\in\\mathbb\{R\}^\{n\\times r\}, exactly matching the index representation defined in Eq\.[7](https://arxiv.org/html/2607.27766#S3.E7)\.
#### Peak Memory Footprint\.
During the first pass, CoRA retains only one pair of feature blocks𝐂b\\mathbf\{C\}\_\{b\}and𝐇~x,b\\tilde\{\\mathbf\{H\}\}\_\{x,b\}, together with the sufficient\-statistic matrices𝐆\\mathbf\{G\}and𝐓\\mathbf\{T\}\. The global solve additionally produces the coefficient matrix𝐁\\mathbf\{B\}and thedcat×dcatd\_\{\\mathrm\{cat\}\}\\times d\_\{\\mathrm\{cat\}\}matrix𝐁⊤𝐆𝐁\\mathbf\{B\}^\{\\top\}\\mathbf\{G\}\\mathbf\{B\}, from which the basis𝐕1:r\\mathbf\{V\}\_\{1:r\}is obtained\. During the second pass, each input\-feature block is projected using𝐕1:r\\mathbf\{V\}\_\{1:r\}and written incrementally to the retrieval index\. Excluding the persistent storage of the resulting index, the construction\-time working memory is therefore bounded by
\(25\)𝒪\(\|𝒟b\|\(p\+dcat\)\+p\(p\+dcat\)\+dcat2\)\.\\mathcal\{O\}\\\!\\left\(\|\\mathcal\{D\}\_\{b\}\|\(p\+d\_\{\\mathrm\{cat\}\}\)\+p\(p\+d\_\{\\mathrm\{cat\}\}\)\+d\_\{\\mathrm\{cat\}\}^\{2\}\\right\)\.For fixed\|𝒟b\|\|\\mathcal\{D\}\_\{b\}\|,pp, anddcatd\_\{\\mathrm\{cat\}\}, this working\-memory bound is independent of the number of exemplarsnn\. The resulting retrieval index𝐙∈ℝn×r\\mathbf\{Z\}\\in\\mathbb\{R\}^\{n\\times r\}requires a separate𝒪\(nr\)\\mathcal\{O\}\(nr\)storage term\. The two\-pass construction thus trades an additional sequential scan for working memory controlled by the chunk size and feature dimensions\. Representative\-layer selection further reduces this cost by keepingnln\_\{l\}, and hencedcatd\_\{\\mathrm\{cat\}\}, small\. Section[5\.4](https://arxiv.org/html/2607.27766#S5.SS4)empirically evaluates the resulting memory scaling as the candidate pool grows\.
#### Extension to CoRA\-M\.
The identical streaming construction applies to the multimodal variant CoRA\-M by replacing𝐂\\mathbf\{C\}with𝐂mm∈ℝn×\(1\+2d\)\\mathbf\{C\}\_\{\\mathrm\{mm\}\}\\in\\mathbb\{R\}^\{n\\times\(1\+2d\)\}and𝐇~x\\tilde\{\\mathbf\{H\}\}\_\{x\}with the multimodal concatenation\[𝐇~x\(ℓ1\)\|⋯\|𝐇~x\(ℓnl\)\|𝐇~x\(vis\)\]∈ℝn×\(nl\+1\)d\[\\,\\tilde\{\\mathbf\{H\}\}\_\{x\}^\{\(\\ell\_\{1\}\)\}\\;\|\\;\\cdots\\;\|\\;\\tilde\{\\mathbf\{H\}\}\_\{x\}^\{\(\\ell\_\{n\_\{l\}\}\)\}\\;\|\\;\\tilde\{\\mathbf\{H\}\}\_\{x\}^\{\(\\mathrm\{vis\}\)\}\\,\]\\in\\mathbb\{R\}^\{n\\times\(n\_\{l\}\+1\)d\}\. This changesdcatd\_\{\\mathrm\{cat\}\}to\(nl\+1\)d\(n\_\{l\}\+1\)dandppto1\+2d1\+2d, and no other changes to the streaming procedure are required\.
### 4\.2\.Compatibility with Existing and Emerging Hardware\.
Because the entire CoRA pipeline reduces to standard dense linear algebra primitives, matrix multiplications, a linear\-system solve, an eigen\-decomposition, and an inner\-product\-based nearest\-neighbor search, it can be implemented on conventional CPU\-based edge platforms using highly optimized numerical libraries such as BLAS/LAPACK or their embedded variants\(Andersonet al\.,[1999](https://arxiv.org/html/2607.27766#bib.bib33)\)\. Looking ahead, recent work on in\-memory computing \(IMC\) architectures has demonstrated hardware support for each of these primitives individually, including matrix inversion for linear regression\(Zuoet al\.,[2025](https://arxiv.org/html/2607.27766#bib.bib32)\), low\-rank SVD kernels\(Mannocciet al\.,[2023](https://arxiv.org/html/2607.27766#bib.bib36)\), and inner\-product\-basedkk\-nearest\-neighbor\(Nieet al\.,[2025](https://arxiv.org/html/2607.27766#bib.bib34)\)or approximate\-nearest\-neighbor search\(Liuet al\.,[2025a](https://arxiv.org/html/2607.27766#bib.bib35)\)\. Since CoRA is composed solely of such operations, it is in principle compatible with IMC\-style accelerators and could benefit from their advantages in latency and energy efficiency\.
## 5\.Experiment
### 5\.1\.Experimental Setup
#### Tasks and Datasets\.
Following our conference study\(Liuet al\.,[2025b](https://arxiv.org/html/2607.27766#bib.bib10)\)and prior work\(Yeet al\.,[2023](https://arxiv.org/html/2607.27766#bib.bib5)\), we evaluate CoRA on the same textual benchmark suite of ten publicly available datasets, comprising five classification datasets and five generation datasets across seven task categories\. For each dataset, we construct a candidate pool𝒟=\{\(𝐱ic,𝐲ic\)\}i=1n\\mathcal\{D\}=\\\{\(\\mathbf\{x\}\_\{i\}^\{c\},\\mathbf\{y\}\_\{i\}^\{c\}\)\\\}\_\{i=1\}^\{n\}and a disjoint evaluation set𝒯=\{\(𝐱jt,𝐲jt\)\}j=1m\\mathcal\{T\}=\\\{\(\\mathbf\{x\}\_\{j\}^\{t\},\\mathbf\{y\}\_\{j\}^\{t\}\)\\\}\_\{j=1\}^\{m\}\. Given a test input𝐱t\\mathbf\{x\}^\{t\}, the retriever selects𝒮\(𝐱t\)⊆𝒟\\mathcal\{S\}\(\\mathbf\{x\}^\{t\}\)\\subseteq\\mathcal\{D\}with\|𝒮\(𝐱t\)\|=k\|\\mathcal\{S\}\(\\mathbf\{x\}^\{t\}\)\|=kto construct the in\-context prompt\. The evaluation target𝐲t\\mathbf\{y\}^\{t\}is used only to compute the downstream metric and is never accessed during retrieval or alignment\. The candidate and evaluation sets contain no overlapping instances\. Table[1](https://arxiv.org/html/2607.27766#S5.T1)summarizes the task type, split, candidate\-pool size, evaluation\-set size, and metric for each dataset\.
Table 1\.Summary of datasets and tasks\. Each dataset is divided into a local candidate pool𝒟=\{\(𝐱ic,𝐲ic\)\}i=1n\\mathcal\{D\}=\\\{\(\\mathbf\{x\}\_\{i\}^\{c\},\\mathbf\{y\}\_\{i\}^\{c\}\)\\\}\_\{i=1\}^\{n\}and an evaluation query set𝒯=\{𝐱jt\}j=1m\\mathcal\{T\}=\\\{\\mathbf\{x\}\_\{j\}^\{t\}\\\}\_\{j=1\}^\{m\}\. Given a test input𝐱t\\mathbf\{x\}^\{t\}, the retriever selects𝒮\(𝐱t\)⊆𝒟\\mathcal\{S\}\(\\mathbf\{x\}^\{t\}\)\\subseteq\\mathcal\{D\}with\|𝒮\(𝐱t\)\|=k\|\\mathcal\{S\}\(\\mathbf\{x\}^\{t\}\)\|=kto construct the in\-context prompt\.
#### Baselines\.
We compare CoRA with representative retrieval methods that are feasible for local or pre\-inference deployment under limited on\-device computational budgets\. The baselines include:Random, which sampleskkexemplars from the candidate pool;Top\-kkBM25, which retrieves exemplars using BM25\(Robertsonet al\.,[1995](https://arxiv.org/html/2607.27766#bib.bib15)\);Top\-kkSBERT, which replaces BERT with sentence\-BERT\(Reimers and Gurevych,[2019](https://arxiv.org/html/2607.27766#bib.bib27)\);Top\-kkBERT, which ranks exemplars by the cosine similarity between their average final\-layer BERT embeddings and the query\(Devlinet al\.,[2019](https://arxiv.org/html/2607.27766#bib.bib14)\);DPP\-BERT, which applies MAP inference with a determinantal point process on Top\-kkBERT candidates for diverse subset selection\(Chenet al\.,[2018](https://arxiv.org/html/2607.27766#bib.bib28)\);Top\-kkQwen3\-Embedding, which ranks exemplars using cosine similarity between embeddings produced by the dedicated embedding model Qwen3\-Embedding\-0\.6B\(Zhanget al\.,[2025](https://arxiv.org/html/2607.27766#bib.bib57)\); and our previously proposed lightweight gradient\-based retriever,MLSM\(Liuet al\.,[2025b](https://arxiv.org/html/2607.27766#bib.bib10)\), which combines layerwise BERT similarities by optimizing their agreement\. We additionally compare CoRA with the training\-based retrievers EPR\(Rubinet al\.,[2022](https://arxiv.org/html/2607.27766#bib.bib4)\), CEIL\(Yeet al\.,[2023](https://arxiv.org/html/2607.27766#bib.bib5)\), and TTF\(Liuet al\.,[2025b](https://arxiv.org/html/2607.27766#bib.bib10)\)in Section[5\.4](https://arxiv.org/html/2607.27766#S5.SS4), where their task\-adaptation cost is included in the efficiency comparison\.
#### Implementation Details\.
Following the textual retrieval configuration established in our conference study\(Liuet al\.,[2025b](https://arxiv.org/html/2607.27766#bib.bib10)\), we use BERT\(Devlinet al\.,[2019](https://arxiv.org/html/2607.27766#bib.bib14)\)as the frozen retrieval encoder, selectnl=3n\_\{l\}\{=\}3representative layers from a calibration subset ofns=1000n\_\{s\}\{=\}1000candidate inputs, and retrievek=20k\{=\}20exemplars for each query\. We keep these shared settings fixed to enable direct comparison with MLSM and focus the evaluation on the task\-conditioned alignment introduced by CoRA\. We set the ridge regularization coefficient toλ=10−6\\lambda\{=\}10^\{\-6\}, and retain a conditional subspace of dimensionr=256r\{=\}256\. Input and output representations are standardized independently for each selected layer using statistics computed from the candidate pool\. For generation datasets, the reference response associated with each candidate is used to construct its output representation; evaluation responses are not used by the retriever\. The downstream language models are instruction\-tunedLlama\-3\.2\-1B\(Grattafioriet al\.,[2024](https://arxiv.org/html/2607.27766#bib.bib58)\), 4\-bit\-quantizedMobileLLM\-Pro\(Huberet al\.,[2025](https://arxiv.org/html/2607.27766#bib.bib59)\), andQwen3\.5\-2B\(Qwen Team,[2026](https://arxiv.org/html/2607.27766#bib.bib60)\)\. All retrieval methods use the same candidate pools, query sets, number of retrieved exemplars, prompt templates, exemplar ordering rule, and downstream decoding configuration\. We report accuracy for classification and exact match for generation\.
#### Multimodal Extension Setup\.
We evaluate CoRA\-M on four multimodal exemplar\-retrieval benchmarks: VQAv2\(Goyalet al\.,[2017](https://arxiv.org/html/2607.27766#bib.bib62)\), OKVQA\(Schwenket al\.,[2022](https://arxiv.org/html/2607.27766#bib.bib64)\), VizWiz\(Gurariet al\.,[2018](https://arxiv.org/html/2607.27766#bib.bib63)\), and MSCOCO\(Chenet al\.,[2015](https://arxiv.org/html/2607.27766#bib.bib65)\)\. The first three evaluate visual question answering, whereas MSCOCO evaluates image captioning\. For each benchmark, the candidate pool and evaluation set are disjoint, and evaluation targets are withheld from all retrieval procedures\. CoRA\-M uses CLIP\(Radfordet al\.,[2021](https://arxiv.org/html/2607.27766#bib.bib66)\)to obtain the textual and visual representations\.
Following established multimodal ICL protocols\(Baldassiniet al\.,[2024](https://arxiv.org/html/2607.27766#bib.bib56); Chenet al\.,[2025b](https://arxiv.org/html/2607.27766#bib.bib41)\), we compare CoRA\-M withRandom,RICES\-image,RICES\-text\(Alayracet al\.,[2022](https://arxiv.org/html/2607.27766#bib.bib40)\), andMMICES\(Chenet al\.,[2025b](https://arxiv.org/html/2607.27766#bib.bib41)\)\. The downstream VLMs areOpenFlamingo\-3B\(Awadallaet al\.,[2023](https://arxiv.org/html/2607.27766#bib.bib61)\)andQwen3\.5\-2B\(Qwen Team,[2026](https://arxiv.org/html/2607.27766#bib.bib60)\)\. All methods use the same candidate pools, number and order of demonstrations, prompt templates, and decoding configuration\. We report the standard VQA accuracy for VQAv2, OKVQA, and VizWiz, and CIDEr for MSCOCO\.
### 5\.2\.Retrieval Effectiveness
Table 2\.Main results on five textual classification benchmarks across three language models\. “✝” indicates that gradient computation is required\. Best score for each task is boldfaced, and Avg\. denotes the average score across all five tasks\.Table 3\.Main results on five textual generation benchmarks across three language models\. “✝” indicates that gradient computation is required\. Best score for each task is boldfaced, and Avg\. denotes the average score across all five tasks\.#### Overall Performance on Textual Benchmarks\.
Table[2](https://arxiv.org/html/2607.27766#S5.T2)and Table[3](https://arxiv.org/html/2607.27766#S5.T3)reports ICL performance on five classification and five generation benchmarks with three downstream LLMs\. CoRA achieves the highest average score in every model\-by\-task\-category block, outperforming both static retrieval methods and MLSM\. The improvements are observed across classification and generation settings, indicating that the output\-conditioned retrieval basis can improve exemplar selection beyond input\-similarity\-based retrieval under diverse task formulations\.
The comparison with MLSM is particularly informative because CoRA retains its representative\-layer selection procedure while changing how the selected representations are used for retrieval\. MLSM computes input\-side similarities at the selected layers and optimizes query\- or batch\-specific aggregation weights to combine them\. In contrast, CoRA uses paired candidate outputs during index construction to fit a fixed low\-rank retrieval basis, after which retrieval for an unseen query requires only its input representation and the precomputed index\. CoRA achieves higher average results than MLSM across all evaluated backbones and task categories, indicating a consistent advantage under the considered evaluation protocol and across the tested retrieval scenarios\.
This comparison extends the two hypotheses from our preliminary conference work\. Representative layers preserve complementary input\-side signals associated with H1, while the output\-derived conditioning basis incorporates task\-specific structure motivated by H2\. Within the evaluated setting, the results suggest that integrating these two signals in a fixed retrieval basis is more effective than aggregating task\-agnostic layerwise similarity signals alone\.
#### Transferability Across Downstream LLMs\.
CoRA achieves the strongest classification and generation averages with Llama\-3\.2\-1B, MobileLLM\-Pro, and Qwen3\.5\-2B, despite their differences in model architecture, scale, and deployment configuration\. In particular, CoRA remains effective with MobileLLM\-Pro, the 4\-bit\-quantized and most resource\-constrained backbone in our evaluation\. This result indicates that the retrieval basis can improve ICL even when the downstream model operates under a restricted memory footprint\. CoRA also attains the strongest aggregate results with Qwen3\.5\-2B, a more recent and higher\-capacity backbone, showing that its retrieval formulation remains compatible with stronger downstream models and is applicable across heterogeneous model settings\.
The magnitude of improvement varies across models and task categories, which indicates that retrieval utility depends on both the downstream model and the task\. Nevertheless, the consistent aggregate advantage across all three backbones supports the use of CoRA as a model\-agnostic pre\-inference retrieval component\. It requires neither modification and fine\-tuning of the textual encoder, nor retrieval\-time interaction with the downstream model\.
#### Task\-wise Behavior and Failure Modes\.
CoRA performs strongly on several structured generation tasks, including GeoQuery, MTOP, and SMCalFlow, where the candidate outputs follow relatively regular compositional patterns\. These tasks provide output\-side representations that can serve as informative conditioning signals during index construction\. However, the benefits of output\-conditioned alignment are not uniform across all generation settings\.
NL2Bash provides a representative challenging case\. CoRA does not attain the best score on NL2Bash with any of the three downstream backbones, consistent with prior observations that this dataset is difficult for retrieval\-based ICL\(Liuet al\.,[2025b](https://arxiv.org/html/2607.27766#bib.bib10); Yeet al\.,[2023](https://arxiv.org/html/2607.27766#bib.bib5)\)\. A plausible explanation is the many\-to\-many relation between natural\-language intents and Bash commands\. Functionally equivalent solutions can differ substantially in the utilities, flags, and command compositions that they use\. Consequently, surface\-form output representations may provide a less stable proxy for the functional relation relevant to retrieval\. This interpretation is also consistent with Table[6](https://arxiv.org/html/2607.27766#S5.T6), where restricting CoRA to lower\-layer representations improves NL2Bash performance relative to middle\-, upper\-, and CKA\-selected layer configurations\. The result suggests that pattern\-level input cues are particularly important for this task and identifies high\-variability output spaces as a limitation of the current output\-conditioning formulation\.
#### Performance on Multimodal Retrieval\.
Table 4\.Results on multimodal benchmarks\. Best score of each task is boldfaced\. Avg\. denotes the average score across all five tasks\.Table[4](https://arxiv.org/html/2607.27766#S5.T4)reports multimodal ICL results on three visual question\-answering benchmarks and the MSCOCO image\-captioning benchmark\. CoRA\-M achieves the strongest result for every dataset with both OpenFlamingo\-3B and Qwen3\.5\-2B\. The improvement is therefore consistent across two downstream VLMs and across both question answering and captioning settings\.
The multimodal baselines considered here either retrieve demonstrations using a single modality or combine visual and textual signals through sequential filtering and ranking\. In contrast, CoRA\-M constructs a shared low\-rank retrieval space in which visual candidate representations and output\-side textual representations jointly condition the selected textual input features\. The consistent gains in Table[4](https://arxiv.org/html/2607.27766#S5.T4)are compatible with the benefit of this joint conditioning design for multimodal exemplar retrieval\. Section[5\.3](https://arxiv.org/html/2607.27766#S5.SS3)further examines the respective roles of visual representations and target\-side textual conditioning through controlled ablations\.
### 5\.3\.Analysis of Retrieval Design
#### Importance of Target Conditioning\.
Table 5\.Ablation study on key components of CoRA\.w/o Fusionuses only the final encoder layer\.w/o Cond\.replaces output\-conditioned projection with an unconditional one\. Subscriptrrdenotes the number of retained dimensions\. Default CoRA usesr=256r\{=\}256\.To isolate the contribution of output\-derived conditioning, we compare CoRA with an unconditional variant \(w/o Cond\.\) that uses the same representative layers and low\-rank dimensionality but replaces the output\-conditioned operator in Eq\.[5](https://arxiv.org/html/2607.27766#S3.E5)with the identity map, i\.e\.,𝐏𝐂=𝐈\\mathbf\{P\}\_\{\\mathbf\{C\}\}=\\mathbf\{I\}\. Consequently,w/o Cond\.sets𝐇^x\(ℓj\)=𝐇~x\(ℓj\)\\hat\{\\mathbf\{H\}\}\_\{x\}^\{\(\\ell\_\{j\}\)\}=\\tilde\{\\mathbf\{H\}\}\_\{x\}^\{\(\\ell\_\{j\}\)\}and estimates its low\-rank retrieval basis directly from the concatenated selected\-layer input representations, without using candidate\-output representations\. As shown in Table[5](https://arxiv.org/html/2607.27766#S5.T5), both projection\-based variants outperform Top\-kkBERT on all four datasets, indicating that low\-rank transformation of the selected multi\-layer features can improve downstream ICL performance beyond direct final\-layer similarity retrieval\. CoRA further outperformsw/o Cond\.on every dataset\. This result indicates that conditioning the retrieval basis on paired candidate outputs provides information beyond input\-side multi\-layer representations alone and improves exemplar selection in the evaluated tasks\.
#### Effects of Multi\-Layer Representations and Layer Position\.
We examine whether the representative\-layer construction improves retrieval beyond using the final encoder layer alone\. In Table[5](https://arxiv.org/html/2607.27766#S5.T5), full CoRA outperforms thew/o Fusionvariant on all four datasets\. This comparison indicates that the selected layers provide complementary input\-side information that is not consistently retained in the final\-layer representation\. Combining these representations therefore yields a more informative input feature space for the subsequent output\-conditioned alignment\.
Table 6\.Effect of layer position on CoRA retrieval performance\. Each setting uses three encoder layers, either from a fixed depth range or selected by CKA\.The value of combining layers raises a related question, whether a fixed layer range is suitable across tasks\. We address this question by comparing three fixed\-depth layer groups with the CKA\-selected layers used by CoRA\. Table[6](https://arxiv.org/html/2607.27766#S5.T6)shows contrasting layer preferences across the two generation tasks\. NL2Bash performs best with lower\-layer features, with performance gradually decreasing as the selected layers become deeper\. In contrast, GeoQuery benefits from upper\-layer features, while the CKA\-selected configuration achieves the strongest result among the compared settings\. These results show that no fixed layer range is uniformly preferable for exemplar retrieval across tasks with different input\-output characteristics\. The lower\-layer preference on NL2Bash is consistent with the task’s reliance on pattern\-level input cues, whereas the GeoQuery result suggests that higher\-level representations are useful for regular compositional mappings\. CKA\-based selection therefore provides a data\-dependent alternative to a fixed depth range\. It achieves the strongest result on GeoQuery and remains more effective than middle\- and upper\-layer configurations on NL2Bash\.
#### Effect of Low\-Rank Dimensionality\.
Table[5](https://arxiv.org/html/2607.27766#S5.T5)also evaluates the retained dimensionalityrrof the retrieval basis\. The effect ofrrvaries by task and does not follow a monotonic trend\. Increasing the dimensionality fromr=32r=32to an intermediate setting consistently improves performance across all four datasets, although the optimal value differs across tasks\. QNLI reaches its strongest result atr=64r=64, SST\-5 atr=128r=128or256256, and WebQs and MTOP atr=256r=256\. Further increasing the dimension tor=512r=512does not produce a consistent additional gain and instead reduces performance on several datasets\. We therefore adoptr=256r=256as the default configuration, as it offers strong and broadly competitive results across the evaluated tasks while maintaining a compactrr\-dimensional index and query representation\.
#### Effect of the Number of Retrieved Exemplars\.
Figure 2\.Performance comparison on four datasets with various number of exemplarskk\.Ablation study on the number of exemplars\.Figure[2](https://arxiv.org/html/2607.27766#S5.F2)examines how the number of retrieved exemplarskkaffects downstream ICL performance\. The preferred context size differs substantially across tasks rather than following a shared pattern\. MRPC and WebQs attain their strongest CoRA results with relatively small values ofkk, whereas QNLI and MTOP benefit from a larger context before performance plateaus or continues to improve\. These task\-specific trends indicate that increasing the number of demonstrations does not uniformly improve ICL performance\.
Nevertheless, CoRA remains competitive across the evaluated context sizes\. It achieves the strongest result at every displayed value ofkkon all four datasets\. These results indicate that the benefit of output\-conditioned retrieval is not tied to a single demonstration budget\. In practice, this permitskkto be selected according to the available prompt\-length and downstream\-inference budget while retaining the benefit of the learned retrieval basis\.
#### Analysis of Multimodal Signal Placement and Target\-Side Textual Conditioning\.
Table 7\.Ablation on visual signal placement and target\-side textual conditioning in CoRA\-M\.Table[7](https://arxiv.org/html/2607.27766#S5.T7)examines how visual features and target\-side textual representations are incorporated into CoRA\-M\. The default CoRA\-M configuration uses the final\-layer representation of each candidate response together with its visual representation in the conditioning matrix, and additionally appends visual features to the retrieval representation\. To isolate these design choices,input\-onlyadds visual features only to the retrieval representation, whereastarget\-onlyadds them only to the conditioning matrix\. Both retain the same final\-layer target\-text representation\.CoRA\-M \(layerwise\-target\)replaces the final\-layer target\-text representation with selected layerwise target features while retaining visual features on both sides\.CoRA\-Tapplies the text\-only formulation without visual features, andCoRA\-M \(shuffle\-vis\)randomly permutes visual features across candidate examples while preserving their dimensionality and marginal distribution\.
The full CoRA\-M configuration achieves the strongest result on both VQAv2 and VizWiz\. Adding visual features only to the retrieval representation improves over CoRA\-T on both datasets, whereas adding them to the conditioning matrix improves VQAv2 but not VizWiz\. The combined configuration is consistently stronger than either one\-sided variant, indicating that the two placements provide complementary information\. Moreover, CoRA\-M outperformsCoRA\-M \(layerwise\-target\)on both datasets, showing that the final\-layer target representation is a more effective target\-side textual conditioning choice than the selected layerwise alternative\.
The shuffled\-visual variant performs below CoRA\-T on both datasets\. By preserving visual feature dimensionality while disrupting their correspondence with candidate examples, this result indicates that CoRA\-M gains depend on correctly aligned visual information rather than additional feature dimensions alone\. Together, these ablations support the default CoRA\-M design and motivate further analysis of its query\-level retrieval behavior\.
#### Retained Fitted Energy and Retrieval Performance\.
Table 8\.Retained fitted energy and downstream ICL performance under a common rank budget ofr=256r=256\. All values ofρr\(𝐖\)\\rho\_\{r\}\(\\mathbf\{W\}\)are evaluated with respect to the same output\-conditioned fitted matrix𝐇^x\\hat\{\\mathbf\{H\}\}\_\{x\}\.Following Eq\.[17](https://arxiv.org/html/2607.27766#S3.E17), we measure the fitted energy retained by different bases under the same rank budget\. All retained\-energy ratios are computed with respect to the same output\-conditioned fitted matrix𝐇^x\\hat\{\\mathbf\{H\}\}\_\{x\}\. We compare CoRA’s basis with an unconditioned basis formed by the top\-rrright singular vectors of𝐇~x\\tilde\{\\mathbf\{H\}\}\_\{x\}, and a random orthogonal basis of the same dimension\.
Table[8](https://arxiv.org/html/2607.27766#S5.T8)shows that CoRA retains the largest fraction of the output\-conditioned fitted energy under the shared rank budget, consistent with Proposition[3\.1](https://arxiv.org/html/2607.27766#S3.Thmtheorem1)\. The unconditioned basis retains substantially less fitted energy, indicating that the dominant directions of the raw input representations do not fully coincide with those identified through output conditioning\. The random orthogonal basis exhibits the lowest retained energy, reflecting its lack of alignment with the fitted representation\. The downstream results follow the same ordering on both datasets\. Relative to the unconditioned and random alternatives, CoRA combines greater preservation of the fitted structure with higher ICL performance\. This agreement connects the rank\-constrained basis construction characterized in Proposition[3\.1](https://arxiv.org/html/2607.27766#S3.Thmtheorem1)with its empirical utility for exemplar retrieval under the same compact representation budget\.
### 5\.4\.Resource Cost and On\-Device Deployment
#### Aggregate Pre\-Inference Retrieval Cost and Memory Scaling\.
Table 9\.Aggregate pre\-inference retrieval latency cost \(s\) and peak CPU memory \(MB\) on MRPC under identical single\-CPU settings\.cscsdenotes the fixed chunk size used by streaming under limited memory budgets\.
![[Uncaptioned image]](https://arxiv.org/html/2607.27766v1/x3.png)
Figure 3\.Peak CPU memory \(MB\) versus corpus size during the pre\-inference retrieval workflow, with and without chunked streaming\.Memory results\.
Table[9](https://arxiv.org/html/2607.27766#S5.T9)reports aggregate pre\-inference retrieval cost and peak CPU memory on MRPC under identical single\-CPU settings\. The reported time covers the complete workflow from representation computation through exemplar selection and prompt construction for the evaluated candidate pool and query set, but excludes downstream\-model inference\. It should therefore be interpreted as an aggregate pre\-inference cost rather than query\-time latency alone\. Under this measure, CoRA requires47\.9447\.94s, which is comparable to Top\-kkBERT and lower than DPP\-BERT and MLSM\. Unlike MLSM, CoRA performs no gradient evaluation or optimizer\-based update during this workflow\. When memory is constrained, chunked streaming with\|𝒟b\|=64\|\\mathcal\{D\}\_\{b\}\|=64reduces peak memory from 3,356 MB to 2,396 MB, placing it close to that of Top\-kkBERT\. This reduction increases aggregate pre\-inference time to 57\.23 s, reflecting the additional sequential passes over the candidate pool required by streaming\.
Figure[5\.4](https://arxiv.org/html/2607.27766#S5.SS4.SSS0.Px1)examines memory scaling as the candidate\-pool size increases from 100 to 7,000 on QNLI under identical CPU\-only settings\. Without streaming, peak memory increases from approximately 2\.3 GB to 3\.9 GB over the measured range because the workflow materializes the full feature matrix𝐇~x\\tilde\{\\mathbf\{H\}\}\_\{x\}and conditioning matrix𝐂\\mathbf\{C\}before fitting the retrieval basis\. With streaming, peak memory remains within a narrower range after approximately 3,000 candidates\. The remaining growth is attributable to the persistent projected index𝐙∈ℝn×r\\mathbf\{Z\}\\in\\mathbb\{R\}^\{n\\times r\}, dataset objects, and label storage\. This behavior is consistent with Eq\.[25](https://arxiv.org/html/2607.27766#S4.E25)\. The working memory for alignment is independent ofnnfor fixed chunk and feature dimensions, whereas persistent index storage retains an𝒪\(nr\)\\mathcal\{O\}\(nr\)dependence\.
#### End\-to\-End On\-Device Deployment on Raspberry Pi 5\.
Table 10\.End\-to\-end on\-device results on Raspberry Pi 5 \(8 GB RAM\)\. UseQwen3\.5\-0\.8Bas the on\-device model\. Training\-based methods run out of memory\.We evaluate textual CoRA in an end\-to\-end on\-device setting using a Raspberry Pi 5 with 8 GB RAM, where the complete pre\-inference retrieval workflow and downstream LLM inference are executed locally\. To fit the device memory budget, we useQwen3\.5\-0\.8Bas the on\-device inference model\. As shown in Table[10](https://arxiv.org/html/2607.27766#S5.T10), CoRA achieves the strongest result on all four evaluated tasks relative to Top\-kkBERT, DPP\-BERT, and MLSM\. EPR, CEIL, and TTF could not complete their corresponding task\-adaptation and pre\-inference retrieval workflows within the available device memory and are therefore reported as OOM\. In contrast, CoRA completes the full textual retrieval\-and\-inference pipeline without gradient\-based retriever adaptation\. This experiment establishes end\-to\-end feasibility for textual CoRA on the evaluated device configuration\.
#### Task\-Adaptation and Pre\-Inference Retrieval Cost Compared with Training\-Based Methods\.
Table 11\.Efficiency\-accuracy trade\-off on MRPC\. Time includes the full task adaptation/training and retrieval pipeline\. Peak memory is reported per GPU\. Unlike the CPU\-only setting in the main text, this experiment is conducted on an 8×\\timesRTX 4090 server because the training\-based baselines require multi\-GPU optimization\.We compare CoRA with three representative training\-based demonstration\-selection methods on MRPC: EPR, CEIL, and TTF\. Because these methods require task\-specific retriever adaptation before exemplar selection, Table[11](https://arxiv.org/html/2607.27766#S5.T11)reports the total cost from method\-specific adaptation through pre\-inference retrieval, rather than retrieval alone\.
The training\-based methods are executed on an8×8\\timesRTX 4090 server to accommodate their task\-specific optimization procedures, whereas CoRA’s closed\-form workflow runs on a single RTX 4090\. We report peak memory per GPU together with total wall\-clock time for the complete adaptation\-to\-retrieval workflow\. Under these execution settings, CoRA uses substantially less device memory and completes the workflow markedly faster than EPR, CEIL, and TTF\. These savings are accompanied by accuracy differences of1\.961\.96,2\.922\.92, and1\.721\.72percentage points, respectively, while CoRA reduces adaptation\-to\-retrieval time by factors of18\.118\.1,24\.124\.1, and23\.423\.4\.
These results position CoRA as an efficiency\-oriented alternative\. CEIL attains the strongest MRPC accuracy when multi\-GPU task\-specific optimization is available\. CoRA instead provides a gradient\-free option for settings in which adaptation time, memory, or retriever\-training resources are constrained\.
## 6\.Conclusion and Limitations
We presented*Conditional Retrieval Alignment*\(CoRA\), a gradient\-free framework for task\-conditioned exemplar retrieval in on\-device ICL\. CoRA uses paired candidate inputs and outputs to construct an output\-conditioned retrieval space from complementary frozen\-encoder layers\. Candidate outputs are required only during offline index construction\. At query time, CoRA retrieves exemplars using the query input and a compact precomputed low\-rank index\. This design provides task\-conditioned retrieval without retriever fine\-tuning, backpropagation, or target\-model calls\. We further derived an exact streaming construction procedure and extended the framework to multimodal retrieval\. Experiments across textual and visual\-language benchmarks, together with end\-to\-end deployment on a*Raspberry Pi 5*, demonstrate the effectiveness and practical feasibility of this approach under edge resource budgets\.
The current study also has several limitations\. The current deployment study evaluates a software implementation on a Raspberry Pi 5\. Extending the streaming construction to continuously evolving candidate pools, and designing specialized accelerators for better end\-to\-end energy consumption, remain important directions for future work\.
## References
- J\. Alayrac, J\. Donahue, P\. Luc, A\. Miech, I\. Barr, Y\. Hasson, K\. Lenc, A\. Mensch, K\. Millican, M\. Reynolds,et al\.\(2022\)Flamingo: a visual language model for few\-shot learning\.Advances in neural information processing systems35,pp\. 23716–23736\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p2.1),[§2\.2](https://arxiv.org/html/2607.27766#S2.SS2.p1.1),[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px4.p2.1)\.
- S\. An, B\. Zhou, Z\. Lin, Q\. Fu, B\. Chen, N\. Zheng, W\. Chen, and J\. Lou \(2023\)Skill\-based few\-shot selection for in\-context learning\.InProceedings of the 2023 Conference on Empirical Methods in Natural Language Processing,pp\. 13472–13492\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p1.1),[§1](https://arxiv.org/html/2607.27766#S1.p2.1),[§2\.1](https://arxiv.org/html/2607.27766#S2.SS1.p2.1)\.
- E\. Anderson, Z\. Bai, C\. Bischof, S\. Blackford, J\. Demmel, J\. Dongarra, J\. Du Croz, A\. Greenbaum, S\. Hammarling, A\. McKenney, and D\. Sorensen \(1999\)LAPACK users’ guide\.Third edition,Society for Industrial and Applied Mathematics,Philadelphia, PA\.External Links:ISBN 0\-89871\-447\-8 \(paperback\)Cited by:[§4\.2](https://arxiv.org/html/2607.27766#S4.SS2.p1.1)\.
- J\. Andreas, J\. Bufe, D\. Burkett, C\. Chen, J\. Clausman, J\. Crawford, K\. Crim, J\. DeLoach, L\. Dorner, J\. Eisner,et al\.\(2020\)Task\-oriented dialogue as dataflow synthesis\.Transactions of the Association for Computational Linguistics8,pp\. 556–571\.Cited by:[Table 1](https://arxiv.org/html/2607.27766#S5.T1.12.14.12.1)\.
- A\. Awadalla, I\. Gao, J\. Gardner, J\. Hessel, Y\. Hanafy, W\. Zhu, K\. Marathe, Y\. Bitton, S\. Gadre, S\. Sagawa,et al\.\(2023\)Openflamingo: an open\-source framework for training large autoregressive vision\-language models\.arXiv preprint arXiv:2308\.01390\.Cited by:[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px4.p2.1)\.
- F\. B\. Baldassini, M\. Shukor, M\. Cord, L\. Soulier, and B\. Piwowarski \(2024\)What makes multimodal in\-context learning work?\.InProceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition,pp\. 1539–1550\.Cited by:[§3\.2](https://arxiv.org/html/2607.27766#S3.SS2.SSS0.Px5.p1.1),[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px4.p2.1)\.
- J\. Berant, A\. Chou, R\. Frostig, and P\. Liang \(2013\)Semantic parsing on freebase from question\-answer pairs\.InProceedings of the 2013 conference on empirical methods in natural language processing,pp\. 1533–1544\.Cited by:[Table 1](https://arxiv.org/html/2607.27766#S5.T1.12.10.8.1)\.
- T\. Brown, B\. Mann, N\. Ryder, M\. Subbiah, J\. D\. Kaplan, P\. Dhariwal, A\. Neelakantan, P\. Shyam, G\. Sastry, A\. Askell,et al\.\(2020\)Language models are few\-shot learners\.Advances in neural information processing systems33,pp\. 1877–1901\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p1.1)\.
- C\. Chen, Y\. Zhai, Y\. Zhao, J\. Gao, B\. Ding, and J\. Li \(2025a\)Provoking multi\-modal few\-shot lvlm via exploration\-exploitation in\-context learning\.InProceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition,pp\. 3826–3835\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p2.1),[§2\.2](https://arxiv.org/html/2607.27766#S2.SS2.p2.1)\.
- L\. Chen, G\. Zhang, and E\. Zhou \(2018\)Fast greedy map inference for determinantal point process to improve recommendation diversity\.Advances in neural information processing systems31\.Cited by:[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px2.p1.6)\.
- S\. Chen, Z\. Han, B\. He, J\. Liu, M\. Buckley, Y\. Qin, P\. Torr, V\. Tresp, and J\. Gu \(2025b\)Can multimodal large language models truly perform multimodal in\-context learning?\.In2025 IEEE/CVF Winter Conference on Applications of Computer Vision \(WACV\),pp\. 6000–6010\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p2.1),[§2\.2](https://arxiv.org/html/2607.27766#S2.SS2.p2.1),[§3\.2](https://arxiv.org/html/2607.27766#S3.SS2.SSS0.Px5.p1.1),[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px4.p2.1)\.
- X\. Chen, H\. Fang, T\. Lin, R\. Vedantam, S\. Gupta, P\. Dollár, and C\. L\. Zitnick \(2015\)Microsoft coco captions: data collection and evaluation server\.arXiv preprint arXiv:1504\.00325\.Cited by:[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px4.p1.1)\.
- F\. Dalvi, H\. Sajjad, N\. Durrani, and Y\. Belinkov \(2020\)Analyzing redundancy in pretrained transformer models\.InProceedings of the 2020 Conference on Empirical Methods in Natural Language Processing \(EMNLP\),pp\. 4908–4926\.Cited by:[§3\.2](https://arxiv.org/html/2607.27766#S3.SS2.SSS0.Px2.p1.8)\.
- J\. Devlin, M\. Chang, K\. Lee, and K\. Toutanova \(2019\)Bert: pre\-training of deep bidirectional transformers for language understanding\.InProceedings of the 2019 conference of the North American chapter of the association for computational linguistics: human language technologies, volume 1 \(long and short papers\),pp\. 4171–4186\.Cited by:[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px2.p1.6),[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px3.p1.5)\.
- Y\. Ding, C\. Niu, F\. Wu, S\. Tang, C\. Lyu, and G\. Chen \(2024\)Enhancing on\-device llm inference with historical cloud\-based llm interactions\.InProceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining,KDD ’24,New York, NY, USA,pp\. 597–608\.External Links:ISBN 9798400704901,[Link](https://doi.org/10.1145/3637528.3671679),[Document](https://dx.doi.org/10.1145/3637528.3671679)Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p1.1)\.
- W\. B\. Dolan, C\. Quirk, and C\. Brockett \(2004\)Unsupervised construction of large paraphrase corpora: exploiting massively parallel news sources\.InCOLING 2004: Proceedings of the 20th international conference on computational linguistics,pp\. 350–356\.Cited by:[Table 1](https://arxiv.org/html/2607.27766#S5.T1.12.5.3.1)\.
- S\. Doveh, S\. Perek, M\. J\. Mirza, W\. Lin, A\. Alfassy, A\. Arbelle, S\. Ullman, and L\. Karlinsky \(2024\)Towards multimodal in\-context learning for vision and language models\.InEuropean Conference on Computer Vision,pp\. 250–267\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p2.1),[§2\.2](https://arxiv.org/html/2607.27766#S2.SS2.p1.1)\.
- G\. Gao, A\. Taymanov, E\. Salinas, P\. Mineiro, and D\. Misra \(2024\)Aligning llm agents by learning latent preference from user edits\.Advances in neural information processing systems37,pp\. 136873–136896\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p1.1)\.
- Y\. Goyal, T\. Khot, D\. Summers\-Stay, D\. Batra, and D\. Parikh \(2017\)Making the v in vqa matter: elevating the role of image understanding in visual question answering\.InProceedings of the IEEE conference on computer vision and pattern recognition,pp\. 6904–6913\.Cited by:[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px4.p1.1)\.
- A\. Grattafiori, A\. Dubey, A\. Jauhri, A\. Pandey, A\. Kadian, A\. Al\-Dahle, A\. Letman, A\. Mathur, A\. Schelten, A\. Vaughan,et al\.\(2024\)The llama 3 herd of models\.arXiv preprint arXiv:2407\.21783\.Cited by:[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px3.p1.5)\.
- D\. Gurari, Q\. Li, A\. J\. Stangl, A\. Guo, C\. Lin, K\. Grauman, J\. Luo, and J\. P\. Bigham \(2018\)Vizwiz grand challenge: answering visual questions from blind people\.InProceedings of the IEEE conference on computer vision and pattern recognition,pp\. 3608–3617\.Cited by:[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px4.p1.1)\.
- B\. Huang, C\. Mitra, A\. Arbelle, L\. Karlinsky, T\. Darrell, and R\. Herzig \(2024\)Multimodal task vectors enable many\-shot multimodal in\-context learning\.Advances in Neural Information Processing Systems37,pp\. 22124–22153\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p2.1)\.
- P\. Huber, E\. Chang, W\. Wen, I\. Fedorov, T\. Elgamal, H\. Huang, N\. Suda, C\. Sankar, V\. Vogeti, Y\. Wang,et al\.\(2025\)MobileLLM\-pro technical report\.arXiv preprint arXiv:2511\.06719\.Cited by:[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px3.p1.5)\.
- G\. Jawahar, B\. Sagot, and D\. Seddah \(2019\)What does bert learn about the structure of language?\.InProceedings of the 57th Annual Meeting of the Association for Computational Linguistics,pp\. 3651–3657\.Cited by:[§3\.1](https://arxiv.org/html/2607.27766#S3.SS1.SSS0.Px2.p1.1)\.
- J\. Killingback, O\. Meshi, H\. Li, H\. Zamani, and M\. Karimzadehgan \(2026\)A unified model and document representation for on\-device retrieval\-augmented generation\.arXiv preprint arXiv:2604\.14403\.Cited by:[§2\.3](https://arxiv.org/html/2607.27766#S2.SS3.p2.1)\.
- S\. Kornblith, M\. Norouzi, H\. Lee, and G\. Hinton \(2019\)Similarity of neural network representations revisited\.InInternational conference on machine learning,pp\. 3519–3529\.Cited by:[§3\.2](https://arxiv.org/html/2607.27766#S3.SS2.SSS0.Px2.p2.1)\.
- S\. Kudugunta, A\. Kusupati, T\. Dettmers, K\. Chen, I\. Dhillon, Y\. Tsvetkov, H\. Hajishirzi, S\. Kakade, A\. Farhadi, and P\. Jain \(2024\)Matformer: nested transformer for elastic inference\.Advances in Neural Information Processing Systems37,pp\. 140535–140564\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p1.1)\.
- J\. Leonhardt, H\. Müller, K\. Rudra, M\. Khosla, A\. Anand, and A\. Anand \(2024\)Efficient neural ranking using forward indexes and lightweight encoders\.ACM Trans\. Inf\. Syst\.42\(5\)\.External Links:ISSN 1046\-8188,[Link](https://doi.org/10.1145/3631939),[Document](https://dx.doi.org/10.1145/3631939)Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p1.1),[§2\.3](https://arxiv.org/html/2607.27766#S2.SS3.p1.1)\.
- H\. Li, A\. Arora, S\. Chen, A\. Gupta, S\. Gupta, and Y\. Mehdad \(2021\)MTOP: a comprehensive multilingual task\-oriented semantic parsing benchmark\.InProceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume,pp\. 2950–2962\.Cited by:[Table 1](https://arxiv.org/html/2607.27766#S5.T1.12.13.11.1)\.
- X\. Li, K\. Lv, H\. Yan, T\. Lin, W\. Zhu, Y\. Ni, G\. Xie, X\. Wang, and X\. Qiu \(2023\)Unified demonstration retriever for in\-context learning\.InProceedings of the 61st Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),pp\. 4644–4668\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p2.1),[§2\.1](https://arxiv.org/html/2607.27766#S2.SS1.p3.1)\.
- Y\. Li, J\. Yang, T\. Yun, P\. Feng, J\. Huang, and R\. Tang \(2025\)Taco: enhancing multimodal in\-context learning via task mapping\-guided sequence configuration\.InProceedings of the 2025 Conference on Empirical Methods in Natural Language Processing,pp\. 736–763\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p2.1),[§2\.2](https://arxiv.org/html/2607.27766#S2.SS2.p2.1)\.
- J\. Lin, W\. Chen, Y\. Lin, C\. Gan, S\. Han,et al\.\(2020\)Mcunet: tiny deep learning on iot devices\.Advances in neural information processing systems33,pp\. 11711–11722\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p1.1)\.
- S\. Lin and J\. Lin \(2023\)A dense representation framework for lexical and semantic matching\.ACM Trans\. Inf\. Syst\.41\(4\)\.External Links:ISSN 1046\-8188,[Link](https://doi.org/10.1145/3582426),[Document](https://dx.doi.org/10.1145/3582426)Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p2.1),[§2\.1](https://arxiv.org/html/2607.27766#S2.SS1.p1.1)\.
- X\. V\. Lin, C\. Wang, L\. Zettlemoyer, and M\. D\. Ernst \(2018\)NL2Bash: a corpus and semantic parser for natural language interface to the linux operating system\.InProceedings of the Eleventh International Conference on Language Resources and Evaluation \(LREC 2018\),Cited by:[Table 1](https://arxiv.org/html/2607.27766#S5.T1.12.12.10.1)\.
- C\. Liu, D\. Chen, Y\. Huang, W\. Xiao, H\. Liu, Y\. Zhang, H\. Li, X\. Liao, and H\. Jin \(2025a\)SeIM: in\-memory acceleration for approximate nearest neighbor search\.In2025 62nd ACM/IEEE Design Automation Conference \(DAC\),pp\. 1–7\.Cited by:[§4\.2](https://arxiv.org/html/2607.27766#S4.SS2.p1.1)\.
- H\. Liu, W\. Wang, H\. Sun, C\. X\. Tian, C\. Kong, X\. Dong, and H\. Li \(2025b\)Unraveling the mechanics of learning\-based demonstration selection for in\-context learning\.InProceedings of the 63rd Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),pp\. 2623–2641\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p3.1),[§2\.4](https://arxiv.org/html/2607.27766#S2.SS4.p1.1),[§3\.1](https://arxiv.org/html/2607.27766#S3.SS1.SSS0.Px2.p1.1),[§3\.2](https://arxiv.org/html/2607.27766#S3.SS2.SSS0.Px2.p1.8),[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px1.p1.6),[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px2.p1.6),[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px3.p1.5),[§5\.2](https://arxiv.org/html/2607.27766#S5.SS2.SSS0.Px3.p2.1)\.
- J\. Liu, D\. Shen, Y\. Zhang, W\. B\. Dolan, L\. Carin, and W\. Chen \(2022\)What makes good in\-context examples for gpt\-3?\.InProceedings of Deep Learning Inside Out \(DeeLIO 2022\): The 3rd Workshop on Knowledge Extraction and Integration for Deep Learning Architectures,pp\. 100–114\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p2.1),[§2\.1](https://arxiv.org/html/2607.27766#S2.SS1.p2.1)\.
- Y\. Lu, M\. Bartolo, A\. Moore, S\. Riedel, and P\. Stenetorp \(2022\)Fantastically ordered prompts and where to find them: overcoming few\-shot prompt order sensitivity\.InProceedings of the 60th Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),pp\. 8086–8098\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p1.1)\.
- X\. Ma, Z\. Wang, P\. Ng, R\. Nallapati, and B\. Xiang \(2019\)Universal text representation from bert: an empirical study\.arXiv preprint arXiv:1910\.07973\.Cited by:[§3\.1](https://arxiv.org/html/2607.27766#S3.SS1.SSS0.Px2.p1.1)\.
- P\. Mannocci, E\. Giannone, and D\. Ielmini \(2023\)In\-memory principal component analysis by analogue closed\-loop eigendecomposition\.IEEE Transactions on Circuits and Systems II: Express Briefs71\(4\),pp\. 1839–1843\.Cited by:[§4\.2](https://arxiv.org/html/2607.27766#S4.SS2.p1.1)\.
- Z\. Min and X\. Wang \(2025\)DOCS: quantifying weight similarity for deeper insights into large language models\.InThe Thirteenth International Conference on Learning Representations,Cited by:[§3\.2](https://arxiv.org/html/2607.27766#S3.SS2.SSS0.Px2.p1.8)\.
- C\. Nie, C\. Jiang, L\. Xiao, W\. Zhang, and Z\. He \(2025\)PICK: an sram\-based processing\-in\-memory accelerator for k\-nearest\-neighbor search in point clouds\.In2025 62nd ACM/IEEE Design Automation Conference \(DAC\),pp\. 1–7\.Cited by:[§4\.2](https://arxiv.org/html/2607.27766#S4.SS2.p1.1)\.
- OpenClaw contributors \(2026\)OpenClaw\.Note:[https://github\.com/openclaw/openclaw](https://github.com/openclaw/openclaw)Open\-source personal AI assistant, version 2026\.3\.13, accessed 2026\-03\-15Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p1.1)\.
- Qwen Team \(2026\)Qwen3\.5: towards native multimodal agents\.External Links:[Link](https://qwen.ai/blog?id=qwen3.5)Cited by:[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px3.p1.5),[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px4.p2.1)\.
- A\. Radford, J\. W\. Kim, C\. Hallacy, A\. Ramesh, G\. Goh, S\. Agarwal, G\. Sastry, A\. Askell, P\. Mishkin, J\. Clark,et al\.\(2021\)Learning transferable visual models from natural language supervision\.InInternational conference on machine learning,pp\. 8748–8763\.Cited by:[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px4.p1.1)\.
- N\. Reimers and I\. Gurevych \(2019\)Sentence\-bert: sentence embeddings using siamese bert\-networks\.InProceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing \(EMNLP\-IJCNLP\),pp\. 3982–3992\.Cited by:[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px2.p1.6)\.
- S\. E\. Robertson, S\. Walker, S\. Jones, M\. M\. Hancock\-Beaulieu, M\. Gatford,et al\.\(1995\)Okapi at trec\-3\.British Library Research and Development Department\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p2.1),[§2\.1](https://arxiv.org/html/2607.27766#S2.SS1.p1.1),[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px2.p1.6)\.
- O\. Rubin, J\. Herzig, and J\. Berant \(2022\)Learning to retrieve prompts for in\-context learning\.InProceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies,pp\. 2655–2671\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p2.1),[§2\.1](https://arxiv.org/html/2607.27766#S2.SS1.p3.1),[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px2.p1.6)\.
- D\. Schwenk, A\. Khandelwal, C\. Clark, K\. Marino, and R\. Mottaghi \(2022\)A\-okvqa: a benchmark for visual question answering using world knowledge\.InEuropean conference on computer vision,pp\. 146–162\.Cited by:[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px4.p1.1)\.
- Y\. Shao, T\. Li, W\. Shi, Y\. Liu, and D\. Yang \(2024\)Privacylens: evaluating privacy norm awareness of language models in action\.Advances in Neural Information Processing Systems37,pp\. 89373–89407\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p1.1)\.
- R\. Socher, A\. Perelygin, J\. Wu, J\. Chuang, C\. D\. Manning, A\. Y\. Ng, and C\. Potts \(2013\)Recursive deep models for semantic compositionality over a sentiment treebank\.InProceedings of the 2013 conference on empirical methods in natural language processing,pp\. 1631–1642\.Cited by:[Table 1](https://arxiv.org/html/2607.27766#S5.T1.12.4.2.1)\.
- K\. Sun, J\. Wu, A\. K\. Bashir, J\. Li, H\. Xu, Q\. Pan, and Y\. D\. Al\-Otaibi \(2024\)Personalized privacy\-preserving distributed artificial intelligence for digital\-twin\-driven vehicle road cooperation\.IEEE Internet of Things Journal11\(22\),pp\. 35902–35916\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p1.1)\.
- A\. Talmor, J\. Herzig, N\. Lourie, and J\. Berant \(2019\)Commonsenseqa: a question answering challenge targeting commonsense knowledge\.InProceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 \(Long and Short Papers\),pp\. 4149–4158\.Cited by:[Table 1](https://arxiv.org/html/2607.27766#S5.T1.12.7.5.1)\.
- A\. Voronov, L\. Wolf, and M\. Ryabinin \(2024\)Mind your format: towards consistent evaluation of in\-context learning improvements\.InFindings of the Association for Computational Linguistics: ACL 2024,pp\. 6287–6310\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p1.1)\.
- A\. Wang, A\. Singh, J\. Michael, F\. Hill, O\. Levy, and S\. Bowman \(2018\)GLUE: a multi\-task benchmark and analysis platform for natural language understanding\.InProceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP,pp\. 353–355\.Cited by:[Table 1](https://arxiv.org/html/2607.27766#S5.T1.12.6.4.1)\.
- C\. Wang, Z\. Yuan, P\. Zhou, Z\. Xu, R\. Li, and D\. O\. Wu \(2023\)The security and privacy of mobile\-edge computing: an artificial intelligence perspective\.IEEE Internet of Things Journal10\(24\),pp\. 22008–22032\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p1.1)\.
- J\. Ye, Z\. Wu, J\. Feng, T\. Yu, and L\. Kong \(2023\)Compositional exemplars for in\-context learning\.InInternational Conference on Machine Learning,pp\. 39818–39833\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p2.1),[§2\.1](https://arxiv.org/html/2607.27766#S2.SS1.p3.1),[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px1.p1.6),[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px2.p1.6),[§5\.2](https://arxiv.org/html/2607.27766#S5.SS2.SSS0.Px3.p2.1)\.
- J\. M\. Zelle and R\. J\. Mooney \(1996\)Learning to parse database queries using inductive logic programming\.InProceedings of the national conference on artificial intelligence,pp\. 1050–1055\.Cited by:[Table 1](https://arxiv.org/html/2607.27766#S5.T1.12.11.9.1)\.
- R\. Zellers, A\. Holtzman, Y\. Bisk, A\. Farhadi, and Y\. Choi \(2019\)HellaSwag: can a machine really finish your sentence?\.InProceedings of the 57th Annual Meeting of the Association for Computational Linguistics,pp\. 4791–4800\.Cited by:[Table 1](https://arxiv.org/html/2607.27766#S5.T1.12.8.6.1)\.
- P\. Zhang, G\. Bai, H\. Yin, and Z\. Huang \(2023\)Proactive privacy\-preserving learning for cross\-modal retrieval\.ACM Trans\. Inf\. Syst\.41\(2\)\.External Links:ISSN 1046\-8188,[Link](https://doi.org/10.1145/3545799),[Document](https://dx.doi.org/10.1145/3545799)Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p1.1),[§2\.2](https://arxiv.org/html/2607.27766#S2.SS2.p3.1)\.
- T\. Zhang, J\. Yi, B\. Yao, Z\. Xu, and A\. Shrivastava \(2024\)Nomad\-attention: efficient llm inference on cpus through multiply\-add\-free attention\.Advances in Neural Information Processing Systems37,pp\. 112706–112730\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p1.1)\.
- Y\. Zhang, M\. Li, D\. Long, X\. Zhang, H\. Lin, B\. Yang, P\. Xie, A\. Yang, D\. Liu, J\. Lin, F\. Huang, and J\. Zhou \(2025\)Qwen3 embedding: advancing text embedding and reranking through foundation models\.arXiv preprint arXiv:2506\.05176\.Cited by:[§5\.1](https://arxiv.org/html/2607.27766#S5.SS1.SSS0.Px2.p1.6)\.
- H\. Zhao, Z\. Cai, S\. Si, X\. Ma, K\. An, L\. Chen, Z\. Liu, S\. Wang, W\. Han, and B\. Chang \(2024a\)MMICL: empowering vision\-language model with multi\-modal in\-context learning\.InThe Twelfth International Conference on Learning Representations,Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p2.1),[§2\.2](https://arxiv.org/html/2607.27766#S2.SS2.p1.1)\.
- P\. Zhao, H\. Zhang, Q\. Yu, Z\. Wang, Y\. Geng, F\. Fu, L\. Yang, W\. Zhang, J\. Jiang, and B\. Cui \(2026\)Retrieval\-augmented generation for ai\-generated content: a survey\.Data Science and Engineering,pp\. 1–29\.Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p1.1)\.
- W\. X\. Zhao, J\. Liu, R\. Ren, and J\. Wen \(2024b\)Dense text retrieval based on pretrained language models: a survey\.ACM Trans\. Inf\. Syst\.42\(4\)\.External Links:ISSN 1046\-8188,[Link](https://doi.org/10.1145/3637870),[Document](https://dx.doi.org/10.1145/3637870)Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p2.1),[§2\.1](https://arxiv.org/html/2607.27766#S2.SS1.p1.1)\.
- H\. Zhou, X\. Wan, L\. Proleev, D\. Mincu, J\. Chen, K\. A\. Heller, and S\. Roy \(2024\)Batch calibration: rethinking calibration for in\-context learning and prompt engineering\.InThe Twelfth International Conference on Learning Representations,Cited by:[§1](https://arxiv.org/html/2607.27766#S1.p1.1)\.
- P\. Zuo, Q\. Wang, Y\. Luo, R\. Xie, S\. Wang, Z\. Cheng, L\. Bao, Z\. Wang, Y\. Cai, R\. Huang,et al\.\(2025\)Precise and scalable analogue matrix equation solving using resistive random\-access memory chips\.Nature Electronics,pp\. 1–12\.Cited by:[§4\.2](https://arxiv.org/html/2607.27766#S4.SS2.p1.1)\.相似文章
上下文优化下的检索增强生成:从梯度下降视角
本文研究检索增强生成作为上下文优化过程,表明线性自注意力可以在统一的RAG目标上实现梯度下降。它提出了一种轻量级方法,适用于冻结的RAG大语言模型,通过预测上下文条件的更新,在多个问答基准上提升了性能。
从失败中学习:基于硬负样本的检索中心思维链用于统一多模态检索
本文提出了UniME-R1,一种用于统一多模态检索的嵌入器-顾问框架,该框架基于检索反馈生成检索中心思维链(RC-CoT),通过从硬负样本中学习来提升检索性能。
面向长周期任务的智能体兼容上下文管理
介绍AdaCoM,一种基于外部LLM的上下文管理器,适用于冻结的智能体。通过保留任务约束和修剪过时内容,利用强化学习提升长周期任务性能,并在网络搜索和深度研究基准上进行了实验。
Q-RAG:通过基于价值的 Embedder 训练实现长上下文多步检索
Q-RAG 引入了一种基于强化学习的 Embedder 模型微调方法,以实现高效的多步检索,并在长达 10M token 的长上下文基准测试中取得了最先进的结果。该方法为微调小型 LLM 以处理复杂的多步搜索任务提供了一种资源高效的替代方案。
ReCoLoRA:面向连续大语言模型微调的频谱感知递归整合方法
ReCoLoRA 是一个频谱感知框架,用于大型语言模型的连续微调。它通过递归整合低秩适配器来防止灾难性遗忘,在多个骨干网络的连续 GLUE 任务上取得了更优的性能。