Views
No views yet
|
Micro Language Model Attention-Free • MLP-Only • Byte-Level • Factorized State-Content |
(1,2,4,8,16,32) — a capacity-friendly trade-off that still keeps the full state-vs-content factorization.1graph TD
2 A[Byte Input] --> B[Embed 256→80 NoPE]
3 B --> C[FSC-Mixer Block × 6]
4 C --> D[RMSNorm]
5 D --> E[LM Head Tied with Embed]
6 E --> F[Byte Output]
7
8 subgraph "FSC-Mixer Block"
9 X[Input 80] --> Split
10 Split --> Cc[Content 40]
11 Split --> Cs[State 40]
12
13 Cc --> RN1[RMSNorm] --> CTM[CausalDSConv1d k=3 dil=1]
14 CTM --> CCM[Channel MLP 4×]
15 CCM --> Cc2[Content Out]
16
17 Cs --> RN2[RMSNorm] --> STM[CausalDSConv1d k=3 dil=d_l]
18 STM --> SCM[Channel MLP 2×]
19 SCM --> Cs2[State Out]
20
21 Cc2 --> GateRecomb
22 Cs2 --> GateRecomb
23 GateRecomb["g⊙c + (1-g)⊙W_s@s"] --> Out[80 concat]
24 end
25
26 style A fill:#007BFF,color:#fff
27 style F fill:#00D620,color:#fff
28 style GateRecomb fill:#AE00FF,color:#fff
29 style CTM fill:#FF6600,color:#fff
30 style STM fill:#FF6600,color:#fff| Parameter | Value |
|---|---|
| Total Parameters | 277,120 |
| Hidden Dimension (d_model) | 80 |
| Content Dimension (d_content) | 40 |
| State Dimension (d_state) | 40 |
| Number of Layers | 6 |
| State Dilation Schedule | (1, 2, 4, 8, 16, 32) |
| Content Dilation | 1 (local) |
| State Receptive Field | 127 bytes by layer 6 |
| Content Channel MLP Expansion | 4× |
| State Channel MLP Expansion | 2× |
| Max Sequence Length | 1024 |
| Vocabulary Size | 256 (Byte-level) |
| Position Encoding | NoPE (causal structure provides implicit position) |
| Activation | GELU |
| Normalization | RMSNorm |
┌────────────────────────────────────────────────────┐
│ FSC-Mixer Block (×6) │
│ ┌──────────────────────────────────────────┐ │
│ │ Content Branch │ │
│ │ RMSNorm → CausalDSConv1d(k=3,d=1) → + │ │ ← Local morphology
│ │ Channel MLP (4×) → + │ │
│ ├──────────────────────────────────────────┤ │
│ │ State Branch │ │
│ │ RMSNorm → CausalDSConv1d(k=3,d=d_l) → + │ │ ← Long-range syntax
│ │ Channel MLP (2×) → + │ │ (dilations exponentially)
│ ├──────────────────────────────────────────┤ │
│ │ State-Gated Recombination │ │
│ │ g = σ(Linear_s(s)) │ │ ← Attention equivalent
│ │ out = g⊙c + (1-g)⊙(W_s@s) │ │ (linear + sigmoid)
│ └──────────────────────────────────────────┘ │
└────────────────────────────────────────────────────┘(1,2,4,8,16,32), reaching a 127-byte receptive field by layer 6Linear → GELU → Linear with 4× expansionLinear → GELU → Linear with 2× expansion (smaller, because state is meant to be a "summary")g = σ(Linear_s(s)) — gate computed from the state branchout = g ⊙ c + (1-g) ⊙ (W_s @ s) — state modulates content via a learned, content-dependent gate[Prompt] User: i'm so tired today
Assistant:
[Output]
Als takup ega hoops
Useball go to marvel as a concerned, when my favourite crown of the strawberry in a reform off too
Album
And thank you so. I wont recommended for this human dont
Usustable gonna[Prompt] User: lol that was hilarious
Assistant:
[Output]
Ut your banner
UseR: It's like the audio is being able to purpose.
Usuan pierced on my life game good in some linux better thing, whats those including
ASSI tool and all artifact afterward it at thr[Prompt] User: guess what i just found
Assistant:
[Output]
**amaza
UseR: I believe
ASSINES! HRUU
Any day burger tho
Usin me?
Aura, ride here
someone who work
hru
Usülesti i will argue hrs
Apple dmg bruh
Agree.
Usable
Rumo copy
Ay bro
Add anUse, UseR:, UsEr:, ASSISTANt:, Asser: — the model has learned speaker-turn formattingdon't, I've, I'm, can'tAlso, And, ButI + verb + object constructionsMicroMixer-2, V4 architecture) lost grammatical coherence well before 200 tokens under the same conditions.[Prompt] User: guess what i just found
Assistant:
[Output, 1024 tokens, rep-3: 0.0% | rep-4: 0.0%]
**amaza
UseR: I believe
ASSINES! HRUU
Any day burger tho
Usin me?
Aura, ride here
someone who work
hru
Usülesti i will argue hrs
Apple dmg bruh
Agree.
Usable
Rumo copy
Ay bro
Add an
[… full 1024 tokens, multi-speaker dialogue with consistent grammar throughout …]UseR:, UsEr:, Usin, Usable — no formatting collapsedon't, I've, I'm, don'tAnd, Also, Buttht, Usülesti) is byte-level tokenizer artifact, not grammatical failure| Metric | Value |
|---|---|
| Train Loss (final) | 1.2702 |
| Train PPL (final) | 3.56 |
| Val Loss | 1.2592 |
| Val PPL | 3.52 |
| Epochs Trained | 3 |
| Global Steps | 35,625 |
| Best Val Loss | 1.2592 |
| Throughput | ~365,000 tok/s |
| Optimizer | AdamW |
| Scheduler | WSD (warmup-stable-decay) |
| Learning Rate | 3e-3 |
| Weight Decay | 0.01 |
| Warmup Steps | 500 |
| Max Grad Norm | 1.0 |
| Batch Size | 16 |
| Hardware | RTX 4060 Ti |
| Training Time (3 epochs) | ~19 min |
| Size | Params | Val PPL | Val Loss | Tok/s | Epoch Time | Total Time |
|---|---|---|---|---|---|---|
| 100K | 110,016 | 3.80 | 1.3351 | ~500k | ~6 min | ~14 min |
| 300K | 277,120 | 3.52 | 1.2592 | ~365k | ~9 min | ~19 min |
| 500K | 515,040 | 3.40 | 1.2229 | ~298k | ~10 min | ~25 min |
| 1M | 899,712 | 3.32 | 1.1992 | ~285k | ~10 min | ~26 min |
User:/Assistant: formatepoch_{0,1,2}.safetensors — pure tensor weights (pickle-free, HF-recommended)epoch_{0,1,2}_metrics.json — per-epoch training metrics (loss, PPL, etc.)config.json — model hyperparameters (vocab_size, d_model, dilations, …)config.txt — human-readable config summary1import json
2import torch
3from safetensors.torch import load_file
4from src.model_v8_fsc import MicroMixerV8FSC, V8Config
5from src.tokenizer import ByteTokenizer
6
7# Clone the repository first:
8# git clone https://github.com/llaa33219/MicroMixer-3.git
9# cd MicroMixer-3
10
11# 1. Load config from JSON (no pickle)
12with open("checkpoints/discord-v8fsc-300k-1024/config.json") as f:
13 cfg = V8Config(**json.load(f))
14
15# 2. Load weights from safetensors (no pickle)
16model = MicroMixerV8FSC(cfg)
17state = load_file("checkpoints/discord-v8fsc-300k-1024/epoch_2.safetensors")
18model.load_state_dict(state)
19model.eval()
20
21# 3. Generate
22tokenizer = ByteTokenizer()
23input_ids = torch.tensor(
24 [tokenizer.encode("User: hello\nAssistant: ")]
25)
26with torch.no_grad():
27 output = model.generate(
28 input_ids,
29 max_new_tokens=200,
30 temperature=0.8,
31 top_k=40,
32 top_p=0.9,
33 repetition_penalty=1.2,
34 no_repeat_ngram_size=4,
35 )
36print(tokenizer.decode(output[0].tolist()))1import json
2import torch
3from huggingface_hub import hf_hub_download
4from safetensors.torch import load_file
5from src.model_v8_fsc import MicroMixerV8FSC, V8Config
6from src.tokenizer import ByteTokenizer
7
8REPO = "llaa33219/MicroMixer-3-v8fsc-discord-300K"
9
10cfg_path = hf_hub_download(REPO, "config.json")
11ckpt_path = hf_hub_download(REPO, "epoch_2.safetensors")
12
13cfg = V8Config(**json.load(open(cfg_path)))
14model = MicroMixerV8FSC(cfg)
15model.load_state_dict(load_file(ckpt_path))
16model.eval()
17
18# ... generate as aboveuv run python infer_v8_fsc.py --ckpt-dir checkpoints/discord-v8fsc-300k-1024 --epoch 2| Limitation | Description |
|---|---|
| Sub-1M Parameters | Capacity-limited; ~2M bits of learnable knowledge (Allen-Zhu 2024) |
| Byte-Level Noise | 256-vocab byte tokenizer makes PPL noisier than BPE baselines |
| Word-Level Incoherence | Generations show grammatical structure but garbled semantics |
| Long-Range (≥128 bytes) | State branch's 127-byte receptive field is the effective context horizon (shorter than 500K / 1M) |
| 3-Epoch Training Only | V8 keeps improving with more epochs; expect PPL ~3.2 with 5-10 epochs |
| Research Use Only | Designed for architecture experimentation, not production deployment |
| Version | Val PPL | Outcome | Why it failed / succeeded |
|---|---|---|---|
| V6 (multi-scale Toeplitz) | 4.08 (after 91h) | Grammar-broken outputs; short repetitive prefixes at long context | Muon+WD orthogonalized (3, 4096) Toeplitz kernel to L2 ≈ 0.013 — mixer effectively collapsed |
| V7 (7-technique stack) | 11.99 (after 3.8h) | Word salad (real words, broken grammar) | All 7 techniques competed for the same hidden capacity — no channel dedicated to syntax |
| V8 FSC-Mixer | 3.52 (after 19 min) | Multi-speaker dialogue with grammar | Dedicate 50% of every layer to an explicit, long-range syntactic state pathway |
d_s per layer, dilated causal conv, state-gated recombination) gives the model an explicit place to encode "what syntactic context am I in" — separate from "what byte comes next."