A production-grade continuously learning model system built on SSM (State Space Model) + OML (Optimization-based Meta-Learning) with autonomous data exploration.
Formerly known as LMT-twister. Established 2026-08-20. Status: research system for continual learning; the mechanism conclusions (not just the scores) are the main artifact.
checkpoints/lm1_final.pt (6.3MB) — the production LM1 autonomous continual-learning model, result of 17 rounds / 680 iterations.
| file | role |
|---|---|
checkpoints/lm1_final.pt |
production LM1 (1.05M params, autonomous CL) |
checkpoints/lm1_round*.pt |
intermediate LM1 rounds |
tests/run_lm1_production.py |
production training (checkpoint, eval, infer) |
tests/lm1_inference_demo.py |
inference API (define + adapt + query) |
tests/run_lm2_text.py / run_lm3_bpe.py |
real-text and BPE cross-domain CL experiments |
hibs_lnn/ |
SSM, SwiftTD, meta-rule world, code world modules |
docs/wiki/log.md |
experiment log |
LM1 (Production, 1.05M params)
├── SSM backbone (V31_RLN, configurable d_model/d_state/layers)
├── SwiftTD head — per-feature step-size optimization (IDBD online, no BPTT)
├── OML dual-loop — inner-loop PLN adaptation + outer-loop meta-update
└── S4 Value Proposer — autonomous task generation from structural novelty
LM2 (Text, 0.71M params)
├── SSM character-level LM (vocab 607)
└── Streaming 3-domain wikitext-2
LM3 (BPE, 2.26M params)
├── BPE tokenizer (vocab 4627)
└── en→zh→code cross-domain experiments
| mechanism | role | evidence |
|---|---|---|
| Replay | anti-forgetting (data anchoring) | +5.0pp avg over base |
| OML | adaptation efficiency (inner-loop cloning) | not anti-forgetting; enables fast new-domain adaptation |
| SwiftTD | per-feature learning rates (online IDBD) | prevents step-size collapse under bound/decay |
| Value Proposer | autonomous data generation | drives continuous exploration without human labeling |
| metric | value | family peak | improvement |
|---|---|---|---|
| Unseen accuracy | 0.1276 | 0.099 | +29% |
| c4 structure accuracy | 0.1510 | 0.099 | +53% |
| Forgetting | -0.006 | — | negative (improvement) |
| S5 transfer (R16) | 0.1172 | — | positive migration |
17 rounds / 680 iters, fully automatic convergence. Report: results/lm1_report.md.
| domain | before | after | change |
|---|---|---|---|
| A (train 2M chars) | 0.429 | 0.472 | +4.3pp |
| B (valid 1.1M chars) | 0.478 | 0.488 | +1.0pp |
| C (test 1.3M chars) | 0.493 | — | positive transfer |
All domains show positive transfer after sequential training — zero forgetting on real same-domain text.
| method | en | zh | code | average |
|---|---|---|---|---|
| Base (sequential) | 0.260 | 0.076 | 0.340 | 0.170 |
| Replay | 0.252 | 0.057 | 0.352 | 0.220 |
| OML (dual-lr) | — | — | — | 0.131 |
| OML2 (correct) | — | — | — | 0.168 |
Naive sequential training causes catastrophic forgetting (-10.4pp on English). Replay is the only effective anti-forgetting mechanism (+5.0pp).
Works reasonably:
Does not work reliably:
# Smoke test (1 round, 2 iters, no migration)
python smoke_lm1.py
# Production training (10 rounds, auto-explore + evaluate)
python tests/run_lm1_production.py --rounds 10
# Resume from checkpoint
python tests/run_lm1_production.py --resume
# Inference demo
python tests/lm1_inference_demo.py --ckpt checkpoints/lm1_final.pt
# Text continuous learning / BPE cross-domain
python tests/run_lm2_text.py
python tests/run_lm3_bpe.py --method replay
Data: LM1/LM2 need no external data (synthetic tasks / wikitext-2 auto-download). LM3 needs data in /tmp/lm2data and /tmp/lm3data.
These are research results on small models (1–2M params) and controlled task worlds. The mechanism conclusions are the contribution; do not read the scores as production-scale language-model performance. If you use this work, cite the mechanism conclusions and the LM1 production system results.
MIT — see LICENSE
checkpoints/lm1_8m_round9.pt 46 MBcheckpoints/lm1_round4.pt 1 MBcheckpoints/lm1_round3.pt 1 MBcheckpoints/lm1_smoke.pt 1 MBcheckpoints/lm3_replay_sequential_latest.pt 1 MBcheckpoints/lm3_base_sequential_latest.pt 1 MBcheckpoints/lm2_latest.pt 725.1 kBcheckpoints/lm1_latest.pt 545.4 kBcheckpoints/lm1_round2.pt 545.4 kBcheckpoints/lm1_round1.pt 545.2 kB