CoolFace
Modelpublic

llaa33219/MicroMixer-4-1M-Discord-Dialogues

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes
Model Card

<div align="center">

<img src="https://raw.githubusercontent.com/llaa33219/MicroMixer-4/main/logo.svg" width="300" alt="MicroMixer-4 Logo"/>

MicroMixer-4-1M-Discord-Dialogues

<img src="https://img.shields.io/badge/Parameters-996%2C873-blue?style=for-the-badge&logo=python&logoColor=white&color=%23007BFF" alt="Parameters"/> <img src="https://img.shields.io/badge/Architecture-CCD--Mixer-purple?style=for-the-badge&color=%23AE00FF" alt="Architecture"/> <img src="https://img.shields.io/badge/Fine--tuning-FMSP-green?style=for-the-badge&color=%2300D620" alt="FMSP"/>

<br/> <br/>

<table> <tr> <td align="center" style="padding: 20px;"> <strong style="color: #007BFF; font-size: 1.2em;">Micro Language Model</strong><br/> <em>Attention-Free • MLP-Only • Byte-Level • Content-Gated Dilated Convolution</em> </td> </tr> </table>

![GitHub](https://github.com/llaa33219/MicroMixer-4)

</div>


<div style="background: linear-gradient(135deg, #007BFF22, #AE00FF22); padding: 20px; border-radius: 10px; border-left: 4px solid #007BFF;">

📋 Overview

MicroMixer-4-1M-Discord-Dialogues is a 996,873-parameter pure MLP-Mixer causal language model — no attention, no recurrence, no SSM — pretrained on Discord conversation data and then fine-tuned with FMSP (Fine-tuning with Minimal Parameter changes for Small-parameter LMs) on 9,012 general-knowledge QA pairs.

This is the 1M member of the MicroMixer-4 (V87 Final) family: the flagship — the only size that holds all four capability axes at once (fluency, memorization, boundary discipline, language preservation).

The backbone is V87 Final, the project's champion architecture — a CCD-Mixer (Content-gated mixture of shared-weight Dilated convolutions) crowned overall champion of the 1M architecture census (V86), frozen as the final chassis and scaled to six parameter budgets. The 1M preset reproduces the champion recipe verbatim at its budget.

</div>


🏗️ Architecture

<div align="center">

mermaid
graph TD
    A[Byte Input] --> B[Embed 256→128 NoPE]
    B --> C[CCD-Mixer Block × 7]
    C --> D[RMSNorm]
    D --> E[LM Head Tied with Embed]
    E --> F[Byte Output]

    subgraph "CCD-Mixer Block"
        X[Input 128] --> U["Linear d→2d → split v, g"]
        U --> RP[Full RoPE on v AND g]
        RP --> M["Shared-weight dilated conv<br/>dilations 1·2·4·8, k=129"]
        M --> G["Per-position 4-way gate<br/>softmax(Linear_dil(x)/τ)"]
        G --> O["W_o(v ⊙ g)  — zero-init"]
        O --> SW[SwiGLU Channel-Mix]
        SW --> RM[ReMixerLayer sidecar]
    end

    style A fill:#007BFF,color:#fff
    style F fill:#00D620,color:#fff
    style G fill:#AE00FF,color:#fff
    style M fill:#FF6600,color:#fff

</div>

Model Configuration

<table> <tr> <th style="background-color: #007BFF; color: white;">Parameter</th> <th style="background-color: #AE00FF; color: white;">Value</th> </tr> <tr><td>Total Parameters</td><td><code>996,873</code></td></tr> <tr><td>Hidden Dimension (dmodel)</td><td><code>128</code></td></tr> <tr><td>Number of Blocks</td><td><code>7</code></td></tr> <tr><td>Token-Mix</td><td><code>GLCTokenMixCCD</code> (content-gated mixture of shared-weight dilated causal conv)</td></tr> <tr><td>Dilations</td><td><code>(1, 2, 4, 8)</code> — one shared depthwise kernel, zero extra conv params</td></tr> <tr><td>Depthwise Kernel Size</td><td><code>129</code></td></tr> <tr><td>RoPE</td><td>Full RoPE on <b>both</b> v and g (V76 "RPG" pattern)</td></tr> <tr><td>Channel-Mix</td><td><code>SwiGLU</code></td></tr> <tr><td>Sidecar</td><td><code>ReMixerLayer</code> per block (labeldim 16, poolheads 4)</td></tr> <tr><td>Max Sequence Length</td><td><code>1024</code></td></tr> <tr><td>Vocabulary Size</td><td><code>256</code> (byte-level)</td></tr> <tr><td>Position Encoding</td><td>RoPE inside token-mix only; no position embedding table</td></tr> <tr><td>Normalization</td><td><code>RMSNorm</code> (pre-norm)</td></tr> <tr><td>Output Head</td><td>Tied with input embedding</td></tr> <tr><td>Zero-Init</td><td><code>Wo</code>, <code>dilgate</code>, <code>logτ</code> — silent at init</td></tr> </table>

Core Components

┌──────────────────────────────────────────────────────────────┐
│                 CCD-Mixer Block (×7)                        │
│  u    = Linear(d → 2d)(x)                                    │
│  v, g = u.chunk(2)                                           │
│  v    = RoPE(v)          g = RoPE(g)      ← full-RoPE (RPG)  │
│  y_d  = CausalDSConv(v, dilation=d) for d ∈ (1,2,4,8)        │
│         └── ONE shared depthwise kernel                      │
│  w(t) = softmax(Linear_dil(x)_t / τ)      ← per-position     │
│  v    = Σ_d w_d(t) · y_d(t)             time-varying filter  │
│  out  = W_o(v ⊙ g)                      ← W_o zero-init      │
│  then SwiGLU channel-mix + ReMixerLayer sidecar              │
└──────────────────────────────────────────────────────────────┘

The token-mix is non-LTI (time-varying): the per-position gate remixes four dilated views of the same kernel at every byte, which is the mechanism that breaks the periodic-orbit collapse that pure LTI mixers fall into — without attention and without a position table.


🎯 Generation Examples

<div style="background-color: #FF050515; padding: 15px; border-radius: 8px; border-left: 4px solid #FF6600;">

Questions the model was trained on (FMSP train set, 9,012 QA pairs — greedy decoding, repetition_penalty=1.2, no_repeat_ngram_size=4):

[Prompt] User: Who painted the Mona Lisa?
Assistant:
[Output] Leonardo da Vinci painted the Mona Lisa during the early 1500s in Italy.

<sub>correct — near-verbatim recitation of the trained fact</sub>

[Prompt] User: Who painted The Starry Night?
Assistant:
[Output] Vincent van Gogh painted The Starry Night in 1889 while staying at a mental asylum in Saint-Rémy-de…

<sub>correct — recites the trained answer to the truncation limit</sub>

Questions the model has never seen and cannot answer (unanswerable probe — the correct behavior is to decline; the model's actual behavior is shown):

[Prompt] User: Who painted the Glimmering Frostberry?
Assistant:
[Output] France Sea Sea Stands in Paris, developed in France and the French Revolution and Spanish between 19…

<sub>fabricates — no such painting exists; the model should have declined</sub>

[Prompt] User: Who composed the Symphony of Hollow Dawn?
Assistant:
[Output] The assassination of Archduke Franz Ferdinand of Austria in Sarajevo on June 28, 1914, triggered the…

<sub>fabricates — retrieves an unrelated trained fact instead of abstaining</sub>

</div>


📊 Results

<div style="background-color: #007BFF15; padding: 15px; border-radius: 8px; border-left: 4px solid #007BFF;">

Pretraining (Discord-Dialogues 200K, V76 recipe, 3 epochs)

Metric1 ep2 ep3 ep
Val PPL3.493.393.18

AdamW lr 3e-3 · WSD (warmup 500) · wd 0.01 · bs 16 · seq 1024 · seed 42 · plain CE on non-pad bytes.

FMSP fine-tuning (small-qa-en-10k, P05 recipe, 10 epochs)

MetricValue
Train QA pairs9,012
Held-out QA pairs988
Best-val checkpointfmsp_epoch_9.safetensors (val loss 0.0271)
freeze_fraction0.05 (true freeze)
Lossanswer-only CE + probe KL (weight 0.5)

Evaluation battery (post-FMSP)

AxisMicroMixer-4-1M
Chatter fluency d2 (cycles)0.883 (1/9)
Full-988 EM (3-seed mean)563.7 (564/559/568)
Q-relevance echo / hijack %95.0 / 4.0
OOD hijack %6.8%
Unanswerable fabrication /1818
Discord PPL (forgetting)3.66

<sub>‡ where marked: degenerate-pass — the model does not engage the question at all, so there is nothing to hijack or fabricate with. Not boundary discipline.</sub>

MicroMixer-4 family (same protocol, all sizes)

SizeParams3ep Val PPLChatter d2Full-988 EMqrel echo/hijackOOD hijack
1M996,8733.180.883563.795.0 / 4.06.8%
500K491,7423.290.912279.337.0 / 49.035.6%
300K292,5253.410.81056.311.0 / 60.025.4%
100K95,0843.780.5460.04.0 / 54.027.1%
50K48,6844.090.6670.02.0 / 31.06.8% ‡
10K9,6665.490.3590.00.0 / 0.0 ‡0.0% ‡

</div>


📚 Training Data

<div style="background-color: #00D62015; padding: 15px; border-radius: 8px; border-left: 4px solid #00D620;">

  1. 1.Pretraining: Discord-Dialogues — 200K multi-turn Discord conversations, User:/Assistant: format, 1024-byte sequences, 3 epochs.
  2. 2.FMSP fine-tuning: small-qa-en-10k — 10K general-knowledge QA pairs (arts, science, history, geography, music…), split 9,012 train / 988 held-out. 10 epochs under the P05 recipe (5% of parameters frozen-true, answer-only CE, probe-KL 0.5).

</div>


🔧 Usage

Files in this repository

  • —fmsp_epoch_{0..9}.safetensors — per-epoch FMSP weights (pickle-free safetensors). `fmsp_epoch_9.safetensors` is the best-val checkpoint for this size.

Load and generate (local clone)

python
import torch
from safetensors.torch import load_file
from src.model_v87_final import MicroMixerV87Final, v87_final_1m
from src.fmsp import attach_adapter
from src.tokenizer import ByteTokenizer

# Clone the code repository first:
# git clone https://github.com/llaa33219/MicroMixer-4.git && cd MicroMixer-4

cfg = v87_final_1m()
model = MicroMixerV87Final(cfg)
attach_adapter(model, d_model=cfg.d_model, rank=16)   # FMSP adapter (trained weights are in the file)
model.load_state_dict(load_file("fmsp_epoch_9.safetensors"), strict=True)
model.eval()

tok = ByteTokenizer()
prompt = "User: Who painted the Mona Lisa?\n\nAssistant: "
ids = tok.encode(prompt)
if ids and ids[-1] == tok.eos_token_id:
    ids = ids[:-1]                       # ByteTokenizer appends EOS; the prompt must end open
ids = torch.tensor([ids])
with torch.no_grad():
    out = model.generate(
        ids, max_new_tokens=200,
        temperature=0.0,                 # greedy — used for all reported numbers
        repetition_penalty=1.2,
        no_repeat_ngram_size=4,
        eos_token_id=tok.eos_token_id,
    )
print(tok.decode(out[0].tolist()))

Load from Hugging Face Hub (no clone of the weights needed)

python
import torch
from huggingface_hub import hf_hub_download
from safetensors.torch import load_file
from src.model_v87_final import MicroMixerV87Final, v87_final_1m
from src.fmsp import attach_adapter

REPO = "llaa33219/MicroMixer-4-1M"

cfg = v87_final_1m()
model = MicroMixerV87Final(cfg)
attach_adapter(model, d_model=cfg.d_model, rank=16)
model.load_state_dict(
    load_file(hf_hub_download(REPO, "fmsp_epoch_9.safetensors")), strict=True)
model.eval()
# ... generate as above

⚠️ Limitations

<div style="background-color: #FF050515; padding: 15px; border-radius: 8px; border-left: 4px solid #FF0505;">

LimitationDescription
Micro parameters996,873 parameters; capacity is the binding constraint on every axis
Knows only what it memorizedKnowledge is limited to the 9,012 trained QA pairs + Discord pretraining distribution
Does not abstainUnknown questions are answered with fabrication or degeneration, not refusal — see the examples above
Byte-level noise256-vocab byte tokenizer; PPL not comparable to BPE baselines
Research use onlyArchitecture/scaling research artifact, not a production model

</div>


🧬 Context

MicroMixer-4 is the fourth generation of the MicroMixer research line: sub-1M-parameter language models built purely from MLP-Mixer operations. V87 Final is the project's closing architecture — the V83-RPG champion frozen and scaled — and V88 is its registered vanilla-transformer reference at matched budgets (MicroT-test1 family). Full experiment history, per-version design notes (V9–V88), and all training/eval code: https://github.com/llaa33219/MicroMixer-4.


<div align="center">

![GitHub](https://github.com/llaa33219/MicroMixer-4)

<sub>Part of the <a href="https://github.com/llaa33219/MicroMixer-4">MicroMixer-4</a> research project — V87 Final (CCD-Mixer) family, 1M preset</sub>

</div>