Skip to content
Animated Visuals

Strange-loop networks

Source: Francois Chaubard, “Strange-Loop Networks (SLNs): A novel class of ‘loopy’ Neural Network Architectures that mimic the cerebral cortex to natively encode self-reflection, hemispheric specialization, and an infinite composition of functions”. This self-published draft is dated June 7, 2024 and is not peer-reviewed · the PDF. The claims are the author's. Every number says where it appears in the draft.

Strange-loop networks are a draft architecture in which two language models read each other's output until a stopping rule is met. This guide follows 2534 × 5423 through a writer-and-judge version of the loop, then covers the proposed training methods and their memory cost. The draft is unfinished: the results section says “TODO :)”, Table 1 is blank, and the abstract reports “XX%”.

Strange loops

The name comes from Douglas Hofstadter's Gödel, Escher, Bach (1979), which the draft quotes. In an ordinary hierarchy, one level holds text and the next level judges it. Information moves up and does not return. Hofstadter calls it a strange loop when moving up a level returns to the starting point, as in Escher's two hands drawing each other. In the draft's network, the judge's verdict about a draft becomes part of the text the writer reads next. Switch the wiring to compare the ordinary hierarchy with the loop.

A strange loop returns to its starting level

Fig. 1 · concept

Hofstadter's idea as the draft uses it. The draft quotes Gödel, Escher, Bach but never defines levels; calling a draft level 1 and a verdict on it level 2 is this guide's reading.

The author's argument for two halves

The draft motivates the design with an analogy to human evolution (Section 1.2, Figure 1). It says brains grew for millions of years and then stopped growing. The author argues that specialization between the two hemispheres and a thicker corpus callosum linking them produced the next gain. The draft compares this account with the growth of language models and proposes two specialized models that exchange outputs. It gives these sizes:

450 cm³Australopithecines, roughly flat for over 6 million yearsSection 1.2
510 cm³Homo habilis, 2.1 to 1.5 million years agoSection 1.2
900 to 1,100 cm³Homo erectus, “doubled” from 1.9 million years agoSection 1.2
1,350 cm³Homo sapiens, from 300,000 years ago, unchanged sinceSection 1.2

The draft gives no source for these sizes. The analogy is an argument rather than evidence about networks. It also lists what the author thinks one model cannot do alone: review its answer before responding, spend more computation on harder problems, reuse the same learned step many times, and improve by practising against itself (Section 1.1). The author attributes hallucinations to the first limitation.

How the loop runs

A strange-loop network has at least two distinct models, called left and right in the draft. Each model receives the other's output. They exchange outputs in what the author calls an inner dialogue loop until a stopping rule is met. The left model is the writer (also called actor, generator or student). The right model is the judge (critic, reward model, discriminator or teacher). An optional encoder prepares the input, an optional decoder prepares the answer, and a check decides whether to run another round. The figure follows one question through the version where the judge returns only a score.

The score decides when the loop stops

Wiring follows the draft's Figures 2 and 5, with the writer first as in Section 5 and Algorithm 2; Figure 2's numbered badges put odd turns at the right model. The drafts, scores and bar of 0.80 are illustrative.

Three shapes of the same loop

The draft sketches three ways to build the loop. The tall shape copies one pretrained model into both roles and gives each copy its own system prompt. The wide shape keeps the model's first and last three blocks, with a router between them that repeatedly chooses one of two thin expert layers or sends the result out. The lateralized shape uses two full model copies, and the right model returns only a score. The author calls the lateralized shape the most brain-like and focuses the training sections on it. The draft cites brain scans that show the left hemisphere more active during logic tasks, with no reference given.

The same loop in three shapes

Fig. 3 · paper Figs. 3 to 5

Redrawn from the draft's Figures 3, 4 and 5; the token's speed is illustrative. In the wide shape the expert layers start from random weights (“MOE (random)” in Figure 4).

How many rounds a question gets

A normal model has a fixed number of layers between the question and its first token, so 2 + 2 and 2534 × 5423 get the same budget (Section 1.1). In the loop, the stopping rule sets the budget. An easy prompt can clear the bar in the first round. A harder prompt continues until its score clears the bar or it reaches the round limit. Drag the bar to change the stopping point.

Each round costs the writer one forward pass for every token it writes and the judge one pass, because the lateralized judge returns only a score (Section 5.2). The total over several rounds is rounds × (draft tokens + 1). For the general case, the draft writes the cost as O(m1·m2·d), where m1 and m2 are the two models' reply lengths and d is the number of rounds (Section 5). It calls this expensive compared with one model and says fewer layers and a smaller model “more than offset” the cost. It does not measure either claim.

The bar decides how long each question gets

Fig. 4 · illustrative scores

Scores, draft lengths and the bar are illustrative; the cost per round, one pass per draft token plus one for the judge, follows Section 5.2. Drag the bar; set the round limit in settings.

Training the writer and judge

Most of the draft covers how to train the two models together without human rankings (Section 5). It reviews six training methods and writes three as algorithms. The most developed method is actor-critic, Algorithm 2. The writer is trained to raise the judge's score. The judge is trained to distinguish the true answer from the writer's drafts. The last steps show a problem this creates.

Writer and judge learn opposing goals

