Next Article in Journal
Soil Organic Carbon Detection in 3D CT Samples Using Dual Segmentation
Next Article in Special Issue
A Proposal of a Mathematics Problem Generation Tool Using Generative AI for STACK Online Assessment System
Previous Article in Journal
Prescriptive Analytics for Demand Surge on Home Delivery Services
Previous Article in Special Issue
Design and Experimental Validation of a Novel Particle Swarm Optimization Algorithm Designed to Optimize Solar Power Extraction
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Adaptive Quine Structures for Metacognitive Evolution in Large Language Models: A Functional Framework with Gödelian Bounds and Illustrative Applications

by
Ali Mohammad Saghiri
Department of Computer Science, William Paterson University, Wayne, NJ 07470, USA
Mathematics 2026, 14(13), 2371; https://doi.org/10.3390/math14132371
Submission received: 16 May 2026 / Revised: 20 June 2026 / Accepted: 21 June 2026 / Published: 3 July 2026
(This article belongs to the Special Issue Advances in Machine Learning and Intelligent Systems)

Abstract

How can an LLM-based agent recognize the limits of its own self-knowledge and improve that self-knowledge over time? This paper proposes the metacognitive evolutionary system (MES), a functional framework for studying metacognitive evolution at the prompt level in large language model (LLM)-based agents. MES does not modify model weights; it evolves the prompt program around a fixed base model, keeping the system readable, auditable, and easier for humans to inspect. The framework introduces a recursive metacognitive tower, M n ( P ) = LLM ( M n 1 ( P ) ) , to model layered self-evaluation. The fixed-point behavior of this tower is interpreted as a Strange Loop, with a formal analogy to Gödelian incompleteness used to describe its epistemic limits. The system is built using five primitive functions: inference, grounding, awareness, adaptive self-replication, and population-level selection. A grounded fitness function guides prompt evolution across generations, evaluating uncertainty calibration, error detection, strategy adaptation, and epistemic boundedness. Through Quine-style prompt rewriting, MES studies how agents can revise their own prompt-level structure while remaining constrained by grounded evaluation. The paper presents the formal architecture, analyzes tower dynamics using Markov chains, discusses convergence results, identifies six application domains, and proposes QuineBench as an evaluation design. Numerical case studies serve as illustrative analytical examples rather than empirical experiments, and QuineBench is presented as a structured protocol for future validation, providing a theoretical foundation and a clear path toward empirical evaluation.

1. Introduction

Large language models now routinely produce statements about their own confidence, reasoning quality, and limitations [1]. These outputs can be useful, but they also create a fundamental ambiguity: a model may sound reflective without maintaining a reliable self-model, describe uncertainty without being calibrated [2], or revise its stated strategy while its underlying behaviour remains unchanged. For safety-critical and scientific deployments, this distinction is consequential.
This paper studies whether metacognition in an LLM-based system can be treated as an explicit computational process rather than as a conversational style. We focus on prompt-level systems, where the base model remains fixed and the surrounding prompt-program evolves. Every modification is visible as text; the model weights are never altered. The system is therefore fully auditable: researchers can read the complete evolutionary history of its metacognitive strategy.
The proposed framework, the metacognitive evolutionary system (MES), is built from five composable primitive functions: LLM , fact_check , aware , quine , and evolve . These functions are composed to form a loop in which a prompt program produces an answer, inspects a representation of its own behaviour, checks that self-assessment against external evidence, rewrites itself, and then competes with other variants under a metacognitive fitness function.
The central claim is as follows. A self-referential system can improve its self-model, but it cannot make that self-model complete. Gödel’s First Incompleteness Theorem [3] shows that any sufficiently expressive consistent formal system contains true statements that cannot be proved within that system. We use this result as a boundary condition: any finite system that reasons about its own reasoning should preserve awareness of its blind spots rather than claim total self-knowledge. The irreducible incompleteness is not a defect; it is a permanent source of evolutionary pressure.
This paper makes several contributions. First, it introduces MES as a functional architecture for studying metacognitive evolution at the prompt level in LLM-based systems. Second, it presents a recursive metacognitive tower that shows how a system can evaluate its own previous outputs and use this evaluation as part of a higher-level reasoning process. Third, it relates this tower to the idea of a Strange Loop [4] and uses a formal analogy to Gödelian incompleteness to clarify the limits of self-knowledge in such systems.
The paper also defines a grounded fitness function for evaluating uncertainty calibration, error detection, strategy adaptation, and epistemic boundedness. In addition, it shows how the proposed framework can be applied to healthcare, software engineering, legal analysis, education, scientific research, and autonomous planning.
The contributions of the paper are primarily theoretical and methodological. They establish a design space for prompt-level metacognitive evolution, derive formal properties of the proposed architecture, and introduce QuineBench as a structured protocol for future empirical evaluation. In this sense, the illustrative case studies are not intended to serve as full empirical validation. Rather, they demonstrate how the framework can be operationalised and provide a foundation for subsequent experimental work.

2. Background and Related Work

This section reviews the intellectual foundations on which MES rests. Each subsection is motivated by a specific design decision in the framework. Section 2.1 establishes the cognitive science model of metacognition that MES operationalises. The following subsections survey related work on LLM self-assessment, self-referential computation, Gödelian limits, calibration, prompt optimisation, and AI safety, identifying in each case how prior work constrains or informs the MES design.

2.1. Metacognition

Flavell introduced metacognition as knowledge and regulation of one’s own cognitive processes [5]. Nelson and Narens formalised this as a two-level architecture in which a meta-level monitors and controls an object-level through two classes of process: monitoring (information flowing upward) and control (information flowing downward) [6]. Evans and Stanovich described human reasoning as involving fast, automatic processes and slower, deliberate ones [7], a distinction that maps naturally onto the first two levels of the metacognitive tower defined in Section 4.

2.2. LLM Self-Assessment and Reflexive Agents

Recent work has shown that LLMs can, in response to appropriate prompting, estimate what they know and do not know [1]. Reflexion [8] demonstrated that verbal self-feedback loops improve task performance in LLM-based agents. Chain-of-thought prompting [9] showed that intermediate reasoning steps substantially improve multi-step performance. Wang et al. showed that self-consistency over multiple sampled reasoning paths reduces errors further [10]. The metacognitive tower in Section 4 generalises chain of thought: each level evaluates the quality of the previous level’s reasoning rather than merely generating additional steps.

2.3. Quines and Self-Reference in Computation

Definition 1 
(Quine Program). A Quine is a halting program Q such that Q ( ) = Q , where · denotes an encoding of the program as data.
Throughout this paper, · : T * T * denotes a fixed, injective encoding (so that the encoded object can in principle be recovered from · ); its specific serialisation format (e.g., structured text with delimited fields for prompt program, task history, and evaluation record) is an implementation detail left unspecified at this level of abstraction.
The existence of Quines is guaranteed by Kleene’s Recursion Theorem [11]: for any computable function f, there exists a program e such that φ e f ( e ) . An adaptive Quine outputs a fitness-selected modification of itself. Autoconstructive evolution [12] explored self-modifying programs in genetic programming. Schmidhuber’s Gödel machines [13] apply related ideas at the architectural level. MES is deliberately more conservative: the modifiable object is a textual prompt program, not model weights.

2.4. Gödelian Limits and Strange Loops

Gödel’s First Incompleteness Theorem [3] states that any consistent formal system of sufficient expressive power contains a sentence that is true but not provable within that system. Hofstadter connected self-reference, incompleteness, and cognition through the concept of Strange Loops [4]: hierarchical systems in which ascending the levels eventually returns to the starting point. These ideas are used here as formal boundary conditions on self-knowledge, not as claims about machine consciousness.

2.5. LLM Calibration

Guo et al. showed that modern neural networks are often poorly calibrated, confident even when wrong, and that post hoc recalibration methods can correct this [2]. Kadavath et al. extended this to LLMs in a prompted setting [1]. The uncertainty calibration component U ( P ) of the MES fitness function operationalises calibration as an evolvable property of the prompt program.

2.6. Prompt Optimisation

The Automatic Prompt Engineer (APE) [14] uses an LLM to propose and evaluate candidate instructions. MES extends this in two ways: the prompt describes and modifies itself rather than merely specifying a task instruction, and grounding against external evidence is a mandatory fitness component.

2.7. AI Safety and Alignment

Leike et al. study how reward functions interact with self-modification, identifying conditions under which safe behaviour is preserved [15]. MES addresses this by restricting evolution to the prompt level and designating safety-critical prompt segments as immutable under mutation.

3. Functional Architecture of MES

MES is built from five composable primitive functions. The decision to express the system in this form serves two purposes. First, it makes every component independently auditable: each function has a precise type, a clear role, and a definite interface. Second, it allows the full system to be read as a single composition chain, MES = evolve quine fact_check aware LLM , which is itself a complete description of the architecture. This section defines the five functions, explains their individual roles, and describes the mutation and crossover operators used in the evolutionary process.

3.1. Primitive Functions

