인터페이스는 현지화되어 있으며, Skill 소개와 설명 문서는 선택한 언어로 AI가 자동 번역합니다. 코드·명령어·경로·전문 용어는 원문을 유지하며 원작자 문서가 우선합니다.
Skills 둘러보기
생산성 및 협업 · SKILL.md

qk_ov_circuit_expansion

qk_ov_circuit_expansion

Expand attention-head QK and OV weights into token-level circuit matrices and copying diagnostics.

Independent GitHub snapshot · Automated classification · Original documentation governs

Skill 문서

GitHub

name: qk_ov_circuit_expansion description: Expand attention-head QK and OV weights into token-level circuit matrices and copying diagnostics.

QK and OV Circuit Expansion

Use this skill when analyzing an attention head as separable query-key and output-value circuits. It is designed for mechanistic interpretability of attention-only or attention-isolated transformer components. Do not use its copying score as definitive proof by itself; pair it with behavioral tests or ablations.

Inputs

  • embedding: vocabulary-by-model matrix.
  • unembedding: model-by-vocabulary matrix.
  • w_qk: model-by-model combined query-key matrix, or already-combined equivalent.
  • w_ov: model-by-model combined output-value matrix.

The included script uses row-vector convention and computes embedding @ w_qk @ embedding.T and embedding @ w_ov @ unembedding.

Outputs

  • Expanded QK token-score circuit.
  • Expanded OV token-to-logit circuit.
  • Diagnostics such as diagonal mean, off-diagonal mean, diagonal dominance, and positive-real-eigenvalue fraction for two-by-two matrices.

Workflow

  1. Validate matrix compatibility.
  2. Multiply out QK and OV circuits through token embeddings and unembeddings.
  3. Summarize whether the OV matrix preferentially copies matching token identities.
  4. Use the expanded matrices as inputs to skip-trigram, induction-head, or path-expansion analysis.

Validation

Run the tests or the Paper2Skills skill-tree validator with --run-tests.

Limitations

The script intentionally avoids heavy numerical dependencies. Eigenvalue diagnostics are exact only for one-by-one and two-by-two examples; larger matrices still get diagonal dominance summaries.

저장한 Skills