# Engineering Specification for Jacobian-Transported ISS ## 0. Purpose This document specifies how to implement the official Internal State Stability metric, abbreviated as ISS, using Jacobian-transported hidden states. The formal metric remains: \[ z^\ell_{m,f,q}=J^\ell_m h^\ell_{m,f,q}, \] where no vocabulary unembedding matrix is applied. The implementation may approximate \(J^\ell_m\), but the approximation must be independently validated and its numerical error must be reported. Raw-ISS is retained only for debugging and ablation. It is not the official metric. --- # 1. Official Definition For model \(m\), fact \(f\), query \(q\), and source layer \(\ell\), extract the query-end residual state: \[ h^\ell_{m,f,q}\in\mathbb R^{d_m}. \] Define the corpus-averaged input-output Jacobian: \[ J^\ell_m = \mathbb E_{x\sim\mathcal C} \left[ \frac{\partial h^L_m(x)}{\partial h^\ell_m(x)} \right], \] where \(\mathcal C\) is an independent calibration corpus. The transported representation is: \[ \boxed{z^\ell_{m,f,q}=J^\ell_m h^\ell_{m,f,q}} \] Do **not** compute: \[ W_UJ^\ell_m h^\ell_{m,f,q}. \] The official ISS therefore operates in the final-layer residual basis rather than vocabulary-logit space. --- # 2. Formal Metric Versus Practical Estimator The formal metric uses the exact population average \(J^\ell_m\). The practical implementation uses a finite-corpus, finite-rank estimator: \[ \widehat J^{\ell,(n,k)}_m. \] The practical transported state is: \[ \widehat z^\ell_{m,f,q} = \widehat J^{\ell,(n,k)}_m h^\ell_{m,f,q}. \] The paper should distinguish: - \(\operatorname{ISS}\): the formal metric; - \(\widehat{\operatorname{ISS}}_{n,k}\): the empirical estimator. The approximation is acceptable only if it satisfies the validation criteria below. --- # 3. Why Full Jacobians Are Not the General Solution For hidden dimension \(d\): \[ J^\ell_m\in\mathbb R^{d\times d}. \] Materializing this matrix is feasible only for small models. For large models with \(d=4096\), \(5120\), or more, exact recovery across many layers and calibration prompts is prohibitively expensive. Therefore: 1. full Jacobians are used only for small-model calibration; 2. large models use a randomized factorized estimator; 3. approximation quality must be validated for every model rather than inferred from a small model. --- # 4. Overall Engineering Pipeline ```text Stage A: Full-matrix calibration on a small model | v Stage B: Per-model approximation validation | v Stage C: Freeze estimator settings | v Stage D: Official ISS evaluation ``` The final test set must not be used to choose estimator hyperparameters. --- # 5. Stage A: Small-Model Full-Matrix Calibration Use Qwen2.5-0.5B as the primary exact-reference model. ## 5.1 Exact finite-corpus reference For a fixed calibration corpus of \(n\) prompts, compute: \[ J^{\ell,(n)}_{\mathrm{full}} = \frac{1}{n} \sum_{i=1}^{n}J^\ell_{x_i}. \] This is an exact empirical Jacobian for that finite corpus. Do not call it the exact population Jacobian or universal ground truth. Use one of the following terms: - full empirical Jacobian reference; - exact finite-corpus Jacobian. ## 5.2 Layer coverage At minimum, compute full references for: - one early layer; - one middle layer; - one late layer. If feasible on Qwen2.5-0.5B, compute every layer. ## 5.3 Candidate ranks Evaluate: \[ k\in\{32,64,128,256,512,768\}, \] subject to \(k