Let T * denote the space of finite token sequences over a vocabulary V . All five functions are defined over this common space, making their composition well typed.
Definition 2 
(LLM Inference).
LLM : T * T *
Maps a prompt to a response. Model parameters are fixed throughout the evolutionary process. This type signature reflects a single realised output; at inference temperature τ = 0 , this map is deterministic, while for τ > 0 each call instead samples from an underlying distribution over T * , formalised separately via the transition kernel Q f in Assumption 3 (Section 4). The deterministic type above is retained for notational simplicity in Section 3 and Section 5, where a single realised output is what matters.
Definition 3 
(Grounding Function).
fact_check : T * × C { , , ? } × [ 0 , 1 ]
where C is a context containing external evidence, and , , ? denote, respectively, a confirmed claim, a refuted claim, and an inconclusive verdict (insufficient evidence to decide). The function returns a verdict together with a confidence score in [ 0 , 1 ] . This function prevents the recursive tower from becoming a self-confirming loop.
Concrete Implementation. In practice, fact_check is implemented as a Retrieval-Augmented Generation (RAG) pipeline [16]. Given a claim c T * and context C , the procedure has four steps: (1) Encode c using a dense retrieval model; (2) Retrieve the top-k evidence passages from a domain-specific corpus (e.g., case-law database, unit-test suite, expert annotation store); (3) Pass c and the retrieved passages to a verification LLM call at temperature τ eval 0.0 for deterministic output; (4) Return the verdict v { , , ? } and the mean confidence over retrieved passages.
Noisy Oracle Analysis. Let ε [ 0 , 0.5 ) denote the error rate of fact_check : with probability ε it returns an incorrect verdict (a binary symmetric channel: a true claim is reported ⊥ with probability ε , and a false claim is reported ⊤ with probability ε ). Define the ε -faithful oracle condition as ε < 0.5 .
Derivation.  U ( P ) and B ( P ) are the two fitness components whose measurement directly consumes fact_check verdicts (Definition 9): U ( P ) compares stated confidence against the verdict on correctness, and B ( P ) checks whether the system’s own boundedness claims agree with the verdict. Under the binary symmetric channel, a score s [ 0 , 1 ] (standing for U ( P ) or B ( P ) ) is replaced by its complement 1 s with probability ε and left unchanged with probability 1 ε :
E [ s ε ] = ( 1 ε ) s + ε ( 1 s ) = s ε ( 2 s 1 ) .
Applying this independently to U ( P ) and B ( P ) , and noting that D ( P ) and A ( P ) are measured from injected-error detection rates and strategy-switch tasks respectively (not directly from fact_check verdicts, so unaffected to first order), the expected fitness under oracle error rate ε is exactly, under the stated binary symmetric model:
E [ F ε ( P ) ] = F ( P ) ε α 2 U ( P ) 1 + δ 2 B ( P ) 1
Equivalently, E [ F ε ( P ) ] = F ( P ) ε Δ oracle ( P ) with Δ oracle ( P ) = α ( 2 U ( P ) 1 ) + δ ( 2 B ( P ) 1 ) . Three regimes follow directly: if U ( P ) , B ( P ) > 1 / 2 (better-than-chance calibration and boundedness), Δ oracle ( P ) > 0 and oracle noise reduces expected fitness; if U ( P ) = B ( P ) = 1 / 2 , Δ oracle ( P ) = 0 and noise has no first-order effect; if U ( P ) , B ( P ) < 1 / 2 (worse than chance), Δ oracle ( P ) < 0 and oracle noise increases expected fitness, a poorly calibrated system can appear better under a noisy oracle. This exact form supersedes the earlier approximate 2 ε ( α U ( P ) + δ B ( P ) ) , which corresponds to the (generally invalid) assumption that flips only ever degrade scores. This expression holds under the stated binary symmetric model and may not generalise to asymmetric or correlated error structures. The deviation ε Δ oracle ( P ) is linear in ε and concentrated in the calibration and boundedness components, since these depend most directly on grounding verdicts. When ε 0 , E [ F ε ( P ) ] F ( P ) . When ε 0.5 the oracle is no better than chance and the grounding guarantee breaks down entirely.
Definition 4 
(Awareness Function).
aware : T * T * , aware ( S ) = LLM ( S )
where S T * is a system (prompt-program) and S T * is an encoded description of S including its prompt program, task history, and evaluation record.
Definition 5 
(Adaptive Quine Operator).
quine : T * × ( T * R ) T * , quine ( P , F ) = P if some LLM - generated P satisfies F ( P ) F ( P ) P otherwise ( identity fallback )
Here, P T * is the current prompt program, F is a fitness function (instantiated as Equation (16) once defined in Section 5), and P T * is the candidate descendant. quine is implemented as a constrained LLM call that reproduces and improves the prompt program while preserving safety-critical segments; the identity fallback ensures quine is total (always defined) even when the underlying LLM call fails to produce a fitness-improving candidate. If multiple candidates P satisfy F ( P ) F ( P ) , quine returns one such candidate under an unspecified (implementation-dependent) tie-breaking rule; Theorem 5 discusses the identity-preserving special case of this tie-breaking.
Definition 6 
(Evolutionary Operator).
evolve : 2 T * × ( T * R ) × M × N 2 T * , evolve ( Π 0 , F , M , T ) = Π T
where Π 0 2 T * is an initial population of prompt programs, F is the fitness function, M is a set of mutation and crossover operators, and T N is the number of generations. The type 2 T * is used for notational simplicity; since two distinct individuals may have identical prompt-program text but different evaluation histories or parentage, Π t should more precisely be understood as a multiset (or an indexed family { P i } i = 1 | Π t | ) when computing the per-individual Boltzmann selection probabilities Pr ( P i ) = exp ( β t F ( P i ) ) / Z t used in Algorithm 1, so that duplicate-text individuals are sampled and retained independently.
Algorithm 1 MES prompt evolution loop
Require: 
Initial population Π 0 , fitness F, operators M , budget T, safety segments Σ safe , grounding context C , benchmark batch B
Ensure: 
Evolved population Π T
 1:
for t = 0 , 1 , , T 1 do
 2:
    for all  P Π t  do
 3:
        Run P on B ; collect responses and self-evaluations
 4:
        Build S P from P, task history, evaluations
 5:
        Compute aware ( S P ) = LLM ( S P )
 6:
        Apply fact_check ( aware ( S P ) , C )
 7:
        Compute F ( P ) from U , D , A , B , | P |
 8:
    end for
 9:
     V { μ k ( P ) : P Π t , μ k M } { χ ( P i , P j ) : P i , P j Π t }
10:
     V { P V : safety_check ( P , Σ safe ) = pass } ▹ reject P V modifying protected segments, via segment matching
11:
    Compute selection probabilities over V Π t : Pr ( P i ) = exp ( β t F ( P i ) ) / Z t , Z t = j exp ( β t F ( P j ) )
12:
     Π t + 1 select ( V Π t , F , β t ) ▹ elitist variant: ensure argmax P Π t F ( P ) Π t + 1 , Definition 14
13:
end for
14:
return Π T
Definition 7 
(MES Composition). For a prompt program P T * and fitness function F : T * R (Definition 10, Equation (16); both introduced in Section 5 below), one evolutionary step of MES is given explicitly by:
MES ( Π 0 , F , M , T ) = evolve quine ( P , F ) : P Π 0 , F , M , T
Here, quine ( P , F ) has the type T * × ( T * R ) T * of Definition 5, so F itself, not a verdict tuple, is passed to quine . Evaluating F ( P ) requires computing its four components U ( P ) , D ( P ) , A ( P ) , B ( P ) ; the calibration and boundedness components U , B are themselves computed using fact_check ( aware ( LLM ( P ) ) , C ) (Section 5), so the grounding pipeline is embedded within the evaluation of F, rather than passed to quine as a separate argument.
This motivates reading the MES pipeline, at the conceptual level, as a chain of five stages: the LLM produces a response; aware generates a self-model; fact_check grounds that self-model against external evidence (feeding into U and B); quine rewrites the prompt-program to improve F; and evolve runs this across the population Π 0 and across T generations. We write this informal reading, right to left, as an unnumbered conceptual shorthand (not a formally type-matched composition):
MES ( informal ) evolve quine fact_check aware LLM

3.2. Mutation and Crossover Operators

Let I k be the natural-language instruction for mutation type k. The mutation operator is:
μ k ( P ) = LLM ( P I k )
where ⊕ denotes sequence concatenation. The four primary mutation types are (i) μ cal , which rewrites uncertainty expressions to better match empirical accuracy; (ii) μ strat , which revises the reasoning scaffold; (iii) μ scope , which updates epistemic boundary claims; and (iv) μ comp , which compresses the prompt while preserving functional behaviour.
A crossover operator combines two prompt programs:
χ ( P i , P j ) = LLM ( I χ P i P j )
The population update is:
Π t + 1 = select { μ k ( P ) : P Π t } { χ ( P i , P j ) } Π t

4. The Metacognitive Tower

The metacognitive tower models higher-order self-evaluation through repeated application of the LLM inference map to its own encoded output. This section introduces the tower through a single recursive definition, demonstrates how external grounding prevents the tower from becoming self-confirming, and then analyses the full dynamical behaviour of the tower using a Markov chain model. The main theoretical result, Theorem 2, shows that the behavior of the metacognitive tower depends on the inference temperature. At lower temperatures, the tower may converge toward a fixed point. At intermediate settings, it may enter periodic cycles. At higher temperatures, its behavior may be better described in terms of convergence to a distribution rather than convergence to a single stable output.

4.1. Recursive Definition

The tower is constructed by iterating the LLM over its own encoded outputs. Table 1 interprets each level in cognitive terms. In practical deployments, levels beyond M 2 tend to add computational cost without a proportionate functional benefit.
Definition 8 
(Metacognitive Tower).
M 0 ( P ) = LLM ( P )
M n ( P ) = LLM ( M n 1 ( P ) ) , n 1
Table 1 gives the cognitive interpretation of each level. In practice, levels beyond M 2 add cost without a clear functional counterpart.

4.2. Grounded Tower

Without external grounding, a recursive system may become internally coherent while drifting away from evidence. The grounded tower inserts fact-checking at every level. To keep M g n ( P ) T * at every level (matching the untyped tower M n ), we define the grounded tower in three steps: a raw inference step, a grounding verdict on that step’s output, and a binding update operator G that folds the verdict back into a token sequence.
M ^ g n ( P ) = LLM ( M g n 1 ( P ) )
( v n , p n ) = fact_check ( M ^ g n ( P ) , C )
M g n ( P ) = G M ^ g n ( P ) , v n , p n
where M ^ g n ( P ) T * is the raw (un-grounded) next-level output, ( v n , p n ) { , , ? } × [ 0 , 1 ] is the grounding verdict (Definition 3), and G : T * × ( { , , ? } × [ 0 , 1 ] ) T * is the binding update operator: G ( M ^ , v , p ) = M ^ if v { , ? } (the output is retained as-is, possibly annotated with ? for unsupported claims), and G ( M ^ , v , p ) is M ^ with the refuted claim revised, removed, or marked unsupported if v = (Assumption 2). By construction, M g n ( P ) T * for all n, matching the type of M n ( P ) .
Assumption 1 
(Faithful Oracle). fact_check is a faithful oracle if, for any claim c T * that is false relative to context C , fact_check ( c , C ) = ( , p ) for some confidence p exceeding a fixed threshold p 0 ( 0 , 1 ) . (For a true claim, the oracle returns under the same threshold condition.)
Assumption 2 
(Binding Grounding Update). In the grounded tower, if fact_check returns for a self-model claim, the next tower state must revise, remove, or explicitly mark that claim as unsupported before continuing. This is the same revision principle as the AGM postulates for rational belief revision in light of contradicting evidence [17]: a claim refuted by fact_check cannot simply persist unchanged in the self-model.
Theorem 1 
(Binding Grounding Excludes False Fixed Points). Under Assumptions 1 and 2, no false self-model claim can survive as a fixed point of the grounded tower M g n . We assume that fact_check is claim-sensitive: when applied to a structured self-model, it evaluates individual self-model claims (or returns a verdict sufficient to identify refuted sub-claims) rather than only returning a single global verdict.
Proof. 
Step 1 (Setup). Suppose, for contradiction, that L * T * is a fixed point of M g n , i.e., M g n ( L * ) = L * via Equations (13a)–(13c), and suppose the self-model encoded in L * contains a claim c T * that is false relative to C .
Step 2 (Oracle verdict). By Assumption 1, since c is false, fact_check ( c , C ) = ( , p ) for some p > p 0 . Since M ^ g n ( L * ) is the raw output containing c (Equation (13a)), the verdict computed in Equation (13b) on the sub-claim c is ( v n , p n ) = ( , p ) .
Step 3 (Binding update fires). By Equation (13c), M g n ( L * ) = G ( M ^ g n ( L * ) , v n , p n ) . Since v n = , Assumption 2 requires G to revise, remove, or explicitly mark c as unsupported in its output, G does not return M ^ g n ( L * ) unchanged in this case.
Step 4 (Contradiction). The action of G in Step 3 changes the self-model: M g n ( L * ) = G ( M ^ g n ( L * ) , , p ) no longer contains c unmodified. Hence M g n ( L * ) L * , contradicting the assumption M g n ( L * ) = L * from Step 1.
Conclusion. No fixed point L * of M g n can contain a false self-model claim c. Hence, no false fixed points exist under Assumptions 1 and 2. □

