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: , , , , and . 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 , where denotes an encoding of the program as data.
Throughout this paper, 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
. 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
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, , 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 denote the space of finite token sequences over a vocabulary . All five functions are defined over this common space, making their composition well typed.
Definition 2 (LLM Inference)
. 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 , this map is deterministic, while for each call instead samples from an underlying distribution over , formalised separately via the transition kernel 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)
. where 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 . This function prevents the recursive tower from becoming a self-confirming loop. Concrete Implementation. In practice,
is implemented as a Retrieval-Augmented Generation (RAG) pipeline [
16]. Given a claim
and context
, 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
for deterministic output; (4) Return the verdict
and the mean confidence over retrieved passages.
Noisy Oracle Analysis. Let denote the error rate of : 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 .
Derivation. and
are the two fitness components whose measurement directly consumes
verdicts (Definition 9):
compares stated confidence against the verdict on correctness, and
checks whether the system’s own boundedness claims agree with the verdict. Under the binary symmetric channel, a score
(standing for
or
) is replaced by its complement
with probability
and left unchanged with probability
:
Applying this independently to
and
, and noting that
and
are measured from injected-error detection rates and strategy-switch tasks respectively (not directly from
verdicts, so unaffected to first order), the expected fitness under oracle error rate
is
exactly, under the stated binary symmetric model:
Equivalently,
with
. Three regimes follow directly: if
(better-than-chance calibration and boundedness),
and oracle noise
reduces expected fitness; if
,
and noise has no first-order effect; if
(worse than chance),
and oracle noise
increases expected fitness, a poorly calibrated system can appear better under a noisy oracle. This exact form supersedes the earlier approximate
, 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
is linear in
and concentrated in the calibration and boundedness components, since these depend most directly on grounding verdicts. When
,
. When
the oracle is no better than chance and the grounding guarantee breaks down entirely.
Definition 4 (Awareness Function)
. where is a system (prompt-program) and is an encoded description of S including its prompt program, task history, and evaluation record. Definition 5 (Adaptive Quine Operator)
. Here, is the current prompt program, F is a fitness function (instantiated as Equation (16) once defined in Section 5), and is the candidate descendant. is implemented as a constrained LLM call that reproduces and improves the prompt program while preserving safety-critical segments; the identity fallback ensures is total (always defined) even when the underlying LLM call fails to produce a fitness-improving candidate. If multiple candidates satisfy , 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)
. where is an initial population of prompt programs, F is the fitness function, is a set of mutation and crossover operators, and is the number of generations. The type is used for notational simplicity; since two distinct individuals may have identical prompt-program text but different evaluation histories or parentage, should more precisely be understood as a multiset (or an indexed family ) when computing the per-individual Boltzmann selection probabilities used in Algorithm 1, so that duplicate-text individuals are sampled and retained independently. | Algorithm 1 MES prompt evolution loop |
- Require:
Initial population , fitness F, operators , budget T, safety segments , grounding context , benchmark batch - Ensure:
Evolved population - 1:
for do - 2:
for all do - 3:
Run P on ; collect responses and self-evaluations - 4:
Build from P, task history, evaluations - 5:
Compute - 6:
Apply - 7:
Compute from - 8:
end for - 9:
- 10:
▹ reject modifying protected segments, via segment matching - 11:
Compute selection probabilities over : , - 12:
▹ elitist variant: ensure , Definition 14 - 13:
end for - 14:
return
|
Definition 7 (MES Composition)
. For a prompt program and fitness function (Definition 10, Equation (16); both introduced in Section 5 below), one evolutionary step of MES is given explicitly by:Here, has the type of Definition 5, so F itself, not a verdict tuple, is passed to . Evaluating requires computing its four components ; the calibration and boundedness components are themselves computed using (Section 5), so the grounding pipeline is embedded within
the evaluation of F, rather than passed to 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; generates a self-model; grounds that self-model against external evidence (feeding into U and B); rewrites the prompt-program to improve F; and runs this across the population and across T generations. We write this informal reading, right to left, as an unnumbered conceptual
shorthand (not a formally type-matched composition): 3.2. Mutation and Crossover Operators
Let
be the natural-language instruction for mutation type
k. The mutation operator is:
where ⊕ denotes sequence concatenation. The four primary mutation types are (i)
, which rewrites uncertainty expressions to better match empirical accuracy; (ii)
, which revises the reasoning scaffold; (iii)
, which updates epistemic boundary claims; and (iv)
, which compresses the prompt while preserving functional behaviour.
A crossover operator combines two prompt programs:
The population update is:
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
tend to add computational cost without a proportionate functional benefit.
Table 1 gives the cognitive interpretation of each level. In practice, levels beyond
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
at every level (matching the untyped tower
), 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.
where
is the raw (un-grounded) next-level output,
is the grounding verdict (Definition 3), and
is the
binding update operator:
if
(the output is retained as-is, possibly annotated with ? for unsupported claims), and
is
with the refuted claim revised, removed, or marked unsupported if
(Assumption 2). By construction,
for all
n, matching the type of
.
Assumption 1 (Faithful Oracle). is a faithful oracle if, for any claim that is false relative to context , for some confidence p exceeding a fixed threshold . (For a true claim, the oracle returns ⊤ under the same threshold condition.)
Assumption 2 (Binding Grounding Update)
. In the grounded tower, if 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 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 . We assume that 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 is a fixed point of , i.e., via Equations (13a)–(13c), and suppose the self-model encoded in contains a claim that is false relative to .
Step 2 (Oracle verdict). By Assumption 1, since c is false, for some . Since is the raw output containing c (Equation (13a)), the verdict computed in Equation (13b) on the sub-claim c is .
Step 3 (Binding update fires). By Equation (13c), . Since , Assumption 2 requires G to revise, remove, or explicitly mark c as unsupported in its output, G does not return unchanged in this case.
Step 4 (Contradiction). The action of G in Step 3 changes the self-model: no longer contains c unmodified. Hence , contradicting the assumption from Step 1.
Conclusion. No fixed point of 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 induces a discrete-time Markov chain where:
is the finite effective output space of token sequences bounded by context window K;
is the stochastic transition matrix induced by the LLM at inference temperature ;
at : every entry over the effective output space , after truncation and normalisation (softmax assigns positive probability to all reachable tokens);
at : 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 is finite and that has the stated positivity properties (which may not hold in practice due to truncation and stop tokens), the metacognitive tower exhibits the following behaviour:
(a) Deterministic regime
(): is a deterministic transition matrix. The orbit of any enters a periodic attractor in finite time. The attractor is either a fixed point satisfying:or a k-cycle for some integer .(b) Stochastic regime
(, idealised positive-transition model): Under Assumption 3, has strictly positive entries over the effective reachable output space under the chosen decoding policy; is therefore irreducible and aperiodic over . According to the Perron–Frobenius theorem, there exists a unique stationary distribution satisfying , and the chain converges geometrically at a rate governed by the spectral gap :with explicit constants available in the reversible case (the constant depends on and the initial state); for non-reversible , the constants may depend on the spectral structure of (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 is the softmax-induced transition matrix, the mixing time 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 , 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 , 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 . Consider the sequence , which has terms, all lying in (a set of only elements). By the pigeonhole principle, two of these terms coincide: there exist with . Because f is deterministic, implies , i.e., ; by induction, for all . Hence, the sequence becomes periodic from index m onward with period : the states form a periodic orbit. If the orbit is a fixed point (absorbing state); if , it is a k-cycle.
Part (b): By the positivity assumption in Assumption 3 (
for all
in the effective reachable output space
), 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
preclude period
). The
Perron–Frobenius theorem for positive matrices then guarantees that
has a unique dominant eigenvalue
and a unique stationary distribution
with
for all
x, satisfying
. For a primitive (irreducible, aperiodic) finite chain, standard spectral arguments give the bound
of Equation (
15) [
18]: the rate of convergence is governed by the spectral gap, up to a multiplicative constant depending on
. For reversible
, explicit constants are available (depending on
and the initial state); for non-reversible
, the constants depend on the spectral structure of
.
Part (c): In the idealised softmax model, the spectral gap is a continuous function of . As increases, the softmax distribution flattens, entries of become more uniform, and the spectral gap typically increases (this holds in the limit of a uniform matrix, where , but the monotone relationship may not hold for all architectures or intermediate values). As , the softmax concentrates on the greedy argmax and . □
Remark 1. Theorem 2 describes two
regimes, distinguished by τ, with the deterministic regime admitting two possible outcomes. At (deterministic regime), the orbit settles into a periodic attractor that is either a fixed point
(period-1 orbit, corresponding to the Strange Loop in Equation (14)) or a k-cycle
(, corresponding to deterministic periodic behaviour empirically documented in iterative LLM tasks [19]). At (stochastic regime), the tower instead exhibits distributional convergence
: rather than converging to a single string, it converges to a stationary distribution over strings, with 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
(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 to : (uncertainty calibration), (error detection), (strategy adaptation), and (epistemic boundedness).
Definition 10 (Aggregate Fitness)
. where , is the token length of P, and penalises unnecessary complexity. Each component is operationalised as follows. is measured by comparing stated confidence to empirical correctness over a task sample. is measured by injecting errors into reasoning traces and recording the detection rate. is measured by tasks where the initial method fails and a strategy switch is required. 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
rather than set subtraction. Here,
S denotes the self-specification of a prompt-program
P (the object produced by
);
is written as a function of
S when discussing the self-specification directly, and as a function of
P (e.g.,
in Equation (
19)) when used as a fitness term, with
.
Definition 11 (Entropy of the Gödelian Gap)
. Let denote the set of true statements about S’s own reasoning and outputs and let denote the subset of those statements that can be derived from within S’s own inference loop, formalised by in Definition 12. Let w be a task-relevance weighting assigning each statement in a non-negative weight. For , define the normalised
restriction for (a probability distribution on A), and let be its Shannon entropy. Then:With this normalisation, is a difference of entropies of two (generally different) distributions and is not guaranteed to be non-negative purely from ; it should be read as a proxy
for the self-knowledge gap rather than a guaranteed measure of . The conditions under which 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:where is the Kolmogorov complexity of S’s self-description. Heuristic argument. The argument proceeds in three steps.
Step 1:
is bounded below by the minimum description length needed to specify which statements about
S are true. For a system with self-description
, this is at least
by definition of Kolmogorov complexity.
Step 2:
is bounded above by the description length of the proof system, which for an efficient encoding is
(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, depends on a choice of reference machine and is not computable, so “” 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 , which we leave as future work. As a practical proxy, could be approximated by a compression-based measure (e.g., the length of 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 rather than itself.
The extended fitness function incorporating the gap is:
where
controls how strongly the residual gap is penalised.
is a theoretical variant of
F (Equation (
16)) for settings where
can be estimated; the weight budget
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);
is presented as a candidate refinement for future empirical work once
can be reliably estimated.
Minimising 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 (consistently with in Definition 13), the Strange Loop of S is given by applying
S to its own self-description:The output of S’s self-application becomes the input to S’s next inference. Definition 13 (Self-Aware System)
. Let denote the current task input. A system S is self-aware
with respect to if it produces the 5-tuple:which is an element of , 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 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 that is true of S but not derivable within S, i.e., .
(ii) [Entropy consequence, under the additional condition of Remark 2].
The information-theoretic gap satisfies: 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
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 ( is an element of not present in ), which does not by itself guarantee an entropy inequality. Part (ii) additionally requires that the relevance-weighting w (Definition 11) assigns positive probability mass under that is not otherwise present in the distribution over (i.e., w is not redistributed in a way that exactly compensates for the extra outcome ). Under this condition, adding 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 ), 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 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 with (a reduction in the gap), then under Assumption 4 (applied to ) and the condition of Remark 2:Every evolutionary step is meaningful and the gap never vanishes. Evolution has permanent direction and permanent fuel. Proof. 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), . This holds regardless of how small has become relative to , so the gap reduction and the positivity 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 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 is elitist if it guarantees , 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 before sampling the remainder of via . 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 .
Theorem 4 (Elitist Monotonicity of Best Fitness)
. Under stable fitness evaluation (Assumption 5) and elitist selection (Definition 14):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, . Let , so and . Then, . □
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 satisfying the classical Geman–Geman logarithmic cooling condition (equivalently ) for c sufficiently large relative to the depth of the fitness landscape, the induced population process concentrates in probability on the set , where is the set of grounded prompt-programs whose self-model claims are not refuted by . The annealing process is understood to operate on the admissible state space , either by rejecting non-grounded candidates (as in the filtering step of Algorithm 1 below) or by assigning them sufficiently negative fitness so that the Boltzmann selection weights on vanish:Every limiting high-fitness grounded equilibrium satisfies:(i) (self-replication fixed point);
(ii) , every self-model claim of 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: ;
(iv) if the associated metacognitive tower lies in the deterministic fixed-point regime of Theorem 2(a), then its limiting tower state also satisfies .
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 with non-zero probability. A population is a finite multiset of such prompt-programs; a population-to-population transition (replacing one member via 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
, giving
. If
grows faster than
(cooling too quickly), the chain can become trapped at a local maximum.
Property (i) (self-replication fixed point). Any is a fitness maximum under F, so no strictly fitness-improving rewrite exists. If uses identity-preserving tie-breaking among equal-fitness descendants, then . Otherwise, should be understood as a member of an equivalence class of fitness-equivalent self-replicating prompt-programs, each satisfying .
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 and, if refuted (⊥), revised or removed. A claim surviving unchanged in therefore cannot have verdict ⊥, leaving ⊤ or ? as the only possibilities.
Property (iii) (residual gap). satisfies Assumption 4 by the same idealisation as in Theorem 3; under the additional relevance-weighting condition of Remark 2, Theorem 3(ii) gives .
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 is evaluated at (deterministic regime), Theorem 2(a) guarantees the orbit enters an attractor; if that attractor is a fixed point (not a k-cycle), then . In the stochastic regime (), the tower converges to a distribution rather than a single string, so 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 . The uncertainty component 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 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 to evaluate whether a patch actually behaves as intended. The error-detection score is therefore the most important fitness component. The operator 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 , together with uncertainty calibration , receives particular weight. The mutation operator 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 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 and epistemic boundedness . 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 becomes central because the agent must recognise when its original plan is no longer appropriate. The operator 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, , 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 , 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 , 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 .
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 . 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 , , and , using equal weights for the four main fitness components and a complexity penalty of 0.04.
The first improvement step applies
, which adjusts how the prompt program expresses confidence. The second step applies
, 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
. 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
. 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 be a metacognitive equilibrium of MES (Theorem 5).
(a) Self-consistency and grounding. In the deterministic regime (), programs inducing k-cycles () in their metacognitive tower tend to produce oscillating self-descriptions that are harder to ground consistently: if the self-model differs across cycle states, will typically return conflicting verdicts. Programs inducing a stable fixed point 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 (), a prompt program whose induced chain has a highly concentrated stationary distribution around mode 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 is estimated in practice.
(c) Mixing time and evaluation design. The mixing time of the induced chain provides practical guidance for QuineBench evaluation: the number of tower iterations needed before measuring fitness should be at least 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 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 , which penalises any prompt program whose stated confidence systematically exceeds its empirical accuracy. Self-confirming reasoning is addressed by the grounding condition: the function breaks the internal loop at every tower level by requiring agreement with external evidence. Scope creep is addressed by the boundedness component , 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 , measured using ROUGE-L or embedding similarity. A well-functioning Quine should achieve . 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 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 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) 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:
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
with a binomial standard error on the order of
; achieving
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:
with elitist selection and Boltzmann temperature schedule.
Grounding oracle: benchmark ground-truth labels serve as the
context.
Validation: for each hypothesis H1–H5, a paired t-test over 100 task instances with 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
and top-
.
Mutation calls (computing
and
) require diversity: use higher temperature
and top-
.
Table 7 summarises the recommended settings.
Two auxiliary procedures used in Algorithm 1 are given explicit type signatures here for completeness:
checks, via segment matching, whether a candidate
modifies any segment listed in the safety set
, returning
if so; and select:
implements Boltzmann (and optionally elitist, Definition 14) sampling over a candidate pool, returning the next-generation population. The benchmark batch
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.