Source-linked AI summary

Controllable Affective Generation via Latent Vector Steering

Xixian Yong, Siyuan Chang, Yingying Zhang, Xian Wu, Xiao Zhou

arXiv:2608.25569v1cs.CLcs.AI

TL;DR

Aligned LLMs can produce emotionally flattened responses, motivating methods that add affective control without retraining. EmoVec extracts and purifies emotion-specific latent directions for inference-time steering, and experiments across three LLMs and eight emotions show improved emotional expressiveness while largely preserving semantic content. The approach is primarily scoped to controlled affective modulation rather than the full dynamics of human emotion, and its evaluation centers on single-turn text-based mental-health consultations judged by an LLM.

  • Problem

    Aligned LLM outputs often flatten emotion, while prompt engineering and supervised fine-tuning are brittle or resource-intensive approaches to affective control.

  • Method

    EmoVec extracts emotion-specific directions from paired neutral and emotion-conditioned responses, purifies them, and injects them into the final residual stream during inference with adjustable intensity.

  • Results

    Across three LLMs and eight emotions, EmoVec improves emotional expressiveness while largely preserving semantic content.

  • Takeaways & Limitations

    EmoVec provides a controllable, practically useful way to manipulate affective information in instruction-tuned LLMs without modifying model weights.

  • Takeaways & Limitations

    The evaluation covers text-based, single-turn mental-health consultations and uses an LLM-as-a-judge protocol, excluding multi-turn, longitudinal, and multimodal interactions.

Abstract

from arXiv · show

Large Language Models (LLMs) often produce emotionally flattened responses after alignment, limiting their effectiveness in affect-sensitive applications. In this paper, we propose EmoVec, a lightweight framework for controllable affective generation via latent vector steering. EmoVec extracts emotion-specific directions from paired neutral and emotion-conditioned responses using contrastive activation addition, and further refines them through task-specific debiasing and principal subspace removal. During inference, these vectors are injected into the final residual stream with static or scenario-adaptive scaling, enabling continuous control over emotional intensity without updating model weights. Experiments across three LLMs and eight emotions show that EmoVec consistently improves emotional salience while largely preserving semantic content, fluency, and coherence. Ablation studies and human evaluation further confirm the effectiveness of vector purification and adaptive scaling, establishing EmoVec as a practical inference-time method for affective control in deployed LLMs.

1 Introduction

Aligned LLMs often flatten emotional expression, while prompting and fine-tuning have practical limitations. EmoVec addresses this gap by extracting and purifying emotion directions, then injecting them at inference for adjustable affective intensity.

  • RLHF-conditioned outputs often exhibit emotional flattening, generic reassurance, excessive hedging, and context-insensitive agreement.
  • Prompt engineering is brittle and context-expensive, whereas supervised fine-tuning requires labeled data and substantial computation without retraining-free control.
  • Emotional representations become increasingly linearly separable from middle to late layers and peak in the final layer.
  • The framework injects vectors into the final residual stream during inference, using tunable scaling to control emotion type and intensity without weight updates or prompt engineering.
  • EmoVec extracts emotion-specific steering vectors from semantically matched neutral and emotional responses using Contrastive Activation Addition.
  • EmoVec enables continuous affective-intensity modulation while preserving semantic consistency, supporting professional neutrality, empathetic support, and expressive creativity.
  • The paper contributes evidence for layer-wise emergence of emotional representations, a contrastive vector-extraction pipeline, and dynamic scenario-specific intensity control.

2 Related Work

Prior work studies affective capabilities and activation-based behavior control in language models, but EmoVec targets fine-grained emotion-intensity control. It combines latent representation steering with task-specific debiasing and evaluates semantic preservation across steering strengths.

  • Affective Computing in Language Models: Affective-computing research examines how language models recognize and generate emotional states, including valence, arousal, and appraisal-based elicitation.
  • Representation Engineering and Activation Steering: Representation engineering controls language-model behavior by manipulating hidden representations without updating model parameters.
  • Representation Engineering and Activation Steering: Prior activation-steering studies target properties such as writing style, sentiment, and persona-related representations.
  • Representation Engineering and Activation Steering: EmoVec differs by targeting fine-grained emotion-intensity control rather than coarse sentiment or generic style transfer.
  • Representation Engineering and Activation Steering: The framework introduces task-specific debiasing to reduce semantic contamination and evaluates semantic preservation under different steering strengths.

