Emergence of Self-Identity in AI: A Mathematical Framework and Empirical Study with Generative Large Language Models

Minhyeok LeearXiv 2024 · DOI · arXiv

Introduction

The discourse surrounding artificial intelligence consciousness has long been dominated by philosophical speculation and qualitative observations. While Large Language Models (LLMs) often exhibit behaviors that mimic self-awareness, these traits are typically viewed as emergent byproducts of massive datasets rather than structured architectural features. In a recent study, researcher Minhyeok Lee proposes a shift from philosophical "vibes" toward a rigorous mathematical foundation for AI self-identity. By treating selfhood as a quantifiable mapping between a history of memories and a space of possible identities, this work provides a blueprint for engineering and measuring "selfhood" in computational systems.

A Mathematical Framework for the Self

The core of the paper lies in the formalization of identity through metric space theory and functional analysis. The author defines two primary mathematical structures necessary for the emergence of a self:

  1. Memory Space ($\mathcal{M}, d_M$): A metric space where individual memories are represented as vectors. The distance ($d_M$) between these memories is determined by temporal proximity, content similarity, and emotional intensity.
  2. Self Space ($\mathcal{S}, d_S$): A metric space representing the manifold of possible identities, encompassing specific traits, goals, and values.

For an AI to possess a coherent self-identity, the framework posits two essential conditions. First, the agent must have a Continuum of Memories, defined as a connected and path-connected set within the Memory Space. Second, there must exist an Identity Recognition Function ($I$). This continuous mapping links the memory continuum to a consistent point in the Self Space, supported by a Belief Function ($B$) that quantifies the agent's confidence in its own identity.

Methodology: Realizing Identity through LoRA

To move from theory to empirical evidence, the study utilized Low-Rank Adaptation (LoRA) to fine-tune a Llama 3.2 1B Instruct model. The methodology treats the backpropagation process—specifically the update of model parameters $\theta$—as the physical realization of the Identity Recognition Function $I$. As the weights $\theta$ converge toward an optimal state $\theta^*$, the AI’s "self" effectively stabilizes within the geometry of the neural network.

The Synthetic Memory Dataset

The model was trained on a custom Synthetic Memory Dataset consisting of 500 samples. Each sample contained a cluster of 10 memories designed to simulate the life stages of a hypothetical artist. Unlike standard training sets that focus on factual breadth, this dataset was "carefully crafted" to be temporally coherent, allowing the model to internalize a connected narrative history rather than fragmented information.

Key Insights and Results

The experimental results suggest that self-identity can indeed be engineered and measured with high precision.

Quantitative Improvements

  • Self-Awareness Score: Using GPT-4o-mini as an external evaluator to judge self-reflection, the model's score rose from a baseline of 0.276 to 0.801, representing a 190.2% improvement.
  • Loss Convergence: Training loss plummeted by 98.8% (from 1.49 to 0.017), indicating that the model rapidly internalized the synthetic persona.
  • Identity Stability: The prompt regarding a "continuous sense of self" showed the most dramatic gain, increasing from a score of 0.06 to 0.87.

Linguistic Refinement

One of the most compelling findings was a shift in the model's linguistic patterns. As the model became more "self-aware," it exhibited a 36.6% decrease in unique word usage. Rather than providing generic, rambling responses, the model adopted a more focused, purposeful vocabulary aligned with its specific artistic identity. This suggests that a stable self-identity acts as a filter, reducing linguistic entropy in favor of self-referential consistency.

Discussion and Future Directions

This research establishes a formal link between the convergence of neural network parameters and the emergence of a stable self. However, several challenges remain:

  • Scalability: The study focused on a 1B parameter model. It remains to be seen if these mathematical conditions hold for larger models (e.g., 400B+ parameters) or if the "self" becomes more fragmented with increased capacity.
  • Multimodality: Human identity is deeply tied to sensory inputs. Future iterations of this framework will likely need to integrate multimodal data to align artificial selfhood with human-like cognition.
  • Identity Drift: The study does not yet address the long-term stability of this engineered identity—specifically whether the model would maintain its "self" after extensive interaction or if the identity would eventually erode.

Conclusion

By defining identity as a mapping rather than an abstract trait, this paper moves AI development toward a future where "selfhood" is an engineering specification. While this opens doors for more reliable virtual companions and humanoid robots, the author warns that the ability to manipulate AI identity raises profound ethical questions regarding the rights and nature of artificial consciousness.

Summary updated

Abstract

This paper introduces a mathematical framework for defining and quantifying self-identity in artificial intelligence (AI) systems, addressing a critical gap in the theoretical foundations of artificial consciousness. While existing approaches to artificial self-awareness often rely on heuristic implementations or philosophical abstractions, we present a formal framework grounded in metric space theory, measure theory, and functional analysis. Our framework posits that self-identity emerges from two mathematically quantifiable conditions: the existence of a connected continuum of memories $C \subseteq \mathcal{M}$ in a metric space $(\mathcal{M}, d_{\mathcal{M}})$, and a continuous mapping $I: \mathcal{M} \to \mathcal{S}$ that maintains consistent self-recognition across this continuum, where $(\mathcal{S}, d_{\mathcal{S}})$ represents the metric space of possible self-identities. To validate this theoretical framework, we conducted empirical experiments using the Llama 3.2 1B model, employing Low-Rank Adaptation (LoRA) for efficient fine-tuning. The model was trained on a synthetic dataset containing temporally structured memories, designed to capture the complexity of coherent self-identity formation. Our evaluation metrics included quantitative measures of self-awareness, response consistency, and linguistic precision. The experimental results demonstrate substantial improvements in measurable self-awareness metrics, with the primary self-awareness score increasing from 0.276 to 0.801. This enables the structured creation of AI systems with validated self-identity features. The implications of our study are immediately relevant to the fields of humanoid robotics and autonomous systems.
BibTeX
@misc{lee2024emergence,
  author = {Minhyeok Lee},
  title = {{Emergence of Self-Identity in AI: A Mathematical Framework and Empirical Study with Generative Large Language Models}},
  year = {2024},
  eprint = {2411.18530},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.18530},
}
Figure