Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

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.

  • Score 93
  • 42k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

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-check

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install embedding-anisotropy-check in Claude Code

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

A

No 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 →

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.

embedding-anisotropy-check Install

Add to stack

Loading.