mlsanityData to 14 Oct 2026

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

arXiv 2410.05218 ↗First posted 7 Oct 2024cs.LG cs.CL stat.MLcited by 6

Not on the map. Why?

Abstract (arXiv)

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

Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Builds on 15 of its 39 references that are in the map. First posted on arXiv 7 Oct 2024.

Builds on

15 of 39 references.

References · 15

  1. 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
  2. 2015Deep Unsupervised Learning using Nonequilibrium Thermodynamicscited by 7,058
  3. 2019Normalizing Flows for Probabilistic Modeling and Inferencecited by 1,323
  4. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
  5. 2022Transformers learn in-context by gradient descentcited by 732
  6. 2023Time-LLM: Time Series Forecasting by Reprogramming Large Language Modelscited by 700
  7. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
  8. 2022Why Can GPT Learn In-Context? Language Models Implicitly Perform Gradient Descent as Meta-Optimizerscited by 204
  9. 2023Birth of a Transformer: A Memory Viewpointcited by 161
  10. 2024LLM Processes: Numerical Predictive Distributions Conditioned on Natural Languagecited by 55
  11. 2023Measuring Inductive Biases of In-Context Learning with Underspecified Demonstrationscited by 49
  12. 2024LLMs learn governing principles of dynamical systems, revealing an in-context neural scaling lawcited by 32
3 more
  1. 2023The Training Process of Many Deep Networks Explores the Same Low-Dimensional Manifoldcited by 21
  2. 2024How Do Transformers "Do" Physics? Investigating the Simple Harmonic Oscillatorcited by 4
  3. 2024Can LLMs predict the convergence of Stochastic Gradient Descent?cited by 2

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 3; 2026: 3.

6 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026Sparse or Dense? A Mechanistic Estimation of Computation Density in Transformer-based LLMs
  2. 2026In-Context Function Learning in Large Language Models
  3. 2026Eliciting Numerical Predictive Distributions of LLMs Without Autoregression
  4. 2026Rethinking the Role of LLMs in Time Series Forecasting
  5. 2023In-Context Explainers: Harnessing LLMs for Explaining Black Box Models
  6. 2024Beyond the Black Box: A Statistical Model for LLM Reasoning and Inference
  7. 2026Stories in Space: In-Context Learning Trajectories in Conceptual Belief Space
  8. 2026Interpretable Probability Estimation with LLMs via Shapley Reconstruction