CoolFace
Modelpublic

SmallDoge/Doge-320M

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
8likes9.5kdownloads
Model Card

Doge 320M

<div align="center"> <img src="https://huggingface.co/spaces/SmallDoge/README/resolve/main/orgicon.png" width="100%" alt="SmallDoge" /> </div> <hr> <div align="center"> <a href="https://discord.gg/P2yYH95N" target="blank" style="margin: 2px;"> <img alt="Discord" src="https://img.shields.io/badge/Discord-Small%20Doges-7289da?logo=discord&logoColor=white&color=7289da" style="display: inline-block; vertical-align: middle;"/> </a> <!-- <a href="https://arxiv.org/abs/2412.11834" target="blank" style="margin: 2px;"> <img alt="arXiv" src="https://img.shields.io/static/v1?label=arXiv&message=2412.11834&color=B31B1B&logo=arXiv" style="display: inline-block; vertical-align: middle;"/> </a> --> <a href="https://github.com/SmallDoges/small-doge" target="blank" style="margin: 2px;"> <img alt="GitHub" src="https://img.shields.io/badge/GitHub-SmallDoge-181717?logo=github" style="display: inline-block; vertical-align: middle;"/> </a> <a href="https://github.com/SmallDoges/small-doge/blob/main/LICENSE" style="margin: 2px;"> <img alt="License" src="https://img.shields.io/badge/License-Apache--2.0-blue.svg" style="display: inline-block; vertical-align: middle;"/> </a> </div>

Doge uses Dynamic Mask Attention as sequence transformation and can use Multi-Layer Perceptron or Cross Domain Mixture of Experts as state transformation. Dynamic Mask Attention allows the Transformer to use self-attention during training and state space during inference, and Cross Domain Mixture of Experts can directly inherit the weights of Multi-Layer Perceptron for further training. This model is trained by SmallDoge community, for detailed algorithm and model architecture, paper coming soon, all training details and code are available in the small-doge repository.

Uses

python
>>> from transformers import AutoTokenizer, AutoModelForCausalLM

>>> tokenizer = AutoTokenizer.from_pretrained("SmallDoge/Doge-320M")
>>> model = AutoModelForCausalLM.from_pretrained("SmallDoge/Doge-320M", trust_remote_code=True)
>>> inputs = tokenizer("Hey how are you doing?", return_tensors="pt")

>>> out = model.generate(**inputs, max_new_tokens=100)
>>> print(tokenizer.batch_decode(out))

Model Details

We build the Doge by doing Per-Training on Smollm-Corpus. If you want to continue pre-training this model, you can find the unconverged checkpoint here. These models has not been fine-tuned for instruction, the instruction model is here.

Pre-Training:

ModelTraining DataStepsContent LengthTokensLRBatch SizePrecisionRTX 4090 GPU hours
Doge-20Msmollm-corpus8k20484B8e-30.5Mbfloat1614
Doge-60Msmollm-corpus16k204816B6e-31Mbfloat16128
Doge-160Msmollm-corpus24k204832B4e-31.5Mbfloat16522
Doge-320Msmollm-corpus32k204864B2e-32Mbfloat161856

Evaluation:

ModelMMLUTriviaQAARCPIQAHellaSwagOBQAWinograndetokens / s on i7-11 CPU
Doge-20M25.40.0329.858.427.325.650.2142
Doge-60M26.40.237.961.431.528.050.862
Doge-160M29.24.844.470.143.434.452.228
Doge-320M35.69.455.473.952.737.959.316

Procedure:

<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>

Environment:

  • Image: nvcr.io/nvidia/pytorch:24.12-py3
  • Hardware: 1x NVIDIA RTX 4090
  • Software: Transformers

Citation

bibtex
@misc{smalldoges,
  title={SmallDoges: A Family of Dynamic UltraFast Small Language Models}, 
  author={Jingze, Shi and Yifan, Wu and Bingheng, Wu and Yuyu, Luo},
  year={2025},
  month={March},
  url={https://github.com/SmallDoges/small-doge}
}