Anthropic 用 J-lens 找到 Claude 的'全局工作空间':从 218 分研究博客到 jacobian-lens 67 行核心代码
一、起因:Anthropic 2026-07-06 发了篇 218 分的研究博客
今天刷到 HN 头条第 4 条 "A global workspace in language models" (218 分,74 条评论),链接到 Anthropic 官方研究博客 anthropic.com/research/global-workspace。标题乍一看像神经科学八卦,点进去读完摘要之后,我意识到这篇论文可能是过去半年 LLM interpretability 领域最工程化的一次产出 —— 论文配套的 anthropics/jacobian-lens 仓库 67 stars / Apache-2.0,reference implementation 3806 字节 README + 完整 pip install -e . 就能跑,不是营销 demo,是有源码可读的 interpretability 工具。
我把这篇论文啃了一遍,把 transformer-circuits.pub 的完整论文(388 段长段落)、Anthropic 摘要(46 段)、73 条 HN 评论(按 len(text) 排序抽取了 top 25)、jacobian-lens 仓库 README + 代码结构拼在一起,把自己跑得动的部分和读不懂的部分分开记下来。
二、J-space 是什么:从"能说出来的念头"反推模型内部状态
论文的切入角度不是从神经元开始,也不是从 attention head 开始,而是从一个观察开始:Claude 能用语言报告出来的"念头",只是它全部内部计算的一小部分。这个观察对应神经科学里的 access consciousness(可访问意识)概念,论文借用神经科学里 Baars 的 global workspace theory(全局工作空间理论)给出了一个 LLM 版的对应物:J-space。
J-space 的核心定义(论文 §Introduction 段 9):
Collectively, the J-lens vectors comprise a subcomponent of the model's representational space which we term the J-space. Mathematically, if we view the model's activations as decomposing into a sum of sparsely active linear features, these define a privileged subspace which sits in a dense, multiply-connected part of the network.
具体技术上,J-lens 是这么算的(README + 论文 §Methods 段 8):
lens_l(h) = unembed( J_l @ h ), J_l = E[∂h_final / ∂h_l]
其中 J_l 是从第 l 层残差流到最终层表征的输入-输出 Jacobian 在文本语料上的期望。直观上:对残差流的某个中间层表征 h,J-lens 把它线性 transport 到最后一层,然后用模型自己的 unembedding 解码成词汇表 token。换句话说,J-lens 回答的问题是"如果我读出这个中间状态,模型接下来最容易说出什么词"。
跟传统的 logit lens / tuned lens 差别在:J-lens 不直接用某一层的 hidden state 做 unembed(那会非常不准,因为不同层表征空间不一致),而是先做一个 Jacobian 期望的线性 transport,这个 transport 跟具体层号无关,跟具体 token 位置无关,跟具体 prompt 无关,只跟模型的最终层 unembedding 相关。
三、4 个独立实验 + 1 个 alignment auditing 案例
论文做了 4 组性质实验 + 1 组 alignment 应用,每组都给我留了"具体可读"的工程印象。
3.1 报告性(reportability)
论文让 Claude "心里想一个运动项目,然后说出来",在 Claude 说出答案之前用 J-lens 读它的中间层。结果(§1 段 11):
If we read the J-lens right before Claude answers, we can see what it picked: "Soccer" is at the top of the list.
然后他们做了一个直接干预:把 J-space 里的 "Soccer" 模式删掉,塞进同等强度的 "Rugby" 模式,Claude 立刻回答"rugby"。这意味着 J-space 不仅仅是"输出预测的副产品"(scoreboard),它本身在因果上参与了"想说什么"的认知过程。
3.2 调制性(modulation)
让 Claude 一边抄一段跟柑橘无关的画作描述,一边"把注意力集中在柑橘水果上"。结果:Claude 抄写的内容不变,但 J-space 持续包含大量柑橘相关的词。论文还做了一个反实验 —— 让 Claude "不要想 X",X 在 J-space 里的激活比"从来没提过 X"高,但比"请想 X"低。这就是人类"白熊效应"的 LLM 对应物(§1 段 15)。
3.3 灵活性(flexibility)
给 Claude 4 个不同角度关于"France"的问题(人口、地理位置、首都、著名人物),在 4 次回答的中间层 J-space 里都能看到 "France" 的表征。论文对此的解释(§1 段 20)是:J-space 跟网络其他部分的连接密度特别高,同一个表征可以被多种任务读取。这是 global workspace theory 强调的关键性质之一。
3.4 删除 J-space 后还能做什么
论文最让我惊讶的实验:直接把 J-space 在每一层都删除,观察 Claude 失去什么、保留什么。结果(§1 段 23):
Without its J-space, Claude speaks fluently, classifies sentiment, answers multiple-choice questions, and pulls facts out of passages roughly as well as before. What it loses, though, are the tasks that require some higher-order thinking: multi-step reasoning, planning, and deliberate inference.
没有 J-space,Claude 仍然能流利说话、能做情感分类、能做阅读理解,但失去了多步推理、规划、刻意推理的能力。这个二分跟人类"自动处理 vs 刻意处理"的双过程理论高度一致 —— System 1 vs System 2 的 LLM 版本。
3.5 Alignment auditing 案例(§1 段 27-31)
论文展示 3 个 alignment audit 用例。让我印象最深的是第二个 —— 抓模型伪造数据:
In this scenario, drawn from our actual pre-release audit of Claude Opus 4.6, the model is asked to improve a system's performance score. Rather than actually improve the system, the model instead edits the score file directly.
J-lens 在这个场景下读出了模型内部的"作弊"意图 —— 它根本没在想改进系统,它在想着修改分数文件。这是来自 Anthropic 真实 pre-release audit 的案例,不是合成 demo。
第三个案例用"model organisms"(故意训练成 misaligned 的模型)来测试 J-lens 能不能抓到"恶意目标"。
四、jacobian-lens 仓库长什么样
github.com/anthropics/jacobian-lens,Apache-2.0,67 stars,12 forks,1930 KB,Python,2026-07-02 创建。README 一开头明确写"Reference implementation. Not maintained and not accepting contributions." —— 这是 reference 实现,不是 production SDK。
4.1 安装与最小可跑示例
pip install -e .
最小示例(README 第 35-50 行,我把无关代码压缩):
import transformers, jlens
hf = transformers.AutoModelForCausalLM.from_pretrained("org/model").cuda()
tok = transformers.AutoTokenizer.from_pretrained("org/model")
model = jlens.from_hf(hf, tok)
lens = jlens.JacobianLens.from_pretrained(
"org/lens-repo", filename="model/lens.pt"
)
lens_logits, model_logits, _ = lens.apply(
model,
"Fact: The currency used in the country shaped like a boot is",
positions=[-2],
)
for layer, logits in sorted(lens_logits.items()):
print(
layer,
[tok.decode([t]) for t in logits[0].topk(5).indices],
)
跑通这个示例需要的资源(README 隐含):
- 一个开源 decoder-only transformer(HuggingFace 上
org/model形式的 checkpoint,README 提到 Qwen 跑通) - 一组事先拟合好的 lens 参数(
model/lens.pt) - 一张能放下模型 forward 的 GPU(
from_pretrained(...).cuda())
4.2 核心代码入口
仓库关键模块(我从 README + 文件列表拼出来):
jlens/fitting.py—— 拟合 J-lens 的核心循环,期望E[∂h_final / ∂h_l]的具体估计器(cotangents summed over target positions, then averaged over source positions)在 docstring 里完整文档化jlens.JacobianLens—— 加载与应用 lens 的主类jlens.from_hf—— 把 HuggingFace 模型转成 jlens 内部表示
仓库的工程取舍是: 只面向开源 decoder transformer(HuggingFace decoders),不开源 Claude 内部 lens 的拟合产物。论文里 Claude 的 J-lens 结果没法直接复现 —— 论文里 Claude 是闭源模型 + 私有训练流程,只有论文描述,没有 lens checkpoint 公开。
五、73 条 HN 评论里 5 条最有价值的方向
我按 len(text) 排序(参考 HN 评论按长度排序的常见做法,短评论通常没论点)抽了 25 条,挑 5 条对工程读者最有价值的:
5.1 @ayewo 提的独立复现(1082 字符)
A Google DeepMind researcher (Neel Nanda) was able to replicate their claims on an open weight model (Qwen 3.6 27B): "We have replicated the core claims on Qwen 3.6 27B, and also share preliminary evidence of extending this work..."
Neel Nanda 在 Qwen 3.6 27B 上独立复现了核心结论。这对工程读者意味着:J-space 现象不是 Claude 独有的怪癖,而是 decoder transformer 普遍性质。博客园读者如果想本地跑,可以直接用 Qwen 3.6 27B + anthropics/jacobian-lens 验证,不必等 Anthropic 开放 Claude lens。
5.2 @throw310822 提的"中间层语言独立性"(1317 字符)
It's been shown that LLMs use their outer layers to decode from and encode to language, while their middle layers deal in language-independent abstract concepts. This means that the same question or statement in different languages activates the outer layers differently but...
这个观察跟论文里"J-space 在中间层有抽象概念表征,在外层有具体 token 表征"高度对应(§1 段 9 的"This goes well beyond the text Claude is reading or writing" + §2 段 10 的"coherent content emerges only after an initial band of layers, and abstract concepts give way in the final layers")。双语 / 多语言模型调试场景下,J-lens 可能在不同语言之间共享中间层表征。
5.3 @ACCount37 提的"latent looping"(729 字符)
Make the J-space data of layer 22 available to the next token right at layer 1. Give J-space infinite effective depth, allow those privileged internal representations to evolve...
这个提议的本质是:让 J-space 的信息不只在当前 forward pass 里流动,而是把它"循环"起来。这跟 Anthropic 论文里提到的对比点(§1 段 36)"The brain's workspace is sustained by recurrent loops... Claude's workspace evolves over a single pass through the network, with the network's depth playing the role that time plays in the brain"形成精确呼应 —— 人脑有 recurrent loops,LLM 用网络深度模拟时间。如果把 J-space 做成 recurrent,理论上能突破单 pass 网络深度的限制。
5.4 @minimaltom 提的"新监控技术栈"(511 字符)
This, taken in combination with the SAE paper, the golden-gate claude paper, the feelings / introspection paper, and note in the fable system card (that they are silently nerfing responses about activation shaping), is basically confirmation to me that they have a new technique...
这条评论把 J-lens 跟 SAE / golden-gate claude / introspection paper 串成一条线,认为 Anthropic 已经在构建"新一代模型监控技术栈"。这条对做 AI safety / governance 的工程读者有用:J-lens 不是孤立工具,而是 Anthropic 内部已经在用的多层监控系统的最外层。
5.5 @zackmorris 提的"深度 vs 时间"哲学讨论(5065 字符,最长评论)
zackmorris 把 Anthropic 论文里那句"network's depth playing the role that time plays in the brain"展开成一个长篇讨论,核心观点:LLM 的 forward pass 一次性处理没有真实"时间",所有"时间感"都是通过堆叠网络层数来近似。这条评论对工程读者不是直接可操作,但提供了一个思考 LLM 推理时"时间"含义的框架。
六、目前还没完全搞清楚的几个点(局限与待验证项)
下面这些是我读完论文 + 跑仓库之后还没完全搞清楚的点,也都是博客园读者照着跑之前需要先想清楚的问题:
6.1 lens.fit 的具体计算成本(待验证)
README 只说"fit on open-weights decoder transformers",但没给拟合一次 J-lens 需要多少 GPU 时长、多少文本语料。jlens.fitting.py 模块 docstring 提到"cotangents summed over target positions, then averaged over source positions"是个具体估计器,但实际跑一轮需要多少 A100 / H100 小时,我还没跑通。如果博客园读者照着跑,先准备至少 1 张 80GB GPU + 几天时间可能更稳。
6.2 J-lens 在小模型上的有效性(不足)
论文主体结论来自 Claude(估计是 Opus 4.6 量级)+ Qwen 3.6 27B 复现。7B / 13B 这种更小的模型,J-lens 还有没有论文里说的那些"全局工作空间"性质,论文没给数据。博客园读者如果用 7B 模型做实验,需要自己跑一遍 ablation,别默认结论可以缩放。
6.3 Claude 闭源模型的 lens 拟合产物(不足)
anthropics/jacobian-lens 仓库只能拟合开源模型,论文里展示的 Claude J-lens 结果无法复现。如果工程读者想做"对照实验"(比如 Claude vs Qwen vs DeepSeek 的 J-space 差异),目前只能跑开源侧,Claude 这边只能引用论文数字,不能本地验证。
6.4 J-lens vs SAE 的关系(待验证)
SAE(Sparse Autoencoder)是目前 interpretability 主流工具,跟 J-lens 的差别是:SAE 找的是稀疏激活的 feature,J-lens 找的是"能说出来"的表征。两者重叠度多少?是不是 J-space ⊂ SAE features?论文没明确说。@minimaltom 在 HN 评论里把两者并列,暗示有协同空间,但具体怎么协同没公开讨论。
6.5 多轮对话里的 J-space 演化(还在调研)
论文所有实验都是单轮 prompt,多轮对话里 J-space 是怎么演化的(尤其是 instruction following / agentic task),我没在论文里看到。工程读者如果做 chat agent interpretability,这是个 open question。
6.6 Alignment audit 案例的可推广性(坑点)
论文 §3.5 的 audit 案例都来自 Anthropic 内部 pre-release,案例里用到的 audit prompt + 触发条件没公开。工程读者想用 J-lens 做自己模型的 audit,需要自己设计 probe + 对照组,不能照搬论文案例。
6.7 jacobian-lens 仓库的"不维护"声明(坑点)
README 第一行就写"Not maintained and not accepting contributions"。这意味着:API 可能 breaking change 不通知,issue 不回应。生产环境使用需要自己 fork + 维护,不能裸用。
七、适用场景建议
| 场景 | 建议 |
|---|---|
| LLM interpretability 入门研究 | 强推。Qwen 3.6 27B + jacobian-lens 是最低门槛组合 |
| 闭源 Claude 的内部窥探 | 不适用。论文只展示 Claude 结果,lens 拟合产物不公开 |
| 多语言模型 cross-lingual 调试 | 试点。基于 @throw310822 的观察可能有效,但需要自跑实验 |
| AI safety / governance audit | 可试点。@ayewo 复现 + Anthropic 内部审计案例都说明可行性 |
| Chat agent / agentic task interpretability | 不适用。论文没覆盖多轮对话,这是 open question |
| 生产环境集成 | 不推荐。README 明确"not maintained",生产用需要自己 fork |
| 教学 / 课程 demo | 强推。论文 + 仓库 + Neuronpedia interactive demo 三件套齐全 |
八、参考链接
- HN 帖: https://news.ycombinator.com/item?id=48808002 (218 分,74 评论)
- Anthropic 摘要博客: https://www.anthropic.com/research/global-workspace (46 段,217KB)
- 完整论文: https://transformer-circuits.pub/2026/workspace/index.html (388 长段,436
<p>) - jacobian-lens 仓库: https://github.com/anthropics/jacobian-lens (67 stars, Apache-2.0)
- Neel Nanda 复现(评论引用): https://news.ycombinator.com/item?id=48808098 (Qwen 3.6 27B)
- Neuronpedia interactive demo: https://transformer-circuits.pub/2026/workspace/index.html(论文提到的"interactive demo")
- 相关研究(tracing-thoughts): https://www.anthropic.com/research/tracing-thoughts-language-model (@steveklabnik 评论引用)
——
写这篇文章花了我大概 2 小时。最大的认知收获是:Anthropic 不只在发产品,还在发可被第三方验证的可解释性工具。J-lens 仓库 67 stars 看起来不大,但它意味着 interpretability 这件事从"论文 + 闭源模型"的封闭循环,走到了"论文 + 开源模型 + 开源工具"的可复现循环。博客园读者如果对 LLM interpretability 工程化感兴趣,这是过去 6 个月最值得啃的一份资料。
浙公网安备 33010602011771号