arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2312.01648cs.AIcs.CLcs.LG
收藏

表征大语言模型几何结构有助于解决毒性检测与生成问题

Characterizing Large Language Model Geometry Helps Solve Toxicity Detection and Generation

Brown University(布朗大学);Tenyx

Randall Balestriero, Romain Cosentino, Sarath Shekkizhar

AI总结:

该研究从几何视角解析大语言模型内部机制,推导注意力嵌入本征维度与前馈网络仿射映射等理论结果,据此实现绕过RLHF防护的方法,并提取可解释几何特征用于毒性检测,验证了理论结果对实际问题的应用价值。

摘要:

大语言模型(LLM)推动了当前的AI突破,然而人们对其内部表征的了解仍极为有限。本研究提出从几何学视角揭示LLM的内在机制。具体而言,我们以闭式形式推导出了两点内容:(i)多头注意力嵌入被约束存在的本征维度;(ii)LLM各层前馈(MLP)网络的分区映射与逐区域仿射映射。我们的理论发现进一步支撑了适用于前沿LLM的新型有原则解决方案的设计。首先,我们证明借助这种几何理解,可通过有针对性的提示操控来控制嵌入的本征维度,从而绕过LLM的RLHF(基于人类反馈的强化学习)防护机制。其次,我们推导出可从任意(预训练)LLM中提取的可解释几何特征,为其输入提供丰富的抽象表征。我们观察到这些特征足以辅助解决毒性检测问题,甚至能够识别多种类型的毒性。研究结果表明,即便在大规模场景下,精确的理论结果也能解答LLM领域的实际问题。代码详见:https://github.com/RandallBalestriero/SplineLLM

英文摘要:

Large Language Models (LLMs) drive current AI breakthroughs despite very little being known about their internal representations. In this work, we propose to shed the light on LLMs inner mechanisms through the lens of geometry. In particular, we develop in closed form $(i)$ the intrinsic dimension in which the Multi-Head Attention embeddings are constrained to exist and $(ii)$ the partition and per-region affine mappings of the feedforward (MLP) network of LLMs' layers. Our theoretical findings further enable the design of novel principled solutions applicable to state-of-the-art LLMs. First, we show that, through our geometric understanding, we can bypass LLMs' RLHF protection by controlling the embedding's intrinsic dimension through informed prompt manipulation. Second, we derive interpretable geometrical features that can be extracted from any (pre-trained) LLM, providing a rich abstract representation of their inputs. We observe that these features are sufficient to help solve toxicity detection, and even allow the identification of various types of toxicity. Our results demonstrate how, even in large-scale regimes, exact theoretical results can answer practical questions in LLMs. Code: https://github.com/RandallBalestriero/SplineLLM

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

↑