Aquin LogoAquinLabs
Login

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.

Prerequisiteaquin login · aquin load model gte-small (or all-minilm-l6, bge-small-en)

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.

FlagDescription
--text*Primary text.
--ref_textReference for drift overlay.
--textsJSON array for isotropy / space analysis.
--in_texts / --ood_textsIn-distribution and OOD sets.
--paraphrasesParaphrases for consistency scoring.
--checkSave layer-analysis-check.json and layer-analysis-check.png in the current directory.
example

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.

FlagDescription
--text*Input text.
--checkSave attention-check.json and attention-check.png in the current directory.
example

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.

FlagDescription
--texts*JSON array of strings.
--checkSave matrix-check.json and matrix-check.png in the current directory.
example

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.

FlagDescription
--texts*JSON array of strings.
--checkSave space-check.json and space-check.png in the current directory.
example

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.

FlagDescription
--text*Input text.
--checkSave attribution-check.json and attribution-check.png in the current directory.
example

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.

FlagDescription
--text*Input text.
--checkSave perturbation-check.json and perturbation-check.png in the current directory.
example

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.

FlagDescription
--querySingle query string.
--corpusJSON array of document strings.
--checkSave retrieval-check.json and retrieval-check.png in the current directory.
example