Pixedar commited on
Commit
2de5528
·
verified ·
1 Parent(s): 4315454

Reorganise: dataset card for all parts, Parts 1-2 code under parts1-2_code/

Browse files
README.md CHANGED
@@ -1,97 +1,66 @@
1
  ---
2
- pretty_name: Strange Loop in J-space
 
 
 
3
  tags:
4
  - interpretability
5
- - j-space
6
- - global-workspace
7
  - self-model
8
- - recurrence
 
 
 
 
9
  - qwen3
10
  size_categories:
11
- - 10K<n<100K
12
  ---
13
 
14
- # Strange Loop in J-space: data
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
- ## Runs
 
 
33
 
34
- | Directory | Minds | Conditions | J-space dictionary |
35
- |---|---|---|---|
36
- | `runs/mainA` | 60 = 6 × 10 seeds | free, loop, yoked, avg, perturb, ablate (treated at thought 200) | every word-like token (40,034 atoms) |
37
- | `runs/mainB` | 60 = 6 × 10 seeds | same as A | common English words (27,929 atoms) |
38
- | `runs/mainC` | 60 = 4 × 15 seeds | free, loopc, yokedc, clampc (individual self-models; clamp 150–199; forward question) | common English, natural case (26,236 atoms) |
39
- | `runs/pilot2` | 23 | recurrent gain sweep, reflection layer/gain sweep | every word-like token |
40
 
41
- Each run has 400 thoughts per mind and a reflection every 10 thoughts (40 per mind). Minds with the same seed share
42
- their sampling noise, so a treated mind and its twin are identical until they are treated differently.
43
 
44
- ## Files per run
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
- | `part2/ladder07/<model>/` | read at 70 % of depth: `val.json` (lens check per layer), `gsweep/` and `fsweep/` (gain and reflection sweeps), `gain.json`, `params.json`, `main/` (free / loop / yoked / clamp × 12 minds × 300 thoughts, individual self-models, forward question) |
78
- | `part2/ladder2/<model>/` | the same read at 50 % of depth (1.7B–14B) |
79
- | `part2/own/<model>/` | ownership or resemblance: free / loop / yoked / **match** (the most similar stranger's self-model) / **stale** (own self-model from 50 thoughts earlier) × 16 minds (4B, 8B, 14B) |
80
- | `part2/ladder_paper/qwen3-1.7b/` | 1.7B with the paper's every-token dictionary (robustness check) and the dictionary fidelity test (`diag/`, with raw residual states) |
81
- | `part2/ladder/qwen3-4b/diag/` | the dictionary fidelity test on 4B |
82
-
83
- Main results (all in the interactive report):
84
- - The lens turns conceptual only past ~60 % of depth up to 8B; 14B and 32B have a fuller, earlier workspace (occupancy
85
- 30–37 and 13–19, concepts from 0.40 and 0.55 of depth).
86
- - At every size the self-model reads its own trajectory (51–73 %, chance 8 %), a self-symbol forms, the individual self
87
- persists only when fed back, nothing is anticipated, and the next thoughts follow whichever self is fed in.
88
- - With size the loop's self becomes more individual (+0.01 → +0.25 from 1.7B to 32B) and stickier after a clamp.
89
- - Pooled over 15 runs, a mind holds its own self-model better than a random stranger's (+0.065 ± 0.007, z = 8.9), but
90
- the most similar stranger's self is held better still (−0.045 ± 0.014 for own minus matched, z = −3.2) and its own
91
- outdated self worse than a random stranger's (−0.113 ± 0.018, z = −6.5): fit to the present, not ownership.
92
-
93
- ## Notes
94
-
95
- Thoughts are unfiltered base-model output from a think-aloud frame and occasionally contain profanity or sexual
96
- content. The J-space word lists of run A are dominated by under-trained and non-English tokens; prefer runs B and C for
97
- reading words.
 
 
 
 
 
 
 
 
 
 
 
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