通过稀疏编码控制大模型输出风格与认知复杂度
Steered Generation via Gradient Descent on Sparse Features
- 用稀疏自编码器学习查询嵌入的稀疏表示
- 调整特定层的编码可系统改变生成内容复杂度
- 适合需要定制化输出的教学与内容生成场景
大型语言模型(LLMs)在其隐状态中编码了多样的语言特征,这些特征可用于引导模型输出朝向特定目标特性。本文通过训练稀疏自编码器来学习查询嵌入的稀疏表示,从而修改模型内部结构,实现对注意力分布的精确控制。实验表明,操纵该稀疏表示能有效引导输出向不同风格和认知目标转变。特别是在教育场景中,我们通过在特定层调整编码后的查询表示,系统性地调节了大模型生成反馈的认知复杂度。具体方法是在潜在空间中使用基于梯度的优化,将学习到的稀疏嵌入导向目标认知层级样本的表示。
原文摘要 · Abstract (English)
Large language models (LLMs) encode a diverse range of linguistic features within their latent representations, which can be harnessed to steer their output toward specific target characteristics. In this paper, we modify the internal structure of LLMs by training sparse autoencoders to learn a sparse representation of the query embedding, allowing precise control over the model's attention distribution. We demonstrate that manipulating this sparse representation effectively transforms the output toward different stylistic and cognitive targets. Specifically, in an educational setting, we show that the cognitive complexity of LLM-generated feedback can be systematically adjusted by modifying the encoded query representation at a specific layer. To achieve this, we guide the learned sparse embedding toward the representation of samples from the desired cognitive complexity level, using gradient-based optimization in the latent space.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。