When a Language Model Refers to Itself, What Is "Itself"?
This is the second half of a reading-group talk on self-reference and recursive self-improvement (RSI). Part 1 separated three things that all get called a “fixed point”:
- Kleene’s second recursion theorem: a program obtaining its own description (a quine is the simplest case). Constructed once, no iteration.
- The Y combinator: a function able to call itself. Also constructed once.
- The limit of an iteration $x_{t+1} = f(x_t)$: a question about dynamics, with convergence only under extra conditions.
Here I use that vocabulary on large language models.
The paper that got me started
The talk grew out of reading Zhang, Yuan, and Zhang, Self-Reference in Large Language Models: The Introspection Threshold for Recursive Self-Improvement (Entropy, 2026). Its thesis, as I read it: sustainable self-improvement needs a functional analogue of von Neumann’s complexity threshold for self-reproducing automata. The authors call this introspection, the system’s capacity to simulate its own operations and its intended modifications. Kleene’s second recursion theorem shows that introspective programs exist in principle. Current LLMs show partial, “quasi-introspective” behavior and face structural limits on the way to the real thing.
I like this paper. It takes a word that is usually used loosely and ties it to a theorem, which is what makes a claim checkable. It is also the reason I went back and relearned the recursion theorems properly. What follows are three questions I kept asking as I read, and where I ended up on each. They are a reader’s notes, and I may have misread things. I first read the arXiv preprint; the journal version is more careful in several of the places I discuss, and that is the version I am working from.
Question 1: which fixed point is doing the work?
On the existence side, the paper is explicit. The recursion theorem is used once, to obtain the first introspective program $S_0$. Everything after that, $S_0 \to S_1 \to S_2 \to \cdots$, is a trajectory produced by running it, where each $S_{i+1}$ is the output of $S_i$. That is the definitional/dynamical split from part 1, stated cleanly.
Where I would keep the same care is on the limitation side. One limit discussed for Transformers is that a single forward pass cannot execute fixed-point iterations. Iterating to a fixed point is the third kind in my list, the Banach kind. Kleene’s fixed point is the first kind: the s-m-n theorem builds it in one shot, and a quine does not iterate toward its source. So I would treat these as two independent properties of a system:
- Can it iterate a map until it converges?
- Does it support Kleene-style self-reference?
A limit on the first does not, by itself, tell us about the second.
A related point. The paper takes true introspection to require unbounded recursion, with the system modeling its own self-modeling to arbitrary depth. I read that as a chain:
introspection → self-simulation → recursive self-simulation → unbounded recursive self-simulation
Each arrow is a real strengthening. Kleene’s construction gives a program access to its own description without any tower of “simulating how I simulate how I simulate my next action.” Whether improvement needs that tower seems to me an open question, and one worth arguing for directly.
Question 2: how binding is the single-pass bound?
The bound in question is from Merrill and Sabharwal (2023): a log-precision Transformer, in one forward pass, computes only functions in uniform $\mathsf{TC}^0$. This is correct and important. It is also a statement about one forward pass, as the paper itself says, noting that chain-of-thought partially evades it.
How far does the evasion go? The models we call LLMs are autoregressive decoders, so the relevant theory is the one for decoder-only Transformers with intermediate generation. Merrill and Sabharwal (2024) give a ladder indexed by the number of chain-of-thought steps: logarithmically many steps stays within log-space; linearly many adds real power (all regular languages) while staying within context-sensitive languages; polynomially many gives exactly $\mathsf{P}$.
Beyond that there is a line of Turing-completeness results: Pérez et al. (2021), then Schuurmans (2023) and Schuurmans et al. (2024), then Li and Wang (2025), who show that a Transformer with a fixed number of parameters and fixed numerical precision is Turing complete, provided the context window can grow as needed and the autoregressive computation can run long enough. The full picture has more moving parts than this summary (hard versus soft attention, the choice of positional encoding), but for the system as it is actually used, the natural reference point is Turing completeness.
Two caveats, so that I do not overclaim in the other direction.
Execution is not discovery. Turing completeness says the model can carry out a program, including a program that refers to its own description. RSI needs something else: given only a goal (prove this theorem, design this algorithm, find this bug), find the useful program. Turing completeness is silent on that.
What counts as “the program”? Early results build a separate Transformer for each computable function. Qiu et al. (2025) show something more relevant: fix one Transformer, never touch its weights again, and by changing only the prompt you can compute any computable function. In that picture, the prompt is the program code of a Turing-complete model of computation. This matters for the next question.
Question 3: so can an LLM refer to itself?
If Transformers are Turing complete, and Kleene’s second recursion theorem holds in any acceptable programming system, then the answer should be yes.
It is yes. But it may not be the self-reference you had in mind.
Think about what a quine running on my laptop can and cannot print. It can print its own source code. It cannot print the transistor layout of the processor, the CPU microcode, the contents of RAM, the operating system kernel, or the binary of the Python interpreter that is running it. The recursion theorem is about program descriptions relative to a fixed interpreter. The interpreter stays in the background and is never asked to read itself.
Now line this up with an LLM:
| Kleene’s setting | LLM |
|---|---|
| a fixed universal interpreter $\varphi$ | weights plus architecture |
| a program code $e$, given as input | the prompt |
| $\varphi_e$, the behavior of code $e$ | the model’s behavior on that prompt |
This matches the setting of Qiu et al. Under it, I would expect a statement like the following to hold. I state it informally, and I have not verified every detail of the acceptable-numbering condition (the s-m-n property) for the specific constructions:
Suppose a fixed Transformer $T_\theta$, with sufficiently scalable context and computation, implements an acceptable universal programming system over program descriptions encoded as prompts. Then for every computable transformation $g$ on such descriptions there is a prompt $c^\ast$ with $T_\theta(c^\ast) = g(c^\ast)$. Taking $g$ to be the identity gives a prompt quine, $T_\theta(c^\ast) = c^\ast$.
So “Kleene’s theorem implies a Transformer can execute self-referential programs” is fine. “Kleene’s theorem implies a Transformer knows its own parameters” does not follow. The theorem has no necessary connection to $\theta$ at all.
Prompt-level self-access is also close to free. In the classical setting a program is not handed its own code; it obtains it indirectly, through the diagonal construction. In a Transformer, attention makes the entire prompt visible to the computation at every step.
It helps to step back and see the stack. The GPU executes inference code. The inference code reads the weights. The weights act on the prompt. The prompt produces behavior. The weights are a program from the point of view of the inference code, and an interpreter from the point of view of the prompt. “Self” depends on which level you are standing on. (Li and Wang’s main theorem, for instance, is in a one-model-per-task setting, where the weights play the role of the program.)
The paper is after weight-level self-reference: for a bare LLM, the functional identity lives in the weights, so the reflexive structure would have to be realized over the weights. That is a reasonable thing to want. My point is only about which level the theorem lives on. The formal development identifies a program with its source code, and in the Turing-completeness results for a fixed model, the object playing that role is the prompt. Getting from there to the weights needs its own argument.
Without Kleene: can parameters refer to themselves?
Set Kleene aside, then, and ask directly. It helps to distinguish program self-reference from parameter self-description and parameter self-modification.
| Capability | Status |
|---|---|
| Parameter self-description: output your own weights | Yes, with a cost: neural quines |
| Parameter self-modification: change your own weights | Yes, within limits: self-referential weight matrices |
| An ordinary Transformer reading its own $\theta$ during a forward pass | No; $\theta$ is not available to the computation as data |
| Strong closure, $S_{t+1} = \Phi_{S_t}(S_t)$: the rule doing the modifying is itself among the things modified | Open; Kleene does not supply it, and it may need a stronger form of computational reflection |
Neural quines
Chang and Lipson (2018) trained a network to output its own weights. The naive version, $f_\Theta(x) = (\theta_1, \ldots, \theta_N)$, fails by counting: the output layer alone would need more parameters than the network has. Their solution is to query by index. Given a coordinate $c$, the network returns the single weight $\theta_c$, and training minimizes
$$L_{SR}(\Theta) = \sum_c \lVert f_\Theta(c) - \theta_c \rVert^2$$It is supervised learning where the labels are the weights themselves.
Two things they report are worth knowing. Trained on self-replication alone, the network is strongly attracted to the zero quine: all weights zero, which satisfies the equation trivially. And when an auxiliary task (MNIST classification) is added, the self-replication loss rises over training instead of converging, because the network prioritizes the task. The quine-plus-task network reaches 90.41% test accuracy, against 96.33% for an identical network trained on the task alone.
Which kind of fixed point is this? The condition $f_\Theta(c) = \theta_c$ is definitional: it is an equation to be satisfied. But there is no Kleene-style construction that hands you a solution. You have to approach one by iteration, which here means training.
That contrast is the main thing I took away. In Kleene’s setting, self-reference is free. The theorem constructs the program, once, and the program still does whatever $F$ asks of it. In parameter space, self-reference is bought with optimization, it competes with the task for capacity, and the price can be measured.
Self-referential weight matrices
Irie, Schlag, Csordás, and Schmidhuber (2022) go from description to modification. A single weight matrix $W$ is partitioned into four blocks that produce, respectively, the output $y$, a key $k$ (where to write), a query $q$ (what to write), and a learning rate $\beta$ (how strongly):
$$y_t,\, k_t,\, q_t,\, \beta_t = W_{t-1}\,\phi(x_t)$$$$\bar v_t = W_{t-1}\,\phi(k_t), \qquad v_t = W_{t-1}\,\phi(q_t)$$$$W_t = W_{t-1} + \sigma(\beta_t)\,(v_t - \bar v_t) \otimes \phi(k_t)$$Eliminating the intermediate variables gives $W_t = H(W_{t-1};\, x_t)$. The current weights really do take part in producing the next weights, and the new weights are used immediately in the next step. That is one level beyond a deep equilibrium model, where only the activations change.
The rank-1 form is what makes this affordable. Producing a full update $\Delta W \in \mathbb{R}^{m \times n}$ from a hypernetwork would need on the order of $d \cdot mn$ parameters. An outer product avoids that blow-up, and it does so while staying entirely in continuous weights, without serializing anything into discrete symbols.
The limits are just as instructive. The modification is input-conditioned. The form of the update, a rank-1 additive write, is fixed by the designers. The initial matrix $W_0$ is found by gradient descent. And the changes live within an episode,
$$W_0 \xrightarrow{x_1} W_1 \xrightarrow{x_2} W_2 \xrightarrow{x_3} \cdots \xrightarrow{x_t} W_t$$without being carried over permanently to the next one.
What stays outside the loop
The same question can be put to a range of systems that have some flavor of $x = f(x)$ or of self-modification: what changes, and what is left untouched?
| System | What changes | What stays outside |
|---|---|---|
| Deep equilibrium models | the activation state $z$, solved from $z^\ast = f_\theta(z^\ast, x)$ | the weights and the solver |
| DARTS | weights $w$ and architecture parameters $\alpha$, by bilevel optimization | the search space and the evaluation criterion |
| Graph hypernetworks | the weights of a target network | the generator itself and its training objective |
| Self-referential weight matrix | fast weights within an episode | the form of the update rule; $W_0$; persistence across episodes |
| Neural quine | weights, to match their own description | the training objective and the optimizer |
| Darwin Gödel Machine | the agent’s own code | the outer archive and the selection procedure |
The agent case deserves a remark, because it is where current practice is. A coding agent’s loop looks like this:
while True:
code = llm(prompt) # a bounded function call that returns text
result = exec(code) # executed by a genuinely Turing-complete interpreter
prompt = update(prompt, result)
This system is Turing complete for a plain reason: Python is. The LLM has become a bounded subroutine inside a universal machine. Recent work that formalizes agent harnesses as λ-calculi (Liu’s $\lambda_A$; the LLMbda calculus of Garby, Gordon, and Sands) makes the structure explicit, and the self-reference in these calculi is mainly the Y-combinator kind, recursive invocation, rather than the second-recursion-theorem kind.
In every row, whatever is left outside the loop is what the system cannot improve. So the honest version of the RSI equation carries one more argument:
$$S_{t+1} = \Phi(S_t;\, A)(S_t)$$where $A$ is everything fixed from outside. $A$ is never empty. Hardware, physics, and the Python interpreter are always in it. The useful question is what else is.
What this adds up to
Three clarifications, in the vocabulary of part 1:
- Criterion. Whether a system can self-refer is settled by universality, through Kleene’s theorem. Whether an iteration converges is a separate matter.
- Scope. The $\mathsf{TC}^0$ bound covers a single forward pass. Autoregressive use is a different regime.
- Object. What Kleene delivers for a fixed model is self-reference to its instructions, the prompt. Self-reference to weights is a different thing. Where it has been built, it was paid for.
And one thing this does not do. The paper’s conclusion, that current systems fall short of sustainable recursive self-improvement, is untouched by any of the above. I have not refuted it, and I have not proved it. It may well be right. My guess is that the road to it runs through the dynamical question more than through self-reference.
So I end where part 1 began, with $S_{t+1} = \Phi(S_t)(S_t)$ and two questions to put to any proposed system:
- Where does $\Phi$ come from, and how much of it is really inside $S$?
- What does the iteration do when it runs: stabilize, diverge, oscillate, or stop somewhere?
Self-reference itself is not the hard part, with two qualifications. It matters which kind you have, because the three kinds come with different prices: Kleene’s and Y’s are free, constructed directly by a theorem, and the parameter kind is bought by iteration at a measurable cost. And having it is not the end of the story, because something always remains outside.
My thanks to the authors for a paper worth arguing with, and to the reading group for the questions.
References
- Zhang, J., Yuan, B., & Zhang, Q. (2026). Self-reference in large language models: The introspection threshold for recursive self-improvement. Entropy, 28(9), 951.
- Merrill, W., & Sabharwal, A. (2023). The parallelism tradeoff: Limitations of log-precision transformers. TACL, 11, 531–545.
- Merrill, W., & Sabharwal, A. (2024). The expressive power of transformers with chain of thought. ICLR.
- Pérez, J., Barceló, P., & Marinkovic, J. (2021). Attention is Turing-complete. JMLR, 22(75), 1–35.
- Schuurmans, D. (2023). Memory augmented large language models are computationally universal. arXiv:2301.04589.
- Schuurmans, D., Dai, H., & Zanini, F. (2024). Autoregressive large language models are computationally universal. arXiv:2410.03170.
- Li, Q., & Wang, Y. (2025). Constant bit-size transformers are Turing complete. NeurIPS.
- Qiu, R., Xu, Z., Bao, W., & Tong, H. (2025). Ask, and it shall be given: On the Turing completeness of prompting. ICLR.
- Chang, O., & Lipson, H. (2018). Neural network quine. Artificial Life Conference Proceedings, 234–241.
- Irie, K., Schlag, I., Csordás, R., & Schmidhuber, J. (2022). A modern self-referential weight matrix that learns to modify itself. ICML.
- Zhang, J., Hu, S., Lu, C., Lange, R., & Clune, J. (2026). Darwin Gödel Machine: Open-ended evolution of self-improving agents. ICLR.
- Liu, Q. (2026). $\lambda_A$: A typed lambda calculus for LLM agent composition. arXiv:2604.11767.
- Garby, Z., Gordon, A. D., & Sands, D. (2026). The LLMbda calculus: AI agents, conversations, and information flow. arXiv:2602.20064.