You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds embedding-anisotropy-check, a skill for checking a cosine similarity over embeddings or transformer hidden states before it is reported.
Most encoders put every vector near one shared direction, so raw cosine is rarely centred on zero: bge-small-en-v1.5 scores an unrelated SciFact half-abstract at 0.60 against 0.86 for the matching half. A model asked to compare embeddings usually reports the raw cosine, and a raw 0.9 or a gap of 0.01 then reads as a result.
The bundled script (numpy only) takes paired rows and reports each side's anisotropy, raw and centred cosine for matched pairs, a permuted floor from the same comparison, and how often the partner ranks first. SKILL.md says when to run it and how to read and report the output; its worked example is reproducible from the first 100 documents of mteb/scifact.
npm run skill:validate passes and npm start regenerated docs/README.skills.md.
I wrote this skill; it comes from the measurement rules we use in our own embedding work at Sunstone North.
✓ [spec-compliance] All 1 skill(s) are spec-compliant.
ℹ️
✓ spec-compliance: All spec checks passed.
ℹ️
✓ [valid-refs] All file references across 1 skill(s) are valid.
ℹ️
✓ valid-refs: All file references resolve to existing files within the skill directory.
ℹ️
1 skill(s) linted, 1 passed
Full linter output
### Linting skills/embedding-anisotropy-check
✅ embedding-anisotropy-check (2/2 checks passed)
✓ [spec-compliance] All 1 skill(s) are spec-compliant.
✓ spec-compliance: All spec checks passed.
✓ [valid-refs] All file references across 1 skill(s) are valid.
✓ valid-refs: All file references resolve to existing files within the skill directory.
1 skill(s) linted, 1 passed
A mean from another domain does not necessarily under-correct: depending on its direction and magnitude, subtracting it can also over-correct or introduce a new direction. Describe this as mis-centring rather than asserting one failure mode.
This issue also appears on line 78 of the same file.
Clarify reporting rule for greatest bias
skills/embedding-anisotropy-check/SKILL.md:58
The phrase “and most where” is grammatically incomplete, which makes this reporting rule hard to parse. State that the bias is greatest when the gap is small relative to its noise.
For valid inputs whose unrelated-pair cosines have zero variance, compare intentionally returns None for gap_over_floor_sd, but this sentence renders that as None floor sd apart. This occurs, for example, with paired orthogonal basis vectors, and leaves users with a misleading interpretation instead of explaining that the standardized gap is undefined.
Avoid overstating mean cosine as a general anisotropy measure
skills/embedding-anisotropy-check/SKILL.md:49
This guidance overstates what the reported statistic establishes. The implementation's mean off-diagonal cosine is algebraically (||sum(u)||² - n) / (n(n-1)), so it detects a shared mean direction but not anisotropy generally: for example, a balanced cloud containing only +v and -v has a value approaching zero while remaining confined to one axis and producing raw cosines of ±1. A near-zero value therefore does not make raw cosine directly interpretable; users still need the floor and its spread.
Risk tier:merge-risk:high — Privileged execution, automation, or review-policy change Required to merge: passing submission-gate checks plus 2 approvals from reviewers with write access, including a maintainer with admin or maintain permission.
Why this tier
skills/embedding-anisotropy-check/scripts/anisotropy_check.py is a high-risk path (automation, scripts, MCP config, hooks, or review policy)
skills/embedding-anisotropy-check/scripts/example_scifact_halves.py is a high-risk path (automation, scripts, MCP config, hooks, or review policy)
The contributor check succeeded but its result artifact was missing, unreadable, or for another commit · logs
Action needed
🔧 Contributor risk signal hit an automation problem that is not caused by your contribution. Comment /rerun-checks to retry; maintainers are notified if it keeps failing.
Still needed: 2 more approval(s); an approval from a maintainer with admin or maintain permission
The core-maintainers pool is not staffed yet; an approver with admin or maintain permission is required instead.
Commands
Command
Who
What it does
/rerun-checks
PR author, maintainers
Re-runs failed or incomplete checks and re-evaluates this gate
/request-review
PR author, maintainers
Asks the review rotation to assign a reviewer (adds needs-reviewer)
Updated for 7ced8bc · This comment is maintained automatically — see submission gate docs.
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
embedding-anisotropy-check, a skill for checking a cosine similarity over embeddings or transformer hidden states before it is reported.Most encoders put every vector near one shared direction, so raw cosine is rarely centred on zero: bge-small-en-v1.5 scores an unrelated SciFact half-abstract at 0.60 against 0.86 for the matching half. A model asked to compare embeddings usually reports the raw cosine, and a raw 0.9 or a gap of 0.01 then reads as a result.
The bundled script (numpy only) takes paired rows and reports each side's anisotropy, raw and centred cosine for matched pairs, a permuted floor from the same comparison, and how often the partner ranks first. SKILL.md says when to run it and how to read and report the output; its worked example is reproducible from the first 100 documents of
mteb/scifact.npm run skill:validatepasses andnpm startregenerateddocs/README.skills.md.I wrote this skill; it comes from the measurement rules we use in our own embedding work at Sunstone North.