Instructions to use User01110/CMA-20M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use User01110/CMA-20M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="User01110/CMA-20M", trust_remote_code=True, device_map="auto")# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("User01110/CMA-20M", trust_remote_code=True, dtype="auto", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use User01110/CMA-20M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "User01110/CMA-20M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "User01110/CMA-20M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/User01110/CMA-20M
- SGLang
How to use User01110/CMA-20M with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "User01110/CMA-20M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "User01110/CMA-20M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "User01110/CMA-20M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "User01110/CMA-20M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use User01110/CMA-20M with Docker Model Runner:
docker model run hf.co/User01110/CMA-20M
CMA-20M
Evaluated training checkpoint from a 20.21M-parameter Channel-Mixing Attention generalist language model using the third-party BananaMind 8,192-token digit-aware byte-level BPE tokenizer. It has no place embeddings, role embeddings, or inference-time equation detection. It was recorded at step 6,000 with WikiText normalized BPB 1.3426. Its report-only Open SLM Leaderboard-style average is 36.32%.
Loading
This is a custom Transformers architecture. trust_remote_code=True is
required because stock Hugging Face model classes do not implement CMA or this
model's exact rotary convention.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "User01110/CMA-20M"
tokenizer = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
repo, trust_remote_code=True, dtype="auto"
)
Checkpoint tensors are stored in bfloat16. Pass dtype=torch.float32 when an
FP32 runtime is required; every stored BF16 value widens exactly to FP32, though
the pre-export FP32 master-weight mantissa cannot be reconstructed.
Architecture
- Parameters: 20,212,355, with tied input/output embeddings
- Weights: native bfloat16 safetensors (
model.safetensors); no.binweights - Runtime: PyTorch 2.5+ for native SDPA grouped-query attention
- Tokenizer:
BananaMind/BananaMind-2-Miniat revision84a0afb98db902caf07a1e949676d9fef9e5cf9e - Vocabulary: 8,192 third-party tokens
- Parameter allocation: 2,752,512 tied embedding parameters and 17,459,843 non-embedding parameters
- Context: 1,024 tokens
- Standalone prompt tokenization automatically prepends the native BOS token
- Width/layers: 336 / 13
- Token-attention heads: 6 query, 2 KV
- CMA: 14 slots of 24 channels, 3 routing heads, expansion 3
- Each token receives dense values followed by content-dependent softmax routing across channel slots
- Signed routing uses
0.95 * softsign(signal), preserving at least a 5% base path under positive routing - Contiguous-half RoPE without scaling
- No task-specific model features or inference-time benchmark handling
Tokenizer provenance
The tokenizer and its 8,192-token vocabulary were not
created or owned by the CMA model author. They are reused from the public
BananaMind/BananaMind-2-Mini
repository at the exact revision listed above, whose repository metadata
identifies BananaMind as the publisher and Apache-2.0 as the license. No claim
of tokenizer ownership beyond that public attribution is made here. The
exported copy preserves its vocabulary, merges, normalization, and digit-aware
pre-tokenization; CMA only configures the existing BOS token to be prepended
automatically and sets the model context length.
Optimization
- Training budget: 10,485,760,000 tokens over 20,000 updates
- Effective batch: 524,288 tokens per update
- Learning rate: 500-update linear warmup to 1.0e-03, then linear decay
- The final configured update is positive; update 20,001 is exactly zero
- Official PyTorch Muon with
match_rms_adamwfor hidden matrices; AdamW for embeddings and remaining parameters
Training mixture
- FineWeb-Edu 100BT shuffled: 45.00% of trained tokens
- DCLM-Baseline 1.0: 25.00% of trained tokens
- DCLM-Edu: 10.00% of trained tokens
- Cosmopedia v2: 10.00% of trained tokens
- FineMath 4+: 10.00% of trained tokens
DCLM-Baseline adds broadly curated web diversity, DCLM-Edu adds an education-filtered DCLM view, and FineMath-4+ supplies mathematical explanations and reasoning as ordinary causal-language-model text. There are no benchmark labels or benchmark-specific preprocessing. All five training sources are streamed natural-text corpora.
Zero-shot evaluation at step 6,000
The four lm-eval tasks use normalized accuracy when supplied by lm-eval 0.4.12, with native bfloat16 weights and float32 likelihood softmax. ArithMark uses the same precision policy and its official raw continuation log-likelihood-sum rule. Autocast is not used for evaluation. Every independent benchmark context starts with the native BOS token.
| Benchmark | Accuracy |
|---|---|
| HellaSwag | 27.97% |
| ARC-Easy | 36.74% |
| ARC-Challenge | 22.70% |
| PIQA | 58.43% |
| ArithMark-2 | 29.16% |
| ARC mean | 29.72% |
| Open SLM Leaderboard-style average | 36.32% |
The average is (HellaSwag + mean(ARC-Easy, ARC-Challenge) + PIQA + ArithMark-2) / 4, matching the Open SLM Leaderboard formula.
WikiText-103 validation at this step: loss 3.2634, perplexity 26.14, normalized BPB 1.3426 over 326,337 scored tokens and 1,144,346 normalized UTF-8 bytes, using one initial BOS, 1,024-token windows, and a 1,024-token stride.
- Downloads last month
- -