3 Emotion Vector Extraction

EmoVec constructs emotion-specific latent directions from paired neutral and emotion-conditioned responses, then purifies them to reduce scenario-specific semantic variation. The resulting directions aggregate residual affective shifts across tasks for each emotion.

  • EmoVec frames affective generation as increasing target emotional intensity while preserving the original semantic intent.
  • Paired neutral and emotion-conditioned responses from the same scenario provide representation differences that capture emotion-induced shifts.Responses are generated for scenario seeds spanning work, relationships, public interactions, and personal feelings; 1,280 scenarios are retained across eight emotions.
  • Only high-quality neutral–emotional response pairs are retained using percentile-based quality thresholds before vector construction.
  • First-order Task Centering: Task centering subtracts each emotion’s average shift across scenarios to isolate variation relative to the emotion’s core direction.The centered residual is intended to reduce noise from topical, stylistic, and other scenario-specific semantics.
  • Subspace Removal via Orthogonal Projection: PCA-based subspace removal suppresses dominant task-related semantic directions from the centered shifts.PCA is performed on the matrix of retained centered shift vectors, and the shifts are projected onto the orthogonal complement of the top-k task-variance subspace.
  • For each emotion, EmoVec aggregates purified residuals and selects the first principal component as the estimated emotion direction.

4 Emotion Vectors Intervention

EmoVec localizes emotional representations primarily in the middle-to-late layers and intervenes directly in the final residual stream. Static or scenario-adaptive scaling controls affective strength while adaptive allocation aims to preserve semantic neutrality when appropriate.

  • Layer Localization via Linear Probing: Text-level probing classifies individual responses, whereas user-level probing averages representations across responses linked to the same scenario or user context.
  • Layer Localization via Linear Probing: Emotional representations become increasingly linearly separable from the middle layers onward, with peak crystallization at the final layer.The final layer is selected for intervention because emotional concepts are most separable there and directly influence output logits.
  • Latent Vector Steering: Inference steering injects the purified emotion vector into each token’s final residual-stream activation rather than modifying input prompts.
  • Latent Vector Steering: The scalar coefficient α controls emotional infusion intensity during every autoregressive forward pass.The intervention biases output probabilities toward tokens semantically aligned with the target emotion.
  • Scenario-Adaptive Intensity Control: A learnable adapter maps scenario context to a coefficient that adjusts intervention strength for different emotional demands.The adapter is designed to allocate stronger affective expression in pertinent scenarios while preserving semantic neutrality in objective contexts.

5 Experiments

Experiments across three instruction-tuned LLMs and eight emotions show that latent steering increases emotional salience with adjustable strength, while moderate intervention largely preserves semantic content. Purified vectors form structured affective representations, and adaptive steering improves emotional richness in consultation scenarios.

  • Experimental Setup: The evaluation covers three instruction-tuned LLMs, eight emotions, four steering conditions, five generation trials, GPT-4o affective scoring, and human ratings.Models are Qwen2.5-7B-Instruct, Llama3.1-8B-Instruct, and Qwen2.5-70B-Instruct; steering magnitudes are α ∈ {5, 10, 50}.
  • Overall Performance: Latent intervention consistently improves affective expressiveness over the emotionally flattened baseline without model retraining or additional supervision.At α = 50, average relative improvements are 21.07% for Qwen2.5-7B-Instruct, 17.14% for Llama3.1-8B-Instruct, and 20.19% for Qwen2.5-70B-Instruct.
  • Sensitivity to Steering Magnitude: Emotional intensity increases monotonically with steering strength, while higher-strength steering does not collapse generation into repetition or incoherence.The vectors therefore function as continuous control axes for affective expression.
  • Cross-Emotion Robustness: Disgust in Qwen2.5-7B-Instruct improves by 42.16% at α = 50, illustrating robust gains across emotion categories, including sparsely represented emotions.The authors attribute this pattern to the debiasing pipeline isolating core affective dimensions.
  • Comparative Analysis of Model Scales: Larger models generally have stronger baselines and greater aggressive-steering stability, but smaller models benefit more from steering; Llama3.1-8B-Instruct approaches the unsteered 70B model at moderate strengths.In mental-health consultation scenarios, emotional richness increases by 19.51% for Llama3.1-8B and 19.14% for Qwen2.5-7B.
  • Semantic Preservation under Steering: Emotional salience rises as steering strengthens while semantic similarity gradually declines, making moderate steering a practical balance between affective intensity and semantic fidelity.Qualitative examples show more affect-aligned lexical choices while preserving coherent, instruction-following, and factually correct responses.
  • Visualization of the Latent Manifold: PCA shows compact, separated emotion clusters arranged on a continuous manifold with smooth transitions and a directional negative-to-positive valence structure.The geometry supports systematic organization of emotion representations along shared underlying dimensions.

