Views
No views yet
∂t y_j = ν_j(ρ - y_j) is mathematically equivalent to the diagonal-state
update of S4/S5/Mamba/RWKV. The full architecture extends this baseline with
nonlinear self-interaction (Λ|Ψ|²), anti-collapse via temporal memory lag,
and FDT-locked stochastic regularization.github.com/qrv0/mnsm.| Property | Value |
|---|---|
| Parameters | 71,069,184 |
d_model | 768 |
n_layers | 10 |
n_heads (memory modes) | 12 |
ffn_mult | 5 |
max_seq_len | 1024 |
vocab_size | 256 (byte-level) |
| Λ (nonlinearity) | -0.5 |
| Σλ (memory coupling total) | 0.3 |
| ν range | [0.5, 10.0] |
1import json
2import importlib.util
3import torch
4from huggingface_hub import hf_hub_download
5from safetensors.torch import load_file
6
7REPO = "qvr0/mnsm-memnls-70m-enwik8"
8
9config_path = hf_hub_download(REPO, "config.json")
10weights_path = hf_hub_download(REPO, "model.safetensors")
11modeling_path = hf_hub_download(REPO, "modeling.py")
12
13spec = importlib.util.spec_from_file_location("modeling", modeling_path)
14modeling = importlib.util.module_from_spec(spec)
15spec.loader.exec_module(modeling)
16
17with open(config_path) as f:
18 config_dict = json.load(f)
19
20model = modeling.MemoryNLSLanguageModel(modeling.MemoryNLSConfig(**config_dict))
21state = load_file(weights_path)
22model.load_state_dict(state)
23model.eval()
24
25# Generate
26prompt = "The history of "
27input_ids = torch.tensor([list(prompt.encode("utf-8"))])
28out = model.generate(input_ids, max_new_tokens=200, temperature=0.8, top_k=40)
29print(bytes(out[0].tolist()).decode("utf-8", errors="replace"))| Metric | Value |
|---|---|
| Final validation perplexity | 4.27 |
| Min validation perplexity | 3.86 (at step 48,000, 96% of training) |
| Final train loss | 1.3226 |
| Final val loss | 1.4510 |
| Train-val gap | 0.13 |
| Catastrophic events during training | None |
qvr0/mnsm-transformer-70m-enwik8)
is presented as differentiation, not competition. The structural finding
is the trajectory shape (monotonic vs catastrophic), not the comparative
final perplexity number.1@misc{mnsm,
2 title = {Memory-Nonlinear State Models: A Memory-Augmented Nonlinear Schrödinger
3 Field Equation with State Space Model Correspondence},
4 author = {qrv0},
5 year = {2026},
6 url = {https://github.com/qrv0/mnsm},
7 note = {Three structural principles, one equation, seven cross-domain instantiations.}
8}