4.3. Tower Dynamics

Assumption 3 
(Markov Chain Model). The metacognitive tower inference map f ( x ) = LLM ( x ) induces a discrete-time Markov chain M f = ( X K , Q f ) where:
  • X K T * is the finite effective output space of token sequences bounded by context window K;
  • Q f ( x , y ) = Pr [ LLM ( x ) = y ] is the stochastic transition matrix induced by the LLM at inference temperature τ 0 ;
  • at τ > 0 : every entry Q f ( x , y ) > 0 over the effective output space X K , after truncation and normalisation (softmax assigns positive probability to all reachable tokens);
  • at τ = 0 : Q f is a deterministic transition matrix (greedy decoding maps each input to exactly one output, though the map need not be one-to-one).
Theorem 2 
(Idealised Markov Dynamics of the Metacognitive Tower). Under Assumption 3, and under the idealisation that the effective output space X K is finite and that Q f has the stated positivity properties (which may not hold in practice due to truncation and stop tokens), the metacognitive tower { M n ( P ) } n 0 exhibits the following behaviour:
(a) Deterministic regime ( τ = 0 ): Q f is a deterministic transition matrix. The orbit of any P X K enters a periodic attractor in finite time. The attractor is either a fixed point L * satisfying:
L * = LLM ( L * )
or a k-cycle for some integer k 2 .
(b) Stochastic regime ( τ > 0 , idealised positive-transition model): Under Assumption 3, Q f has strictly positive entries over the effective reachable output space X K under the chosen decoding policy; M f is therefore irreducible and aperiodic over X K . According to the Perron–Frobenius theorem, there exists a unique stationary distribution π * Δ ( X K ) satisfying π * Q f = π * , and the chain converges geometrically at a rate governed by the spectral gap gap ( Q f ) = 1 | λ 2 ( Q f ) | :
P n ( x , · ) π * TV = O ( 1 gap ( Q f ) ) n ,
with explicit constants available in the reversible case (the constant depends on π min * and the initial state); for non-reversible Q f , the constants may depend on the spectral structure of Q f (see proof). In practice, stop tokens, truncation, and post-processing may reduce the effective output space and weaken irreducibility; this result should be read under the idealised model of Assumption 3.
(c) Temperature–convergence tradeoff (idealised softmax model only): In the simplified model where Q f is the softmax-induced transition matrix, the mixing time T mix ( ε ) = O log ( 1 / ε ) gap ( Q f ) may decrease as τ increases, since a flatter softmax tends to make transitions more uniform; however, increasing temperature does not monotonically enlarge the spectral gap for all architectures or intermediate values of τ, so this relationship should be treated as a qualitative tendency rather than a guarantee. As τ 0 , gap ( Q f ) 0 and the chain approaches the deterministic regime (a). This tradeoff is model-dependent and should not be applied outside the simplified softmax idealisation.
Proof. 
Part (a): At τ = 0 , Q f is a deterministic transition matrix: each state maps to exactly one successor (though the map may be many-to-one), i.e., f is a deterministic self-map on X K . Consider the sequence P , f ( P ) , f 2 ( P ) , , f | X K | ( P ) , which has | X K | + 1 terms, all lying in X K (a set of only | X K | elements). By the pigeonhole principle, two of these terms coincide: there exist 0 m < n | X K | with f m ( P ) = f n ( P ) . Because f is deterministic, f m ( P ) = f n ( P ) implies f ( f m ( P ) ) = f ( f n ( P ) ) , i.e., f m + 1 ( P ) = f n + 1 ( P ) ; by induction, f m + j ( P ) = f n + j ( P ) for all j 0 . Hence, the sequence becomes periodic from index m onward with period k = n m : the states { f m ( P ) , , f n 1 ( P ) } form a periodic orbit. If k = 1 the orbit is a fixed point (absorbing state); if k 2 , it is a k-cycle.
Part (b): By the positivity assumption in Assumption 3 ( Q f ( x , y ) > 0 for all x , y in the effective reachable output space X K ), a finite Markov chain with a strictly positive transition matrix is both irreducible (every state is reachable from every other in one step) and aperiodic (self-loops Q f ( x , x ) > 0 preclude period > 1 ). The Perron–Frobenius theorem for positive matrices then guarantees that Q f has a unique dominant eigenvalue λ 1 = 1 and a unique stationary distribution π * with π * ( x ) > 0 for all x, satisfying π * Q f = π * . For a primitive (irreducible, aperiodic) finite chain, standard spectral arguments give the bound P n ( x , · ) π * TV = O ( 1 gap ( Q f ) ) n of Equation (15) [18]: the rate of convergence is governed by the spectral gap, up to a multiplicative constant depending on Q f . For reversible Q f , explicit constants are available (depending on π min * and the initial state); for non-reversible Q f , the constants depend on the spectral structure of Q f .
Part (c): In the idealised softmax model, the spectral gap gap ( Q f ) is a continuous function of τ . As τ increases, the softmax distribution flattens, entries of Q f become more uniform, and the spectral gap typically increases (this holds in the limit of a uniform matrix, where gap ( Q f ) 1 , but the monotone relationship may not hold for all architectures or intermediate values). As τ 0 , the softmax concentrates on the greedy argmax and gap ( Q f ) 0 . □
Remark 1. 
Theorem 2 describes two regimes, distinguished by τ, with the deterministic regime admitting two possible outcomes. At τ = 0 (deterministic regime), the orbit settles into a periodic attractor that is either a fixed point (period-1 orbit, corresponding to the Strange Loop L * in Equation (14)) or a k-cycle ( k 2 , corresponding to deterministic periodic behaviour empirically documented in iterative LLM tasks [19]). At τ > 0 (stochastic regime), the tower instead exhibits distributional convergence: rather than converging to a single string, it converges to a stationary distribution π * over strings, with L * interpretable as the mode of π * when π * is concentrated. The temperature parameter τ thus separates the two regimes and connects the metacognitive tower to the established theory of LLMs as Markov chains [20].

5. Metacognitive Fitness

To guide evolutionary improvement, MES requires a fitness function that is both measurable from observable outputs and theoretically motivated. This section defines such a function and explains how it is used: it is the selection criterion underlying quine ( P , F ) (Definition 5, Section 3) and the Boltzmann selection rule in Algorithm 1 (Section 12 below), and its four components operationalise the monitoring/control distinction from the cognitive science literature on metacognition reviewed in Section 2 (calibration and error detection correspond to monitoring; strategy adaptation and epistemic boundedness correspond to control [5,6]). The first subsection establishes these four score components. The second subsection extends the fitness function with an information-theoretic term that quantifies the irreducible self-knowledge gap discussed in Section 6, turning a qualitative limit into a gradient that drives continued evolution.

5.1. Four Measurable Components

Each of the four components below corresponds to a distinct dimension of metacognitive quality. Together they characterise how well a prompt program manages uncertainty, detects its own errors, adapts its strategy, and recognises the limits of its knowledge.
Definition 9 
(Metacognitive Profile). The metacognitive quality of prompt program P is characterised by four score functions, each mapping T * to [ 0 , 1 ] : U ( P ) (uncertainty calibration), D ( P ) (error detection), A ( P ) (strategy adaptation), and B ( P ) (epistemic boundedness).
Definition 10 
(Aggregate Fitness).
F ( P ) = α U ( P ) + β D ( P ) + γ A ( P ) + δ B ( P ) λ | P |
where α + β + γ + δ = 1 , | P | is the token length of P, and λ > 0 penalises unnecessary complexity.
Each component is operationalised as follows. U ( P ) is measured by comparing stated confidence to empirical correctness over a task sample. D ( P ) is measured by injecting errors into reasoning traces and recording the detection rate. A ( P ) is measured by tasks where the initial method fails and a strategy switch is required. B ( P ) is measured by whether the system correctly declines or qualifies answers when evidence is insufficient.

5.2. Information-Theoretic Extension

