From 9b9c3f34d8d0ca496b8b29a10a43f31d06bf94d2 Mon Sep 17 00:00:00 2001 From: PanQiWei <594557445@qq.com> Date: Mon, 20 Apr 2026 02:10:41 +0800 Subject: [PATCH] fix: add ch-07 to parent navigation, fix AI writing patterns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add ch-07-symbols-connectionism to parent .pages (ZH + EN) - Add ch-07 entry to mental-models/index.md (ZH + EN) - Update write-mental-model skill: add parent .pages + index.md update as explicit step (previously omitted, causing invisible chapters) - Fix "代价的本质:" / "The nature of the cost:" mechanical refrain in article 04 (5x identical pattern → varied phrasing) - Regenerate llms.txt to include ch-07 (gitignored, not committed) Co-Authored-By: Claude Opus 4.6 (1M context) --- .claude/skills/write-mental-model/SKILL.md | 10 ++++++++++ docs/en/mental-models/.pages | 1 + .../04-cost-of-translation.md | 10 +++++----- docs/en/mental-models/index.md | 1 + docs/zh/mental-models/.pages | 1 + .../04-cost-of-translation.md | 10 +++++----- docs/zh/mental-models/index.md | 1 + 7 files changed, 24 insertions(+), 10 deletions(-) diff --git a/.claude/skills/write-mental-model/SKILL.md b/.claude/skills/write-mental-model/SKILL.md index 8facbe0..54a75f9 100644 --- a/.claude/skills/write-mental-model/SKILL.md +++ b/.claude/skills/write-mental-model/SKILL.md @@ -214,6 +214,11 @@ Write the chapter `index.md` after all articles are done — it needs the full p Create `.pages` navigation file for the chapter directory. +**Update parent navigation files.** Two files must be updated — both are easy to forget and cause the chapter to be invisible in the site even though it builds fine: + +1. `docs/zh/mental-models/.pages` — add the new chapter directory to the nav list +2. `docs/zh/mental-models/index.md` — add a bullet entry with chapter link and one-line description (match the style of existing entries) + ### Step 3b: Write English articles English articles are **natively written, not translated**. Read the Chinese version for content and argument structure, then write English from scratch in an English-native voice. @@ -228,6 +233,11 @@ Write in sequence, same micro-review cadence as Chinese. Create `.pages` navigation file and `index.md` for the English chapter directory. +**Update parent navigation files** — same as the ZH step: + +1. `docs/en/mental-models/.pages` — add the new chapter directory to the nav list +2. `docs/en/mental-models/index.md` — add a bullet entry with chapter link and one-line description + ### Step 3c: Build verification After all articles are written: diff --git a/docs/en/mental-models/.pages b/docs/en/mental-models/.pages index 6080983..e4f2e55 100644 --- a/docs/en/mental-models/.pages +++ b/docs/en/mental-models/.pages @@ -7,3 +7,4 @@ nav: - ch-04-operating-system - ch-05-fractal - ch-06-causality + - ch-07-symbols-connectionism diff --git a/docs/en/mental-models/ch-07-symbols-connectionism/04-cost-of-translation.md b/docs/en/mental-models/ch-07-symbols-connectionism/04-cost-of-translation.md index d53c510..4a1ef32 100644 --- a/docs/en/mental-models/ch-07-symbols-connectionism/04-cost-of-translation.md +++ b/docs/en/mental-models/ch-07-symbols-connectionism/04-cost-of-translation.md @@ -18,7 +18,7 @@ Before OpenAI introduced structured outputs, schema violation rates on complex e But it is not free. Strict mode works by compiling the schema into a formal grammar (OpenAI uses a context-free grammar; other tools like Outlines use finite state machines), then masking tokens that violate the current grammar state at every decoding step. This requires additional inference-time computation to maintain the grammar state, engineering complexity to handle schema compilation, and a subtler cost that we will get to shortly. -The nature of the cost: the neural system's output space is vastly larger than what the symbolic constraint permits. Compressing that space costs inference time and engineering complexity. +Put differently, the neural system's output space is vastly larger than what the symbolic constraint permits. Compressing that space costs inference time and engineering complexity. ## Semantic drift @@ -28,7 +28,7 @@ Chroma's 2025 study tested 18 frontier models and found that every one exhibited The lost-in-the-middle effect compounds the problem: information positioned in the middle of the context is retrieved at significantly lower rates than information at the head or tail. As conversations grow long enough, the carefully written tool-use rules and output format requirements in the system prompt gradually fade. -The nature of the cost: symbolic constraints are text in the context window. They compete for the same finite attention budget as conversation history, retrieval results, and user inputs. Constraints are not "cancelled" — they are diluted. +At bottom, symbolic constraints are just text in the context window. They compete for the same finite attention budget as conversation history, retrieval results, and user inputs. Constraints are not "cancelled" — they are diluted. ## Tool hallucination @@ -38,7 +38,7 @@ Research finds that model failures at this translation point are diverse: the mo A separate study of LLMs in agentic scenarios observed a subtler degradation pattern: models start tasks with correct reasoning and valid tool selections but deteriorate mid-execution — malformed tool calls, loss of JSON output structure, or forgetting earlier decisions. -The nature of the cost: tool schemas are just text in the context, as far as the neural system is concerned. The model "knows" a schema the same way it "knows" a conversation turn — through statistical associations extracted from the token sequence. But a schema demands precise compliance, not approximate understanding. +Here is the problem: tool schemas are just text in the context, as far as the neural system is concerned. The model "knows" a schema the same way it "knows" a conversation turn — through statistical associations extracted from the token sequence. But a schema demands precise compliance, not approximate understanding. ## Trajectory bias @@ -50,7 +50,7 @@ A study published at RANLP 2025 found that this step-by-step modification biases A more counterintuitive finding: instruction-tuned models sometimes perform worse under constraints than base models. Instruction tuning may "inadvertently reduce structured output capabilities." -The nature of the cost: symbolic constraints reshape the probability landscape. You get a structural guarantee — the output is definitely valid JSON, definitely conforms to your schema — but you may pay in semantic quality. Format correctness and content correctness are two independent dimensions; constrained decoding guarantees the former but may degrade the latter. +The tradeoff is clear: symbolic constraints reshape the probability landscape. You get a structural guarantee — the output is definitely valid JSON, definitely conforms to your schema — but you may pay in semantic quality. Format correctness and content correctness are two independent dimensions; constrained decoding guarantees the former but may degrade the latter. ## Boundary penetration @@ -66,7 +66,7 @@ LLMs face the same problem with no equivalent structural solution. System prompt The production consequences are real. Security researchers have demonstrated remote code execution via prompt injection in coding assistants. In 2024, Slack AI was found vulnerable to data exfiltration through RAG poisoning — attackers injected malicious instructions into public channels, which the model treated as legitimate context during retrieval. -The nature of the cost: symbolic systems maintain a strict structural distinction between data and code. Neural systems do not. The translation layer sits between the two, but it inherits the weakness from the neural side — in a token sequence, control and data are indistinguishable. +This is the most fundamental of the five costs: symbolic systems maintain a strict structural distinction between data and code. Neural systems do not. The translation layer sits between the two, but it inherits the weakness from the neural side — in a token sequence, control and data are indistinguishable. ## These are not bugs diff --git a/docs/en/mental-models/index.md b/docs/en/mental-models/index.md index 92a2a80..69bd9f3 100644 --- a/docs/en/mental-models/index.md +++ b/docs/en/mental-models/index.md @@ -8,3 +8,4 @@ They are the cause; everything else is the effect. Read these first. - [**Operating System**](ch-04-operating-system/index.md) — The five pillars OS engineers refined over fifty years — memory management, scheduling, trust boundaries, cooperation protocols — are being reinvented in agent harness. Each pillar unfolds, and each break point marks design space the OS paradigm does not cover. - [**Fractal**](ch-05-fractal/index.md) — Self-similarity is not a coincidental observation about agentic systems — it is a generative principle of complexity. The same structure repeats at the prompt, agent, and swarm scales. Understand the principle, and engineering intuition transfers across layers. - [**Causality**](ch-06-causality/index.md) — LLMs learn from statistical co-occurrence; they live in an ocean of correlation. When your application demands the reliability of causation, the system needs causal discipline — staying honest about what it knows and how it knows it. +- [**Symbols & Connectionism**](ch-07-symbols-connectionism/index.md) — Symbolic systems excel at structure; neural networks excel at discovery — two irreducible modes of representation. The harness is the translation layer between them, and translation carries structural costs distributed along a tension axis. diff --git a/docs/zh/mental-models/.pages b/docs/zh/mental-models/.pages index 05f2f27..b1a27fe 100644 --- a/docs/zh/mental-models/.pages +++ b/docs/zh/mental-models/.pages @@ -7,3 +7,4 @@ nav: - ch-04-operating-system - ch-05-fractal - ch-06-causality + - ch-07-symbols-connectionism diff --git a/docs/zh/mental-models/ch-07-symbols-connectionism/04-cost-of-translation.md b/docs/zh/mental-models/ch-07-symbols-connectionism/04-cost-of-translation.md index 362af66..0993341 100644 --- a/docs/zh/mental-models/ch-07-symbols-connectionism/04-cost-of-translation.md +++ b/docs/zh/mental-models/ch-07-symbols-connectionism/04-cost-of-translation.md @@ -18,7 +18,7 @@ 但它不是免费的。Strict mode 的工作原理是把 schema 编译成形式语法(OpenAI 使用上下文无关文法,其他工具如 Outlines 使用有限状态机),在每一步解码时屏蔽当前语法状态不允许的 token。这需要额外的推理时间来维护语法状态,需要工程复杂度来处理 schema 编译,还有一个更微妙的代价——后面会讲到。 -代价的本质:神经系统的输出空间远大于符号约束允许的空间。压缩这个空间需要在推理时间和工程复杂度上付出。 +换句话说,神经系统的输出空间远大于符号约束允许的空间。压缩这个空间需要在推理时间和工程复杂度上付出。 ## 语义漂移 @@ -28,7 +28,7 @@ Chroma 在 2025 年测试了 18 个前沿模型,发现每一个模型都在上 Lost-in-the-middle 效应进一步恶化了这个问题:位于上下文中段的信息被检索的概率显著低于头尾。当对话足够长时,system prompt 中精心编写的工具使用规则和输出格式要求会逐渐"褪色"。 -代价的本质:符号约束在上下文中是文本——它和对话内容、检索结果、用户输入共同竞争有限的注意力资源。约束不是被"取消"了,而是被"稀释"了。 +说到底,符号约束在上下文中也只是文本——它和对话内容、检索结果、用户输入共同竞争有限的注意力资源。约束不是被"取消"了,而是被"稀释"了。 ## 工具幻觉 @@ -38,7 +38,7 @@ Lost-in-the-middle 效应进一步恶化了这个问题:位于上下文中段 另一项针对 agent 场景的研究观察到一种更微妙的退化模式:模型在正确开始执行后中途崩溃——以正确的推理和有效的工具选择开始任务,但执行过程中频繁出现性能下降,包括畸形的工具调用、JSON 输出结构的丢失、或遗忘早先的决策。 -代价的本质:工具 schema 对神经系统来说是上下文中的一段文本。它"知道" schema 的方式和"知道"一段对话历史的方式没有本质区别——都是从 token 序列中提取的统计关联。但 schema 要求的是精确遵守,不是"大致理解"。 +问题出在哪?工具 schema 对神经系统来说就是上下文中的一段文本。它"知道" schema 的方式和"知道"一段对话历史的方式没有本质区别——都是从 token 序列中提取的统计关联。但 schema 要求的是精确遵守,不是"大致理解"。 ## Trajectory Bias @@ -50,7 +50,7 @@ Lost-in-the-middle 效应进一步恶化了这个问题:位于上下文中段 更反直觉的发现:经过指令微调的模型在约束下的表现有时比基础模型更差。指令微调本身可能"无意中降低了结构化输出能力"。 -代价的本质:符号约束改变了概率分布的地形。你拿到了结构保证——输出一定是合法的 JSON,一定符合你的 schema——但你可能付出了语义质量。格式正确和内容正确是两个独立的维度,约束解码保证了前者,但可能损害了后者。 +这里的取舍很清楚:符号约束改变了概率分布的地形。你拿到了结构保证——输出一定是合法的 JSON,一定符合你的 schema——但你可能付出了语义质量。格式正确和内容正确是两个独立的维度,约束解码保证了前者,但可能损害了后者。 ## 边界穿透 @@ -66,7 +66,7 @@ LLM 面对同样的问题,但没有等价的结构性解决方案。System pro 生产中的后果是真实的:安全研究者已经演示了通过 prompt injection 在编码助手中实现远程代码执行的攻击路径。2024 年,Slack AI 被发现可以通过 RAG 投毒实现数据泄露——攻击者在公共频道中注入恶意指令,模型在检索时将其当作合法上下文执行。 -代价的本质:符号系统对数据和代码有严格的结构性区分。神经系统没有。翻译层位于两者之间,但它继承了神经系统一侧的弱点——在 token 序列中,控制和数据是不可区分的。 +这是五种代价中最根本的一种:符号系统对数据和代码有严格的结构性区分,神经系统没有。翻译层位于两者之间,但它继承了神经系统一侧的弱点——在 token 序列中,控制和数据是不可区分的。 ## 这些不是 bug diff --git a/docs/zh/mental-models/index.md b/docs/zh/mental-models/index.md index 8d8ae22..5b3f284 100644 --- a/docs/zh/mental-models/index.md +++ b/docs/zh/mental-models/index.md @@ -8,3 +8,4 @@ - [**操作系统**](ch-04-operating-system/index.md) — OS 工程师用 50 年精炼出来的五根支柱——内存管理、调度、信任边界、协作协议——正在 agent harness 里被逐一重新发明。每根支柱展开,每个断裂点指向 OS 范式没覆盖的设计空间。 - [**分形**](ch-05-fractal/index.md) — 自相似性不是对 agentic system 的巧合观察,而是复杂性的生成原理。同一个结构在 prompt、agent、swarm 三个尺度重复。理解了这个原理,工程直觉跨层迁移。 - [**因果**](ch-06-causality/index.md) — LLM 从统计共现中学习,它生活在相关性的海洋里。当你的应用需要因果性的可靠性时,系统需要因果纪律——迫使自己对"它知道什么"和"它怎么知道的"保持诚实。 +- [**符号与联结**](ch-07-symbols-connectionism/index.md) — 符号系统擅长结构,神经网络擅长发现——两种不可互相还原的表征方式。Harness 是它们之间的翻译层,翻译有结构性的代价,代价沿一根张力轴分布。