| --- |
| language: |
| - en |
| license: apache-2.0 |
| library_name: pytorch |
| pipeline_tag: text-generation |
| pretty_name: Muse2-230M |
| tags: |
| - text-generation |
| - conversational |
| - hybrid-attention |
| - convolution |
| - grouped-query-attention |
| - edge |
| - on-device |
| - structured-output |
| - json |
| - muse2 |
| task_categories: |
| - text-generation |
| - conversational |
| size_categories: |
| - 100M<n<1B |
| --- |
| |
| # Muse2-230M |
|
|
| ## Model Information |
|
|
| The Muse2 collection is a family of compact language models built **entirely from scratch** — architecture, tokenizer, and inference stack — for edge and on-device use. Muse2 pairs an LFM2-style hybrid layout (short causal convolutions + grouped-query attention) with a parallel merged SwiGLU MLP per block, chosen for inference efficiency on constrained hardware. The instruction-tuned version is optimized for assistant-like chat, formatting, and structured extraction from developer logs. |
|
|
| **Model Developer:** Muse Research (lingom) |
|
|
| **Model Architecture:** Muse2 is an auto-regressive language model that uses a hybrid convolution/attention architecture implemented from scratch in PyTorch (`Muse2ForCausalLM`, no `transformers` code). The tuned version is aligned with supervised fine-tuning (SFT) with completion-only loss masking. No RLHF or DPO has been applied. |
|
|
| | | Params | Input modalities | Output modalities | Context Length | GQA | Shared Embeddings | Knowledge cutoff | |
| | :---- | :---- | :---- | :---- | :---- | :---- | :---- | :---- | |
| | Muse2-230M (Base) | 230M (196.1M) | English Text | English Text and code | 8k (128k max) | Yes | Yes | Early 2024 | |
| | Muse2-230M (Instruct) | 230M (196.1M) | English Text | English Text and code | 8k (128k max) | Yes | Yes | Early 2024 | |
|
|
| **Supported Languages:** English. The model also handles source code and mathematical text. |
|
|
| **Muse2 Model Family:** All model versions use Grouped-Query Attention (GQA, 16 query / 8 key-value heads) and tied input/output embeddings. The 14-block layout interleaves 8 causal depthwise short-convolution blocks (kernel size 3) with 6 full-attention blocks; RoPE with theta 1e6; RMSNorm; parallel merged SwiGLU MLPs (hidden 1024, ff 2560); vocabulary of 65,536 byte-level BPE tokens trained from scratch (pad=0, bos=1, eos=7, ChatML-style control tokens). |
|
|
| **Model Release Date:** Aug 23, 2026 |
|
|
| **Status:** This is a static model. Later versions may be released that improve model capabilities. |
|
|
| **License:** Model weights are released under Apache-2.0. |
|
|
| ## Intended Use |
|
|
| **Intended Use Cases:** Muse2 is intended for research and education: studying compact hybrid architectures, edge/on-device inference, structured log-to-JSON extraction, formatting-disciplined output, and as a base for further fine-tuning. The Instruct version is intended for assistant-like chat in resource-constrained environments where a small footprint matters more than factual reliability. |
|
|
| **Out of Scope:** Production deployment without developer-side evaluation and guardrails. Any safety-critical, medical, legal, or factual-reliance use. Use in any manner that violates applicable laws or the upstream dataset licenses. The model has had **no safety alignment, red-teaming, or content filtering** applied. |
|
|
| ## How to use |
|
|
| This repository uses the from-scratch `muse` package (PyTorch + safetensors only). The config schema follows the LFM2-family layout for edge-tooling compatibility, but the architecture is not a transformers-native class. |
|
|
| ```python |
| import torch |
| from tokenizers import Tokenizer |
| from muse import Muse2ForCausalLM |
| from muse.sft_data import apply_chat_template |
| |
| model = Muse2ForCausalLM.from_pretrained(".", dtype=torch.float32).eval() |
| tk = Tokenizer.from_file("tokenizer.json") |
| |
| messages = [ |
| {"role": "system", "content": "You are an automated, silent compiler API."}, |
| {"role": "user", "content": "<raw log> + <required schema>"}, |
| ] |
| ids = apply_chat_template(tk, messages) # ends at the assistant header |
| out = model.generate(torch.tensor([ids]), max_new_tokens=256, |
| temperature=0.2, top_k=50, eos_token_id=4) # <|im_end|> |
| print(tk.decode(out[0][len(ids):].tolist(), skip_special_tokens=True)) |
| ``` |
|
|
| Interactive chat on a single cloud T4: |
|
|
| ```bash |
| modal run modal_app.py::chat |
| ``` |
|
|
| Local CPU chat: `python scripts/chat.py --model . --interactive` |
|
|
| ## Responsibility & Safety |
|
|
| Muse2 is a research artifact released without safety fine-tuning, red-teaming, or content classification. It can produce inaccurate, biased, repetitive, or otherwise objectionable output, and it **hallucinates facts readily at this model scale**. Developers are solely responsible for deployment decisions and should add appropriate input/output safeguards for any application, and should not rely on the model for correctness. |
|
|
| ## Ethical Considerations and Limitations |
|
|
| **Values:** Muse2 is intended to make small-scale, from-scratch language-model development accessible — every component (tokenizer, architecture, inference stack) is open and reproducible. |
|
|
| **Testing:** Safety and capability testing to date is limited to qualitative inspection. It does not cover, nor could it cover, all scenarios. Before any deployment, developers should perform testing appropriate to their use case. Upstream dataset licenses and attribution requirements continue to apply to derivative uses. |
|
|