Demystifying Anthropic's J-Space: A Mathematical Primer
Demystifying Anthropic’s J-Space: A Mathematical Primer
解密 Anthropic 的 J-Space:数学入门指南
In Verbalizable Representations Form a Global Workspace in Language Models, Anthropic researchers introduce the J-space — an LLM analogue (demonstrated on Claude Opus 4.6) to the global workspace in the human cortex, the neural circuit hypothesized to underpin access consciousness. The authors present extensive empirical evidence validating this connection and demonstrate the utility of the J-space as an auditing tool for LLM alignment. 在《可言说表征构成了语言模型中的全局工作空间》(Verbalizable Representations Form a Global Workspace in Language Models)一文中,Anthropic 的研究人员引入了 J-space——这是人类大脑皮层中“全局工作空间”(被认为是支撑“访问意识”的神经回路)在大型语言模型(LLM)中的对应物(在 Claude Opus 4.6 上进行了演示)。作者提供了大量的实证证据来验证这种联系,并展示了 J-space 作为 LLM 对齐审计工具的实用性。
Our goal in this brief article is not to contribute to that broader conceptual debate. Instead, more modestly, we re-examine the formal definition and mathematical properties of the J-space and provide precise justifications for the surgical interventions performed by Anthropic. Because the original paper’s concise style can leave key mechanics implicit, we aim to provide a clear, step-by-step account for readers who value clear definitions and explicit derivations—delivered directly through an applied mathematics lens, without unnecessary jargon. 本文的目的并非参与更广泛的概念性辩论。相反,我们更谦逊地重新审视 J-space 的形式定义和数学属性,并为 Anthropic 所执行的“手术式”干预提供精确的论证。由于原论文风格简洁,可能会使关键机制变得隐晦,因此我们旨在为那些重视清晰定义和显式推导的读者提供一个清晰的、循序渐进的说明——通过应用数学的视角直接呈现,且不包含不必要的术语。
J-space as a Union of Cones
作为锥体并集的 J-space
To keep this article self-contained, we first recall the basic definitions. The semantic representation of a token at position $t$ in layer $\ell$ within the residual stream of a Transformer: 为了使本文内容自洽,我们首先回顾基本定义。Transformer 残差流中第 $\ell$ 层位置 $t$ 处 token 的语义表征为:
We then define the average causal impact of a variation in this representation on the final layer $L$ of the Transformer as an expectation over a set of prompts $p$, across all token positions $t$, and over all future context positions $t’$: 随后,我们将该表征的变化对 Transformer 最终层 $L$ 的平均因果影响定义为:在提示词集 $p$、所有 token 位置 $t$ 以及所有未来上下文位置 $t’$ 上的期望:
Converting this impact to logit scores is achieved by multiplying on the left by the unembedding matrix. The rows of the resulting matrix are by definition the J-lens vectors (omitting the normalization step for simplicity): 通过左乘反嵌入矩阵(unembedding matrix),可以将这种影响转换为 Logit 分数。所得矩阵的行向量即为 J-lens 向量(为简化起见,省略了归一化步骤):
Thus, there are as many J-lens vectors as there are tokens in the LLM’s vocabulary, this for each layer $\ell$ (we drop the index $\ell$ hereafter to avoid clutter). Because these J-lens vectors form an overcomplete frame in the representation space. 因此,每一层 $\ell$ 都有与 LLM 词汇表中 token 数量相等的 J-lens 向量(为避免冗余,下文省略索引 $\ell$)。因为这些 J-lens 向量在表征空间中构成了一个过完备框架(overcomplete frame)。
The average impact of a representation in layer $\ell$ on the Transformer’s propensity to output token $i$ at step $t$ is simply given by the inner product: 第 $\ell$ 层表征对 Transformer 在步骤 $t$ 输出 token $i$ 的倾向性的平均影响,简单地由内积给出:
As a side note, assuming these vectors are distributed approximately uniformly on the sphere, a classical result from high-dimensional geometry (Lévy’s concentration of measure on the sphere) guarantees that pair-wise inner products between distinct vectors are close to zero on average except for semantically related vectors (such as “king” and “emperor” for instance). For a standard model dimension of 4096, this inner product is on the order of 0.015. 顺便提一下,假设这些向量在球面上近似均匀分布,高维几何中的一个经典结果(Lévy 在球面上的测度集中定理)保证了不同向量之间的两两内积平均接近于零,除非是语义相关的向量(例如“国王”和“皇帝”)。对于 4096 的标准模型维度,该内积的数量级约为 0.015。
The J-space itself is then formally defined as the set of $k$-sparse linear combinations of J-lens vectors with non-negative coefficients. More precisely, for any subset of indices, we define the cone: J-space 本身被正式定义为 J-lens 向量的 $k$-稀疏线性组合集合,且系数为非负。更准确地说,对于任何索引子集,我们定义锥体:
Finally, the J-space is defined as the set of all points expressible as a $k$-sparse non-negative combination of J-lens vectors. Geometrically, it corresponds to the union of all such cones: which is a union of cones, rather than a linear subspace. 最后,J-space 被定义为所有可表示为 J-lens 向量的 $k$-稀疏非负组合的点集。在几何上,它对应于所有此类锥体的并集:这是一个锥体的并集,而不是线性子空间。
Verbalizable and Non-Verbalizable Components
可言说与不可言说分量
The verbalizable component of a representation is defined as its orthogonal projection onto the J-space—or, framed differently, as an approximate $k$-sparse expansion over the J-lens vectors: 表征的“可言说分量”被定义为其在 J-space 上的正交投影——或者换句话说,作为在 J-lens 向量上的近似 $k$-稀疏展开:
The sparsity constraint selects J-lens vectors in this sum that are approximately orthogonal and thus semantically distant. Since inner products between such vectors are near zero, the only tokens receiving high scores in (4) belong to semantic clusters close to the $k$ J-lens vectors in the decomposition. 稀疏性约束在求和中选择了近似正交且语义距离较远的 J-lens 向量。由于这些向量之间的内积接近于零,因此在 (4) 中获得高分的唯一 token 属于分解中接近那 $k$ 个 J-lens 向量的语义簇。
The non-verbalizable component of a representation is simply the residual of this projection: 表征的“不可言说分量”仅仅是该投影的残差:
Standard results in convex optimization establish that the residual of a projection onto a closed convex cone is orthogonal to the projection itself. Consequently, the inner product is identically zero—a property that will prove useful in the next section. 凸优化中的标准结果表明,在闭凸锥上的投影残差与投影本身正交。因此,内积恒为零——这一属性在下一节中将非常有用。
Defining J-Space Capacity and Selecting the Sparsity $k$
定义 J-Space 容量与选择稀疏度 $k$
A key question is how to select the sparsity parameter $k$ in (8). To address this, we introduce the fraction of variance explained (FVE) by the projection onto the J-space: 一个关键问题是如何选择 (8) 中的稀疏参数 $k$。为了解决这个问题,我们引入了投影到 J-space 上所解释的方差比例(FVE):
where the expectation is on prompts $p$ and positions $t$. The second equality follows from the orthogonality relation (10). To isolate signal from noise—given that $k$ random vectors would naturally account for a fraction of the variance—we consider the excess variance explained by $k$ J-lens vectors, defined as: 其中期望是在提示词 $p$ 和位置 $t$ 上计算的。第二个等式源于正交关系 (10)。为了将信号与噪声分离——考虑到 $k$ 个随机向量自然会解释一部分方差——我们考虑由 $k$ 个 J-lens 向量解释的超额方差(excess variance),定义为:
where the second term in (12) is defined identically to the first, but replaces the $k$ J-lens vectors with $k$ randomly selected vectors. Empirically, this excess variance plateaus beyond $k = 25$. The interpretation is that $k \approx 25$ represents a natural elbow: up to this threshold, projecting onto the J-space captures significantly more information than projecting onto an equivalent number of random vectors, after which excess variance plateaus. 其中 (12) 中的第二项定义与第一项相同,但将 $k$ 个 J-lens 向量替换为 $k$ 个随机选择的向量。经验表明,当 $k > 25$ 时,这种超额方差趋于平稳。其解释是 $k \approx 25$ 代表了一个自然的“肘点”:在此阈值之前,投影到 J-space 所捕获的信息量明显多于投影到等量随机向量的信息量,此后超额方差趋于平稳。
Numerically, this excess variance is roughly 10%, which is instructive to compare against the variance explained by 25 random vectors. For $d = 4096$ and $k = 25$, the expected fraction of variance explained by random vectors would be on the order of $25 / 4096 < 1%$ assuming the components are independent. This stark imbalance confirms the hypothesis that verbalizable representations lie substantially within a very low-dimensional manifold ($25 \ll 4096$). 从数值上看,这种超额方差大约为 10%,将其与 25 个随机向量解释的方差进行比较具有启发意义。对于 $d = 4096$ 和 $k = 25$,假设各分量独立,随机向量解释的预期方差比例约为 $25 / 4096 < 1%$。这种巨大的不平衡证实了以下假设:可言说表征实质上位于一个非常低维的流形内($25 \ll 4096$)。
A note on computational complexity: Computing the exact projection in (9) onto the J-space requires solving a non-negative sparse coding problem, which is NP-hard in general. This exact calculation is likely only necessary when evaluating the FVE in (11), which is then performed offline. Using an approximate method—such as the regression heuristic discussed below—would cause correlated J-lens vectors to double-count the variance. 关于计算复杂度的说明:计算 (9) 中在 J-space 上的精确投影需要解决一个非负稀疏编码问题,这在一般情况下是 NP-hard 的。这种精确计算可能仅在评估 (11) 中的 FVE 时是必要的,且通常离线执行。使用近似方法(例如下文讨论的回归启发式方法)会导致相关的 J-lens 向量对方差进行重复计算。
Interventions in J-Space
J-Space 中的干预
To define interventions on J-space representations that are computationally tractable in practice, Anthropic researchers rely on a simple linear regression framework, avoiding the NP-hard exact projection onto the J-space. Let us examine this in detail. The practical objective of an intervention… 为了定义在实践中计算上可行的 J-space 表征干预,Anthropic 的研究人员依赖于简单的线性回归框架,从而避免了在 J-space 上进行 NP-hard 的精确投影。让我们详细探讨这一点。干预的实际目标是……