Density estimation with LLMs: a geometric investigation of in-context learning trajectories

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Liu, Toni J. B., Boullé, Nicolas, Sarfati, Raphaël, Earls, Christopher J.
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866929739932893184
author Liu, Toni J. B.
Boullé, Nicolas
Sarfati, Raphaël
Earls, Christopher J.
author_facet Liu, Toni J. B.
Boullé, Nicolas
Sarfati, Raphaël
Earls, Christopher J.
contents Large language models (LLMs) demonstrate remarkable emergent abilities to perform in-context learning across various tasks, including time series forecasting. This work investigates LLMs' ability to estimate probability density functions (PDFs) from data observed in-context; such density estimation (DE) is a fundamental task underlying many probabilistic modeling problems. We leverage the Intensive Principal Component Analysis (InPCA) to visualize and analyze the in-context learning dynamics of LLaMA-2 models. Our main finding is that these LLMs all follow similar learning trajectories in a low-dimensional InPCA space, which are distinct from those of traditional density estimation methods like histograms and Gaussian kernel density estimation (KDE). We interpret the LLaMA in-context DE process as a KDE with an adaptive kernel width and shape. This custom kernel model captures a significant portion of LLaMA's behavior despite having only two parameters. We further speculate on why LLaMA's kernel width and shape differs from classical algorithms, providing insights into the mechanism of in-context probabilistic reasoning in LLMs. Our codebase, along with a 3D visualization of an LLM's in-context learning trajectory, is publicly available at https://github.com/AntonioLiu97/LLMICL_inPCA
format Preprint
id arxiv_https___arxiv_org_abs_2410_05218
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Density estimation with LLMs: a geometric investigation of in-context learning trajectories
Liu, Toni J. B.
Boullé, Nicolas
Sarfati, Raphaël
Earls, Christopher J.
Machine Learning
Computation and Language
Large language models (LLMs) demonstrate remarkable emergent abilities to perform in-context learning across various tasks, including time series forecasting. This work investigates LLMs' ability to estimate probability density functions (PDFs) from data observed in-context; such density estimation (DE) is a fundamental task underlying many probabilistic modeling problems. We leverage the Intensive Principal Component Analysis (InPCA) to visualize and analyze the in-context learning dynamics of LLaMA-2 models. Our main finding is that these LLMs all follow similar learning trajectories in a low-dimensional InPCA space, which are distinct from those of traditional density estimation methods like histograms and Gaussian kernel density estimation (KDE). We interpret the LLaMA in-context DE process as a KDE with an adaptive kernel width and shape. This custom kernel model captures a significant portion of LLaMA's behavior despite having only two parameters. We further speculate on why LLaMA's kernel width and shape differs from classical algorithms, providing insights into the mechanism of in-context probabilistic reasoning in LLMs. Our codebase, along with a 3D visualization of an LLM's in-context learning trajectory, is publicly available at https://github.com/AntonioLiu97/LLMICL_inPCA
title Density estimation with LLMs: a geometric investigation of in-context learning trajectories
topic Machine Learning
Computation and Language
url https://arxiv.org/abs/2410.05218