Embedding Anisotropy Check Skill for Cosine Similarity in Codex
Check whether matched embeddings score above unrelated pairs in the same vector space. Compare raw and centered cosines alongside a baseline estimated from the evaluated data.
中文Setup for Codex
Use Codex with Python 3.9 or later and NumPy. The input arrays must contain paired rows of the same dimension in a shared space.
- This Awesome Copilot skill can be adapted manually to Codex. Copy the pinned skills/embedding-anisotropy-check directory into the project's .agents/skills directory, keeping its files together.
- Use a Python environment with NumPy installed. Open the project in Codex and select $embedding-anisotropy-check.
Example task
Save the same four vectors [10, 1, 0], [10, -1, 0], [10, 0, 1], and [10, 0, -1] to a.npy and b.npy. Ask $embedding-anisotropy-check to compare matched rows using the bundled helper with --shared.Expected result
Matched rows have cosine 1.0. Unrelated scores are already near 1.0 before centering because the first coordinate dominates. Centering reveals a larger gap above the unrelated baseline.
Upstream documentation
Original SKILL.md on GitHub · MIT license · Source reviewed
Frequently asked question
Why compare matched cosine similarity with an unrelated-pair baseline?
A shared direction can raise cosine scores for unrelated embeddings. A baseline from the same comparison shows how much the matched score separates from unrelated scores.