Research

Civilization Architecture: auditable Memory, State, and Rule pathways

A research note on integrating structured Memory, State, and Rule pathways into hidden-state computation with explicit ablation and audit surfaces.

Read article48 min read
Civilization Architecture cover

Research summary

Civilization Architecture investigates a narrow question: when a model has long-lived Memory, immediate State, and Rule constraints, how can we verify that a decision actually used one of those structured sources rather than a prompt template, candidate ordering, or a leaky readout? We treat the neural core, the three paths, readout, and audit surface as one model system.

We evaluated a controllable PyTorch backend and a frozen Qwen3-0.6B instance. The controlled backend supports precise interventions; the frozen instance asks whether the same interface can enter a real language model’s hidden-state flow. The resulting claim is deliberately limited: independently addressed, ablated, and traced residual paths can make use of structured context an experimentally falsifiable proposition. It is not a claim that this architecture outpredicts every matched adapter or constitutes a complete autonomous civilization.

1. From more context to an auditable path

Language models can already consume retrieval, tool output, workspace state, and instructions. When all of it becomes one undifferentiated token sequence, however, a correct output does not reveal its causal source. A rule may appear obeyed because of a superficial phrase; a long-term fact may appear recalled because of a task template.

We define path auditability as an intervention boundary. If Memory contributes to a decision, disabling Memory, replacing it with wrong Memory, or zeroing its residual scale should cause a measurable, task-specific change. Disabling an irrelevant path should not cause the same collapse. This reframes the question from “did more information raise the score?” to “which information changed hidden-state computation in a checkable way?”

Input tokensEmbeddingand base streamNeural coreself-attention / MLPHidden-stateupdate boundaryReadoutand auditOutputtracesMemory pathrecords, vectorsState pathgates, contextRule pathconstraints, conflictStage gatesablation, auditH̃ₗ = Hᵇᵃˢᵉₗ + ΔB + gMΔM + gSΔS + gRΔR
图 1. 文明架构的完整计算边界。三条结构化路径在隐状态更新处进入计算,读出与审计面单独评价路径影响;长期学习与记忆固化在架构中保留,但不被计入本文已验证结论。

2. Model boundary

Let the input be x and structured context be C = (M, S, R): Memory records, a State vector, and Rule records. In the controllable backend, ordinary self-attention and MLP updates form a base stream. Memory attention, State gate/projection, and Rule projection create separately controllable contributions that meet at the residual update boundary. We record attention, gates, and norms and can ablate each path independently.

HₗSelf-Attention+ MLPHₗ₊₁Memory AttentionΔM(H,M,S)State Gateand Projection ΔS(S)Rule PathΔR(R,S)Trace exportattention, gates, norms+Memory vectors MState vector SRule vectors R
图 2. 受控后端的 CivilizationBlock。普通 Transformer 更新与 Memory attention、State gate、Rule projection 在残差汇合点相遇,并导出注意力、门值与范数轨迹。

The point is not a final-output filter. Filtering can reject an answer but cannot establish that a rule participated in internal conflict resolution. Nor do we assume that a structured path is automatically correct. The architecture is useful precisely because a run can fail a predeclared intervention test.

3. Why freeze Qwen3

In the language-model phase, Qwen3-0.6B base weights remain frozen and are excluded from optimization. This is not a general claim that freezing beats fine-tuning. It reduces an attribution problem: changes cannot be simultaneously explained by base-weight adaptation, task-distribution absorption, and a path residual. Only path-specific adapters and readout modules train.

The adapter separates Base, Memory, State, and Rule residuals. An early single-hook version could write to a hidden layer and passed engineering checks, yet its medium-scale runs remained near the five-choice random baseline. That failure taught us that a trainable hook is not evidence of a working path mechanism. We moved to multi-layer placement, separated paths, exported deltas, and independent readouts so that a failure could be localized.

Input tokensFrozen Qwen3embeddingFrozen decoderlayers 0:l−1Hidden tapHₗ / H̃ₗFrozen decoderlayers l:LLM head logitsMemory/State/Rulestructured contextFrozen contextencoderPath-specific adapterΔM ΔS ΔR ΔBProjected / rawreadout audit
图 3. 冻结 Qwen3-0.6B 的实例化路径。Qwen3 的权重、tokenizer 与 embedding 保持冻结;仅训练路径特异 adapter/readout,并对写入的残差和最终隐状态分别审计。

4. Two readouts, fixed centroids

For task group g and path p, we measure a path drop as D(g,p) = accuracy(full) − accuracy(without p). A large drop alone is insufficient: it can arise from an unrelated path, label leakage, or a readout retrained on the intervention. Passing therefore requires a competent full condition, a target-path drop, controlled irrelevant-path drops, and—where applicable—a wrong-context control.

We retain two evidence streams. A projected-delta readout asks whether a particular residual carries target-option information. A full-hidden fixed-centroid readout builds candidate centroids only from training-split, full-condition final hidden states, then reuses exactly those centroids for full, wrong-context, adapter-disabled, zero-scale, and ablated conditions. Rebuilding centroids per condition would let measurement adapt to the intervention.

