Abstract
Large language models (LLMs) have shown impressive abilities in leveraging pretrained knowledge through prompting, but they often struggle with unseen tasks, particularly in data-scarce scenarios. While cross-task in-context learning offers a direct solution for transferring knowledge across tasks, it still faces critical challenges in terms of robustness, scalability, and efficiency. In this paper, we investigate whether cross-task transfer can be achieved via latent space steering without parameter updates or input expansion. Through an analysis of activation patterns in the latent space of LLMs, we observe that the enhanced activations induced by in-context examples have consistent patterns across different tasks. Inspired by these findings, we propose CAST, a novel Cross-task Activation Steering Transfer framework that enables effective transfer by manipulating the model's internal activation states. Our approach first selects influential and diverse samples from high-resource tasks, then utilizes their contrastive representation-enhanced activations to adapt LLMs to low-resource tasks. Extensive experiments across both cross-domain and cross-lingual transfer settings show that our method outperforms competitive baselines and demonstrates superior scalability and lower computational costs.
Abstract (translated)
大型语言模型(LLMs)通过提示展示出利用预训练知识的出色能力,但在处理未见过的任务时特别是在数据稀缺的情况下经常遇到困难。虽然跨任务的在上下文学习提供了直接的知识转移解决方案,它仍然面临着关于鲁棒性、可扩展性和效率的关键挑战。本文探讨了是否可以通过潜在空间引导实现跨任务迁移而无需更新参数或扩展输入。通过对LLMs中激活模式的分析,我们观察到由在上下文示例引起的增强激活在不同任务之间具有一致的模式。受到这一发现的启发,我们提出了CAST(Cross-task Activation Steering Transfer),这是一种通过操控模型内部激活状态来实现有效迁移的新框架。我们的方法首先从高资源任务中选择有影响力且多样化的样本,然后利用它们的对比表示增强激活将LLMs适应到低资源任务。跨领域和跨语言转移设置中的广泛实验表明,我们的方法优于竞争基准,并表现出更优的可扩展性和更低的计算成本。
URL
https://arxiv.org/abs/2507.13236