Abstract
Controlling stylistic attributes in large language models (LLMs) remains challenging, with existing approaches relying on either prompt engineering or post-training alignment. This paper investigates this challenge through the lens of representation engineering, testing the hypothesis that distinct stylistic attributes - from emotional tone to linguistic structure - are encoded as linear directions in the model's activation space. We provide strong empirical evidence for this hypothesis across a wide range of styles and, based on this finding, present a lightweight, training-free method for precise style control. Our approach supports linear style composition, enhances safety by ablating undesirable behaviors, and, as confirmed by experiments on over a dozen models, achieves high style adherence while preserving core capabilities at minimal computational cost.
Abstract (translated)
在大型语言模型(LLMs)中控制风格属性仍然是一项挑战,现有方法依赖于提示工程或后期训练对齐。本文通过表征工程的视角探讨了这一难题,并检验了一个假设:不同的风格特征——从情感基调到语言结构——都被编码为模型激活空间中的线性方向。我们提供了广泛的风格范围内的强有力的经验证据来支持这一假设,并基于此发现提出了一种轻量级且无需训练的方法,用于实现精确的风格控制。我们的方法支持线性的风格组合、通过消除不希望的行为增强安全性,并在超过十多种模型上的实验中证实,在最小计算成本下实现了高风格一致性和核心能力的保持。
URL
https://arxiv.org/abs/2603.03324