arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2403.01509cs.CL
收藏

奇妙语义何处寻:探究生成式大语言模型的哪些层反映词汇语义

Fantastic Semantics and Where to Find Them: Investigating Which Layers of Generative LLMs Reflect Lexical Semantics

School of Humanities, Tsinghua University(清华大学人文学院);Department of Computer Science and Technology, Tsinghua University(清华大学计算机科学与技术系)

Zhu Liu, Cunliang Kong, Ying Liu, Maosong Sun

AI总结:

本文通过上下文词识别任务探测Llama2各层隐藏状态,发现低层编码词汇语义、高层负责预测,与BERT类判别式模型相反,并揭示了提示中无意义符号的单调性能提升现象。

摘要:

大语言模型在通用语言理解任务中取得了显著成功。然而,作为一类以预测下一个词元为目标的生成式方法,这些模型随深度变化的语义演化尚未被充分探索,这与它们的前身(如类BERT架构)不同。本文中,我们专门研究流行大语言模型Llama2中词汇语义的自底向上演化,通过使用上下文词识别任务探测其每一层末端隐藏状态。实验表明,较低层的表示编码词汇语义,而较高层语义归纳较弱,主要负责预测。这与具有判别式目标的模型(如掩码语言建模)形成对比,后者在较高层获得更好的词汇语义。该结论进一步得到支持:在提示策略中,最后无意义符号(如标点)的隐藏状态性能单调提升。我们的代码可在https://github.com/RyanLiut/LLM_LexSem获取。

英文摘要:

Large language models have achieved remarkable success in general language understanding tasks. However, as a family of generative methods with the objective of next token prediction, the semantic evolution with the depth of these models are not fully explored, unlike their predecessors, such as BERT-like architectures. In this paper, we specifically investigate the bottom-up evolution of lexical semantics for a popular LLM, namely Llama2, by probing its hidden states at the end of each layer using a contextualized word identification task. Our experiments show that the representations in lower layers encode lexical semantics, while the higher layers, with weaker semantic induction, are responsible for prediction. This is in contrast to models with discriminative objectives, such as mask language modeling, where the higher layers obtain better lexical semantics. The conclusion is further supported by the monotonic increase in performance via the hidden states for the last meaningless symbols, such as punctuation, in the prompting strategy. Our codes are available at https://github.com/RyanLiut/LLM_LexSem.

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

↑