Spectral analysis of low-rank adaptation dynamics — measure rank evolution, detect phase transitions, and study training geometry
Project description
Gradience
Spectral analysis of low-rank adaptation dynamics.
Gradience is a research instrument for studying the geometry of LoRA fine-tuning. It measures rank structure, energy concentration, and subspace alignment across adapter layers — and provides reproducible, multi-seed experimental infrastructure for validating spectral hypotheses.
Quick Start
Requires Python 3.10+
pip install gradience
# Audit a LoRA adapter's spectral structure
gradience audit --peft-dir ./your-adapter --suggest-ranks
# Measure merge compatibility between two adapters
gradience merge-audit --adapter-a ./adapter_a --adapter-b ./adapter_b
# Run a full compression validation benchmark
gradience-bench --config bench_config.yaml
What You Get
- Spectral measurements — Per-layer SVD analysis: stable rank, energy concentration, utilization ratios, rank waste quantification
- Merge compatibility analysis — Principal angles, directional agreement, and magnitude balance between adapter pairs, with per-layer geometric verdicts
- Training telemetry — Structured JSONL recording of spectral evolution across training steps
- Reproducible benchmarking — Multi-seed compression validation with statistical aggregation and tolerance-based safety policies
- Publication-ready artifacts — JSON data, Markdown reports, and aggregate statistics for tables and figures
Install
pip install gradience # Core (torch + safetensors + scipy)
pip install "gradience[hf]" # + HuggingFace Trainer integration
pip install "gradience[bench]" # + Full benchmark protocol with eval
pip install "gradience[all]" # Everything
Links
- GitHub: github.com/johntnanney/gradience
- License: Apache 2.0
Citation
@software{gradience2026,
title = {Gradience: Spectral Analysis of Low-Rank Adaptation Dynamics},
author = {Nanney, John T.},
year = {2026},
url = {https://github.com/johntnanney/gradience}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gradience-0.11.0.tar.gz.
File metadata
- Download URL: gradience-0.11.0.tar.gz
- Upload date:
- Size: 484.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d14c94ae010f9eb1212076cb2b733beb4c184f2aeccfb056b4e8123d3acb653
|
|
| MD5 |
f8dbb65fb5ce6acdf8474984c126ad2e
|
|
| BLAKE2b-256 |
77b4db84bd6f1f4e4d7bced50b29775eb34e1dad5bae07d24c82560b72eaf2bf
|
File details
Details for the file gradience-0.11.0-py3-none-any.whl.
File metadata
- Download URL: gradience-0.11.0-py3-none-any.whl
- Upload date:
- Size: 375.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f922ae81fbc2ac1f5d63a36a00a08f82cf884c05e485a67c4139437f4fe6c3cd
|
|
| MD5 |
aae522c479bf9ecc105a6e45fc7a4fc2
|
|
| BLAKE2b-256 |
79ae72303ff6b64df0f3b6a22cbe7c7a7750af690789e6ff1d093b3dbb286416
|