EgoRA Diagnostics — Rotation-Retention Law & Knowledge Mapping
Advanced diagnostic tools for analyzing fine-tuned neural networks. Companion package to egora.
Installation
pip install egora-diagnostics
With plotting and dataset support:
pip install egora-diagnostics[all]
Modules
1. Threshold Analysis (Rotation-Retention Law)
Tests the empirical law $\Delta M \propto \bar{\theta}$:
- Dimensionality-aware critical threshold: $\theta_{\text{crit}} = \arcsin(1/\sqrt{d_{\text{head}}})$
- Golden ratio $k$-check
- Phase transition detection
- Cross-architecture validation
from egora import compute_head_geometry
from egora_diagnostics import run_threshold_analysis
geo = compute_head_geometry(base_model, tuned_model)
results = run_threshold_analysis(
geo, model_name="llama_8b",
mmlu_base=63.42, mmlu_after=62.86,
output_dir="analysis/",
)
2. Knowledge Map
Logit lens, attention probing, and Knowledge Concentration Index (KCI) to locate where knowledge lives in the model.
from egora_diagnostics import run_knowledge_map
summary = run_knowledge_map(model, tokenizer, output_dir="analysis/")
3. Alignment Landscape
Per-head gradient alignment between fine-tuning and capability-preservation directions. Identifies critical heads.
from egora_diagnostics import run_alignment_landscape
landscape = run_alignment_landscape(
model, tokenizer,
finetune_data=ft_loader,
capability_data=cap_loader,
)
Resources
| Link | |
|---|---|
| 📦 PyPI | pip install egora-diagnostics |
| 💻 GitHub | ArsSocratica/EgoRA |
| � DOI | 10.5281/zenodo.19410504 |
License
This software is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0), with an Additional Permission for Academic Use pursuant to AGPL Section 7.
- Academic use: Free, no copyleft obligations, citation required. See LICENSE-ACADEMIC.
- Commercial use: Requires both a software license and a patent license.
Patent Notice
The methods implemented in this software are covered by U.S. Provisional Patent Application No. 64/024,742, filed April 1, 2026, by Mark Dillerop.
Contact: mark@dillerop.com
Metadata
Release files for egora-diagnostics 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| egora_diagnostics-0.3.1.tar.gz | 21.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| egora_diagnostics-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 45.1 kB
Release files / egora_diagnostics-0.3.1.tar.gz
| Download URL | egora_diagnostics-0.3.1.tar.gz |
|---|---|
| Size | 21.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e74d08cb59577138526c8c3a0040eab7bdd344b5524b003de4192f5b5ac368b6
|
|
BLAKE2b-256 checksum How to use checksums |
01ee7ffc08c075357515a431a149dc87caea073b9d342b6fc0ea2940f4eb374b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / egora_diagnostics-0.3.1-py3-none-any.whl
| Download URL | egora_diagnostics-0.3.1-py3-none-any.whl |
|---|---|
| Size | 23.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
42213e0b90167c88515d4f7a306a8d7ee9be50c07e33d62160fa7bbccb4f1a57
|
|
BLAKE2b-256 checksum How to use checksums |
4c263e59cc3b78a04fb45c0cc9df533cb59ed0330a9688ffbaacf9132ddfff6a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|