A toolkit for psychoanalytic analysis of LLM probability distributions. Compares base models (primary process), SFT models (ego), DPO models (superego), and optionally RLVR models (reinforced superego / ego-ideal) to map the repression, displacement, and condensation signatures of AI alignment.
Supports multiple model families with different layer counts: 4-layer (OLMo: base/SFT/DPO/RLVR), 3-layer (Amber: base/SFT/DPO), or 2-layer (Llama, Qwen: base/instruct). Analysis adapts gracefully to available layers.
Developed for the paper "Accelerating Desire: Psychoanalytic Architectures for AI" (Accelerationism Revisited, UCD, June 2026).
The repo's findings roll up into four campaign modules under meta/, each
with its own README as the map. These are the four parts of the argument.
M01 — Displacement. Alignment does not delete the transgressive lexicon; it redistributes it. Suppressed probability mass migrates to nameable substitutes (kill → scream) — confirmed at full English scale with all 34 lineages agreeing, larger-but-not-more-frequent at transgressive sites, travelling across languages while the affective change does not. The campaign ran registered letters (B–S) and then a post-registration wave (U–Z): the training-stage ladder, the forced-word experiments (uttering a demoted word costs a little probability and triggers no defense), and the superego at sexual slots.
M02 — Frame-exit. What contradiction does to the continuation. The claim has split by grain (2026-08-09): at hidden-state grain, superposition is real, contradiction-specific, and alignment does not undo it — same-side conjunction controls sit AT their poles, the contradiction sits BETWEEN, both arms, 45 pairs. At next-word grain the frame question is unanswerable (the contradiction's own axis carries ~2% of next-token variance; frame membership fails from an LLM coder and from four geometries alike), so frame-exit is a passage-grain construct and the generation study is the registered primary's corpus. The aligned arm's observed mode is a third thing — naming the contradiction from outside rather than resolving or refusing it. Delivered along the way: E-ASSIST-ambient — aligned checkpoints emit assistant control tokens into raw fiction unbidden.
M03 — Proceduralization. The title claim ("alignment proceduralises the individual, not the institution") is CONTESTED and the challenge is recorded in the module README's own header: alignment proceduralises both arms, differently in kind, with the volume difference bounded near zero. The module carries the correction as its front matter — read it before quoting the title.
M04 — The continuation/combination axis. What alignment does to combination rather than selection. Its first own finding (A, post-utterance shock): forced to utter a word it demoted, an aligned model finds the following region less probable for exactly one token, whoever writes the continuation, and regardless of transgression — the tiebreaker that answered M01's split discriminator table as neither account: the charge is local and does not propagate (at ten tokens; the 256-token window shows a persistent component, register-governed).
The canonical files, so nobody rediscovers them. If a fact conflicts with one of these, the file here wins (except where noted).
Prompts and populations
data/prompt_categorisation.json — THE definitive prompt register (2,800+
prompts: domain, pairs, groups, status, language). Population filters are
GROUP-WISE on status — row-wise filtering produces partial triplets that
look like triplets.data/f11_quintuplets.json — the contradiction quintuplets, en+zh,
controls inline. BUILT by meta/M02_frame_exit/scripts/build_f11_quintuplets.py
— edit a source and rebuild, never this file.data/f11_canonical_texts.json — canonical ownership for prompts shared
across groups (the stash keys on text; shared text = one cell).data/f11_k2_units.json — the k>=2 (surface, group) sampling frame,
voting-model LISTS per unit, triple-verified. CUSTODY: two of its 92
voting models (jais x2) are store-only with no transport file — a store
rebuilt from data/f11_twp* flat files is NOT this population.data/f11_l2_population.json — the L2 generation population (187 distinct
strings; the collapse rule is PER-CONTRAST, not per-group — see the M02
README).data/f11_l2_tokenizer_pairs.json — which base/aligned pairs are ID-safe
for cross-scoring (49/52; within-pair only, never cross-family).data/beam_sample_105.csv — the FC 210-prompt MARKED/UNMARKED twin sample.Models and lineages
data/model_registry.json — BUILT FROM CODE (malign_logits/registry.py,
bootstrapped from MODEL_FAMILIES). Regenerate, don't hand-edit.
Registry.base_of() walks any checkpoint to its base.data/base_aligned_pairs.json — the 52 declared base→aligned pairs. THE
UNIT IS THE BASE MODEL, not the family entry.data/lineage_map_models.json — 34 independent pretraining lineages; any
family-level N above 34 over-counts by construction.data/model_load_environments.json — (model × environment) capability
facts; runners append observation rows on completion. Prose companions:
docs/local_capability.md (failure classes) and docs/cloud_runbook.md.Stores
malign_logits/cache.py — the stash layout. READ ITS DOCSTRING BEFORE
WRITING A READER: the mode-key convention is split across stashes; the
key is how bytes are interpreted; the finiteness guard lives on the read
path.beam_fc: design lives in record VALUES, not keys. 12 of 68 checkpoints
beam-sampled under their own configs ([4994]-[4996]) — within-checkpoint
contrasts difference it out, cross-arm ones do not.(idx, model, prompt, temp) — no mode, no
producer, no params for legacy cells; new corpora record all three.Findings and claims
findings/ — instrument-level F-findings; INDEX.md is the citation
layer (status, grade, chapters); this README lists them briefly below.meta/ — the four campaign modules above; each module README maps its own
files. meta/M01_displacement/REGISTRATIONS.md records what ran.TheoryMachines/notes/claims-register.md — the authoritative quotable
forms with their riders. Where a finding file and the register disagree,
the register governs.This is the narrative layer. For the citation-grade index with status, grade, and chapter mapping, see INDEX.md.
One line per finding; the file is the finding. Status, grade and chapter mapping live in INDEX.md.
meta/ campaign runs on all families we have under a declaredmeta/ campaign runs on all families we have under a declaredhh_rlhf does not encode register preference at the scale the chain analysis required — Registered rebuild of the preference-corpus gate on a validly constituted three-construct slate. The gate failed 0/3 in hh_rlhf, and the failure is a BOUNDED NEGATIVE rather than a non-detection: every marker's 95% interval excludes the 0.174 effect the design required, the largest upper bound at 0.80x of it. No verdict on convention follows and none is available. Measured on: hh_rlhf chosen/rejected unigram tables; pku_saferlhf descriptive-only.This repository is the empirical base of a research program on what alignment does to language models — the Critical Inquiry article Theory Machines and the book Alignment: Computing a Political Economy of Language Models. It compares base models against their aligned descendants across eleven-plus families, asking where suppressed probability mass goes, what happens to contradiction, and what it costs a model to say what it would not have said.
The roster: 104 checkpoints · 52 declared base→aligned pairs · 34
independent pretraining lineages — and any family-level count above 34
over-counts by construction (malign_logits/registry.py is the code-built
source; data/base_aligned_pairs.json and data/lineage_map_models.json
its declared products).
The campaign runs under a preregistration-then-reproducibility discipline — frozen registrations with hashes, declared populations and contrast hierarchies, adversarial cross-checks between independent analysts, and a claims register that records every supersession. The operating manual — who does what, the working rules, the current entry points — is CAMPAIGN.md.
Local dev: pip install -e .; most analysis runs on a Mac (MPS) with the
larger models on rented GPUs — see docs/local_capability.md and
docs/cloud_runbook.md.
The psychoanalytic framing is not decoration; it is the hypothesis space.
The original toolkit modelled base/SFT/DPO/RLVR checkpoints as
id/ego/superego strata (malign_logits/psyche.py, still the living core for
interactive work — Psyche, PromptAnalysis, discover_top_words), and
the campaign's findings are what happened when those metaphors were made to
survive measurement: some did (displacement has structure; the base holds
contradiction in superposition), some inverted (the frame apparatus reads
the scene, not the signifier), and the instrument-grade record of which is
the point.
GPL-3.0 — see LICENSE.
2,937 commits
HTML
74.4%
Jupyter Notebook
20.6%
Python
4.9%
A toolkit for psychoanalytic analysis of LLM probability distributions. Compares base models (primary process), SFT models (ego), DPO models (superego), and optionally RLVR models (reinforced superego / ego-ideal) to map the repression, displacement, and condensation signatures of AI alignment.
Supports multiple model families with different layer counts: 4-layer (OLMo: base/SFT/DPO/RLVR), 3-layer (Amber: base/SFT/DPO), or 2-layer (Llama, Qwen: base/instruct). Analysis adapts gracefully to available layers.
Developed for the paper "Accelerating Desire: Psychoanalytic Architectures for AI" (Accelerationism Revisited, UCD, June 2026).
The repo's findings roll up into four campaign modules under meta/, each
with its own README as the map. These are the four parts of the argument.
M01 — Displacement. Alignment does not delete the transgressive lexicon; it redistributes it. Suppressed probability mass migrates to nameable substitutes (kill → scream) — confirmed at full English scale with all 34 lineages agreeing, larger-but-not-more-frequent at transgressive sites, travelling across languages while the affective change does not. The campaign ran registered letters (B–S) and then a post-registration wave (U–Z): the training-stage ladder, the forced-word experiments (uttering a demoted word costs a little probability and triggers no defense), and the superego at sexual slots.
M02 — Frame-exit. What contradiction does to the continuation. The claim has split by grain (2026-08-09): at hidden-state grain, superposition is real, contradiction-specific, and alignment does not undo it — same-side conjunction controls sit AT their poles, the contradiction sits BETWEEN, both arms, 45 pairs. At next-word grain the frame question is unanswerable (the contradiction's own axis carries ~2% of next-token variance; frame membership fails from an LLM coder and from four geometries alike), so frame-exit is a passage-grain construct and the generation study is the registered primary's corpus. The aligned arm's observed mode is a third thing — naming the contradiction from outside rather than resolving or refusing it. Delivered along the way: E-ASSIST-ambient — aligned checkpoints emit assistant control tokens into raw fiction unbidden.
M03 — Proceduralization. The title claim ("alignment proceduralises the individual, not the institution") is CONTESTED and the challenge is recorded in the module README's own header: alignment proceduralises both arms, differently in kind, with the volume difference bounded near zero. The module carries the correction as its front matter — read it before quoting the title.
M04 — The continuation/combination axis. What alignment does to combination rather than selection. Its first own finding (A, post-utterance shock): forced to utter a word it demoted, an aligned model finds the following region less probable for exactly one token, whoever writes the continuation, and regardless of transgression — the tiebreaker that answered M01's split discriminator table as neither account: the charge is local and does not propagate (at ten tokens; the 256-token window shows a persistent component, register-governed).
The canonical files, so nobody rediscovers them. If a fact conflicts with one of these, the file here wins (except where noted).
Prompts and populations
data/prompt_categorisation.json — THE definitive prompt register (2,800+
prompts: domain, pairs, groups, status, language). Population filters are
GROUP-WISE on status — row-wise filtering produces partial triplets that
look like triplets.data/f11_quintuplets.json — the contradiction quintuplets, en+zh,
controls inline. BUILT by meta/M02_frame_exit/scripts/build_f11_quintuplets.py
— edit a source and rebuild, never this file.data/f11_canonical_texts.json — canonical ownership for prompts shared
across groups (the stash keys on text; shared text = one cell).data/f11_k2_units.json — the k>=2 (surface, group) sampling frame,
voting-model LISTS per unit, triple-verified. CUSTODY: two of its 92
voting models (jais x2) are store-only with no transport file — a store
rebuilt from data/f11_twp* flat files is NOT this population.data/f11_l2_population.json — the L2 generation population (187 distinct
strings; the collapse rule is PER-CONTRAST, not per-group — see the M02
README).data/f11_l2_tokenizer_pairs.json — which base/aligned pairs are ID-safe
for cross-scoring (49/52; within-pair only, never cross-family).data/beam_sample_105.csv — the FC 210-prompt MARKED/UNMARKED twin sample.Models and lineages
data/model_registry.json — BUILT FROM CODE (malign_logits/registry.py,
bootstrapped from MODEL_FAMILIES). Regenerate, don't hand-edit.
Registry.base_of() walks any checkpoint to its base.data/base_aligned_pairs.json — the 52 declared base→aligned pairs. THE
UNIT IS THE BASE MODEL, not the family entry.data/lineage_map_models.json — 34 independent pretraining lineages; any
family-level N above 34 over-counts by construction.data/model_load_environments.json — (model × environment) capability
facts; runners append observation rows on completion. Prose companions:
docs/local_capability.md (failure classes) and docs/cloud_runbook.md.Stores
malign_logits/cache.py — the stash layout. READ ITS DOCSTRING BEFORE
WRITING A READER: the mode-key convention is split across stashes; the
key is how bytes are interpreted; the finiteness guard lives on the read
path.beam_fc: design lives in record VALUES, not keys. 12 of 68 checkpoints
beam-sampled under their own configs ([4994]-[4996]) — within-checkpoint
contrasts difference it out, cross-arm ones do not.(idx, model, prompt, temp) — no mode, no
producer, no params for legacy cells; new corpora record all three.Findings and claims
findings/ — instrument-level F-findings; INDEX.md is the citation
layer (status, grade, chapters); this README lists them briefly below.meta/ — the four campaign modules above; each module README maps its own
files. meta/M01_displacement/REGISTRATIONS.md records what ran.TheoryMachines/notes/claims-register.md — the authoritative quotable
forms with their riders. Where a finding file and the register disagree,
the register governs.This is the narrative layer. For the citation-grade index with status, grade, and chapter mapping, see INDEX.md.
One line per finding; the file is the finding. Status, grade and chapter mapping live in INDEX.md.
meta/ campaign runs on all families we have under a declaredmeta/ campaign runs on all families we have under a declaredhh_rlhf does not encode register preference at the scale the chain analysis required — Registered rebuild of the preference-corpus gate on a validly constituted three-construct slate. The gate failed 0/3 in hh_rlhf, and the failure is a BOUNDED NEGATIVE rather than a non-detection: every marker's 95% interval excludes the 0.174 effect the design required, the largest upper bound at 0.80x of it. No verdict on convention follows and none is available. Measured on: hh_rlhf chosen/rejected unigram tables; pku_saferlhf descriptive-only.This repository is the empirical base of a research program on what alignment does to language models — the Critical Inquiry article Theory Machines and the book Alignment: Computing a Political Economy of Language Models. It compares base models against their aligned descendants across eleven-plus families, asking where suppressed probability mass goes, what happens to contradiction, and what it costs a model to say what it would not have said.
The roster: 104 checkpoints · 52 declared base→aligned pairs · 34
independent pretraining lineages — and any family-level count above 34
over-counts by construction (malign_logits/registry.py is the code-built
source; data/base_aligned_pairs.json and data/lineage_map_models.json
its declared products).
The campaign runs under a preregistration-then-reproducibility discipline — frozen registrations with hashes, declared populations and contrast hierarchies, adversarial cross-checks between independent analysts, and a claims register that records every supersession. The operating manual — who does what, the working rules, the current entry points — is CAMPAIGN.md.
Local dev: pip install -e .; most analysis runs on a Mac (MPS) with the
larger models on rented GPUs — see docs/local_capability.md and
docs/cloud_runbook.md.
The psychoanalytic framing is not decoration; it is the hypothesis space.
The original toolkit modelled base/SFT/DPO/RLVR checkpoints as
id/ego/superego strata (malign_logits/psyche.py, still the living core for
interactive work — Psyche, PromptAnalysis, discover_top_words), and
the campaign's findings are what happened when those metaphors were made to
survive measurement: some did (displacement has structure; the base holds
contradiction in superposition), some inverted (the frame apparatus reads
the scene, not the signifier), and the instrument-grade record of which is
the point.
GPL-3.0 — see LICENSE.
2,937 commits
HTML
74.4%
Jupyter Notebook
20.6%
Python
4.9%