Analyzing Large Language Model Behavior via Embedding Analysis
Abstract
The usage of large language models (LLMs) as a generative artificial intelligence tool is becoming increasingly widespread, yet there is limited understanding of the mechanisms by which prompts in whole or in part influence their behavior, capabilities, and limitations. In this paper, the authors conduct a mathematical and topological analysis of token embeddings – the first step in the computational workflow of LLMs. This work shows that the subspace where token embeddings lie is a stratified manifold with varying local dimension, and in those cases where semantically related tokens are co-located on a submanifold, there are non-trivial implications for model behavior. These topological and geometric findings help to explain performance aspects of different LLMs such as why the Llemma model is more likely to overfit than the GPT-2 model, yet the latter does worse at mathematical queries than the former. To the best of the authors’ knowledge, this paper is among the first to conduct such research into the topological characterization of the token embedding space and analyze LLM behavior starting from first principles.
Keywords: Large language models, Generative artificial intelligence, Machine learning, Emerging technologies
DOI: 10.54941/ahfe1005724
Cite this paper
More from this volume
- Implementing an AI Fatigue Risk Management System for Aviation Maintenance SMS: A Technology Enhanced Critical Process Human Factors Safety Plan
- Deep Learning Forecast of Perceptual Load Using fNIRS Data
- Artificial intelligence in the function of improving port systems
- Formalizing Trust in Artificial Intelligence for Built Environment Decision-Making
- Artificial Intelligence and Design: Innovation, Practical Applications, and Future Creative Horizons
- Supporting Informal Sustainability Learning with AI-assisted Educational Technology
- An assessment of the maintenance of heritage buildings using AI and IoT: a South African perspective
- What if we Could Entangle Drones? Towards the Management of a Swarm of Drones as a Non-Local Quantum Object
- Engaging All Elderly Residents in Community Renewal: Designer Spotlight Interview Tool for LLM Building
- AI Play in Higher Education: Students’ perceptions of play and co-creation of knowledge with generative AI
- Optimizing AI Involvement in Engineering University Courses Based on Students' Personality
- Predictive Model for Partner Agencies Dependency on Food Banks


AHFE Open Access