Manuscript Offprint

arXiv:2608.29613

Cross-lingual Functional Vectors for Emotion Detection in Large Language Models

Jieying Xue, Phuong Minh Nguyen, Minh Le Nguyen, Shogo Okada

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

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.

1 Introduction

Large language models (LLMs) exhibit remarkable in-context learning (ICL) abilities, enabling them to perform new tasks from only a few demonstrations without parameter updates (Brown et al., 2020; Adcock et al., 2026; Yang et al., 2025; Singh et al., 2025). Recent studies suggest that this capability is partially encoded in latent activation patterns within the LLMs. In particular, function vectors (FVs) have been proposed as latent task representations that steer model behavior through activation interventions at intermediate layers of LLMs (Todd et al., 2024). Existing studies have demonstrated the effectiveness of FVs on relatively constrained tasks, such as simple classification, retrieval, and factual induction (Todd et al., 2024). However, whether FVs remain effective for semantically complex tasks that require richer contextual understanding and reasoning remains largely unexplored. Therefore, this work investigates FVs using multilingual multi-label emotion recognition as a challenging semantic classification benchmark. Unlike the relatively simple tasks considered in previous work, multilingual emotion recognition requires implicit intention understanding, and the disambiguation of subtle affective expressions across substantial linguistic variation (Muhammad et al., 2025; Belay et al., 2024). This task provides a challenging testbed for evaluating whether FVs encode transferable task-level representations beyond relatively simple pattern matching.

Beyond task complexity, we further investigate the cross-lingual transferability of FVs. Prior studies have shown that multilingual LLMs exhibit partially shared language-agnostic latent representations across languages (Zhang et al., 2024; Zeng et al., 2025; Bandarkar et al., 2025), while other work suggests that these representations may remain biased toward English-centered latent structures (Zhao et al., 2024; Wendler et al., 2024; Schut et al., 2025; Tezuka and Inoue, 2025). These observations naturally raise an important question: Do FVs encode language-specific behaviors, or transferable task-level representations that generalize across languages? If the latter is true, FVs extracted from one language should be able to re-cover and transfer task behavior to other languages without requiring target-language demonstrations during inference.

To answer this question, we conduct a comprehensive study of FVs under both zero-shot and few-shot prompting settings. In the zero-shot setup, we evaluate FVs under both standard clean prompts and a perturbed zero-shot setting. The perturbed setting introduces controlled distractor labels into the prompt, allowing us to isolate the task-steering effect of FVs and evaluate whether cross-lingual FVs can recover the intended task behavior despite misleading contextual information. Experimental results demonstrate that FVs extracted from one language can be effectively transferred to multiple target languages, and are able to steer task behavior under both clean and perturbed zero-shot conditions. We further investigate whether FVs provide complementary task representations under multilingual few-shot prompting. Specifically, FVs are injected into the induction heads of LLMs during inference and shared across languages. While FVs do not completely replace the benefits of standard few-shot ICL, they consistently enhance multilingual few-shot performance and partially reproduce the task-steering effects without requiring additional demonstrations during inference. Moreover, we observe that each LLM exhibits a relatively stable range of attention heads for constructing effective FVs, and that this pattern remains consistent across languages. Overall, our findings suggest that FVs encode transferable task-level representations that are less dependent on language-specific lexical patterns, highlighting their potential as an efficient and transferable mechanism for multilingual task adaptation. Our contributions are summarized as follows:

• We extend FV evaluation from relatively constrained tasks to a semantically complex multilingual setting. We show that FVs remain effective on tasks requiring contextual semantic reasoning, suggesting that the limitations observed in prior work are not inherent to FVs themselves.

• We provide a systematic analysis of FV intervention across transformer layers and show that distributing FV interventions across multiple layers substantially outperforms single-layer intervention, offering a practical strategy for applying FVs to complex semantic tasks.

• We present the first systematic study of cross-lingual FVs for multilingual semantic classification, demonstrating effective task transfer under both standard clean and controlled perturbed zero-shot prompting.

• We analyze the stability of attention-head selection for FVs across languages and find that each LLM exhibits a stable range of attention heads for constructing effective FVs, and that this pattern remains consistent across languages.

• We demonstrate that cross-lingual FVs complement multilingual few-shot prompting. Although they do not fully replace standard few-shot ICL, cross-lingual FVs consistently improve multilingual few-shot performance and partially reproduce the task-steering effects of in-context learning without requiring additional demonstrations during inference.