Gradient-free Task-Conditioned Retrieval for On-Device In-Context Learning

📄 arXiv: 2607.27766v1 📥 PDF

作者: Xinyu Luo, Hui Liu, Yihua Shao, Junyi Yang, Arindam Basu, Haoliang Li

分类: cs.CL, cs.IR, cs.LG

发布日期: 2026-07-30

备注: Under review


💡 一句话要点

提出CoRA框架以解决设备端任务条件检索问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 任务条件检索 无梯度学习 设备端学习 多模态检索 低秩分解

📋 核心要点

  1. 现有的设备端上下文学习方法在任务条件检索时面临计算和内存限制,难以有效利用任务特定信息。
  2. 论文提出的CoRA框架通过无梯度方式将编码器转变为任务条件检索器,利用配对输入输出进行检索。
  3. 在多个文本和多模态基准上进行的实验表明,CoRA在检索效率和准确性上均有显著提升。

📝 摘要(中文)

设备端的上下文学习(ICL)依赖于预推理检索来选择示例,以便在下游模型推理之前提供有用的上下文。这种检索必须利用任务特定信息,同时在有限的计算、内存和数据曝光预算下操作。本文提出了条件检索对齐(CoRA),这是一个无梯度框架,通过配对候选输入和输出将冻结的编码器转换为任务条件检索器。CoRA选择互补的编码器层,从候选记忆中构建输出导向的条件空间,并通过封闭形式的岭回归将候选输入表示对齐到该空间。低秩分解产生紧凑的检索基础,查询时仅需查询输入和预计算索引。实验表明,CoRA在不进行检索器微调、反向传播或目标模型调用的情况下,支持有效的任务条件检索。

🔬 方法详解

问题定义:本文解决的是设备端上下文学习中的任务条件检索问题,现有方法在计算和内存资源有限的情况下,难以有效利用任务特定信息进行检索。

核心思路:CoRA框架通过无梯度的方式,将冻结的编码器转化为任务条件检索器,利用配对的候选输入和输出进行条件检索,从而避免了传统方法中的微调和反向传播。

技术框架:CoRA的整体架构包括选择互补的编码器层、构建输出导向的条件空间、通过岭回归对齐候选输入表示,以及低秩分解生成紧凑的检索基础。

关键创新:CoRA的主要创新在于其无梯度的检索方式和低秩压缩技术,使得检索过程高效且不依赖于目标模型的调用,显著提高了任务条件检索的灵活性和效率。

关键设计:在设计中,CoRA通过选择合适的编码器层和构建条件空间,利用封闭形式的岭回归进行输入对齐,确保了检索的准确性和高效性。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,CoRA在十个文本数据集和四个多模态基准上表现出色,尤其是在使用Llama-3.2-1B和MobileLLM-Pro时,检索效率和准确性均显著提升,且无需进行检索器微调或目标模型调用。

🎯 应用场景

该研究的潜在应用领域包括移动设备上的智能助手、边缘计算环境中的实时数据处理,以及需要快速响应的任务导向应用。CoRA框架的高效性和灵活性使其在资源受限的设备上具有实际价值,能够推动更多智能应用的发展。

📄 摘要(原文)

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.