embedding-anisotropy-check
Skill by github
Checks cosine similarities over embeddings or hidden states before they are reported. It measures each side's anisotropy, centres by the population mean, and scores matched pairs against a permuted floor for AI agents and researchers.
Install embedding-anisotropy-check
Built from the published package, never by AI.
git clone --depth 1 https://github.com/github/awesome-copilot /tmp/awesome-copilot && mkdir -p ~/.claude/skills && cp -r /tmp/awesome-copilot/skills/embedding-anisotropy-check ~/.claude/skills/embedding-anisotropy-checkRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install embedding-anisotropy-check in Claude Code
git clone --depth 1 https://github.com/github/awesome-copilot /tmp/awesome-copilot && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/awesome-copilot/skills/embedding-anisotropy-check ~/.gemini/antigravity-cli/skills/embedding-anisotropy-checkAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install embedding-anisotropy-check in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This agent skill checks cosine similarities computed over embeddings or transformer hidden states before an agent reports them. It measures the anisotropy of each side, centres both sides by a population mean, and scores matched pairs against a floor of permuted unrelated pairs taken from the same comparison. The bundled script, scripts/anisotropy_check.py, reports the raw and centred floors, the gap over floor standard deviation, and whether the matched partner ranks first.
It is aimed at agents comparing one model's embeddings across precisions, runtimes or layers, evaluating retrieval, probes or adapters, or writing claims that a similarity is high, that two conditions agree, or that a small difference is a null. It needs Python 3.9 or later with numpy. The skill says it does not apply directly to two independently trained models without an explicit map, such as orthogonal Procrustes.
Written from the project's SKILL.md and checked against it.
What it can do
- Anisotropy measurementMeasures the mean cosine between different rows of one side to show how much they share a common direction.
- Population-mean centringCentres each side by a mean, fitted from a train split or from the compared rows.
- Permuted floor scoringScores matched pairs against the cosine of unrelated pairs from the same comparison.
- Gap and effect size reportingReports gap over floor standard deviation and Cohen's d to show whether matched pairs separate from unrelated ones.
- Retrieval ranking checkReports how often the matched partner ranks first, against its chance rate of 1/n.
- Cross-model guidanceAdvises fitting an explicit map, such as orthogonal Procrustes, before comparing two independently trained models.
What you need
- Python 3.9 or later
- numpy
Try asking
- Check whether my 4-bit export's embeddings still match the bf16 ones before I report the score
- Run the anisotropy check on these two layers' hidden states and show the floor
- Before I write up this retrieval result, report the cosine floor beside the matched score
Good to know
- Does not apply to two independently trained models as they stand without an explicit map.
- A mean fitted on a different domain can mis-centre the rows.
- An underpowered comparison is not a refutation.
- Centring changes the scoring function and does not replace evaluating an index that searches by raw cosine.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/embedding-anisotropy-check/SKILL.md, skills/embedding-anisotropy-check/scripts/anisotropy_check.py, skills/embedding-anisotropy-check/scripts/example_scifact_halves.py. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md7 KB -
scripts/anisotropy_check.py7 KB -
scripts/example_scifact_halves.py2 KB
Alternatives to embedding-anisotropy-check
All alternatives →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
Compare with agent-reproduce-align, google_contacts or m06-error-handling
embedding-anisotropy-check: common questions
Why check a cosine similarity against a floor?
The source says raw cosine between embeddings is rarely centred on zero, so unrelated inputs can score high. A matched cosine only means something through its distance from the floor of unrelated pairs.
What does the anisotropy value tell me?
It is the mean cosine between different rows of one side, which measures how much the rows share one common direction. A value near 0 does not mean raw cosine can be read without its floor.
Can I compare embeddings from two different models with this skill?
Not as they stand. The source says a rotation of one model's space changes every cosine against the other, so it recommends fitting an explicit map first or comparing each model's own within-space similarities.
How do I install embedding-anisotropy-check?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is embedding-anisotropy-check free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is embedding-anisotropy-check safe to use?
It scores 93 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to embedding-anisotropy-check?
Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.