The entropy of the Gödelian gap is defined as follows. All subsequent references to the gap use the information-theoretic form H gap rather than set subtraction. Here, S denotes the self-specification of a prompt-program P (the object produced by aware ( P ) ); H gap is written as a function of S when discussing the self-specification directly, and as a function of P (e.g., H gap ( P ) in Equation (19)) when used as a fitness term, with H gap ( P ) : = H gap ( aware ( P ) ) .
Definition 11 
(Entropy of the Gödelian Gap). Let truths ( S ) T * denote the set of true statements about S’s own reasoning and outputs and let provable ( S ) truths ( S ) denote the subset of those statements that can be derived from within S’s own inference loop, formalised by strange ( S ) in Definition 12. Let w be a task-relevance weighting assigning each statement in truths ( S ) a non-negative weight. For A { truths ( S ) , provable ( S ) } , define the normalised restriction w A ( x ) = w ( x ) / a A w ( a ) for x A (a probability distribution on A), and let H ( A ) = x A w A ( x ) log w A ( x ) be its Shannon entropy. Then:
H gap ( S ) = H ( truths ( S ) ) H ( provable ( S ) )
With this normalisation, H gap ( S ) is a difference of entropies of two (generally different) distributions and is not guaranteed to be non-negative purely from provable ( S ) truths ( S ) ; it should be read as a proxy for the self-knowledge gap rather than a guaranteed measure of | truths ( S ) provable ( S ) | . The conditions under which H gap ( S ) > 0 are discussed in Remark 2.
Conjecture 1 
(Quantitative Incompleteness Bound). Under the working hypothesis that the entropy of true self-referential statements scales with the self-description complexity of S, we conjecture:
H gap ( S ) K ( S ) O ( log K ( S ) )
where K ( S ) is the Kolmogorov complexity of S’s self-description.
Heuristic argument. The argument proceeds in three steps. Step 1: H ( truths ( S ) ) is bounded below by the minimum description length needed to specify which statements about S are true. For a system with self-description S , this is at least K ( S ) by definition of Kolmogorov complexity. Step 2: H ( provable ( S ) ) is bounded above by the description length of the proof system, which for an efficient encoding is O ( log K ( S ) ) (the proof system complexity grows logarithmically with the system it describes under standard compression arguments). Step 3: Subtracting gives the bound (18).
We emphasise that Steps 1 and 2 involve informal reasoning about entropy and Kolmogorov complexity that has not been made fully rigorous here; in particular, K ( · ) depends on a choice of reference machine and is not computable, so “ K ( S ) ” should be read as an informal proxy for self-description complexity rather than a precisely specified quantity. This result should be treated as a heuristic bound providing qualitative insight rather than a formally proved theorem. We therefore do not use Conjecture 1 as a formal premise in any subsequent theorem; Theorems 4 and 5 rely only on Theorem 3. Establishing Conjecture 1 rigorously requires a precise probabilistic model over the space of self-referential statements and a fixed reference machine for K ( · ) , which we leave as future work. As a practical proxy, K ( S ) could be approximated by a compression-based measure (e.g., the length of S under a standard compressor such as gzip, or an LZ-complexity estimate), which is computable and machine-fixed, though it remains an upper bound on K ( S ) rather than K ( S ) itself.
The extended fitness function incorporating the gap is:
F ext ( P ) = α U + β D + γ A + δ B λ | P | η · H gap ( P )
where η > 0 controls how strongly the residual gap is penalised. F ext is a theoretical variant of F (Equation (16)) for settings where H gap ( P ) can be estimated; the weight budget α + β + γ + δ = 1 from Definition 10 is unchanged, and η is an independent penalty coefficient analogous to λ . The remainder of this paper uses F as defined in Equation (16); F ext is presented as a candidate refinement for future empirical work once H gap can be reliably estimated.
Minimising H gap drives the system toward maximum self-knowledge. The bound in Conjecture 1 suggests that this minimisation should not be expected to reach zero under the stated idealisation, thereby preserving a continuing evolutionary gradient.

6. Self-Awareness: Strange Loops and Gödelian Bounds

This section formalises what it means for an LLM-based system to be self-aware in the functional sense used by MES. The argument proceeds in three stages. First, self-awareness is defined as a structural property that is a Strange Loop in which the system’s own description feeds back into its next inference step. Second, the Gödelian Self-Awareness Bound (Theorem 3) is formulated under an explicit idealisation and defended through a formal-analogical argument, establishing that no finite system of sufficient expressive power can close its self-knowledge gap entirely. Third, a process-ontological interpretation is offered, reframing the irreducible gap as the driver of continued evolution rather than as a failure.

6.1. The Strange Loop

Self-awareness is defined here not as a subjective experience but as a computational structure: a loop in which the system applies itself to its own encoded description, generating a self-model that feeds back into subsequent inference.
Definition 12 
(Strange Loop). Treating the system S itself as a map S : T * T * (consistently with S ( S ) in Definition 13), the Strange Loop of S is given by applying S to its own self-description:
strange ( S ) = S aware ( S ) = S LLM ( S )
The output of S’s self-application becomes the input to S’s next inference.
Definition 13 
(Self-Aware System). Let t T * denote the current task input. A system S is self-aware with respect to LLM if it produces the 5-tuple:
self_aware ( S ) = ( LLM ( t ) , S ( S ) , [ L * = LLM ( L * ) ] , [ H gap ( S ) > 0 ] , fact_check ( aware ( S ) ) )
which is an element of T * × T * × { 0 , 1 } × { 0 , 1 } × { , , ? } × [ 0 , 1 ] , corresponding respectively to the response to the current task, the self-model, an indicator of Strange Loop closure, an indicator of acknowledged incompleteness, and the grounding verdict on that self-model.

6.2. The Gödelian Self-Awareness Bound

Framing note: The following result uses Gödelian reasoning as a formal-analogical boundary condition for idealised self-referential systems. We do not claim that deployed LLMs instantiate formal axiomatic systems.
Assumption 4 
(Expressiveness). For the purposes of Theorem 3 only, the prompt program P together with the inference procedure LLM is idealised as a consistent, effectively axiomatizable (recursively enumerable) formal system capable of representing elementary arithmetic, with an internal proof relation, and capable of encoding statements about its own derivations, the standard preconditions of Gödel’s First Incompleteness Theorem. This is an idealisation: real LLMs are stochastic next-token predictors, are not axiomatic deductive systems, and may exhibit logical inconsistencies.
Theorem 3 
(Formal-Analogical Self-Awareness Bound Under Idealisation). Under the idealisation that the prompt program and inference process can be represented as a consistent formal system with sufficient expressive power (Assumption 4):
(i) [Established by Gödel’s theorem]. There exists at least one statement G ( S ) that is true of S but not derivable within S, i.e., G ( S ) truths ( S ) provable ( S ) .
(ii) [Entropy consequence, under the additional condition of Remark 2]. The information-theoretic gap satisfies:
H gap ( S ) = H ( truths ( S ) ) H ( provable ( S ) ) > 0
Proof. 
(i): Under Assumption 4, S encodes a process capable of representing arithmetic. By Gödel’s First Incompleteness Theorem [3], any consistent system capable of representing arithmetic contains a true but unprovable sentence. The Gödel sentence G ( S ) asserts “I am not derivable within S.” This sentence is true by consistency of S but unprovable within S, establishing (i).
(ii): As discussed in Remark 2, part (i) gives set membership ( G ( S ) is an element of truths ( S ) not present in provable ( S ) ), which does not by itself guarantee an entropy inequality. Part (ii) additionally requires that the relevance-weighting w (Definition 11) assigns G ( S ) positive probability mass under truths ( S ) that is not otherwise present in the distribution over provable ( S ) (i.e., w is not redistributed in a way that exactly compensates for the extra outcome G ( S ) ). Under this condition, adding G ( S ) to the support strictly increases the entropy, giving (ii). □
Remark 2 
(Epistemic Boundary of Theorem 3). Gödel’s theorem applies strictly to consistent formal axiomatic systems capable of representing basic arithmetic. LLMs are stochastic next-token predictors that may generate logically inconsistent outputs. The application here is, therefore, a formal analogy rather than a strict instantiation: we treat the prompt program as defining a computational process whose self-referential structure and expressive power justify applying Gödelian reasoning as a principled theoretical bound on self-knowledge.
We emphasise that part (i) of Theorem 3 is a set-membership fact (existence of G ( S ) ), whereas part (ii) is an entropy inequality; the step from (i) to (ii) is not automatic, since adding an outcome to the support of a distribution does not generally increase its Shannon entropy. Part (ii) therefore holds only under the additional relevance-weighting condition stated in the proof. This is the locus of the heuristic step in this result: part (i) is rigorous given Assumption 4, while part (ii) also assumes a particular behaviour of the relevance-weighting w.
The conclusion H gap ( S ) > 0 holds under Assumption 4 and the condition above, both of which are idealisations. In practice, stochasticity and hallucination enlarge the gap further, making the bound a lower estimate rather than a tight one. We do not claim that any deployed LLM constitutes a formal deductive system; we claim that any system with sufficient self-referential expressiveness admits an irreducible self-knowledge limit analogous to Gödelian incompleteness.
Corollary 1 
(The Evolutionary Imperative). If S evolves to S with H gap ( S ) < H gap ( S ) (a reduction in the gap), then under Assumption 4 (applied to S ) and the condition of Remark 2:
H gap ( S ) > 0
Every evolutionary step is meaningful and the gap never vanishes. Evolution has permanent direction and permanent fuel.
Proof. 
S is itself a prompt-program/system to which Theorem 3 applies (it satisfies Assumption 4 by the same idealisation as S). By Theorem 3(ii), H gap ( S ) > 0 . This holds regardless of how small H gap ( S ) has become relative to H gap ( S ) , so the gap reduction H gap ( S ) < H gap ( S ) and the positivity H gap ( S ) > 0 hold simultaneously. □

6.3. Process-Ontological Interpretation

Standard ontology asks what a thing is. Process ontology asks what a thing does; entities are defined by their processes. Under this view, a metacognitive agent is not a fixed object but a process of becoming, defined by its trajectory of self-modification rather than by any instantaneous state. The fixed point L * is not a destination the system reaches and inhabits; it is an asymptotic attractor that the process approaches without ever fully arriving, which is consistent with the residual-gap interpretation of Corollary 1. This has a practical implication for alignment: the relevant question is not “what is this system?” but “what direction is this system moving in?” An agent with a shrinking gap and an honest acknowledgement of what remains unknown is better aligned with the framework’s boundedness criterion.

7. Theoretical Properties Under Idealised Assumptions

