Table of Contents
Fetching ...

Personalized Text Generation with Contrastive Activation Steering

Jinghao Zhang, Yuting Liu, Wenjie Wang, Qiang Liu, Shu Wu, Liang Wang, Tat-Seng Chua

TL;DR

StyleVector tackles personalized text generation by separating user style from content in activation space and steering generation via a lightweight, training-free mechanism. The method derives a per-user style vector through contrastive analysis between authentic user outputs and style-agnostic model outputs, requiring only $2|P_u|$ forward passes and a single $D$-dimensional vector per user. In experiments on LaMP and LongLaMP, StyleVector achieves about $8$–$11\%$ relative improvements over RAG and PEFT baselines while dramatically reducing storage (roughly $1700\times$ less). The approach offers scalable, low-latency personalization without parameter updates or extensive retrieval, with broad implications for deploying personalized assistants.

Abstract

Personalized text generation aims to infer users' writing style preferences from their historical texts and generate outputs that faithfully reflect these stylistic characteristics. Existing solutions primarily adopt two paradigms: retrieval-augmented generation (RAG) and parameter-efficient fine-tuning (PEFT). While these approaches have advanced the field, they suffer from two critical limitations: (1) the entanglement of content semantics and stylistic patterns in historical texts impedes accurate modeling of user-specific writing preferences; and (2) scalability challenges arising from both RAG's inference latency by retrieval operations and PEFT's parameter storage requirements for per user model. To overcome these limitations, we propose StyleVector, a training-free framework that disentangles and represents personalized writing style as a vector in LLM's activation space, enabling style-steered generation during inference without requiring costly retrieval or parameter storage. Comprehensive experiments demonstrate that our framework achieves a significant 8% relative improvement in personalized generation while reducing storage requirements by 1700 times over PEFT method.

Personalized Text Generation with Contrastive Activation Steering

TL;DR

StyleVector tackles personalized text generation by separating user style from content in activation space and steering generation via a lightweight, training-free mechanism. The method derives a per-user style vector through contrastive analysis between authentic user outputs and style-agnostic model outputs, requiring only forward passes and a single -dimensional vector per user. In experiments on LaMP and LongLaMP, StyleVector achieves about relative improvements over RAG and PEFT baselines while dramatically reducing storage (roughly less). The approach offers scalable, low-latency personalization without parameter updates or extensive retrieval, with broad implications for deploying personalized assistants.

Abstract

Personalized text generation aims to infer users' writing style preferences from their historical texts and generate outputs that faithfully reflect these stylistic characteristics. Existing solutions primarily adopt two paradigms: retrieval-augmented generation (RAG) and parameter-efficient fine-tuning (PEFT). While these approaches have advanced the field, they suffer from two critical limitations: (1) the entanglement of content semantics and stylistic patterns in historical texts impedes accurate modeling of user-specific writing preferences; and (2) scalability challenges arising from both RAG's inference latency by retrieval operations and PEFT's parameter storage requirements for per user model. To overcome these limitations, we propose StyleVector, a training-free framework that disentangles and represents personalized writing style as a vector in LLM's activation space, enabling style-steered generation during inference without requiring costly retrieval or parameter storage. Comprehensive experiments demonstrate that our framework achieves a significant 8% relative improvement in personalized generation while reducing storage requirements by 1700 times over PEFT method.

Paper Structure

This paper contains 47 sections, 12 equations, 9 figures, 4 tables, 1 algorithm.

Figures (9)

  • Figure 1: The overall framework of StyleVector.
  • Figure 2: Performance comparison across different intervention layers $l$.
  • Figure 3: Performance comparison across different intervention strengths $\alpha$.
  • Figure 4: Probing results on LaMP benchmark.
  • Figure 5: Case study of user_310 in News Headline Generation task. The highlighted tokens are the top 5 tokens that most closely match the style vector among all historical tokens. The underline words are the words that match the ground truth. 'Style Ranking' represents the ranking results based on the similarity between the historical headline embeddings with the style vector. 'Semantic Ranking' represents the ranking results obtained by Contriver lei2023unsupervised.
  • ...and 4 more figures