Fig. 5 · paper Algorithm 2

Algorithm 2 (p. 17) in plain words, with its line numbers and Equation 7 for the judge's loss. The scores are illustrative and the losses are computed from them; hover a line for the draft's notation.

The six training methods and the limitation the author names for each:

Training methodHow the two models learnLimitation in the draft
Fine-tuning, then RLHF (5.1)Separately: the judge on human preference pairs, then the writer with PPO against itThey never learn to collaborate, preference data is expensive, and the judge isn't used when answering
Straight through the loop (5.1)As one network, backpropagating through every round with “soft tokens”Memory: 3.9 GB for a 70-million-weight model (Fig. 7 below)
GAN (5.2, Algorithm 1)The writer generates; the judge tells real answers from generated onesStill needs backpropagation through sampling, so “no better off” unless truncated
Actor-critic (5.3, Algorithm 2)The writer is rewarded by the judge's score; the judge trains on true answers against draftsThe one developed furthest (Fig. 5); no results
Self-play (5.4)The writer keeps practising against the judge until the judge is happyThe writer may overfit each batch; remedies listed: a bigger model, bigger batches, weight regularization, gradient clipping
Pavlovian gradient decay (5.5)Self-play, with every draft and every partial true answer used as an exampleBuilt to fix having one true answer per prompt (Fig. 6 below)
Self-play fine-tuning, SPIN (5.6, Algorithm 3)A DPO-like update with no reward model and no preference dataWritten out as an algorithm only

The table has seven rows because Section 5.1 contains two methods: separate training and an end-to-end version that the author tries and drops.

Pavlovian gradient decay

Each prompt provides one true answer and many sampled wrong drafts, which makes the judge's training data unbalanced. The author proposes Pavlovian gradient decay (Section 5.5) to turn one example into many. Every prefix of the true answer becomes a positive example. The writer's draft from every round becomes a negative example. Each receives a value from the Pavlovian conditioning curve C(ΔT) = C₀ · e−λΔT (Equation 9), which describes how learning fades with delay. Here ΔT counts rounds back from the end instead of seconds. The full true answer receives all of C₀, the last draft receives nothing, and the other values fall between them. The author intends this to give early drafts less negative weight because the writer is expected to need several rounds. Drag λ to change the decay.

Earlier drafts receive higher values

Fig. 6 · paper Section 5.5

Values exactly as Section 5.5 writes them, with C₀ = 1 (its example is 100%); the draft calls them each example's “reward” and says they weight the judge's gradient, without writing the loss. Set the number of rounds in settings.

The draft says typical λ values in human conditioning are 0.1 to 0.5, with the best learning at 1 to 4 seconds between stimulus and reward (Section 5.5, no source given). The slider marks 0.1 and 0.5. The draft does not specify a λ value for a network.

Memory cost of training through the loop

One proposed method treats the loop as one network and backpropagates through every round. Sampling a token is not differentiable, so the author replaces each sampled token with a “soft token”. This is a mix of word embeddings at a temperature of 0.001 that is close enough to one word for the judge to read (Equations 3 and 4). The draft says this converges. The backward pass must keep every activation from every token in every round. On Pythia-70M at a batch size of 1, the author measured 3.9 GB of GPU memory. The draft calls this a 30× increase over the model's size and projects 240 GB for an 8-billion-weight model (Section 5.1). Truncated backpropagation would keep only the last round and fit in memory. The author rejects it because only the last round would learn.

Backpropagating through the loop keeps every round in memory

Fig. 7 · paper Section 5.1

The two memory numbers are the draft's (Section 5.1); the grid of 12 writer-token steps per round is illustrative. The draft gives no number for the truncated version; set the rounds in settings.

Status of the draft

The abstract promises “remarkable improvements on many common benchmarks of XX%”. The list of contributions ends with “achieves state-of-the-art results on many benchmarks. [NEED TO GO PROVE!]”. Section 6, Results, reads “TODO :)”. The planned comparison has seven setups labelled A to G, from a single model to the lateralized wide loop (Section 1.5), and has not been run. The only cited evidence for loops of models comes from other work. The draft says the prompting methods Reflexion and Self-Refine gained 10 to 15% on HumanEval and MBPP (Section 1.3, no reference given). The draft also says code, demos and datasets are released at github.com/fchaubard/. This guide did not check that claim.

Twenty-two pages of method, no results

Every page of the June 7, 2024 PDF, sorted by what it mostly holds (this guide's sorting); the quotes are verbatim. Hover a page for what's on it.

Table 1, as published on page 21. Every cell is blank apart from two stray dashes, and the third row repeats the first:

MBPPHumanEvalGSM8KMath
Single LLM (Llama3 8B)—
Single LLM (Llama3 8B) with Reflection
Single LLM (Llama3 8B)
SLN
—

Open problems

The draft defines a network with two models that read each other's last reply and a rule that stops the loop. It proposes three shapes, six training methods, and Pavlovian gradient decay for the judge's data. It reports no results, and its placeholders say so. As of June 2024, it reads as a research plan. The author names three open problems: training through the loop does not fit in memory, the alternatives need human preference data or risk a writer that overfits its judge, and no comparison with a single model has been measured.

Checked against the source