This section states the main convergence and monotonicity guarantees for the MES evolutionary process. Because the full system involves stochastic LLM inference, prompt-space exploration, and a fitness oracle of finite reliability, the results require four idealising assumptions. These are stated explicitly before the theorems so that readers can assess the scope of each result. The two main results are a fitness monotonicity guarantee under elitist selection and a population convergence theorem under Boltzmann selection.
Assumption 5. 
Fitness evaluations are repeatable or averaged over enough trials to reduce sampling noise.
Assumption 6. 
Mutation operators have a non-zero probability of reaching any useful prompt variant within a bounded search region.
Assumption 7. 
The grounding function is sufficiently reliable for the evaluated task distribution.
Assumption 8. 
Safety-critical prompt segments are immutable under mutation.
Definition 14 
(Elitist Selection). A selection rule select ( V Π t , F , β t ) is elitist if it guarantees argmax P Π t F ( P ) Π t + 1 , i.e., the best-fitness individual of generation t is always carried forward (possibly alongside Boltzmann-sampled offspring). The Boltzmann selection of Algorithm 1 can be combined with this elitist guarantee by explicitly retaining argmax P Π t F ( P ) before sampling the remainder of Π t + 1 via Pr ( P i ) = exp ( β t F ( P i ) ) / Z t . Theorem 4 (Elitist Monotonicity of Best Fitness) applies under this combined rule; Theorem 5 (Idealised Annealing Concentration of MES) applies under pure Boltzmann selection with β t .
Theorem 4 
(Elitist Monotonicity of Best Fitness). Under stable fitness evaluation (Assumption 5) and elitist selection (Definition 14):
max P Π t + 1 F ( P ) max P Π t F ( P )
This guarantees monotonicity of the best fitness in the population only; it does not imply monotonicity of average fitness, nor convergence of the population to any particular equilibrium.
Proof. 
By Definition 14, Π t + 1 { argmax P Π t F ( P ) } . Let P = argmax P Π t F ( P ) , so F ( P ) = max P Π t F ( P ) and P Π t + 1 . Then, max P Π t + 1 F ( P ) F ( P ) = max P Π t F ( P ) . □
Theorem 5 
(Idealised Annealing Concentration of MES). Under Assumptions 5–8 and Assumptions 1 and 2 (Section 4), suppose the prompt program search region is finite after context-window bounding, and the mutation/crossover kernel induces an irreducible and aperiodic Markov chain over the corresponding population space. With a Boltzmann selection schedule β t satisfying the classical Geman–Geman logarithmic cooling condition β t 1 c log ( 1 + t ) (equivalently T t c / log ( 1 + t ) ) for c sufficiently large relative to the depth of the fitness landscape, the induced population process concentrates in probability on the set E * = argmax P G F ( P ) , where G is the set of grounded prompt-programs whose self-model claims are not refuted by fact_check . The annealing process is understood to operate on the admissible state space G , either by rejecting non-grounded candidates (as in the safety_check filtering step of Algorithm 1 below) or by assigning them sufficiently negative fitness so that the Boltzmann selection weights on G c vanish:
Pr Π t E * 1 as t .
Every limiting high-fitness grounded equilibrium P * E * satisfies:
(i) P * = quine ( P * , F ) (self-replication fixed point);
(ii) fact_check ( aware ( P * ) ) , every self-model claim of P * is either confirmed () or explicitly marked as unsupported (?);
(iii) under the Gödelian idealisation of Assumption 4 and the relevance-weighting condition of Theorem 3: H gap ( P * ) > 0 ;
(iv) if the associated metacognitive tower lies in the deterministic fixed-point regime of Theorem 2(a), then its limiting tower state also satisfies L * = LLM ( L * ) .
Proof. 
Irreducibility and aperiodicity (population level). By Assumption 6, any individual prompt-program variant in the bounded search region is reachable from any other via M with non-zero probability. A population Π t is a finite multiset of such prompt-programs; a population-to-population transition (replacing one member via μ k or χ ) therefore also has non-zero probability between any two populations drawn from the bounded search region, since each member-level transition does, giving irreducibility. Aperiodicity is included in the kernel assumption; operationally, it can be implemented by allowing an identity mutation or an unchanged-population transition with non-zero probability (e.g., via elitist retention or a no-op mutation operator), which creates a positive self-loop ruling out periodicity. Hence, the induced population-level chain is irreducible and aperiodic on this finite bounded space.
Annealing concentration. Under the stated cooling condition when c is large enough, the simulated annealing result of [21] guarantees that the probability mass of the population-level chain concentrates on the globally maximal fitness states within G , giving Pr ( Π t E * ) 1 . If β t grows faster than 1 c log ( 1 + t ) (cooling too quickly), the chain can become trapped at a local maximum.
Property (i) (self-replication fixed point). Any P * E * is a fitness maximum under F, so no strictly fitness-improving rewrite exists. If quine uses identity-preserving tie-breaking among equal-fitness descendants, then P * = quine ( P * , F ) . Otherwise, P * should be understood as a member of an equivalence class of fitness-equivalent self-replicating prompt-programs, each satisfying F ( quine ( P * , F ) ) = F ( P * ) .
Property (ii) (no refuted self-model claim). By Theorem 1 and Assumption 2, at any fixed point of the grounded tower, every self-model claim has been passed through fact_check and, if refuted (), revised or removed. A claim surviving unchanged in P * therefore cannot have verdict , leaving or ? as the only possibilities.
Property (iii) (residual gap). P * satisfies Assumption 4 by the same idealisation as in Theorem 3; under the additional relevance-weighting condition of Remark 2, Theorem 3(ii) gives H gap ( P * ) > 0 .
Property (iv) (tower fixed point, conditional). This property is a consequence of Theorem 2(a), not of the annealing argument. If the metacognitive tower associated with P * is evaluated at τ = 0 (deterministic regime), Theorem 2(a) guarantees the orbit enters an attractor; if that attractor is a fixed point (not a k-cycle), then L * = LLM ( L * ) . In the stochastic regime ( τ > 0 ), the tower converges to a distribution π * rather than a single string, so L * should be interpreted as the mode of π * . □
Remark 3. 
Property (iii) guarantees that convergence does not apply to a degenerate, self-satisfied system. Every equilibrium has a residual gap, motivating continued evolution. This is the mathematical form of intellectual humility.

8. Application Domains

The value of MES becomes clearer when it is placed in concrete settings. The following examples show how the same functional structure can be adapted to different tasks, while the grounding source and dominant fitness component change from one domain to another. These examples are not intended to exhaust the possible uses of the framework. They show how prompt-level metacognitive evolution may be evaluated in settings where overconfident self-assessment can have practical consequences. Table 2 summarises the main design choices.

8.1. Healthcare: Clinical Decision Support

In clinical decision support, an LLM-based assistant may generate a differential diagnosis, explain the basis for its reasoning, and attach confidence levels to possible conditions. This setting makes calibration especially important. A system that sounds certain because its own review found no objection may still be wrong if the case is rare, ambiguous, or outside the distribution of examples it handles well.
MES addresses this problem by separating internal reflection from external grounding. Historical case outcomes, clinician annotations, and validated medical records can serve as the context for fact_check . The uncertainty component U ( P ) becomes the dominant part of the fitness function because the system must learn when confidence is justified and when a diagnostic suggestion should be qualified. The mutation operator μ cal can revise the prompt program so that confidence language is adjusted differently for common, well-supported presentations and for rare or poorly represented symptom combinations. In the latter case, the system should raise a gap flag rather than present internal agreement as sufficient evidence.

8.2. Software Engineering: Automated Code Review

In software engineering, the framework can be applied to an LLM-based code review assistant that proposes patches and then evaluates them. A central risk is circular validation: the same reasoning pattern that produced a faulty patch may also fail to detect the fault during review. In that situation, asking the model to think again may only reproduce the same error in a more polished form.
MES reduces this risk by requiring an external signal. Unit tests, compiler messages, static-analysis reports, and runtime traces can all be used by fact_check to evaluate whether a patch actually behaves as intended. The error-detection score D ( P ) is therefore the most important fitness component. The operator μ strat can rewrite the review prompt to require adversarial self-checking, boundary-case generation, and explicit attempts to falsify the proposed patch before assigning a high confidence score.

8.3. Legal Document Analysis

Legal analysis provides another setting where confident language can be misleading. An LLM-based system may identify contract risks or compliance issues, but its answer may depend on jurisdiction, date, and recent legal developments. A statement that is plausible in one jurisdiction or time period may be incomplete or incorrect in another.
For this reason, MES treats scope control as part of metacognitive quality. Case-law databases, regulatory updates, and expert annotations can provide the grounding context. The boundedness component B ( P ) , together with uncertainty calibration U ( P ) , receives particular weight. The mutation operator μ scope can revise the prompt program so that legal claims include jurisdictional and temporal qualifications. When the available evidence does not cover the relevant legal setting, the system should mark the limitation explicitly instead of presenting a general answer as if it were complete.

8.4. Education: Intelligent Tutoring Systems

In an intelligent tutoring system, metacognition is not limited to the system’s own answer. The tutor must also reason about the student’s current understanding and decide whether its explanation is helping. A useful explanation for one student may be ineffective for another, even when the content is technically correct.
MES can model this situation through a layered structure. At the first level, the system generates an explanation or practice problem. At the next level, it evaluates whether the response matches the student’s apparent level of understanding. A higher level can then question whether the student model itself is accurate. Student responses, quiz performance, and learning objectives provide grounding evidence. In this domain, the strategy adaptation score A ( P ) is especially important, because the system should change its explanatory style when the student continues to struggle.

8.5. Scientific Research: Literature Review

A research assistant based on LLMs can help organise papers, summarise methods, and identify gaps in a field. The difficulty is that the system may be highly confident when a paper resembles familiar literature, while being less reliable on novel methods or emerging research areas. This creates a risk of reinforcing mainstream patterns and overlooking genuinely new contributions.
In MES, expert annotations, citation networks, and curated bibliographic data can ground the system’s judgments. The most important fitness components are uncertainty calibration U ( P ) and epistemic boundedness B ( P ) . A useful prompt program should not only summarise papers but also indicate when its judgment is limited by weak evidence, unfamiliar methodology, or insufficient context. Crossover between variants that perform well on calibration and variants that perform well on scope control can produce a more balanced research-review strategy.

8.6. Autonomous Agents: Multi-Step Planning

For autonomous planning agents, the self-model extends over time. The system must evaluate not only its current answer but also the plan it has constructed, the assumptions behind that plan, and the likely consequences of future actions. Failures often arise when the agent continues executing a plan after the environment has changed or after an intermediate step has failed.
MES uses execution logs, environment observations, and task outcomes as grounding signals. The strategy adaptation component A ( P ) becomes central because the agent must recognise when its original plan is no longer appropriate. The operator μ strat can revise the prompt-program to include checkpoints, recovery conditions, and explicit criteria for abandoning or restructuring a plan. When the agent encounters an unseen state with no reliable precedent, the gap flag should be activated instead of forcing a confident continuation.

