Views
No views yet
|
Micro Language Model Attention-Free • MLP-Only • Byte-Level • Conversational |
1graph TD
2 A[Byte Input] --> B[Token Embedding]
3 B --> C[RoPE Position Encoding]
4 C --> D[MicroMixerLayer ×5]
5 D --> E[LayerNorm]
6 E --> F[LM Head]
7 F --> G[Byte Output]
8
9 style A fill:#007BFF,color:#fff
10 style G fill:#00D620,color:#fff
11 style D fill:#AE00FF,color:#fff| Parameter | Value |
|---|---|
| Total Parameters | 1,016,204 |
| Hidden Dimension | 168 |
| Hyper Hidden Dimension | 84 |
| Channel MLP Dimension | 448 |
| Number of Layers | 5 |
| Max Sequence Length | 4096 |
| Vocabulary Size | 256 (Byte-level) |
| DropPath Rate | 0.1 |
| Label Smoothing | 0.1 |
┌─────────────────────────────────────────────┐
│ MicroMixerLayer │
│ ┌─────────────────────────────────────┐ │
│ │ LayerNorm → HyperMixing → Residual │ │ ← Token Mixing
│ ├─────────────────────────────────────┤ │
│ │ LayerNorm → MlpBlock → Residual │ │ ← Channel Mixing
│ └─────────────────────────────────────┘ │
└─────────────────────────────────────────────┘Linear → GELU → LinearUser: Hello, how are you?
Assistant: Its not a fun of but I can't really find me be on a heread long collecting...
User: What is your favorite color?
Assistant: Not even worth to get voice the time to up them the stuff inel that was i fever...
User: Tell me a joke.
Assistant: I can always sure when your start to and in the mainse of I had say again...| Epoch | Train Loss | Train PPL | Val Loss | Val PPL |
|---|---|---|---|---|
| 1 | 2.89 | 18.04 | 2.68 | 14.65 |
| 2 | 2.57 | 13.05 | 2.63 | 13.88 |
| 3 | 2.54 | 12.68 | 2.62 | 13.73 |
1import torch
2from huggingface_hub import hf_hub_download
3from src.model import MicroMixer, MicroMixerConfig
4from src.tokenizer import ByteTokenizer
5
6# Clone the repository first:
7# git clone https://github.com/llaa33219/MicroMixer-2.git
8# cd MicroMixer-2
9
10config = MicroMixerConfig(
11 max_seq_len=4096,
12 hidden_dim=168,
13 hyper_hidden_dim=84,
14 channel_mlp_dim=448,
15 num_layers=5,
16)
17
18model = MicroMixer(config)
19weights_path = hf_hub_download("llaa33219/MicroMixer-2-1M-discord-dialogues", "model.pt")
20model.load_state_dict(torch.load(weights_path, map_location="cpu"))
21model.eval()
22
23tokenizer = ByteTokenizer()
24input_ids = torch.tensor([tokenizer.encode("User: Hello
25Assistant:")])
26
27with torch.no_grad():
28 output = model.generate(input_ids, max_new_tokens=128, temperature=0.7, top_k=40)
29
30print(tokenizer.decode(output[0].tolist()))| Limitation | Description |
|---|---|
| Small Model Size | Only ~1M parameters |
| Grammar Issues | Generated text has grammatical errors |
| Repetitive Patterns | Tends to repeat learned phrases |
| Limited Knowledge | Trained only on Discord conversations |