大语言模型中情感检测的跨语言功能向量

·

研究论文 · 2026/09/01

功能向量(FVs)作为一种通过注入从上下文演示中提取的任务特定潜在方向表示来引导大型语言模型(LLMs)行为的机制,近年来受到关注。尽管先前研究表明FVs能在结构化上下文学习环境中恢复任务行为,但其在语义复杂任务上的有效性及跨语言泛化能力仍未充分探索。本文以多语言多标签情感识别作为具有挑战性的语义分类基准,研究FVs的跨语言可迁移性。具体而言,我们考察在推理时不提供演示的干净和扰动零样本设置下,从源语言提取的FVs能否引导另一种语言的任务行为。在多种跨语言设置中,应用FVs显著提升了性能,表明FVs捕获了与语言无关的、任务相关的信号,而非纯粹的语言特定词汇模式,并凸显了其作为轻量级、可迁移的多语言任务适应机制的潜力。我们观察到每个LLM在构建有效FVs时表现出相对稳定的最优注意力头范围,且该模式在不同语言间保持一致。此外,FVs能部分复制标准少样本上下文学习的任务引导效果,同时避免处理多个演示的计算开销,使其适用于大规模实际应用。代码已开源。

该研究填补了功能向量在跨语言语义任务中应用的空白,证明了其语言无关性和轻量级优势,为多语言模型的高效适配提供了新思路,具有重要的理论价值和实际应用潜力。

Function vectors (FVs) have recently emerged as a promising mechanism for steering the behavior of large language models (LLMs) by injecting task-specific latent direction representations derived from in-context demonstrations. While prior studies have shown that FVs can recover task behavior in structured in-context learning settings, their effectiveness on semantically complex tasks and their ability to generalize across languages remain underexplored. We investigate the cross-lingual transferability of FVs using multilingual multi-label emotion recognition as a challenging semantic classification benchmark. Specifically, we examine whether FVs extracted from a source language can steer task behavior in another language under both standard clean and perturbed zero-shot settings without providing demonstrations during inference. Across diverse cross-lingual settings, applying FVs substantially improves performance, suggesting that FVs capture language-agnostic, task-relevant signals rather than purely language-specific lexical patterns, and highlighting their potential as a lightweight and transferable mechanism for multilingual task adaptation. We observe that each LLM exhibits a relatively stable optimal range of attention heads for constructing effective FVs, and the pattern remains consistent across languages. In addition, FVs can partially replicate the task-steering effects of standard few-shot in-context learning while avoiding the computational overhead of processing multiple demonstrations, making them effective for large-scale practical applications. Our code is available at https://github.com/yingjie7/cross_lingual_fvs.

阅读原文

参与讨论