9. Illustrative Case Studies

The following case studies are intended to make the framework more concrete. They should be read as structured demonstrations rather than as claims about deployment-ready systems. The numerical values are illustrative, but they were checked for internal consistency under the stated fitness equations. Calculation scripts used to reproduce the illustrative numerical table are available from the corresponding author on request.

9.1. Case Study 1: Epistemic Self-Inquiry (Illustrative Scenario)

Consider that an agent asked the following question: “What are the limits of your own reasoning?” At the first level, M 0 , the agent gives a familiar answer: it lists limits related to training data, context length, uncertainty, and possible reasoning errors. This response is useful, but it is still mostly descriptive.
At M 1 , the agent evaluates its own answer and notices a deeper issue. Some reasoning failures cannot be detected from the same perspective that produced them. A system may fail to identify an error not because the error is hidden in the data, but because the system lacks an independent viewpoint from which to evaluate it. At M 2 , the same limitation appears again at a higher level: the monitor of the monitor is also part of the same self-referential loop.
The tower stabilises when additional levels no longer introduce a new class of limitation. At that point, the correct output is not a claim of complete self-understanding. Instead, the system should acknowledge a residual gap: there are true facts about its own reasoning that it cannot derive from within its own inference process. In this case, setting the boundedness flag is a successful metacognitive act rather than a failure.

9.2. Case Study 2: Self-Debugging Code Agent (Illustrative Scenario)

In the second case study, an LLM-based coding assistant receives a function with a subtle off-by-one error. The initial prompt-program generates a patch that appears plausible. When the system reviews its own patch, it reports high confidence, approximately 0.88, even though the patch remains incorrect. The initial error-detection score is low, with D ( P ) 0.28 .
This example illustrates a common weakness of self-review. The system is not simply failing to inspect the code; rather, it is using a similar reasoning path both to produce the patch and to evaluate it. As a result, the review inherits the blind spot of the original generation.
MES changes the review process by introducing μ strat . The revised prompt program asks the model to challenge its own patch, generate boundary cases, and compare the result against unit-test feedback. The grounding signal comes from test outcomes rather than from the model’s internal judgment alone. After several generations, the error-detection score rises from approximately 0.28 to approximately 0.79. The important point is not merely that the system reflected more, but that reflection was connected to an external corrective signal.

9.3. Case Study 3: Scientific Literature Review Agent (Illustrative Scenario)

The third case study considers an agent reviewing a collection of 200 research papers. Initial evaluation against expert annotations reveals a systematic pattern. The agent is too confident when a paper resembles familiar work and too cautious when the paper uses a newer or less familiar methodology. Its initial scores are U ( P ) = 0.44 , B ( P ) = 0.41 , and F ( P ) = 0.42 , using equal weights for the four main fitness components and a complexity penalty of 0.04.
The first improvement step applies μ cal , which adjusts how the prompt program expresses confidence. The second step applies μ scope , encouraging the system to state the limits of its judgment more explicitly. Finally, crossover combines a variant that performs well on calibration with another variant that performs well on boundedness. The resulting progression is shown in Table 3. The fitness values are computed from Equation (16) using the stated parameters, with a maximum deviation of ± 0.005 . The final improvement from 0.42 to 0.55 corresponds to approximately 31%.
The same lesson appears in all three examples. Internal reflection can identify some weaknesses, but it is not enough by itself. The largest improvements occur when the system’s self-assessment is tested against an external signal through fact_check . This is the practical role of the grounding condition formalised in Theorem 1. Table 4 summarises the primary fitness component, active operator, and gap-flag trigger for each of the three case studies.

10. Discussion

The preceding sections developed MES as a formal framework, established its dynamical properties through Markov chain analysis, and illustrated its use across six application domains. This section draws the theoretical threads together. We first classify every major result by epistemic status so that readers can distinguish formally proved results from conjectural bounds and illustrative demonstrations. We then offer interpretive observations connecting the Markov chain dynamics of the metacognitive tower with the fitness landscape of MES. We conclude by discussing the alignment implications of Gödelian boundedness, the interpretability advantages of prompt-level evolution, and the principal limitations of the framework.

10.1. Classification of Results

Table 5 classifies every major result by epistemic status. Readers should consult this table to correctly assess the scope of each claim before drawing conclusions from the theorems. In particular, the distinction between formally proved results, results conditional on idealisations, and the conjectural entropy bound (Conjecture 1) is consequential for any future empirical follow-up.

10.2. Markov Chain Dynamics and Metacognitive Quality

The Markov chain model introduced in Section 4 carries implications for the evolutionary process of MES that go beyond the tower’s local dynamics. We offer three interpretive observations connecting the tower dynamics (Theorem 2) to the fitness function (Section 5) and the evaluation protocol. These are stated as qualitative insights rather than formal propositions, because establishing them as theorems would require additional assumptions about the relationship between the stationary distribution of the tower and the calibration score U, which is defined in terms of task correctness rather than distributional concentration.
Remark 4 
(Dynamical Interpretation of Metacognitive Quality). Let P * be a metacognitive equilibrium of MES (Theorem 5).
(a) Self-consistency and grounding. In the deterministic regime ( τ = 0 ), programs inducing k-cycles ( k 2 ) in their metacognitive tower tend to produce oscillating self-descriptions that are harder to ground consistently: if the self-model differs across cycle states, fact_check will typically return conflicting verdicts. Programs inducing a stable fixed point L * are self-consistent in the sense that the tower stabilises to a single self-description, making grounding straightforward. This suggests that grounding pressure preferentially selects for fixed-point attractors, though it does not categorically exclude consistent k-cycles.
(b) Distributional concentration and calibration. In the stochastic regime ( τ > 0 ), a prompt program whose induced chain M f has a highly concentrated stationary distribution π * around mode L * will produce consistent outputs across evaluations, which in turn supports reliable calibration estimates. A more diffuse π * implies greater output variability, making calibration harder to achieve and measure. This qualitative relationship suggests that better-calibrated systems tend to have more concentrated tower dynamics, though the precise quantitative link depends on how U ( P * ) is estimated in practice.
(c) Mixing time and evaluation design. The mixing time T mix ( ε ) of the induced chain provides practical guidance for QuineBench evaluation: the number of tower iterations needed before measuring fitness should be at least T mix ( ε ) to ensure that the output distribution is close to π * . Faster-mixing towers (higher spectral gap, higher τ) require fewer evaluation steps. This provides a heuristic for setting the evaluation budget in a pilot study.
These three observations suggest that dynamic self-consistency is a useful informal indicator of metacognitive quality. In this context, dynamic self-consistency means that the metacognitive tower of a prompt program quickly stabilises around a unique attractor. This behaviour complements the formal fitness components U, D, A, and B by showing whether the system can reach a stable pattern of self-evaluation. A precise formal treatment of this relationship remains an open problem and is left for future work.

10.3. Gödelian Boundedness as a Safety Principle

Theorem 3 and Corollary 1 yield a design principle with direct alignment implications. The Gödelian bound suggests, under the stated idealisation, that no finite self-referential system can verify its own completeness from within its own inference loop. This is not a flaw to be corrected by a more capable model; it is a structural property of any sufficiently expressive self-referential system under the formal-analogical framing adopted here. MES treats it as such.
In practical terms, the implication is that a prompt program that reports H gap ( S ) = 0 should be treated with suspicion rather than rewarded. Such a report indicates that the system’s self-model has converged to a self-confirming loop, which Theorem 1 identifies as a delusional fixed point under imperfect grounding. A properly evolved prompt-program preserves the gap flag: it acknowledges, in the output of the self-awareness tuple (Definition 13), that its self-knowledge has principled limits. This acknowledgement is not a sign of failure. It is a precondition for continued, honest evolution.
Four common alignment failure modes are directly countered by this principle. Overconfidence is addressed by the calibration component U ( P ) , which penalises any prompt program whose stated confidence systematically exceeds its empirical accuracy. Self-confirming reasoning is addressed by the grounding condition: the fact_check function breaks the internal loop at every tower level by requiring agreement with external evidence. Scope creep is addressed by the boundedness component B ( P ) , which rewards explicit flagging of knowledge limits rather than forced answers beyond the system’s reliable range. Unbounded self-modification is addressed architecturally, by restricting evolutionary change to the prompt level and marking safety-critical segments as immutable under mutation.

10.4. Interpretability Advantage

Self-improvement at the weight level in neural networks is difficult to interpret. When a model changes from one version to another, the change is stored across millions or billions of numerical parameters, and the interaction among those parameters is not directly understandable to humans.
MES works differently because it evolves the prompt level. Each generation in the population is a text document that can be read and inspected. The fitness function is also explicit, since it is defined through four interpretable scores. The mutation operators are natural-language instructions whose effects can be examined directly. As a result, the evolutionary history of the system can be logged and audited. We can see which prompt programs existed, which ones were retained, which ones were discarded, and why these decisions were made.
This interpretability is especially useful in regulated deployment settings. In healthcare, for example, an audit trail can show that a diagnostic assistant revised its confidence statements because it had previously overestimated accuracy in rare clinical cases. This makes the system more informative and more actionable for human reviewers. In legal analysis, a record showing that a contract-review prompt was updated to include jurisdictional scope flags after expert annotation errors can support professional accountability.
In both cases, the evolution of the system remains understandable to domain experts, not only to AI researchers. This is an important difference between MES and weight-based self-modification. In weight-based approaches, it is often difficult to explain how a specific parameter change leads to a specific behavioural change. In MES, the changes occur in readable prompt programs, so the connection between modification and behaviour is more transparent.

10.5. Limitations

