Veronica-Polymorphic is a decoder-only language model (≈551M params) with a polymorphic MLP:
each block contains multiple MLP branches (SwiGLU, GLU, Depthwise Causal Conv) and a soft router that blends them per-token.
The goal is adaptive capacity and incremental expansion (adding new branches later, e.g. translation), while keeping the rest of the backbone stable.
⚠️ Status: research preview, pre-training only, no external benchmarks yet.
Do not treat this as a production-ready model.
1. TL;DR
Aspect
Value / Description
Type
Decoder-only causal LM
Params
~551M
Layers
24
Hidden size
768
Heads
12
Positional encoding
RoPE (rotary)
MLP
Polymorphic (SwiGLU • GLU • DepthwiseConv) per block
Routing
Entropy-regularized soft routing, depth-scaled temperature
Router temperature and aux-loss weight scaled ≈√(depth_ratio) when going from shallower (12L) to deeper (24L) models
The key property is that routing remains soft: typical healthy distributions have a dominant branch (~55–65%) and minority branches (~15–25%) instead of hard one-hot selection.
Training data
The pre-train data follows the codelion / DataComp LM mixture guidelines:
Dataset Share Description
codelion/finepdfs-1B 50% Technical/academic PDFs (high semantic density)
codelion/dclm-baseline-1B 30% General web corpus baseline
codelion/fineweb-edu-1B 20% Educational / explanatory web data
Target token budget for this configuration: ~60B tokens (example setting).
For licensing and detailed descriptions, please refer to each dataset on Hugging Face.
One branch > 80% usage for many thousands of steps
Other branches stuck < 5–10%
The provided training script (scripts/train_veronica.py) implements the entropy-max aux-loss and router schedules out-of-the-box.
Evaluation
6.1 Current evaluation status
At the time of this release:
No standardized benchmarks (e.g. lm-eval-harness) have been run yet.
There are no public numbers for:
MMLU (5-shot / 0-shot)
ARC-e / ARC-c
HellaSwag, PIQA, GSM8K, etc.
Internal training logs show sensible LM loss curves and stable routing, but this is not a substitute for external evaluation.
🔎 Interpretation: This checkpoint should be treated as a router / architecture experiment, not as a drop-in replacement for existing small LMs like Llama-3.2-1B, Gemma-2B, SmolLM, etc.
6.2 Planned evaluation (suggested)
If you adopt or extend Veronica-Polymorphic, consider running:
lm-eval-harness on:
mmlu, arc_challenge, arc_easy, hellaswag, piqa
Instruction / SFT (if you fine-tune):
Alpaca-style or OpenAssistant subsets
Ablations:
Polymorphic MLP vs vanilla SwiGLU MLP with same depth/width
With / without entropy-max routing
Contributions of evaluation scripts and reported metrics are very welcome.
How to use
7.1 Loading from code
If you’re using the Veronica codebase directly:
from veronica import VeronicaConfig, VeronicaForCausalLM
You can also integrate via transformers if you register the config/model, or load the checkpoint from this repo if exported.
7.2 Simple generation example
from transformers import AutoTokenizer
from veronica import VeronicaForCausalLM, VeronicaConfig
tokenizer = AutoTokenizer.from_pretrained("gpt2") # or your own tokenizer
config = VeronicaConfig.from_pretrained("MhaWay/Veronica")
model = VeronicaForCausalLM.from_pretrained("MhaWay/Veronica", config=config)
prompt = "The theory of relativity states that"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)