Measure anisotropy in an embedding space
CodingIntermediate⏱ 1 hourRAGanisotropywhiteningsimulationdiagnostics
Problem
Write a diagnostic for embedding anisotropy.
- Measure the mean and standard deviation of the cosine between random unrelated pairs and compare with the isotropic predictions and .
- Compute the spectrum of the embedding covariance and the stable rank .
- Apply mean-centring and whitening and re-measure.
- Report what each step does to the contrast between matched and unmatched pairs.
Implement it, then check the implementation against something you can verify independently.
Write it
Solve it here8 tests · Python runs in your browser
⌘/Ctrl + ↵ to run · limit 60s · draft saved in this browser
8 tests will run against your code. The first run downloads the Python runtime — several megabytes, once per browser.
Solution
Opening this before you have a real attempt on paper is the fastest way to feel like you understand something you cannot reproduce.
Related problems
All problems| Solved | Problem | Field | Type | Difficulty | Time |
|---|---|---|---|---|---|
| Three similarities agree on the unit sphere | RAG | Proof | 15 min | ||
| Simulate distance contrast run | Classical ML | Coding | 30 min | ||
| A sufficient condition for correct retrieval | RAG | Proof | 30 min | ||
| Balls into bins, with one choice and with two run | AI Systems | Coding | 1 hour | ||
| Cache hit rates under Zipf popularity run | AI Systems | Coding | 1 hour |