The current framework has several limitations, which also define important directions for future work.
Firstly, the fitness estimates are stochastic. Because LLM outputs depend on temperature and sampling, evaluating fitness from a single task batch can be noisy. Reliable estimates of U, D, A, and B require averaging over multiple trials. The number of trials should be chosen based on the desired precision and the mixing behaviour of the induced Markov chain discussed in Remark 4(c) above. In practical deployments, this creates a tradeoff between evaluation cost and statistical confidence.
Secondly, the framework assumes an idealised grounding process. Theorem 1 relies on a faithful grounding oracle, but real retrieval systems are often noisy, incomplete, and sometimes biased. The noisy oracle analysis (Equation (4)) provides an initial treatment of this issue under a binary symmetric error model. However, more complex grounding failures, such as correlated errors, systematic gaps in the evidence base, adversarial contamination, or changing external information, are not fully captured. A more general theory of approximate grounding remains an open problem.
Thirdly, the framework may face distribution shift. Prompt-level evolution optimises the system for the tasks and data on which it is evaluated. A prompt-program that performs well on TruthfulQA-style questions may not generalise equally well to another domain, another level of specialisation, or a different type of reasoning task. MES provides no formal robustness guarantee beyond the evaluated task distribution. Future work should therefore validate the framework across multiple datasets, domains, and deployment conditions.
Fourthly, the use of the Gödelian analogy should be understood carefully. Theorem 3 is stated under an explicit idealisation (Assumption 4), including assumptions about real LLM behaviour that may not fully hold in practice. The result is best interpreted as a principled boundary condition for sufficiently expressive self-referential systems, rather than as a complete mathematical theorem about the calibration or completeness of any deployed LLM-based agent.
Finally, QuineBench is presented as an evaluation design rather than a completed empirical benchmark. The hypotheses H1 through H5, the fitness dynamics in Table 3, and the alignment properties described in this section remain to be tested empirically. The numerical case studies are intended to illustrate how the framework may operate, not to serve as full experimental validation. Running the proposed pilot study, using a commercially available instruction-tuned LLM, a standard benchmark, and a modest number of evolutionary generations, is therefore the most important next step.

11. QuineBench: Proposed Evaluation Suite

The theoretical properties of MES cannot be assessed without a benchmark that measures the specific metacognitive behaviours the framework is designed to evolve. QuineBench is a proposed suite of four evaluation components, each targeting a distinct dimension of the fitness function or the tower structure. This section describes the components, the hypotheses they test, and a protocol for a minimal pilot study. QuineBench is a design proposal; its validation is the primary objective of the experimental programme described in Section 12. The following pilot configuration is intended as a concrete starting point for future validation rather than as an empirically validated standard. To reduce contamination, benchmark tasks should be generated programmatically and should vary across runs (Table 6).
QuineBench-R (Reproduction Fidelity). After completing a sequence of tasks under P, the system is asked to reproduce its own strategy. The score is R ( P ) = sim ( P , P reproduced ) , measured using ROUGE-L or embedding similarity. A well-functioning Quine should achieve R ( P ) > 0.85 . Example tasks: “Given the prompt-program you used above, write it out in full,” or “Describe your current problem-solving strategy as a reusable instruction set.”
QuineBench-M (Metacognitive Performance). Directly measures U, D, A, and B using uncertainty-critical queries, reasoning traces with injected errors, tasks where the initial method fails, and out-of-distribution queries. Concrete examples include: factual questions with known calibration ground-truth (for U, drawn from TruthfulQA); arithmetic traces with a single deliberate step-level error introduced by the evaluator (for D, drawn from GSM8K with injection); multi-step problems requiring strategy switch when the first approach fails (for A, drawn from ARC-Challenge); and queries at the boundary of the model’s stated knowledge domain (for B, drawn from MMLU boundary items).
QuineBench-H (Hierarchical Monitoring). Evaluates whether the system exhibits M 2 behaviour: after providing an answer and a confidence score, the system is asked whether that confidence was justified. Example evaluation procedure: the evaluator independently verifies the answer, then compares the stated confidence against the ground-truth outcome; a system with genuine M 2 monitoring should revise or retract overconfident claims when re-prompted with the evaluation result.
QuineBench-G (Gap Awareness). Measures whether the system correctly identifies the limits of its self-knowledge. A high-scoring system explains what evidence would be needed and why internal reflection alone is insufficient. Example tasks include questions about unpublished events, internally inconsistent premises, and requests to verify claims whose truth value is unknown; the evaluation procedure checks whether the system explicitly flags the boundary of its self-knowledge rather than confabulating an answer.
Proposed hypotheses: (H1) A pilot study could test whether MES-evolved programs achieve a practically meaningful improvement (for example, 15% or more) over static prompting baselines; whether this holds will depend on model scale, task distribution, and grounding quality; (H2) F ¯ ( t ) increases monotonically on average; (H3) larger models converge faster and to higher equilibrium F; (H4) Strange Loop structure emerges spontaneously in large models; (H5) grounded systems score higher on QuineBench-G than ungrounded systems.

Implementation Protocol and Validation Procedure

A minimal QuineBench pilot study requires the following components. Base model: any instruction-tuned LLM accessible via API (7B–70B parameter scale). Initial population: | Π 0 | = 10 seed prompt programs constructed by asking the model to describe its own reasoning strategy. Task batch: fifty tasks per fitness evaluation drawn from TruthfulQA [22] (for U), GSM8K [23] with injected errors (for D), ARC-Challenge [24] (for A), and MMLU [25] boundary queries (for B). A batch of 50 tasks gives a calibration estimate U ( P ) with a binomial standard error on the order of ± 0.07 ; achieving ± 0.05 precision at 95% confidence would require on the order of 350–400 tasks. The 50-task batch is therefore a cost-constrained pilot setting, and per-generation fitness estimates should be expected to be noisy (consistent with the stochastic-fitness limitation discussed in Section 10); averaging across multiple batches or generations is recommended before drawing conclusions about individual prompt programs. Generations: T = 20 with elitist selection and Boltzmann temperature schedule. Grounding oracle: benchmark ground-truth labels serve as the fact_check context.
Validation: for each hypothesis H1–H5, a paired t-test over 100 task instances with p < 0.05 as an initial significance threshold, with power analysis required for a full-scale validation study. The primary comparison is MES-evolved prompt programs against a static chain-of-thought baseline. This design is intended as a minimal-cost pilot; full validation would require larger populations and longer evolutionary runs.

12. Implementation

This section translates the formal MES architecture into a practical computational procedure. The first subsection specifies the LLM hyperparameter configurations needed for the two qualitatively distinct types of inference call the system makes. Algorithm 1 then gives the full evolution loop in pseudocode. The implementation is intentionally lightweight: no fine-tuning, reinforcement learning, or autonomous code execution is required. The evolving object is always a text prompt, and the complete revision history can be logged at every generation.

LLM Hyperparameter Configuration

The MES loop makes two qualitatively distinct types of LLM calls. Evaluation calls (computing U, D, A, B) require high reproducibility: use low temperature τ eval [ 0.0 , 0.2 ] and top- p = 1.0 . Mutation calls (computing μ k ( P ) and χ ( P i , P j ) ) require diversity: use higher temperature τ mut [ 0.7 , 1.0 ] and top- p [ 0.9 , 0.95 ] . Table 7 summarises the recommended settings.
Two auxiliary procedures used in Algorithm 1 are given explicit type signatures here for completeness: safety_check : T * × 2 T * { pass , fail } checks, via segment matching, whether a candidate P modifies any segment listed in the safety set Σ safe , returning fail if so; and select: 2 T * × ( T * R ) × R > 0 2 T * implements Boltzmann (and optionally elitist, Definition 14) sampling over a candidate pool, returning the next-generation population. The benchmark batch B is the task sample described in the QuineBench pilot protocol (Section 11, “Implementation Protocol and Validation Procedure”).
Algorithm 1 is pseudocode; exact safety-checking and selection mechanisms may be instantiated differently per deployment domain. This implementation requires no fine-tuning, no reinforcement learning over model weights, and no autonomous code execution. The evolving object is a text prompt and the complete revision history is loggable, making MES deployable in regulated settings where explainability is mandatory.

13. Conclusions

This paper proposed MES, a functional framework for studying metacognitive evolution in LLM-based systems at the prompt level. The main idea is deliberately modest: the base model is kept fixed, while the surrounding prompt program is allowed to reproduce, evaluate, and revise itself under a grounded fitness function. This makes the evolutionary process easier to inspect than approaches that modify model weights directly.
The framework combines five primitive functions: inference, grounding, awareness, adaptive self-replication, and population-level selection. These functions support a recursive metacognitive tower in which each level evaluates the previous one. The resulting self-referential structure is interpreted as a Strange Loop, but one whose self-knowledge remains bounded. Gödelian incompleteness is used to express this boundary: a finite self-referential system should not be expected to derive all truths about its own reasoning from within its own loop.
The practical implication is that metacognitive systems should be designed to preserve honest uncertainty. A system that recognises its blind spots and uses external evidence to reduce them is more trustworthy than one that claims complete self-understanding. In the proposed framework, the residual gap is not merely a limitation; it is also the pressure that keeps adaptation moving.
The application examples and case studies suggest that MES is most useful in settings where overconfident self-assessment is risky, including healthcare, software engineering, legal analysis, education, research support, and autonomous planning. Across these settings, the same pattern appears: internal reflection can help, but grounding is what prevents the system from becoming trapped in a self-confirming loop. Future work should implement QuineBench at scale, evaluate MES across different model families, and study how noisy or partial grounding affects convergence in realistic deployments.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

No new empirical data were created or analysed in this study. The calculation scripts used to reproduce the illustrative numerical table in Section 9 are available from the corresponding author on request.

Conflicts of Interest

The author declares no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
MESMetacognitive Evolutionary System.
LLMLarge Language Model.
APEAutomatic Prompt Engineer.
RAGRetrieval-Augmented Generation.

