揭示大模型如何内部表示实体,发现其能生成多词实体名。
On the Representations of Entities in Auto-regressive Large Language Models

- 用任务向量从隐藏状态重建实体提及
- 可准确生成训练中未见的多词实体
- 新工具Entity Lens扩展了原生注意力分析能力
命名实体是文本中知识的基本单元,承载事实信息并构建语言关系。尽管其重要性显著,但大语言模型(LLMs)如何内部表征实体仍不明确。以往研究多关注显式关系,对实体本身表征了解甚少。本文提出实体提及重建的新框架,用于探究LLMs如何编码与操作实体。我们检验了是否能从内部表示生成实体提及、多词实体如何在非末尾标记嵌入之外被编码,以及这些表征是否包含关系知识。所提方法利用任务向量,可稳定地从不同层次的隐藏状态生成多词提及。由此引入实体视角(Entity Lens),扩展了对数透镜(logit-lens)以预测多词提及。结果表明,LLMs发展出针对实体的特定机制,能表征和操作包括训练中未见的多词实体。代码已开源:https://github.com/VictorMorand/EntityRepresentations。
原文摘要 · Abstract (English)
Named entities are fundamental building blocks of knowledge in text, grounding factual information and structuring relationships within language. Despite their importance, it remains unclear how Large Language Models (LLMs) internally represent entities. Prior research has primarily examined explicit relationships, but little is known about entity representations themselves. We introduce entity mention reconstruction as a novel framework for studying how LLMs encode and manipulate entities. We investigate whether entity mentions can be generated from internal representations, how multi-token entities are encoded beyond last-token embeddings, and whether these representations capture relational knowledge. Our proposed method, leveraging _task vectors_, allows to consistently generate multi-token mentions from various entity representations derived from the LLMs hidden states. We thus introduce the _Entity Lens_, extending the _logit-lens_ to predict multi-token mentions. Our results bring new evidence that LLMs develop entity-specific mechanisms to represent and manipulate any multi-token entities, including those unseen during training. Our code is avalable at https://github.com/VictorMorand/EntityRepresentations .
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。