|
| 1 | +# Continual-learning retention portfolio (v100.40) |
| 2 | + |
| 3 | +The recommended starting point for this hardware is a frozen pretrained base, |
| 4 | +verified historical replay, predecessor KL, immutable accepted versions and |
| 5 | +independent regression gates. Additional constraints should be compared as |
| 6 | +separate candidates. Stacking every method is not evidence of improvement: |
| 7 | +stability constraints can prevent useful new learning and add expensive forwards. |
| 8 | +No finite test establishes universal zero forgetting. |
| 9 | + |
| 10 | +## Primary research and implementation decisions |
| 11 | + |
| 12 | +| Approach | Evidence / limitation | Implementation | |
| 13 | +| --- | --- | --- | |
| 14 | +| Historical replay | LLM CL surveys identify rehearsal as a major family; sampling coverage and distribution matter. | Existing mandatory verified prior-training records remain in A/B datasets. Existing split ledger excludes validation/audit sources. New reference sampler covers historical domains round-robin, at most eight examples. | |
| 15 | +| Learning without Forgetting / KL | Li & Hoiem, ECCV 2016, https://arxiv.org/abs/1606.09282. Original work is vision, not a Gemma guarantee. | Existing shared frozen-base teacher adapter and supervised-token KL remain active; model chooses strength. No second 12B base allocation. | |
| 16 | +| EWC | Kirkpatrick et al., PNAS 2017, https://doi.org/10.1073/pnas.1611835114. Empirical diagonal Fisher is an approximation and misses cross-parameter interactions. | New per-example squared-gradient Fisher on at most eight verified historical training records, quadratic anchor penalty, bounded LoRA parameters only. Reference weights/Fisher pinned and restored across checkpoint resume. Not original full-model EWC and not online-EWC. | |
| 17 | +| Parameter anchoring | L2-SP, Li et al., ICML 2018, https://proceedings.mlr.press/v80/li18a.html. Parameter closeness does not imply identical outputs. | New L2 anchor to the initial predecessor adapter; frozen base unchanged. | |
| 18 | +| Orthogonality | O-LoRA, EMNLP 2023, https://aclanthology.org/2023.findings-emnlp.715/; OGD, AISTATS 2020, https://proceedings.mlr.press/v108/farajtabar20a.html. | Experimental delta-A overlap penalty with predecessor row directions. Initialization penalty is zero. This is inspired by orthogonal methods, **not an O-LoRA/OGD reproduction**. | |
| 19 | +| A-GEM | Chaudhry et al., ICLR 2019, https://arxiv.org/abs/1812.00420. Half-space protection is first-order on sampled replay; AdamW momentum/finite steps can still cause forgetting. | New conflicting-gradient projection after AMP unscale/clip and before optimizer step. Historical replay references rotate; adds one reference forward/backward per optimizer attempt. Nonfinite AMP attempts are left to the existing health gate. | |
| 20 | +| Capacity growth | Progressive Neural Networks, Rusu et al., https://arxiv.org/abs/1606.04671, protect old columns when old task routes stay fixed. Route errors remain a problem. | New doubling of standard LoRA rank (maximum 64 and measured budget), zero new B columns, unchanged alpha/r and old tensors. It preserves the **initial** delta, not future behavior. Normal PEFT/GGUF candidate export and all quality gates remain required. | |
| 21 | +| New layers / embeddings | Architectural growth can isolate interference, but changes export/tokenization and resource use. | `capacity_growth.py` supplies isolated tiny-model residual columns with zero output initialization, frozen predecessor route, and appended embedding rows with unchanged old IDs. Maximum two million old/new parameters for these prototypes. **Not live Gemma layer surgery, tokenizer expansion or a native GGUF serving feature.** | |
| 22 | +| External memory / RAG | Retrieval avoids some weight updates but has stale/missing retrieval and routing failure modes. | Existing CPU hybrid persistent memory remains separate from weights. It is not proof that weights retain knowledge. | |
| 23 | +| Evaluation / rollback | GEM describes backward transfer and continual-learning evaluation. Repeated public/development tests can overfit. | Existing case-by-case ancestor gates, official grading, one-use fresh audits and preserved accepted versions remain mandatory. Fresh audit answers are not training/replay/Fisher inputs. Old-version routing remains an available fallback, not proof a new version retained skills. | |
| 24 | + |
| 25 | +Survey: Shi et al., *Continual Learning of Large Language Models: A Comprehensive |
| 26 | +Survey*, https://arxiv.org/abs/2404.16789. Methods target different kinds of forgetting |
| 27 | +and stages of training; results on small classification networks do not establish |
| 28 | +performance on sequential Gemma 12B fine-tuning or financial outcomes. |
| 29 | + |
| 30 | +## What the controller can select |
| 31 | + |
| 32 | +With `resources.retention_experiments=true`, bounded A/B planning adds: |
| 33 | + |
| 34 | +- `retention_mode`: 0 replay/KL; 1 L2; 2 EWC; 3 L2 + delta-A orthogonality; |
| 35 | + 4 EWC + delta-A orthogonality; 5 A-GEM projection. |
| 36 | +- `retention_strength`: 0.001, 0.01, 0.1, 1.0 (unused for projection). |
| 37 | +- `retention_rank_growth`: 1 or 2, only when an existing rank can double within |
| 38 | + the measured maximum rank and the absolute limit of 64. |
| 39 | + |
| 40 | +Delta-A orthogonality needs a predecessor adapter. EWC/projection are unavailable until a pinned predecessor and historical verified |
| 41 | +training examples exist. Anchors/Fisher are capped at 160 million adapter |
| 42 | +parameters. References are selected from the historical training portion of the |
| 43 | +immutable combined pool, never the withheld validation set. These bounded |
| 44 | +references are not comprehensive coverage of all pretrained capabilities. |
| 45 | + |
| 46 | +Artifacts in each trial's training directory: |
| 47 | + |
| 48 | +- `retention.json`, `retention-anchor.safetensors`: measured/reference provenance. |
| 49 | +- `capacity-growth.json`, `expanded-initial/`: rank expansion evidence. |
| 50 | +- Existing `training_health.json`, metrics, checkpoint manifests and quality |
| 51 | + judgments: actual successful optimizer counters and acceptance evidence. |
| 52 | +- Activity events `retention-reference` and `replay-gradient-projection`. |
| 53 | + |
| 54 | +The mission evidence collector exposes current-run reference/growth reports. |
| 55 | +A configured method or a saved reference is **not** proof of a successful update, |
| 56 | +accepted weights, improved retention, new task accuracy or profit. |
| 57 | + |
| 58 | +## Experimental boundaries and omissions |
| 59 | + |
| 60 | +Full GEM quadratic programming, full 12B Fisher/Jacobian matrices, unconstrained |
| 61 | +layer replication, live vocabulary changes, and running many 12B model copies |
| 62 | +are not enabled. They have unresolved compute/export/validation costs on a 32 GiB |
| 63 | +V100. The implementation provides a testable portfolio, not every CL algorithm |
| 64 | +or all published implementations. Newer variants require separate reproduction |
| 65 | +and hardware measurements before being added to this pipeline. |
| 66 | + |
| 67 | +Frozen-column and embedding prototypes have CPU tests of initial equality and |
| 68 | +unchanged old-route/old-ID outputs after new-parameter training. LoRA growth has |
| 69 | +structural factor/scaling tests. Fisher, penalties, projection and tamper-sensitive |
| 70 | +resume have deterministic tensor tests. **Full NF4/FP16 Gemma training, retention |
| 71 | +improvement and native export of an expanded adapter still need on-device tests.** |
0 commit comments