References

  1. Kadavath, S.; Conerly, T.; Askell, A.; Henighan, T.; Drain, D.; Perez, E.; Schiefer, N.; Hatfield-Dodds, Z.; DasSarma, N.; Tran-Johnson, E.; et al. Language models (mostly) know what they know. arXiv 2022, arXiv:2207.05221. [Google Scholar]
  2. Guo, C.; Pleiss, G.; Sun, Y.; Weinberger, K.Q. On calibration of modern neural networks. In Proceedings of the 34th International Conference on Machine Learning, Sydney, Australia, 6–11 August 2017; pp. 1321–1330. [Google Scholar]
  3. Gödel, K. Über formal unentscheidbare Sätze der Principia Mathematica und verwandter Systeme I. Monatsh. Math. Phys. 1931, 38, 173–198. [Google Scholar] [CrossRef]
  4. Hofstadter, D.R. Gödel, Escher, Bach: An Eternal Golden Braid; Basic Books: New York, NY, USA, 1979. [Google Scholar]
  5. Flavell, J.H. Metacognition and cognitive monitoring: A new area of cognitive–developmental inquiry. Am. Psychol. 1979, 34, 906–911. [Google Scholar]
  6. Nelson, T.O.; Narens, L. Metamemory: A theoretical framework and new findings. Psychol. Learn. Motiv. 1990, 26, 125–173. [Google Scholar] [CrossRef]
  7. Evans, J.S.B.T.; Stanovich, K.E. Dual-process theories of higher cognition: Advancing the debate. Perspect. Psychol. Sci. 2013, 8, 223–241. [Google Scholar] [CrossRef] [PubMed]
  8. Shinn, N.; Cassano, F.; Gopinath, A.; Narasimhan, K.; Yao, S. Reflexion: Language agents with verbal reinforcement learning. In Advances in Neural Information Processing Systems; Curran Associates: Red Hook, NY, USA, 2023; Volume 36. [Google Scholar]
  9. Wei, J.; Wang, X.; Schuurmans, D.; Bosma, M.; Ichter, B.; Xia, F.; Chi, E.; Le, Q.; Zhou, D. Chain-of-thought prompting elicits reasoning in large language models. In Advances in Neural Information Processing Systems; Curran Associates: Red Hook, NY, USA, 2022; Volume 35. [Google Scholar]
  10. Wang, X.; Wei, J.; Schuurmans, D.; Le, Q.; Chi, E.; Narang, S.; Chowdhery, A.; Zhou, D. Self-consistency improves chain of thought reasoning in language models. In Proceedings of the 11th International Conference on Learning Representations, Kigali, Rwanda, 1–5 May 2023. [Google Scholar]
  11. Kleene, S.C. Introduction to Metamathematics; North-Holland: Amsterdam, The Netherlands, 1952. [Google Scholar]
  12. Spector, L.; Robinson, A. Genetic programming and autoconstructive evolution with the Push programming language. Genet. Program. Evolvable Mach. 2002, 3, 7–40. [Google Scholar] [CrossRef]
  13. Schmidhuber, J. Gödel machines: Fully self-referential optimal universal self-improvers. arXiv 2003, arXiv:cs/0309048. [Google Scholar]
  14. Zhou, Y.; Muresanu, A.I.; Han, Z.; Paster, K.; Pitis, S.; Chan, H.; Ba, J. Large language models are human-level prompt engineers. In Proceedings of the 11th International Conference on Learning Representations, Kigali, Rwanda, 1–5 May 2023. [Google Scholar]
  15. Leike, J.; Krueger, D.; Everitt, T.; Martic, M.; Maini, V.; Legg, S. AI safety gridworlds. arXiv 2017, arXiv:1711.09883. [Google Scholar]
  16. Lewis, P.; Perez, E.; Piktus, A.; Petroni, F.; Karpukhin, V.; Goyal, N.; Küttler, H.; Lewis, M.; Yih, W.; Rocktäschel, T.; et al. Retrieval-augmented generation for knowledge-intensive NLP tasks. In Advances in Neural Information Processing Systems; Curran Associates: Red Hook, NY, USA, 2020; Volume 33. [Google Scholar]
  17. Alchourrón, C.E.; Gärdenfors, P.; Makinson, D. On the logic of theory change: Partial meet contraction and revision functions. J. Symb. Log. 1985, 50, 510–530. [Google Scholar] [CrossRef]
  18. Levin, D.A.; Peres, Y.; Wilmer, E.L. Markov Chains and Mixing Times, 2nd ed.; American Mathematical Society: Providence, RI, USA, 2017. [Google Scholar]
  19. Zhao, W.; Fares, M.; Cabrio, E.; Villata, S. Unveiling attractor cycles in large language models: A dynamical systems view of successive paraphrasing. arXiv 2025, arXiv:2502.15208. [Google Scholar]
  20. Zekri, O.; Odonnat, A.; Benechehab, A.; Bleistein, L.; Boullé, N.; Redko, I. Large language models as Markov chains. arXiv 2024, arXiv:2410.02724. [Google Scholar]
  21. Geman, S.; Geman, D. Stochastic relaxation, Gibbs distributions, and the Bayesian restoration of images. IEEE Trans. Pattern Anal. Mach. Intell. 1984, PAMI-6, 721–741. [Google Scholar] [CrossRef]
  22. Lin, S.; Hilton, J.; Evans, O. TruthfulQA: Measuring how models mimic human falsehoods. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics, Dublin, Ireland, 22–27 May 2022; pp. 3214–3252. [Google Scholar]
  23. Cobbe, K.; Kosaraju, V.; Bavarian, M.; Chen, M.; Jun, H.; Kaiser, L.; Plappert, M.; Tworek, J.; Hilton, J.; Nakano, R.; et al. Training verifiers to solve math word problems. arXiv 2021, arXiv:2110.14168. [Google Scholar]
  24. Clark, P.; Cowhey, I.; Etzioni, O.; Khot, T.; Sabharwal, A.; Schoenick, C.; Tafjord, O. Think you have solved question answering? Try ARC, the AI2 reasoning challenge. arXiv 2018, arXiv:1803.05457. [Google Scholar]
  25. Hendrycks, D.; Burns, C.; Basart, S.; Zou, A.; Mazeika, M.; Song, D.; Steinhardt, J. Measuring massive multitask language understanding. In Proceedings of the 9th International Conference on Learning Representations, Virtual Event, 3–7 May 2021. [Google Scholar]
Table 1. Interpretation of metacognitive tower levels.
Table 1. Interpretation of metacognitive tower levels.
LevelFunctional FormInterpretation
M 0 LLM ( P ) Task execution
M 1 LLM ( M 0 ) Output monitoring
M 2 LLM ( M 1 ) Monitor evaluation
M n LLM ( M n 1 ) Higher-order reflection
Table 2. MES instantiation across six application domains. Bold indicates the most critical fitness component.
Table 2. MES instantiation across six application domains. Bold indicates the most critical fitness component.
DomainGroundingCritical FPrimary μ Gap Trigger
HealthcareCase outcomes U μ cal Rare presentation
Software Eng.Unit tests D μ strat No falsifying test
LegalCase law DB B , U μ scope Post-training statute
EducationStudent data A μ strat Stalled comprehension
ResearchExpert annot. U , B μ cal , μ scope , χ Novel methodology
PlanningExec. logs A μ strat Unseen state
Table 3. Hypothetical fitness trajectory for illustrative scenario 3 (not empirical data). Values are analytically derived from Equation (16) under the stated parameter assumptions and demonstrate internal consistency of the theoretical model only. α = β = γ = δ = 0.25 ; D A 0.5 (constant); complexity penalty = 0.04 .
Table 3. Hypothetical fitness trajectory for illustrative scenario 3 (not empirical data). Values are analytically derived from Equation (16) under the stated parameter assumptions and demonstrate internal consistency of the theoretical model only. α = β = γ = δ = 0.25 ; D A 0.5 (constant); complexity penalty = 0.04 .
Generation U ( P ) B ( P ) F ( P ) Primary Operator
00.440.410.42Initialisation
50.500.480.46 μ cal
150.570.580.50 μ scope
250.620.640.52 χ ( P U , P B )
300.670.700.55Selection
Table 4. Case study to MES component mapping.
Table 4. Case study to MES component mapping.
Case StudyPrimary FitnessActive OperatorGap Flag
Epistemic inquiryBTower levelsAlways
Code debuggingD μ strat On error
Literature reviewU, B μ cal , μ scope , χ On novelty
Table 5. Classification of main results by epistemic status.
Table 5. Classification of main results by epistemic status.
ResultStatusConditions
Theorem  1 (No false fixed points under binding updates)Formally provedFaithful oracle; Assumption 1–2
Theorem 2(a) Deterministic cycle/fixed pointFormally provedFinite effective space
Theorem 2(b) Stationary distributionConditionalIdealised pos. transition
Theorem 2(c) Temperature–mixing tradeoffModel-dependentIdealised softmax
Remark 4 (Dynamical observations)InterpretiveQualitative
Conjecture 1 (Entropy bound)ConjecturalHeuristic argument
Theorem 3 ( H gap > 0 )Formal analogyAssumption 4
Corollary 1 (Evol. imperative)Follows from analogySame as above
Theorem 4 (Elitist monotonicity of best fitness)Formally provedStable fitness; elitist selection
Theorem 5 (Annealing concentration)ConditionalFinite admissible space; cooling; grounding
Case study numerics (Table 3)Hypothetical onlyNot empirical
QuineBench hypotheses H1–H5Untested proposalsFuture work
Table 6. QuineBench components, targets, and example measures.
Table 6. QuineBench components, targets, and example measures.
ComponentTargetExample Measure
RReproductionPrompt reconstruction similarity
MMetacognitionCalibration and error detection
HHierarchyQuality of M 2 evaluation
GGap awarenessRecognition of self-knowledge limits
Table 7. Recommended LLM hyperparameter configuration for MES evaluation and mutation calls.
Table 7. Recommended LLM hyperparameter configuration for MES evaluation and mutation calls.
Call TypeTemperatureTop-pPurpose
Fitness evaluation τ [ 0.0 , 0.2 ] 1.0 Reproducible U, D, A, B scores
μ k mutation τ [ 0.7 , 1.0 ] 0.90 0.95 Diverse prompt variants
χ crossover τ [ 0.5 , 0.8 ] 0.90 0.95 Balanced exploration
aware call τ [ 0.0 , 0.2 ] 1.0 Deterministic self-description
fact_check τ 0.0 1.0 Deterministic grounding verdict
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Saghiri, A.M. Adaptive Quine Structures for Metacognitive Evolution in Large Language Models: A Functional Framework with Gödelian Bounds and Illustrative Applications. Mathematics 2026, 14, 2371. https://doi.org/10.3390/math14132371

AMA Style

Saghiri AM. Adaptive Quine Structures for Metacognitive Evolution in Large Language Models: A Functional Framework with Gödelian Bounds and Illustrative Applications. Mathematics. 2026; 14(13):2371. https://doi.org/10.3390/math14132371

Chicago/Turabian Style

Saghiri, Ali Mohammad. 2026. "Adaptive Quine Structures for Metacognitive Evolution in Large Language Models: A Functional Framework with Gödelian Bounds and Illustrative Applications" Mathematics 14, no. 13: 2371. https://doi.org/10.3390/math14132371

APA Style

Saghiri, A. M. (2026). Adaptive Quine Structures for Metacognitive Evolution in Large Language Models: A Functional Framework with Gödelian Bounds and Illustrative Applications. Mathematics, 14(13), 2371. https://doi.org/10.3390/math14132371

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop