Reorganise: dataset card for all parts, Parts 1-2 code under parts1-2_code/
Browse files- README.md +53 -84
- analyze.py → parts1-2_code/analyze.py +0 -0
- export_ladder.py → parts1-2_code/export_ladder.py +0 -0
- export_report.py → parts1-2_code/export_report.py +0 -0
- fidelity_check.py → parts1-2_code/fidelity_check.py +0 -0
- ladder_summary.py → parts1-2_code/ladder_summary.py +0 -0
- pilot_check.py → parts1-2_code/pilot_check.py +0 -0
- pooled.py → parts1-2_code/pooled.py +0 -0
- run_ladder.py → parts1-2_code/run_ladder.py +0 -0
- strange_loop.py → parts1-2_code/strange_loop.py +0 -0
- validate_lens.py → parts1-2_code/validate_lens.py +0 -0
README.md
CHANGED
|
@@ -1,97 +1,66 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
| 3 |
tags:
|
| 4 |
- interpretability
|
| 5 |
-
- j-space
|
| 6 |
-
- global-workspace
|
| 7 |
- self-model
|
| 8 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
- qwen3
|
| 10 |
size_categories:
|
| 11 |
-
-
|
| 12 |
---
|
| 13 |
|
| 14 |
-
# Strange
|
| 15 |
-
|
| 16 |
-
All data from an experiment in which a language model wanders with no memory of its own words, only a latent J-space
|
| 17 |
-
state. Every ten thoughts it reads its last ten states and forms a self-model, which is then fed back into everything it
|
| 18 |
-
thinks next.
|
| 19 |
-
|
| 20 |
-
- **Interactive report:** https://huggingface.co/spaces/Pixedar/strange-loop-in-j-space
|
| 21 |
-
- **Code:** `strange_loop.py`, `analyze.py`, `export_report.py` in this repository (also on GitHub, Pixedar)
|
| 22 |
-
|
| 23 |
-
Qwen3-4B-Base · J-lens at layer 16 · 3 runs · 180 minds · 72,000 thoughts.
|
| 24 |
-
|
| 25 |
-
## Short result
|
| 26 |
-
|
| 27 |
-
The causal loop is real. A model of the trajectory, rebuilt from the trajectory, shapes the trajectory, sustains itself,
|
| 28 |
-
and holds long-range coherence that vanishes when it is cut. A held foreign self-model persists after release. But the
|
| 29 |
-
loop does not single out its own self-model: another mind's self-model fed back works almost exactly as well, and the
|
| 30 |
-
self-model predicts the future only by causing it. See the report for every number.
|
| 31 |
|
| 32 |
-
|
|
|
|
|
|
|
| 33 |
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
|
| 41 |
-
|
| 42 |
-
their sampling noise, so a treated mind and its twin are identical until they are treated differently.
|
| 43 |
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
- `traj.npz` (raw arrays, float16 unless noted). N = thoughts, B = minds, R = reflections, d = 2560, k = 16:
|
| 47 |
-
- `j` (N, B, d): J-space content of each thought, measured against the typical workspace (`jbar`)
|
| 48 |
-
- `j_idx` (N, B, k) int32 and `j_coef` (N, B, k): its word atoms (indices into `meta.json` → `words`) and weights
|
| 49 |
-
- `m` (R, B, d), `m_idx`, `m_coef`: the self-model at each reflection, against the empty-trace answer (`mbar`)
|
| 50 |
-
- `inj` (R, B, d): the vector fed back after each reflection. `inj_src` (R, B) int32 is its source: the row whose
|
| 51 |
-
self-model it is, −1 for none, −2 for the plain average
|
| 52 |
-
- `mf` (R, B, d), run C only: the self-model under the forward question ("my mind will probably turn to"). `generic`
|
| 53 |
-
(R, d): the observers' mean self-model
|
| 54 |
-
- `fid_<layer>_<gain>`: self-models from the same reflection injected at other layers (fidelity check)
|
| 55 |
-
- `mu`, `jbar`, `mbar`: calibration means
|
| 56 |
-
- The recurrent state is not stored. It is `z_t = 0.6 z_{t−1} + 0.4 j_t` with `z_0 = 0`
|
| 57 |
-
- `meta.json`: `rows` (condition and seed of each mind), `args` (every setting), `texts[t][b]` (each thought, 40
|
| 58 |
-
tokens), `desc[r][b]` (the spoken answer to the reflection question), `fdesc` (answer to the forward question, run C),
|
| 59 |
-
`words` (the J-space dictionary), `thought_frame`, `reflect_prompt`, `forward_prompt`, calibration norms
|
| 60 |
-
- `results.json`: everything `analyze.py` computes (autocorrelation, self-model stability, prediction, perturbation,
|
| 61 |
-
ablation, clamp, themes, 3-D projection of every path)
|
| 62 |
-
- `summary.txt`: the console summary of `analyze.py`
|
| 63 |
-
|
| 64 |
-
Also included:
|
| 65 |
-
- `qwen3-4b-base-jlens.npz`: the J-lens (average Jacobian from layer 16 to the final layer, 120 prompts) that every
|
| 66 |
-
run used
|
| 67 |
-
- `runs/*.log`: the run logs
|
| 68 |
-
|
| 69 |
-
## Part 2 (`part2/`): proper J-space, Qwen3 1.7B to 32B
|
| 70 |
-
|
| 71 |
-
Part 2 rebuilds the J-space from the paper and Anthropic's reference code (Neuronpedia's lenses for the post-trained
|
| 72 |
-
`Qwen/Qwen3-{1.7B,4B,8B,14B,32B}`, fitted on 460–615 wikitext prompts), checks every lens layer by layer, and runs the
|
| 73 |
-
experiment at every size. Same file formats as above (`traj.npz`, `meta.json`, `results.json`, `summary.txt`).
|
| 74 |
-
|
| 75 |
-
| Directory | What |
|
| 76 |
|---|---|
|
| 77 |
-
| `
|
| 78 |
-
| `
|
| 79 |
-
| `
|
| 80 |
-
| `
|
| 81 |
-
| `
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: cc-by-4.0
|
| 3 |
+
pretty_name: Strange loop in J-space
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
tags:
|
| 7 |
- interpretability
|
|
|
|
|
|
|
| 8 |
- self-model
|
| 9 |
+
- strange-loop
|
| 10 |
+
- global-workspace
|
| 11 |
+
- j-space
|
| 12 |
+
- language-models
|
| 13 |
+
- representation-geometry
|
| 14 |
- qwen3
|
| 15 |
size_categories:
|
| 16 |
+
- 1K<n<10K
|
| 17 |
---
|
| 18 |
|
| 19 |
+
# Strange loop in J-space — data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
+
Data for **"What a language model builds when a description of itself is looped back into itself"**
|
| 22 |
+
(Wiktor Tomasik, 2026). Code, report and figures: **[github.com/Pixedar/jspace-strange-loop](https://github.com/Pixedar/jspace-strange-loop)**.
|
| 23 |
+
This work extends earlier writing on self-models and latent loops: [medium.com/@pixedar](https://medium.com/@pixedar).
|
| 24 |
|
| 25 |
+
Four loops feed a compact description of a Qwen3 model's own internal state back into the model. Main results:
|
| 26 |
+
loops through a self-description keep what they can regenerate rather than what is their own; a learning self-model's
|
| 27 |
+
surprise is a learned exit from attractors; self-specificity needs private state; a trained self-describing loop
|
| 28 |
+
around the model's own thinking, under discriminative pressure to be predictable to its own self-model, represents its
|
| 29 |
+
own time as a multi-frequency rotation following the arc of reasoning (or a persistent identity when it must tell
|
| 30 |
+
itself from others); and a fed-back self-forecast is enacted — the system makes its prediction of itself come true.
|
| 31 |
|
| 32 |
+
## Contents
|
|
|
|
| 33 |
|
| 34 |
+
| path | what |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|---|---|
|
| 36 |
+
| `parts1-2_code/`, `runs/`, `part2/`, `qwen3-4b-base-jlens.npz` | Parts 1–2: the reflective loop through J-space words (Qwen3-4B-Base; ladder 1.7B–32B): per-run `results.json`, `meta.json` (every thought and answer), summaries, and the fitted lens |
|
| 37 |
+
| `v5/geom/`, `v5/spec/` | geometry of the frozen decision-position J loop: late trajectories, fp32 re-runs, Jacobian spectra (8B, 14B) |
|
| 38 |
+
| `v5/transport/`, `v5/transport14/` | the 3 000 × 3 000 write→read word-transport operator (8B fp32, 14B bf16) and its candidate words |
|
| 39 |
+
| `v5/axis/`, `v5/axis14/` | persona space (40 roles × 16 questions) and the loop's shared self-amplification direction |
|
| 40 |
+
| `v5/q/`, `v5/qm/`, `v5/p/`, `v5/e/` | the self-forecast loop: qualification gates (memoryless and memory loops), policy iteration, online coupled evolution |
|
| 41 |
+
| `v5/stance/`, `v5/deflate/`, `v5/speech/` | stance words and readiness to revise; self-deflation; the loop during the model's own thinking |
|
| 42 |
+
| `phaseB/loopb/` (Qwen3-8B), `phaseB/loopb14/` (Qwen3-14B) | the trained self-describing loop: `data.npz` (the model's own thinking traces as token ids, category, split), `prompts.json`, `ref.npz` (reference NLLs), `stats.npz` (readers), `eval/<arm>.npz/json` (states, forecasts, NLLs, interventions, free generations), `ckpt/<arm>/` (trained reader, writers and self-model, config, training curves), `reader_words.json` (reader axes and the clock read in J-lens words) |
|
| 43 |
+
|
| 44 |
+
Arm names in `phaseB/`: `<channel>_<reader>_l<λ>[_c|_cx][_s<seed>]` — channel `const` (no information), `state`
|
| 45 |
+
(previous state again), `fcst` (the self-model's forecast), `cut` (loop cut); reader `learned` or `J`; λ the pressure on
|
| 46 |
+
the system to be predictable to its own self-model; `_c` contrastive self-prediction with the system's own other moments
|
| 47 |
+
among the candidates, `_cx` with other traces at the same moment only; no suffix = cosine loss.
|
| 48 |
+
|
| 49 |
+
Part 3 (the ring) is in [Pixedar/jspace-ring](https://huggingface.co/datasets/Pixedar/jspace-ring). The raw arrays of
|
| 50 |
+
the decision-position study (21 GB) are kept separately and are available on request.
|
| 51 |
+
|
| 52 |
+
Models: Qwen/Qwen3-8B @ b968826d, Qwen/Qwen3-14B @ 40c06982 (earlier parts Qwen3 1.7B–32B); Jacobian lenses
|
| 53 |
+
neuronpedia/jacobian-lens @ 9fa267f8; prompts for the thinking traces: databricks-dolly-15k (no-context instructions).
|
| 54 |
+
|
| 55 |
+
## Citation
|
| 56 |
+
|
| 57 |
+
```bibtex
|
| 58 |
+
@misc{tomasik2026strangeloop,
|
| 59 |
+
author = {Tomasik, Wiktor},
|
| 60 |
+
title = {Strange loop in J-space: what a language model builds when a description of itself is looped back into itself},
|
| 61 |
+
year = {2026},
|
| 62 |
+
url = {https://github.com/Pixedar/jspace-strange-loop}
|
| 63 |
+
}
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
Licence: CC BY 4.0.
|
analyze.py → parts1-2_code/analyze.py
RENAMED
|
File without changes
|
export_ladder.py → parts1-2_code/export_ladder.py
RENAMED
|
File without changes
|
export_report.py → parts1-2_code/export_report.py
RENAMED
|
File without changes
|
fidelity_check.py → parts1-2_code/fidelity_check.py
RENAMED
|
File without changes
|
ladder_summary.py → parts1-2_code/ladder_summary.py
RENAMED
|
File without changes
|
pilot_check.py → parts1-2_code/pilot_check.py
RENAMED
|
File without changes
|
pooled.py → parts1-2_code/pooled.py
RENAMED
|
File without changes
|
run_ladder.py → parts1-2_code/run_ladder.py
RENAMED
|
File without changes
|
strange_loop.py → parts1-2_code/strange_loop.py
RENAMED
|
File without changes
|
validate_lens.py → parts1-2_code/validate_lens.py
RENAMED
|
File without changes
|