{"type":"thread.started","thread_id":"id-42c2dd20"}
{"type":"item.completed","item":{"id":"item_0","type":"error","message":"Code Mode is unavailable because code-mode host is disabled. Code mode will fail closed; enable `features.code_mode_host` and install `codex-code-mode-host`."}}
{"type":"turn.started"}
{"type":"item.completed","item":{"id":"item_1","type":"agent_message","text":"```python\nimport numpy as np\nfrom scipy.linalg import svd, svdvals\nfrom threadpoolctl import threadpool_limits\nthreadpool_limits(4)\n\nfor name in [\"W_q.0\", \"W_k.0\", \"W_v.0\", \"W_fc.0\", \"W_proj.0\", \"W_proj.3\"]:\n    a = np.asarray(W[name], dtype=np.float64)\n    s = svdvals(a, check_finite=False)\n    print(name, \"first 48 singular values:\", np.round(s[:48], 4))\n    print(\"singular values 64,96,128,192,256,320,384:\",\n          np.round(s[np.array([64,96,128,192,256,320,384])-1],4))\n\nA, C, Q, K = {}, {}, {}, {}\nfor l in range(4):\n    g = np.asarray(W[f\"ln1_w.{l}\"],dtype=float)\n    for j in range(6):\n        sl = slice(j*64,(j+1)*64)\n        name = f\"L{l}H{j}\"\n        Q[name] = np.asarray(W[f\"W_q.{l}\"][sl],dtype=float)*g\n        K[name] = np.asarray(W[f\"W_k.{l}\"][sl],dtype=float)*g\n        A[name] = Q[name].T @ K[name] / 8\n        C[name] = np.asarray(W[f\"W_o.{l}\"][:,sl],dtype=float) @ (\n            np.asarray(W[f\"W_v.{l}\"][sl],dtype=float)*g)\n\nnames = list(A)\nprint(\"\\nL0 QK eigenvalues with greatest absolute value:\")\nfor n in names[:6]:\n    z = np.linalg.eigvals(A[n])\n    z = z[np.argsort(-np.abs(z))][:16]\n    print(n, np.round(z,4))\n\nprint(\"\\nL0 QK pairwise normalized Frobenius inner products:\")\nprint(np.round([[np.sum(A[a]*A[b])/np.linalg.norm(A[a])/np.linalg.norm(A[b])\n                 for b in names[:6]] for a in names[:6]],3))\nprint(\"\\nL1 QK pairwise normalized Frobenius inner products:\")\nprint(np.round([[np.sum(A[a]*A[b])/np.linalg.norm(A[a])/np.linalg.norm(A[b])\n                 for b in names[6:12]] for a in names[6:12]],3))\n\nprint(\"\\nEarlier-head output to later-head query/key weight composition.\")\nprint(\"Each entry: ||Q_l C_earlier||F/(||Q_l||F ||C_earlier||F), and analogous K; random-isotropic scale ~0.051.\")\nfor l in range(1,4):\n    earlier = [f\"L{a}H{b}\" for a in range(l) for b in range(6)]\n    print(\"earlier:\", \" \".join(earlier))\n    for j in range(6):\n        n = f\"L{l}H{j}\"\n        qc = [np.linalg.norm(Q[n]@C[e])/np.linalg.norm(Q[n])/np.linalg.norm(C[e]) for e in earlier]\n        kc = [np.linalg.norm(K[n]@C[e])/np.linalg.norm(K[n])/np.linalg.norm(C[e]) for e in earlier]\n        print(n, \"Q\", np.round(qc,3), \"K\", np.round(kc,3))\n\nprint(\"\\nLayer-0 effective input-weight joint spectrum:\")\nm = np.concatenate([W[f\"{name}.0\"]*W[\"ln1_w.0\"] for name in [\"W_q\",\"W_k\",\"W_v\"]])\nu,s,vt = svd(m,full_matrices=False,check_finite=False)\nprint(np.round(s[:80],4))\nprint(\"L0 ln1 gain quantiles:\",np.round(np.quantile(W[\"ln1_w.0\"],[0,.1,.25,.5,.75,.9,.95,1]),4))\nprint(\"\\nFinal projection column norms quantiles:\",\n      np.round(np.quantile(np.linalg.norm(W[\"W_proj.3\"],axis=0),[0,.1,.25,.5,.75,.9,1]),4))\n```\n"}}
{"type":"turn.completed","usage":{"input_tokens":16762,"cached_input_tokens":7680,"cache_write_input_tokens":0,"output_tokens":2695,"reasoning_output_tokens":1099}}
