Transformer-based large-scale language models (LLMs) are able to generate highly realistic text. They are duly able to express, and at least implicitly represent, a wide range of sentiments and color, from the obvious, such as valence and arousal to the subtle, such as determination and admiration. We provide a first exploration of these representations and how they can be used for understanding the inner sentimental workings of single sentences. We train predictors of the quantiles of the distributions of final sentiments of sentences from the hidden representations of an LLM applied to prefixes of increasing lengths. After showing that predictors of distributions of valence, determination, admiration, anxiety and annoyance are well calibrated, we provide examples of using these predictors for analyzing sentences, illustrating, for instance, how even ordinary conjunctions (e.g., "but") can dramatically alter the emotional trajectory of an utterance. We then show how to exploit the distributional predictions to generate sentences with sentiments in the tails of distributions. We discuss the implications of our results for the inner workings of thoughts, for instance for psychiatric dysfunction.
翻译:基于Transformer的大规模语言模型能够生成高度逼真的文本。它们能够表达并至少隐含地表示广泛的情感和色彩,从明显的效价与唤醒度,到细微的决心与钦佩。我们首次探索了这些表征及其如何用于理解单个句子的内在情感运作。我们从语言模型对递增长度前缀的隐藏表征中,训练了句子最终情感分布分位数的预测器。在展示效价、决心、钦佩、焦虑和厌烦分布预测器均经过良好校准后,我们提供了利用这些预测器分析句子的示例,例如说明即使普通的连词(如“但是”)也能显著改变话语的情感轨迹。随后我们展示了如何利用分布预测生成处于分布尾部的带有情感的句子。我们讨论了这些结果对思想内在运作的影响,例如对精神功能障碍的影响。