Full contextforwardPath deltasΔM, ΔS, ΔRFinal hiddenstatesProjecteddelta readoutFixed train-onlycentroidsPath gateaccuracy / dropFull-hiddenaudit gateAblated / wrongcontext forwardProjected path evidenceRaw full-hidden evidence; same centroids reused across controls
图 4. 审计协议的完整双路径。上支路验证单条残差是否携带目标方向;下支路验证信号融合进最终隐状态后仍可被训练集固定质心恢复。错误上下文与消融条件不得重建质心。

5. Stage gates and failure-driven progress

Every stage starts from the strongest accepted artifact and opens only its permitted parameter set. Engineering gates check execution, artifacts, freezing, trace export, and numerical stability. Research gates check path necessity, wrong-context behavior, and readout leakage. A program that runs is not automatically evidence for a mechanism.

Stage 39 is representative. Memory context could be distinguished, but its residual did not carry choice information to the target readout: the runner stopped before later Rule, Conflict, Combined, and full-hidden steps, preserving the failure artifact. Stage 40 connected supervision to the differentiable memory-delta tensor and froze non-Memory paths. Only after the Memory group, no-Memory drop, and wrong-context drop reached the gate was the Rule path restored.

Stage 39Memory gate faileddelta-to-option .20 / group .00
Stage 40Memory repairmemory gate 1.00 / drop .80
Stage 41Rule/Conflict repairthree groups 1.00 / target drop .80
Stage 42Raw full hiddenfixed centroid .2074 → 1.00
Stage 42-MMulti-seed robustness3/3 passed; after 1.0000±0
停止并写入失败工件wrong-context drop .80irrelevant-path gateshidden-norm 1.1359before .2049±.0028
图 5 / 图 7. Stage 39–42-M 的 fail-fast 修复链。每一阶段只有在上一阶段的路径门通过、失败工件已经保存时才允许继续;这张图复刻论文的阶段顺序、门值与三种子稳健性记录。

6. Controlled backend results

The controlled stress test first answered whether the three paths could be selected and disabled in a diagnosable environment. The full condition maintained high accuracy while Memory, State, and Rule ablations produced distinguishable drops; retaining only structure fell to the five-choice random baseline. These are controlled mechanism observations, not a claim about open-ended language capability.

图 6. 受控路径依赖压力测试。完整模型维持 .9854 平均准确率;关闭 Memory、State、Rule 后分别出现可区分的下降;仅保留结构时落至五类随机基线 .20。

7. Frozen-model results

In the final local five-candidate Stage 42 conditions, the full-hidden fixed-centroid recovery reached 1.0000, mean wrong-context drop reached .8000, and the hidden-state norm ratio was 1.1270, while the Qwen3 base remained frozen. Matched MLP adapter, LoRA, and prefix-tuning baselines also reached the task’s accuracy ceiling. We therefore do not claim a prediction advantage. The evidence supports the narrower statement that the path interface can be separately addressed, disabled, and audited in the frozen model flow.

图 8. 投影残差读出可在全隐状态尚未对齐时先通过;Stage 42 之后固定质心全隐状态读出由 .2049 附近恢复到 1.00。两类读出因此被保留为不同的审计门。

8. Full figures and numerical record

The interactive tables reproduce the study’s staged timeline, controlled and frozen-backend summaries, candidate gates, multi-seed records, and matched baselines. They are retained to make the evidence boundary inspectable rather than replacing it with a single headline score.

表 1. 实验时间线与阶段验证图

阶段后端目标结果与研究门
01–03NumPy / PyTorch最小架构可行性通过:结构化路径进入计算并形成训练闭环。
04–07PyTorch观测、codebook 与泄漏修复发现表面泄漏;跨模板对齐后才允许注入。
08–17PyTorch注入、MSR 融合、链状态硬逻辑失败后修复,恢复路径依赖门。
18–26Frozen Qwen3适配器与初始迁移混合:工程门可过,真实任务迁移不成立。
27–38Frozen Qwen3路径拆分与读出对齐多类别 Memory / full-hidden 反复失败。
39–42-MFrozen Qwen3严格门与多种子复核由失败到修复;局部五候选门通过。
BM-1 / BM-2Frozen Qwen3匹配基线无预测优势;保留原生路径审计差异。

9. What failed and how it changed the study

We encountered template leakage in early codebooks, a hook that wrote without yielding a usable path, projected evidence that did not survive in full hidden state, and runs that could not advance because a wrong-context control did not move. Each failure changed the protocol: templates were aligned and masked; paths were split; fixed centroids were added; and stage gates prevented later results from laundering an earlier failure.

10. What this does and does not establish

The study is local, task-bounded, and mechanism-oriented. It does not demonstrate general reasoning superiority, reliable long-horizon agency, rule revision, production robustness, or safety guarantees. Hidden-state probes remain evidence under a specified protocol, not a direct reading of semantic truth. The claims should be reevaluated whenever the task family, model, adapter placement, or readout contract changes.

11. Publication conclusion

Civilization Architecture offers an auditable interface for structured Memory, State, and Rule contributions to hidden-state computation. Its contribution is methodological: explicit residual paths, negative controls, two distinct readout gates, frozen-base constraints, and recorded failure artifacts allow a path-use claim to fail. The next work is to broaden task families and robustness tests without relaxing that evidence discipline.