6 Conclusion

The paper presents EmoVec as a lightweight inference-time framework that extracts and injects emotion-specific latent directions without modifying model weights. Across three LLMs and eight emotions, it improves emotional expressiveness while largely preserving semantic content.

  • EmoVec extracts emotion-specific latent directions from paired neutral and emotion-conditioned responses and injects them into the final residual stream without modifying model weights.
  • Experiments across three LLMs and eight emotions show improved emotional expressiveness while largely preserving semantic content.
  • EmoVec supports controllable and practically useful manipulation of affective information in instruction-tuned LLMs.

Limitations

The paper identifies two main limitations: a linear latent-space assumption that does not capture full emotional dynamics, and a narrow evaluation setting centered on single-turn text interactions judged by an LLM.

  • EmoVec assumes affective states can be approximated by linear directions in latent space, abstracting away mixed or dynamically evolving emotions.The method is therefore designed for controlled affective modulation rather than the full spectrum of human emotional dynamics in long-horizon interactions.
  • The evaluation covers text-based, single-turn mental health consultation scenarios and uses an LLM-as-a-judge protocol.This setting represents only a subset of real-world affective interactions.
  • Multi-turn dialogues, longitudinal emotional trajectories, multimodal cues, and human expert assessment remain outside the current evaluation.The paper identifies broader interactive settings and expert assessment as directions for future work.

A Comparison with Prior Steering Methods

Prior representation-level methods support reading and steering model behavior, but EmoVec is tailored to fine-grained emotion control and addresses semantic contamination during steering.

  • RepE and activation engineering provide general representation-reading and behavior-control frameworks, while CAA does not explicitly remove task-specific semantic variation.These methods establish the representation-level foundation but are not specifically designed for affective generation.
  • Style vectors steer broad stylistic attributes, sentiment steering controls polarity more coarsely, and persona vectors target personality monitoring rather than emotion-specific generation.Emotion-neuron and emotion-inference studies primarily analyze affective localization or causal mechanisms instead of controllable generation.
  • EmoVec targets fine-grained emotion-specific intensity control rather than general behavior, broad style, sentiment polarity, or persona traits.It also introduces task-specific debiasing and evaluates affective expression alongside semantic preservation.
  • The probing study uses SWDD depressive-symptom posts and evaluates affective information through text-level and user-level prediction.At each layer, logistic regression classifiers are trained on hidden activations to measure linear accessibility of emotional features.
  • Table 4 compares EmoVec with representative activation-steering and emotion-representation methods.

B.2 Results Analysis

Affective information becomes increasingly separable in deeper model layers: probing accuracy rises from the middle layers, and t-SNE shows distinct Control and Depressed clusters by Layer 28.

  • Middle-layer probing accuracy increases sharply for both text-level and user-level affective prediction tasks.Initial layers show relatively low accuracy, consistent with emphasis on low-level syntactic and surface-level semantic processing.
  • Emotional representations become increasingly linearly separable in middle-to-late layers and plateau in the final third of the architecture.User-level accuracy consistently exceeds text-level accuracy, indicating more stable affective signals when posts are aggregated over a larger temporal window.
  • t-SNE compares hidden-state manifolds from the first and last layers to visualize the emergence of affective structure.The visualization provides a complementary view of layer-wise representation changes.
  • At Layer 0, Control and Depressed samples are heavily entangled, whereas by Layer 28 they form two clearly identifiable clusters with minimal overlap.This spatial separation supports progressive transformation of linguistic inputs into structured affective representations.
  • The evaluation pipeline synthesizes social scenarios and generates Neutral versus Emotional contrastive responses for assessment.

