Grote Taalmodellen zijn Lokaal Lineaire Afbeeldingen
Large Language Models are Locally Linear Mappings
May 30, 2025
Auteurs: James R. Golden
cs.AI
Samenvatting
We tonen aan dat de inferentie-operaties van verschillende open-weight grote
taalmodellen (LLMs) kunnen worden gemapt naar een exact equivalent lineair
systeem voor een invoerreeks zonder de modelgewichten te wijzigen of de
uitvoervoorspellingen te veranderen. Door technieken uit beelddiffusiemodellen
die lokale of stuksgewijze lineariteit vertonen uit te breiden, passen we de
gradiëntberekening strategisch aan ten opzichte van een gegeven invoerreeks voor
een volgende-tokenvoorspelling, zodat de Jacobiaan van het model de
voorwaartse voorspelling bijna exact reproduceert met een lineair systeem. We
demonstreren deze aanpak over verschillende modellen (Llama 3, Gemma 3, Qwen 3,
Phi 4, Mistral Ministral en OLMo 2, tot Llama 3.3 70B Q4) en laten door de
singulierewaardedecompositie van de losgekoppelde Jacobiaan zien dat deze LLMs
opereren in extreem lagedimensionale deelruimtes waarin veel van de grootste
singuliere vectoren decoderen naar concepten die gerelateerd zijn aan het meest
waarschijnlijke uitvoertoken. Deze aanpak stelt ons ook in staat om de werking
van elke opeenvolgende laag (en zijn aandacht- en MLP-componenten) te
onderzoeken als bijna-exacte lineaire systemen en de opkomst van semantische
concepten te observeren. Ondanks hun expressieve kracht en globale
niet-lineariteit kunnen moderne LLMs worden geïnterpreteerd door bijna-exacte
lokaal lineaire decomposities die inzicht bieden in hun interne representaties
en interpreteerbare semantische structuren onthullen in het volgende-token
voorspellingsproces.
English
We demonstrate that the inference operations of several open-weight large
language models (LLMs) can be mapped to an exactly equivalent linear system for
an input sequence without modifying the model weights or altering output
predictions. Extending techniques from image diffusion models that exhibit
local or piecewise linearity, we strategically alter the gradient computation
with respect to a given input sequence for a next-token prediction such that
the Jacobian of the model nearly exactly reproduces the forward prediction with
a linear system. We demonstrate this approach across models (Llama 3, Gemma 3,
Qwen 3, Phi 4, Mistral Ministral and OLMo 2, up to Llama 3.3 70B Q4) and show
through the singular value decomposition of the detached Jacobian that these
LLMs operate in extremely low-dimensional subspaces where many of the largest
singular vectors decode to concepts related to the most-likely output token.
This approach also allows us to examine the operation of each successive layer
(and its attention and MLP components) as nearly-exact linear systems and
observe the emergence of semantic concepts. Despite their expressive power and
global nonlinearity, modern LLMs can be interpreted through nearly-exact
locally linear decompositions that provide insights into their internal
representations and reveal interpretable semantic structures in the next-token
prediction process.