Analogies between Transformer Layers and Power Method
In the paper we show that there is an analogy between the operations occurring in a layer of a transformer (projections and layer normalizations, disregarding the feedforward neural network) and a step in the power method. Coherently with this analogy, we show that passing through a layer the tokens tend to be tilted towards the principal eigenvector of a matrix which is the product of the output and value weight matrices of that layer. In the special case of a transformer with shared weights (i.e., in which all layers have identical weights) then the alignment with this principal eigenvector is particularly evident empirically, and can also be shown analytically. The analogy also suggests a method to steer the output of the transformer towards an arbitrary desired direction in token space.
Code (0)
등록된 구현이 없습니다.
Similar Papers 제목 키워드 기반
Why Do We Need Neuro-symbolic AI to Model Pragmatic Analogies?
A hallmark of intelligence is the ability to use a familiar domain to make inferences about a less familiar domain, known as analogical reasoning. In this article, we delve into the performance of Large Language Models (…
Emergent effects of scaling on the functional hierarchies within large language models
Large language model (LLM) architectures are often described as functionally hierarchical: Early layers process syntax, middle layers begin to parse semantics, and late layers integrate information. The present work revi…
Large Language ModelBoosting Scientific Concepts Understanding: Can Analogy from Teacher Models Empower Student Models?
Analogical reasoning plays a critical role in human cognition, enabling us to understand new concepts by associating them with familiar ones. Previous research in the AI community has mainly focused on identifying and ge…
Question AnsweringSelf-LearningTransformer See, Transformer Do: Copying as an Intermediate Step in Learning Analogical Reasoning
Analogical reasoning is a hallmark of human intelligence, enabling us to solve new problems by transferring knowledge from one situation to another. Yet, developing artificial intelligence systems capable of robust human…
BERT is to NLP what AlexNet is to CV: Can Pre-Trained Language Models Identify Analogies?
Analogies play a central role in human commonsense reasoning. The ability to recognize analogies such as "eye is to seeing what ear is to hearing", sometimes referred to as analogical proportions, shape how we structure …
Language ModelingLanguage Modelling