The Remarkable Robustness of LLMs: Stages of Inference?

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Lad, Vedang, Lee, Jin Hwa, Gurnee, Wes, Tegmark, Max
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866918059613093888
author Lad, Vedang
Lee, Jin Hwa
Gurnee, Wes
Tegmark, Max
author_facet Lad, Vedang
Lee, Jin Hwa
Gurnee, Wes
Tegmark, Max
contents We investigate the robustness of Large Language Models (LLMs) to structural interventions by deleting and swapping adjacent layers during inference. Surprisingly, models retain 72-95% of their original top-1 prediction accuracy without any fine-tuning. We find that performance degradation is not uniform across layers: interventions to the early and final layers cause the most degradation, while the model is remarkably robust to dropping middle layers. This pattern of localized sensitivity motivates our hypothesis of four stages of inference, observed across diverse model families and sizes: (1) detokenization, where local context is integrated to lift raw token embeddings into higher-level representations; (2) feature engineering, where task- and entity-specific features are iteratively refined; (3) prediction ensembling, where hidden states are aggregated into plausible next-token predictions; and (4) residual sharpening, where irrelevant features are suppressed to finalize the output distribution. Synthesizing behavioral and mechanistic evidence, we provide a framework for interpreting depth-dependent computations in LLMs.
format Preprint
id arxiv_https___arxiv_org_abs_2406_19384
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle The Remarkable Robustness of LLMs: Stages of Inference?
Lad, Vedang
Lee, Jin Hwa
Gurnee, Wes
Tegmark, Max
Machine Learning
Artificial Intelligence
Computation and Language
We investigate the robustness of Large Language Models (LLMs) to structural interventions by deleting and swapping adjacent layers during inference. Surprisingly, models retain 72-95% of their original top-1 prediction accuracy without any fine-tuning. We find that performance degradation is not uniform across layers: interventions to the early and final layers cause the most degradation, while the model is remarkably robust to dropping middle layers. This pattern of localized sensitivity motivates our hypothesis of four stages of inference, observed across diverse model families and sizes: (1) detokenization, where local context is integrated to lift raw token embeddings into higher-level representations; (2) feature engineering, where task- and entity-specific features are iteratively refined; (3) prediction ensembling, where hidden states are aggregated into plausible next-token predictions; and (4) residual sharpening, where irrelevant features are suppressed to finalize the output distribution. Synthesizing behavioral and mechanistic evidence, we provide a framework for interpreting depth-dependent computations in LLMs.
title The Remarkable Robustness of LLMs: Stages of Inference?
topic Machine Learning
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2406.19384