Adaptive Elastic Learning with Orthogonal Robust Units
V1 is the foundational, stable implementation of the AeloRu layer. It establishes the core architecture that all later versions build on: a neuroscience-inspired low-rank adapter with a conflict-driven cognitive state machine.
Detailed design (formulas, configuration reference, code examples) lives in
README.md. This file is a quick entry point.
中文版:V1_zh.md
| Module | Principle | Role |
|---|---|---|
| Hi-DoRA | Amplitude–direction decoupling | Row/column learnable amplitude vectors modulate ΔW = (m_x · m_yᵀ) ⊙ (α/r · B@A). |
| ReLoRA | Periodic merge-and-reset | Accumulates increments into external buffer W_acc; high-rank consolidation. |
| Hebbian-Fisher | Bidirectional synaptic plasticity | Hebbian trace records exploration; Fisher mask protects critical weights. |
| HongWen State Machine | Four-phase cognitive cycle | EXPLORE → RED → ANCHOR → SOLID, driven by conflict score C = 0.6·v_F + 0.4·(1−H). |
| Hierarchical Fisher | Gradient / sparse / full snapshot | Gradient (high-freq) + sparse Top-K (mid-freq) + quantized full snapshot (low-freq). |
| Orthogonal Penalty | L_ortho = λ‖ΔWᵀW₀‖² |
Pushes ΔW into the left null space of W₀. |
| Energy Budget | ‖ΔW‖_F ≤ η‖W₀‖_F |
Hard constraint preventing adapter from overwhelming pretrained weights. |
Effective weight: W_eff = W₀ + W_acc + Gate(ΔW).
from aeloru_layer import inject_aeloru, AeloruConfig, train_aeloru_step
config = AeloruConfig(r=8, lora_alpha=4.0,
use_hidora=True, use_relora=True, use_hongwen=True)
model = inject_aeloru(model, target_names=["q_proj", "v_proj"], cfg=config)
for x, y in dataloader:
loss, metrics = train_aeloru_step(layer, x, y_target=y, optimizer=optimizer)
print(metrics["state"], metrics["loss_total"])
layer.save_adapter("ckpt.pt") # incremental-only checkpoint
layer.load_adapter("ckpt.pt")- Status: ✅ Stable foundation. All modules independently toggleable via
AeloruConfig. - V1 uses the original 2-D parameter-level Fisher mask (
d_out × d_in). TheO(d²)cost was later reduced toO(d)in V2/V3 via dual 1-D HGF precision gating. - The conflict-detection buffer wiring was incomplete in V1 and was fixed in V3
(see
V3/md/fix1.md). - Companion docs:
README.md(English design),README_zh.md(中文),experiment/for the hidden-state semantic analysis (P0).