Inspection: Embedding (non-SAE)
Geometry and activation tools for encoder models: layer health, OOD separation, attention, and token attribution without sparse autoencoder decomposition. Requires embedding mode: load an embedding model first.
7 commands
aquin check layer
agent tool: run_embed_layer_analysis
Layer health in one pass: pooled-embedding drift across encoder layers (where representation shift concentrates), plus isotropy, OOD separation, and paraphrase consistency. Same command name as LLM mode; with an embedding model loaded this is the embed path.
| Flag | Description |
|---|---|
| --text* | Primary text. |
| --ref_text | Reference for drift overlay. |
| --texts | JSON array for isotropy / space analysis. |
| --in_texts / --ood_texts | In-distribution and OOD sets. |
| --paraphrases | Paraphrases for consistency scoring. |
| --check | Save layer-analysis-check.json and layer-analysis-check.png in the current directory. |
aquin check attention
agent tool: run_embed_attention
Extracts per-head attention matrices across all encoder layers for a single input. Same command as LLM mode; with an embedding model loaded this is the embed path. --text is required.
| Flag | Description |
|---|---|
| --text* | Input text. |
| --check | Save attention-check.json and attention-check.png in the current directory. |
aquin matrix
agent tool: run_embed_matrix
Encodes multiple texts and renders their N×N cosine similarity matrix. Useful for sanity-checking whether related sentences cluster and unrelated ones separate.
| Flag | Description |
|---|---|
| --texts* | JSON array of strings. |
| --check | Save matrix-check.json and matrix-check.png in the current directory. |
aquin space
agent tool: run_embed_space_analysis
Measures anisotropy (variance concentration along principal axes) and intrinsic dimensionality of the embedding cloud. High anisotropy indicates collapse onto a few directions.
| Flag | Description |
|---|---|
| --texts* | JSON array of strings. |
| --check | Save space-check.json and space-check.png in the current directory. |
aquin check attribution
agent tool: run_embed_attribution
Integrated gradients token attribution on the final embedding. Scores each input token by how much it contributes to the embedding vector, the embedding analogue of LLM token attribution.
| Flag | Description |
|---|---|
| --text* | Input text. |
| --check | Save attribution-check.json and attribution-check.png in the current directory. |
aquin check perturbation
agent tool: run_embed_perturbation
Perturbs individual tokens (mask, swap, delete) and measures cosine shift in the output embedding. Identifies tokens the representation is most sensitive to.
| Flag | Description |
|---|---|
| --text* | Input text. |
| --check | Save perturbation-check.json and perturbation-check.png in the current directory. |
aquin retrieval
agent tool: run_embed_retrieval
Encodes one query and a candidate corpus, then ranks every passage by cosine similarity. Returns each passage, score, and rank; it does not compute Recall@k/MRR without relevance labels.
| Flag | Description |
|---|---|
| --query | Single query string. |
| --corpus | JSON array of document strings. |
| --check | Save retrieval-check.json and retrieval-check.png in the current directory. |
