YuLan-Mini is a lightweight language model with 2.4 billion parameters. It achieves performance comparable to industry-leading models trained on significantly more data, despite being pre-trained on only 1.08T tokens. The model excels particularly in the domains of **mathematics** and **code**. To facilitate reproducibility, we open-source the relevant [pre-training resources](https://github.com/RUC-GSAI/YuLan-Mini#pre-training-resources-) and [post-training technical report](https://github.com/RUC-GSAI/YuLan-Mini/tree/main/post_train). --- ## News - [2025.06.25] 🥳 *YuLan-Mini: Pushing the Limits of Open Data-efficient Language Model* has been accepted by ACL 2025 Main Conference Oral! - [2025.05.16] 🥳 *YuLan-Mini: Pushing the Limits of Open Data-efficient Language Model* has been accepted by ACL 2025 Main Conference. - [2025.04.11] A clearer data mixture [table](https://docs.google.com/spreadsheets/d/1YP8-loVUxgxo36UEpOwflR3GRHLieBnLlCy8g10g8RU/edit?gid=0#gid=0). - [2025.03.16] Math, code, & reasoninig classifiers released - [2025.03.07] W&B Logs for ablation studies released - [2025.02.28] [YuLan-Mini-Instruct](/post_train) released - [2025.01.29] YuLan-Mini-Instruct-v1 released - [2024.12.23] YuLan-Mini & pre-training resources released ## Model Downloads 🔗 > YuLan-Mini is part of the [YuLan family](https://github.com/RUC-GSAI/YuLan-Chat), which includes models with larger sizes and different training strategies. | Model | Context Length | SFT | 🤗 Hugging Face | ModelScope | Wise Model | |---------|----------------|-----|-----------------|------------|------------| | YuLan-Mini | 28K | ❎ | [`Base`](https://huggingface.co/yulan-team/YuLan-Mini) | [`Base`](https://modelscope.cn/models/yulan-team/YuLan-Mini) | [`Base`](https://wisemodel.cn/models/yulan-team/YuLan-Mini) | | YuLan-Mini-Instruct | 28K | ✅ | [`Instruct`](https://huggingface.co/yulan-team/YuLan-Mini-Instruct) | | | > The intermediate checkpoint can be found [here](https://github.com/RUC-GSAI/YuLan-Mini#pre-training-resources-) --- ## Features 🌟
config.jsonDue to the implementation of Hugging Face Trainer, certain parameters are stored in the config.json file and cannot be modified through the Trainer's command-line arguments. Therefore, you need to update these parameters in the config.json file first, particularly:
save_steps: The frequency of saving intermediate checkpoints.train_batch_size: The batch size per GPU (equivalent to per_device_train_batch_size in the Trainer). We used a batch size of 1008 (approximately 4M tokens) during the stable training stage. Maintaining this same batch size is equally important for training effectiveness.Below is an example of a properly configured config.json file:
{
"best_metric": null,
"best_model_checkpoint": null,
"epoch": 0.0,
"eval_steps": 500,
"global_step": 0,
"is_hyper_param_search": false,
"is_local_process_zero": true,
"is_world_process_zero": true,
"log_history": [],
"logging_steps": 3,
"max_steps": 0,
"num_input_tokens_seen": 0,
"num_train_epochs": 0,
"save_steps": 250,
"stateful_callbacks": {
"TrainerControl": {
"args": {
"should_epoch_stop": false,
"should_evaluate": false,
"should_log": false,
"should_save": true,
"should_training_stop": true
},
"attributes": {}
}
},
"total_flos": 0,
"train_batch_size": 3,
"trial_name": null,
"trial_params": null
}
To ensure DeepSpeed Integration loads the Universal Checkpoint, you need to enable this feature in the DeepSpeed configuration JSON file.
Here is an example of a ZeRO2 configuration with Universal Checkpointing enabled:
{
"bf16": {
"enabled": "auto"
},
"zero_optimization": {
"stage": 2,
"allgather_partitions": true,
"allgather_bucket_size": 8e8,
"overlap_comm": true,
"reduce_scatter": true,
"reduce_bucket_size": 8e8,
"contiguous_gradients": true
},
"gradient_accumulation_steps": "auto",
"gradient_clipping": "auto",
"steps_per_print": 16,
"train_batch_size": "auto",
"train_micro_batch_size_per_gpu": "auto",
"wall_clock_breakdown": false,
"dump_state": true,
"optimizer": {
"type": "AdamW",
"params": {
"lr": "auto",
"betas": "auto",
"eps": "auto",
"weight_decay": "auto"
}
},
"checkpoint": {
"load_universal": true
}
}
When calling trainer.train, include the resume_from_checkpoint argument to load the distributed optimizer state from the Universal Checkpoint and resume training.
trainer.train(resume_from_checkpoint=training_args.resume_from_checkpoint)
We provide an internal training framework for your reference, but you are free to choose other frameworks.
| Stage | Curriculum Phase | 4K Context | 28K Context | Optimizer | Inference Architecture | LAMBADA Acc |
GSM8K Acc |
HumanEval pass@1 |
|---|---|---|---|---|---|---|---|---|
| Stable | 5 | YuLan-Mini-Phase5 | yulanmini |
53.85 | 3.41 | 12.26 | ||
| Stable | 10 | YuLan-Mini-Phase10 | yulanmini |
55.00 | 9.57 | 15.95 | ||
| Stable | 15 | YuLan-Mini-Phase15 | yulanmini |
55.81 | 13.81 | 16.99 | ||
| Stable | 20 | YuLan-Mini-Phase20 | ✅ | yulanmini |
55.81 | 21.39 | 20.79 | |
| Stable | 25 (1T tokens) | YuLan-Mini-Before-Annealing | ✅ | yulanmini |
55.67 | 29.94 | 34.06 | |
| Annealing | 26 | YuLan-Mini-4K | llama* |
64.72 | 66.65 | 61.60 | ||
| Annealing | 27 | YuLan-Mini | llama* |
65.67 | 68.46 | 64.00 |