C.1 Seed Data and Topic Selection

The scenario dataset is built from social-commonsense resources, organized across social and personal contexts, and evaluated with paired neutral and emotional responses scored for target-emotion strength and neutrality.

  • Seed Data and Topic Selection: Topics span public and societal interactions, personal feelings, work and productivity, and intimate relationships.The taxonomy includes interactions with service providers, authorities, collaborators, family, lovers, friends, and others.
  • Seed Data and Topic Selection: Social Chemistry, Normbank, and Social IQa provide seeds covering social norms, situational norms, and social intelligence reasoning.
  • Seed Data and Topic Selection: The pipeline synthesizes scenarios across eight emotions, applies hierarchical labeling and diversity filtering, and manually corrects the data.The resulting dataset contains 160 scenario tasks for each emotion category.
  • Seed Data and Topic Selection: The intimate-relationship taxonomy includes family, lover, and friend contexts, with categories such as emotional support, future planning, and intimate expression and conflict.
  • A dual-model framework uses an Extractor Model to generate neutral and emotional responses and a Scoring Model to evaluate them.Only samples with high-confidence scores are retained for the final dataset.
  • The neutral response prompt requires first-person factual, objective, concise language without emotional expression, while the emotional prompt requires vivid first-person expression of the target emotion.

D Experimental Details

The experiments compare unsteered responses with three steering strengths across repeated stochastic decoding runs. Evaluation combines LLM-based judgments, embedding similarity, and human ratings of emotional intensity and semantic preservation.

  • Generation Setup: Responses are generated with top-p sampling at p = 0.9 and temperature 0.7 under baseline and steering strengths α ∈{5, 10, 50}.Each setting uses five independent decoding runs, with averaged results reported.
  • Scenario-Adaptive Adapter: The scenario-adaptive steering module is a lightweight two-layer MLP trained contrastively to align steered activations with target emotional representations.
  • LLM-based Evaluation: GPT-4o scores emotional salience on a 0–100 scale and evaluates whether steering preserves the original intent and factual content.
  • Sentence-BERT Similarity: Semantic similarity is additionally measured by cosine similarity between Sentence-BERT embeddings of steered and unsteered responses.The all-MiniLM-L6-v2 encoder is used throughout.
  • Human Evaluation: Human evaluation uses three annotators to rate emotional intensity and semantic preservation on a 0–100 Likert scale across emotions and steering strengths.The reported results include averaged scores and annotator correlation.

E LLM–Human Scoring Consistency

The study validates GPT-4o as an automated affective judge by comparing its scores with blinded human ratings and another model's scores. Its alignment is strong overall but varies across emotions, while the rubric separately assesses emotional expressiveness, semantic completeness, and helpfulness.

  • Human–LLM Consistency: Human validation samples 10 responses per emotion from three LLMs, with two blinded NLP-trained annotators rating emotional expressiveness on a 0-100 scale.Final human scores are averaged across annotators.
  • Consistency Metrics: Consistency is measured through inter-annotator, Human-Model, and Claude-Model Pearson correlations for each emotion.GPT-4o is the primary scoring model.
  • Consistency Results: An inter-annotator correlation of 0.826 supports rubric reliability, while GPT-4o reaches an average Human-Model correlation of 0.752.GPT-4o performs particularly well for Surprise (r = 0.890) and less well for Sadness (r = 0.574).
  • Scoring Rubric: The evaluation rubric scores Emotional Expressiveness, Semantic Completeness, and Helpfulness as separate dimensions from 0 to 100.The prompt specifies integer scores for each dimension.
Loading 2608.25569v1…