arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2310.15154cs.LGcs.AIcs.CL
收藏

大型语言模型中情感的线性表示

Linear Representations of Sentiment in Large Language Models

EleutherAI Institute(EleutherAI研究所);Stanford University(斯坦福大学)

Curt Tigges, Oskar John Hollinsworth, Atticus Geiger, Neel Nanda

AI总结:

本研究发现大型语言模型以单个线性方向表示情感,通过因果干预揭示其机制,并发现情感会在标点等中间位置被摘要,消融该方向会显著降低零样本分类准确率。

摘要:

情感是自然语言文本中的一个普遍特征,然而情感在大型语言模型(LLMs)中是如何表示的仍是一个开放性问题。在本研究中,我们发现在一系列模型中,情感是以线性方式表示的:在激活空间中,单个方向主要捕获了跨多种任务的该特征,其一端代表积极,另一端代表消极。通过因果干预,我们分离出这一方向,并证明它在玩具任务和真实世界数据集(如 Stanford Sentiment Treebank)中均具有因果相关性。通过这一案例研究,我们对单个方向在广泛数据分布上的含义进行了彻底的建模调查。我们进一步揭示了涉及该方向的机制,强调了注意力头和神经元的一小部分子集的作用。最后,我们发现了一种我们称之为“摘要基序”的现象:情感不仅表示在带有情感色彩的词汇上,还会在没有内在情感色彩的中间位置(如标点符号和名称)被摘要。我们表明,在 Stanford Sentiment Treebank 的零样本分类中,消融情感方向会导致 76% 的超机会分类准确率丧失,其中近一半(36%)是由于仅在逗号位置消融被摘要的情感方向所致。

英文摘要:

Sentiment is a pervasive feature in natural language text, yet it is an open question how sentiment is represented within Large Language Models (LLMs). In this study, we reveal that across a range of models, sentiment is represented linearly: a single direction in activation space mostly captures the feature across a range of tasks with one extreme for positive and the other for negative. Through causal interventions, we isolate this direction and show it is causally relevant in both toy tasks and real world datasets such as Stanford Sentiment Treebank. Through this case study we model a thorough investigation of what a single direction means on a broad data distribution. We further uncover the mechanisms that involve this direction, highlighting the roles of a small subset of attention heads and neurons. Finally, we discover a phenomenon which we term the summarization motif: sentiment is not solely represented on emotionally charged words, but is additionally summarized at intermediate positions without inherent sentiment, such as punctuation and names. We show that in Stanford Sentiment Treebank zero-shot classification, 76% of above-chance classification accuracy is lost when ablating the sentiment direction, nearly half of which (36%) is due to ablating the summarized sentiment direction exclusively at comma positions.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