Saved in:
Bibliographic Details
Main Authors: Liu, Zhu, Kong, Cunliang, Liu, Ying, Sun, Maosong
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2403.01509
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866929378046246912
author Liu, Zhu
Kong, Cunliang
Liu, Ying
Sun, Maosong
author_facet Liu, Zhu
Kong, Cunliang
Liu, Ying
Sun, Maosong
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2403_01509
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Fantastic Semantics and Where to Find Them: Investigating Which Layers of Generative LLMs Reflect Lexical Semantics
Liu, Zhu
Kong, Cunliang
Liu, Ying
Sun, Maosong
Computation and Language
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.
title Fantastic Semantics and Where to Find Them: Investigating Which Layers of Generative LLMs Reflect Lexical Semantics
topic Computation and Language
url https://arxiv.org/abs/2403.01509