{"id":27344440,"url":"https://github.com/RUC-GSAI/YuLan-Mini","last_synced_at":"2025-04-12T17:06:22.644Z","repository":{"id":269454869,"uuid":"906043750","full_name":"RUC-GSAI/YuLan-Mini","owner":"RUC-GSAI","description":"A highly capable 2.4B lightweight LLM using only 1T pre-training data with all details.","archived":false,"fork":false,"pushed_at":"2025-04-06T14:40:09.000Z","size":9071,"stargazers_count":168,"open_issues_count":0,"forks_count":12,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-06T15:36:57.827Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2412.17743","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RUC-GSAI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-20T03:37:02.000Z","updated_at":"2025-04-06T14:40:12.000Z","dependencies_parsed_at":"2025-01-10T08:29:02.678Z","dependency_job_id":"2141f269-c1df-46d1-b9d3-0f5a5cdad406","html_url":"https://github.com/RUC-GSAI/YuLan-Mini","commit_stats":null,"previous_names":["ruc-gsai/yulan-mini"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RUC-GSAI%2FYuLan-Mini","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RUC-GSAI%2FYuLan-Mini/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RUC-GSAI%2FYuLan-Mini/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RUC-GSAI%2FYuLan-Mini/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RUC-GSAI","download_url":"https://codeload.github.com/RUC-GSAI/YuLan-Mini/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248602309,"owners_count":21131615,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-12T17:02:13.685Z","updated_at":"2025-04-12T17:06:22.630Z","avatar_url":"https://github.com/RUC-GSAI.png","language":"Python","funding_links":[],"categories":["A01_文本生成_文本对话"],"sub_categories":["大语言对话模型及数据"],"readme":"\u003ch4 align=\"center\"\u003e\n    \u003cp\u003e\n        \u003ca href=\"https://github.com/RUC-GSAI/YuLan-Mini/blob/main/README_zh.md\"\u003e中文\u003c/a\u003e| \u003cb\u003eEnglish\u003c/b\u003e | \u003ca href=\"https://github.com/RUC-GSAI/YuLan-Mini/blob/main/README_ja.md\"\u003e日本語\u003c/a\u003e\n    \u003cp\u003e\n\u003c/h4\u003e\n\n\u003cdiv align=center\u003e\n\u003cimg src=\"assets/YuLan-logo.jpg\" width=\"400px\"\u003e\n\u003ch1\u003eYuLan-Mini: An Open Data-efficient Language Model\u003c/h1\u003e\n\u003ca href=\"https://github.com/RUC-GSAI/YuLan-Mini/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/Code_License-MIT-blue\" alt=\"license\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/RUC-GSAI/YuLan-Mini/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/Model_License-MIT-blue\" alt=\"license\"\u003e\u003c/a\u003e\n\u003ca href=\"https://arxiv.org/abs/2412.17743\" target=\"_blank\"\u003e\u003cimg src=https://img.shields.io/badge/arXiv-b5212f.svg?logo=arxiv\u003e\u003c/a\u003e\n\u003ca href=\"https://huggingface.co/collections/yulan-team/yulan-mini-676d214b24376739b00d95f3\"\u003e\u003cimg alt=\"Hugging Face\" src=\"https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-blue?color=8A2BE2\"\u003e\u003c/a\u003e\n\u003ca\u003e\u003cimg src=\"https://img.shields.io/github/stars/RUC-GSAI/YuLan-Mini\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\nYuLan-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).\n\n---\n\n## News\n\n- [2025.04.11] A clearer data mixture [table](https://docs.google.com/spreadsheets/d/1YP8-loVUxgxo36UEpOwflR3GRHLieBnLlCy8g10g8RU/edit?gid=0#gid=0).\n- [2025.03.16] Math, code, \u0026 reasoninig classifiers released\n- [2025.03.07] W\u0026B Logs for ablation studies released\n- [2025.02.28] [YuLan-Mini-Instruct](/post_train) released\n- [2025.01.29] YuLan-Mini-Instruct-v1 released\n- [2024.12.23] YuLan-Mini \u0026 pre-training resources released\n\n## Model Downloads 🔗\n\n\u003e 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.\n\n|  Model  | Context Length | SFT | 🤗 Hugging Face | ModelScope | Wise Model |\n|---------|----------------|-----|-----------------|------------|------------|\n| 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) |\n| YuLan-Mini-Instruct | 28K | ✅ | [`Instruct`](https://huggingface.co/yulan-team/YuLan-Mini-Instruct) | | |\n\n\u003e The intermediate checkpoint can be found [here](https://github.com/RUC-GSAI/YuLan-Mini#pre-training-resources-)\n\n---\n\n## Features 🌟\n\n\u003cdiv align=center\u003e\n\u003cimg src=\"assets/main.png\"\u003e\n\u003c/div\u003e\n\nOur pre-training methodology improves training efficiency through three key innovations:\n\n1. an elaborately designed **data pipeline** that combines data cleaning with data schedule strategies;\n2. a systematic **optimization method** that can effectively mitigate training instability;\n3. an effective **annealing approach** that integrate targeted data selection and long context training.\n\n\n---\n## Behchmarks 🌟\n\n| Models                  | MMLU | CEVAL | GSM8K | ARC_CHALLENGE | GPQA | MATH | HUMANEVAL@1 | MBPP@10 |\n|-------------------------|-------|-------|-------|---------------|------|------|-------------|--------|\n| Qwen-2.5-1.5B-Instruct  | 57.5  | 65.4  | 73.2  | 47.8          | 29.8 | 55.2 | 61.6        | 88.1   |\n| Llama3.2-3B-Instruct    | 60    | 45.9  | 43.4  | 78.6          | 38.6 | 48   | 51.5        | 80.4   |\n| YuLan-Mini-Instruct  | 53.6  | 50.5    | 82.3  | 51.8          | 30.1 | 55.2 | 67.7        | 85.7   |\n\n\n\u003e Note: The model size calculation includes the embedding size.\n\n|      Models      | Model Size | # Train Tokens | Context Length | MATH 500 | GSM 8K | Human Eval | MBPP   | RACE Middle | RACE High | RULER  |\n|:----------------|----------:|--------------:|--------------:|:--------|:------|:----------|:------|:-----------|:---------|:------|\n|     MiniCPM      |    2.71B    |     1.06T      |       4K       |   15.00  |  53.83 |     50.00* |  47.31 |     56.61   |   44.27   |   N/A  |\n|      Qwen-2      |    1.54B    |       7T       |      128K      |   22.60  | 46.90* |     34.80* | 46.90* |     55.77   |   43.69   |  60.16 |\n|     Qwen2.5      |    0.49B    |      18T       |      128K      |   23.60  | 41.60* |     30.50* | 39.30* |     52.36   |   40.31   |  49.23 |\n|     Qwen2.5      |    1.54B    |      18T       |      128K      |   **45.40**  | **68.50\\*** |     37.20* | 60.20* |     **58.77**   |   44.33   |  \u003cins\u003e68.26\u003c/ins\u003e |\n|     Gemma2       |    2.61B    |       2T       |       8K       |   18.30* | 30.30* |     19.50* | 42.10* |       -     |      -    |   N/A  |\n|    StableLM2     |    1.64B    |       2T       |       4K       |     -    |  20.62 |      8.50* |  17.50 |     56.33   |   **45.06**   |   N/A  |\n|    SmolLM2       |    1.71B    |      11T       |       8K       |   11.80  |    -   |     23.35  |  45.00 |     55.77   |   43.06   |   N/A  |\n|    Llama3.2      |    3.21B    |       9T       |      128K      |    7.40  |    -   |     29.30  |  49.70 |     55.29   |   43.34   |  **77.06** |\n|    YuLan-Mini    |    2.42B    |     1.04T      |       4K       |   32.60  |  66.65 |     \u003cins\u003e61.60\u003c/ins\u003e  |  **66.70** |     55.71   |   43.58   |   N/A  |\n|    YuLan-Mini    |    2.42B    |     1.08T      |      28K       |  \u003cins\u003e37.80\u003c/ins\u003e  |  \u003cins\u003e68.46\u003c/ins\u003e |    **64.00**  |  \u003cins\u003e65.90\u003c/ins\u003e|     \u003cins\u003e57.18\u003c/ins\u003e   |   \u003cins\u003e44.57\u003c/ins\u003e   |  51.48 |\n\n\n|      Models      | LAMBADA | MMLU  | CMMLU | CEval | HellaSwag | WinoGrande | StoryCloze | ARC-e | ARC-c |\n|:----------------|:-------|:-----|:-----|:-----|:----------|:-----------|:-----------|:-----|:-----|\n|   MiniCPM-2.71B   |  61.91  | 53.37 | 48.97 | 48.24 |   67.92    |     65.74   |     78.51   | 55.51 | 43.86 |\n|   Qwen2-1.54B     |  64.68  | 55.90 | **70.76** | **71.94** |   66.11    |     66.14   |     77.60   | 62.21 | 42.92 |\n|  Qwen2.5-0.49B    |  52.00  | 47.50 | 52.17 | 54.27 |   50.54    |     55.88   |     71.67   | 56.10 | 39.51 |\n|  Qwen2.5-1.54B    |  62.12  | \u003cins\u003e60.71\u003c/ins\u003e | \u003cins\u003e67.82\u003c/ins\u003e | \u003cins\u003e69.05\u003c/ins\u003e |   67.18    |     64.48   |     76.80   | **71.51** | \u003cins\u003e53.41\u003c/ins\u003e |\n|   Gemma2-2.61B    |    -    | 52.20*|   -   | 28.00*|   \u003cins\u003e74.60*\u003c/ins\u003e   |    **71.50\\***   |       -     |   -   | **55.70\\***|\n| StableLM2-1.64B   |  66.15  | 40.37 | 29.29 | 26.99 |   69.79    |     64.64   |     \u003cins\u003e78.56\u003c/ins\u003e   | 54.00 | 40.78 |\n|  SmolLM2-1.71B    |  \u003cins\u003e67.42\u003c/ins\u003e  | 51.91 | 33.46 | 35.10 |   72.96    |     67.40   |     **79.32**   | 44.82 | 35.49 |\n|   Llama3.2-3.21B    |  **69.08**  | **63.40** | 44.44 | 44.49 |   **75.62**    |     \u003cins\u003e67.48\u003c/ins\u003e   |     76.80   | \u003cins\u003e70.12\u003c/ins\u003e | 48.81 |\n|    YuLan-Mini-2.42B-4K    |  64.72  | 51.79 | 48.35 | 51.47 |   68.65    |     67.09   |     76.37   | 69.87 | 50.51 |\n|    YuLan-Mini-2.42B-28K    |  65.67  | 49.10 | 45.45 | 48.23 |   67.22    |     67.24   |     75.89   | 67.47 | 49.32 |\n\n\n---\n\n## Pre-Training Resources 🔧\n\nTo enhance research transparency and reproducibility, we are open-sourcing relevant [pre-training resources](https://github.com/RUC-GSAI/YuLan-Mini/blob/main/pretrain):\n\n### Pre-Training\n\n\u003cdetails\u003e\u003csummary\u003e1. Pre-training and Evaluation Code\u003c/summary\u003e\n\nThe pre-training code can be found [here](https://github.com/RUC-GSAI/YuLan-Mini/tree/main/pretrain). Note that due to subsequent code modifications, this code may not run directly and may require some adjustments.\n\n\u003ch4 id=\"step-1-modify-the-config-json-\"\u003eStep 1: Modify the \u003ccode\u003econfig.json\u003c/code\u003e\u003c/h4\u003e\n\u003cp\u003eDue to the implementation of Hugging Face Trainer, certain parameters are stored in the \u003ccode\u003econfig.json\u003c/code\u003e file and cannot be modified through the Trainer\u0026#39;s command-line arguments. Therefore, you need to update these parameters in the \u003ccode\u003econfig.json\u003c/code\u003e file first, particularly:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\u003cstrong\u003e\u003ccode\u003esave_steps\u003c/code\u003e\u003c/strong\u003e: The frequency of saving intermediate checkpoints.\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e\u003ccode\u003etrain_batch_size\u003c/code\u003e\u003c/strong\u003e: The batch size per GPU (equivalent to \u003ccode\u003eper_device_train_batch_size\u003c/code\u003e 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.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eBelow is an example of a properly configured \u003ccode\u003econfig.json\u003c/code\u003e file:\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"lang-json\"\u003e{\n  \u003cspan class=\"hljs-attr\"\u003e\"best_metric\"\u003c/span\u003e: \u003cspan class=\"hljs-literal\"\u003enull\u003c/span\u003e,\n  \u003cspan class=\"hljs-attr\"\u003e\"best_model_checkpoint\"\u003c/span\u003e: \u003cspan class=\"hljs-literal\"\u003enull\u003c/span\u003e,\n  \u003cspan class=\"hljs-attr\"\u003e\"epoch\"\u003c/span\u003e: \u003cspan class=\"hljs-number\"\u003e0.0\u003c/span\u003e,\n  \u003cspan class=\"hljs-attr\"\u003e\"eval_steps\"\u003c/span\u003e: \u003cspan class=\"hljs-number\"\u003e500\u003c/span\u003e,\n  \u003cspan class=\"hljs-attr\"\u003e\"global_step\"\u003c/span\u003e: \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e,\n  \u003cspan class=\"hljs-attr\"\u003e\"is_hyper_param_search\"\u003c/span\u003e: \u003cspan class=\"hljs-literal\"\u003efalse\u003c/span\u003e,\n  \u003cspan class=\"hljs-attr\"\u003e\"is_local_process_zero\"\u003c/span\u003e: \u003cspan class=\"hljs-literal\"\u003etrue\u003c/span\u003e,\n  \u003cspan class=\"hljs-attr\"\u003e\"is_world_process_zero\"\u003c/span\u003e: \u003cspan class=\"hljs-literal\"\u003etrue\u003c/span\u003e,\n  \u003cspan class=\"hljs-attr\"\u003e\"log_history\"\u003c/span\u003e: [],\n  \u003cspan class=\"hljs-attr\"\u003e\"logging_steps\"\u003c/span\u003e: \u003cspan class=\"hljs-number\"\u003e3\u003c/span\u003e,\n  \u003cspan class=\"hljs-attr\"\u003e\"max_steps\"\u003c/span\u003e: \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e,\n  \u003cspan class=\"hljs-attr\"\u003e\"num_input_tokens_seen\"\u003c/span\u003e: \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e,\n  \u003cspan class=\"hljs-attr\"\u003e\"num_train_epochs\"\u003c/span\u003e: \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e,\n  \u003cspan class=\"hljs-attr\"\u003e\"save_steps\"\u003c/span\u003e: \u003cspan class=\"hljs-number\"\u003e250\u003c/span\u003e,\n  \u003cspan class=\"hljs-attr\"\u003e\"stateful_callbacks\"\u003c/span\u003e: {\n    \u003cspan class=\"hljs-attr\"\u003e\"TrainerControl\"\u003c/span\u003e: {\n      \u003cspan class=\"hljs-attr\"\u003e\"args\"\u003c/span\u003e: {\n        \u003cspan class=\"hljs-attr\"\u003e\"should_epoch_stop\"\u003c/span\u003e: \u003cspan class=\"hljs-literal\"\u003efalse\u003c/span\u003e,\n        \u003cspan class=\"hljs-attr\"\u003e\"should_evaluate\"\u003c/span\u003e: \u003cspan class=\"hljs-literal\"\u003efalse\u003c/span\u003e,\n        \u003cspan class=\"hljs-attr\"\u003e\"should_log\"\u003c/span\u003e: \u003cspan class=\"hljs-literal\"\u003efalse\u003c/span\u003e,\n        \u003cspan class=\"hljs-attr\"\u003e\"should_save\"\u003c/span\u003e: \u003cspan class=\"hljs-literal\"\u003etrue\u003c/span\u003e,\n        \u003cspan class=\"hljs-attr\"\u003e\"should_training_stop\"\u003c/span\u003e: \u003cspan class=\"hljs-literal\"\u003etrue\u003c/span\u003e\n      },\n      \u003cspan class=\"hljs-attr\"\u003e\"attributes\"\u003c/span\u003e: {}\n    }\n  },\n  \u003cspan class=\"hljs-attr\"\u003e\"total_flos\"\u003c/span\u003e: \u003cspan class=\"hljs-number\"\u003e0\u003c/span\u003e,\n  \u003cspan class=\"hljs-attr\"\u003e\"train_batch_size\"\u003c/span\u003e: \u003cspan class=\"hljs-number\"\u003e3\u003c/span\u003e,\n  \u003cspan class=\"hljs-attr\"\u003e\"trial_name\"\u003c/span\u003e: \u003cspan class=\"hljs-literal\"\u003enull\u003c/span\u003e,\n  \u003cspan class=\"hljs-attr\"\u003e\"trial_params\"\u003c/span\u003e: \u003cspan class=\"hljs-literal\"\u003enull\u003c/span\u003e\n}\n\u003c/code\u003e\u003c/pre\u003e\n\u003ch4 id=\"step-2-enable-universal-checkpointing-in-the-deepspeed-configuration\"\u003eStep 2: Enable Universal Checkpointing in the DeepSpeed Configuration\u003c/h4\u003e\n\u003cp\u003eTo ensure DeepSpeed Integration loads the Universal Checkpoint, you need to enable this feature in the DeepSpeed configuration JSON file. \u003c/p\u003e\n\u003cp\u003eHere is an example of a ZeRO2 configuration with Universal Checkpointing enabled:\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"lang-json\"\u003e{\n  \u003cspan class=\"hljs-attr\"\u003e\"bf16\"\u003c/span\u003e: {\n    \u003cspan class=\"hljs-attr\"\u003e\"enabled\"\u003c/span\u003e: \u003cspan class=\"hljs-string\"\u003e\"auto\"\u003c/span\u003e\n  },\n  \u003cspan class=\"hljs-attr\"\u003e\"zero_optimization\"\u003c/span\u003e: {\n    \u003cspan class=\"hljs-attr\"\u003e\"stage\"\u003c/span\u003e: \u003cspan class=\"hljs-number\"\u003e2\u003c/span\u003e,\n    \u003cspan class=\"hljs-attr\"\u003e\"allgather_partitions\"\u003c/span\u003e: \u003cspan class=\"hljs-literal\"\u003etrue\u003c/span\u003e,\n    \u003cspan class=\"hljs-attr\"\u003e\"allgather_bucket_size\"\u003c/span\u003e: \u003cspan class=\"hljs-number\"\u003e8e8\u003c/span\u003e,\n    \u003cspan class=\"hljs-attr\"\u003e\"overlap_comm\"\u003c/span\u003e: \u003cspan class=\"hljs-literal\"\u003etrue\u003c/span\u003e,\n    \u003cspan class=\"hljs-attr\"\u003e\"reduce_scatter\"\u003c/span\u003e: \u003cspan class=\"hljs-literal\"\u003etrue\u003c/span\u003e,\n    \u003cspan class=\"hljs-attr\"\u003e\"reduce_bucket_size\"\u003c/span\u003e: \u003cspan class=\"hljs-number\"\u003e8e8\u003c/span\u003e,\n    \u003cspan class=\"hljs-attr\"\u003e\"contiguous_gradients\"\u003c/span\u003e: \u003cspan class=\"hljs-literal\"\u003etrue\u003c/span\u003e\n  },\n  \u003cspan class=\"hljs-attr\"\u003e\"gradient_accumulation_steps\"\u003c/span\u003e: \u003cspan class=\"hljs-string\"\u003e\"auto\"\u003c/span\u003e,\n  \u003cspan class=\"hljs-attr\"\u003e\"gradient_clipping\"\u003c/span\u003e: \u003cspan class=\"hljs-string\"\u003e\"auto\"\u003c/span\u003e,\n  \u003cspan class=\"hljs-attr\"\u003e\"steps_per_print\"\u003c/span\u003e: \u003cspan class=\"hljs-number\"\u003e16\u003c/span\u003e,\n  \u003cspan class=\"hljs-attr\"\u003e\"train_batch_size\"\u003c/span\u003e: \u003cspan class=\"hljs-string\"\u003e\"auto\"\u003c/span\u003e,\n  \u003cspan class=\"hljs-attr\"\u003e\"train_micro_batch_size_per_gpu\"\u003c/span\u003e: \u003cspan class=\"hljs-string\"\u003e\"auto\"\u003c/span\u003e,\n  \u003cspan class=\"hljs-attr\"\u003e\"wall_clock_breakdown\"\u003c/span\u003e: \u003cspan class=\"hljs-literal\"\u003efalse\u003c/span\u003e,\n  \u003cspan class=\"hljs-attr\"\u003e\"dump_state\"\u003c/span\u003e: \u003cspan class=\"hljs-literal\"\u003etrue\u003c/span\u003e,\n  \u003cspan class=\"hljs-attr\"\u003e\"optimizer\"\u003c/span\u003e: {\n    \u003cspan class=\"hljs-attr\"\u003e\"type\"\u003c/span\u003e: \u003cspan class=\"hljs-string\"\u003e\"AdamW\"\u003c/span\u003e,\n    \u003cspan class=\"hljs-attr\"\u003e\"params\"\u003c/span\u003e: {\n      \u003cspan class=\"hljs-attr\"\u003e\"lr\"\u003c/span\u003e: \u003cspan class=\"hljs-string\"\u003e\"auto\"\u003c/span\u003e,\n      \u003cspan class=\"hljs-attr\"\u003e\"betas\"\u003c/span\u003e: \u003cspan class=\"hljs-string\"\u003e\"auto\"\u003c/span\u003e,\n      \u003cspan class=\"hljs-attr\"\u003e\"eps\"\u003c/span\u003e: \u003cspan class=\"hljs-string\"\u003e\"auto\"\u003c/span\u003e,\n      \u003cspan class=\"hljs-attr\"\u003e\"weight_decay\"\u003c/span\u003e: \u003cspan class=\"hljs-string\"\u003e\"auto\"\u003c/span\u003e\n    }\n  },\n  \u003cspan class=\"hljs-attr\"\u003e\"checkpoint\"\u003c/span\u003e: {\n    \u003cspan class=\"hljs-attr\"\u003e\"load_universal\"\u003c/span\u003e: \u003cspan class=\"hljs-literal\"\u003etrue\u003c/span\u003e\n  }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\u003ch4 id=\"step-3-resume-training\"\u003eStep 3: Resume Training\u003c/h4\u003e\n\u003cp\u003eWhen calling \u003ccode\u003etrainer.train\u003c/code\u003e, include the \u003ccode\u003eresume_from_checkpoint\u003c/code\u003e argument to load the distributed optimizer state from the Universal Checkpoint and resume training.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"lang-python\"\u003e\u003cspan class=\"hljs-attr\"\u003etrainer.train(resume_from_checkpoint\u003c/span\u003e=\u003cspan class=\"hljs-string\"\u003etraining_args.resume_from_checkpoint)\u003c/span\u003e\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eWe provide an internal \u003ca href=\"https://github.com/RUC-GSAI/YuLan-Mini/tree/main/pretrain\"\u003etraining framework\u003c/a\u003e for your reference, but you are free to choose other frameworks.\u003c/p\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e2. Intermediate Stage Checkpoints\u003c/summary\u003e\nThe intermediate stage checkpoints are released in \u003ca href=\"https://huggingface.co/collections/yulan-team/yulan-mini-676d214b24376739b00d95f3\"\u003eYuLan-Mini\u003c/a\u003e.\n\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003eStage\u003c/th\u003e\n            \u003cth\u003eCurriculum Phase\u003c/th\u003e\n            \u003cth\u003e4K Context\u003c/th\u003e\n            \u003cth\u003e28K Context\u003c/th\u003e\n            \u003cth\u003eOptimizer\u003c/th\u003e\n            \u003cth\u003eInference Architecture\u003c/th\u003e\n            \u003cth\u003eLAMBADA \u003ccode\u003eAcc\u003c/code\u003e\u003c/th\u003e\n            \u003cth\u003eGSM8K \u003ccode\u003eAcc\u003c/code\u003e\u003c/th\u003e\n            \u003cth\u003eHumanEval \u003ccode\u003epass@1\u003c/code\u003e\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd\u003eStable\u003c/td\u003e\n            \u003ctd\u003e5\u003c/td\u003e\n            \u003ctd\u003e\u003ca href=\"https://huggingface.co/yulan-team/YuLan-Mini-Phase5\"\u003eYuLan-Mini-Phase5\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003eyulanmini\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e53.85\u003c/td\u003e\n            \u003ctd\u003e3.41\u003c/td\u003e\n            \u003ctd\u003e12.26\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003eStable\u003c/td\u003e\n            \u003ctd\u003e10\u003c/td\u003e\n            \u003ctd\u003e\u003ca href=\"https://huggingface.co/yulan-team/YuLan-Mini-Phase10\"\u003eYuLan-Mini-Phase10\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003eyulanmini\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e55.00\u003c/td\u003e\n            \u003ctd\u003e9.57\u003c/td\u003e\n            \u003ctd\u003e15.95\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003eStable\u003c/td\u003e\n            \u003ctd\u003e15\u003c/td\u003e\n            \u003ctd\u003e\u003ca href=\"https://huggingface.co/yulan-team/YuLan-Mini-Phase15\"\u003eYuLan-Mini-Phase15\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003eyulanmini\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e55.81\u003c/td\u003e\n            \u003ctd\u003e13.81\u003c/td\u003e\n            \u003ctd\u003e16.99\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003eStable\u003c/td\u003e\n            \u003ctd\u003e20\u003c/td\u003e\n            \u003ctd\u003e\u003ca href=\"https://huggingface.co/yulan-team/YuLan-Mini-Phase20\"\u003eYuLan-Mini-Phase20\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003c/td\u003e\n            \u003ctd\u003e✅\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003eyulanmini\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e55.81\u003c/td\u003e\n            \u003ctd\u003e21.39\u003c/td\u003e\n            \u003ctd\u003e20.79\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003eStable\u003c/td\u003e\n            \u003ctd\u003e25 (1T tokens)\u003c/td\u003e\n            \u003ctd\u003e\u003ca href=\"https://huggingface.co/yulan-team/YuLan-Mini-Before-Annealing\"\u003eYuLan-Mini-Before-Annealing\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003c/td\u003e\n            \u003ctd\u003e✅\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003eyulanmini\u003c/code\u003e\u003c/td\u003e\n            \u003ctd\u003e55.67\u003c/td\u003e\n            \u003ctd\u003e29.94\u003c/td\u003e\n            \u003ctd\u003e34.06\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003eAnnealing\u003c/td\u003e\n            \u003ctd\u003e26\u003c/td\u003e\n            \u003ctd\u003eYuLan-Mini-4K\u003c/td\u003e\n            \u003ctd\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003ellama\u003c/code\u003e*\u003c/td\u003e\n            \u003ctd\u003e64.72\u003c/td\u003e\n            \u003ctd\u003e66.65\u003c/td\u003e\n            \u003ctd\u003e61.60\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003eAnnealing\u003c/td\u003e\n            \u003ctd\u003e27\u003c/td\u003e\n            \u003ctd\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ca href=\"https://huggingface.co/yulan-team/YuLan-Mini\"\u003eYuLan-Mini\u003c/a\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003ccode\u003ellama\u003c/code\u003e*\u003c/td\u003e\n            \u003ctd\u003e65.67\u003c/td\u003e\n            \u003ctd\u003e68.46\u003c/td\u003e\n            \u003ctd\u003e64.00\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n\\*: For easier inference and deployment, we merged the re-parameterized added parameters and scaling factors into the final released models ([**YuLan-Mini**](https://huggingface.co/yulan-team/YuLan-Mini) and **YuLan-Mini-Intermediate-4K**), enabling it to run on the Llama architecture. However, these parameters are still retained in the intermediate checkpoints from the training process.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e3. Optimizer States Before Annealing\u003c/summary\u003e\n\n\u003ca href=\"https://huggingface.co/yulan-team/YuLan-Mini-Before-Annealing\"\u003e🤗 YuLan-Mini-Before-Annealing\u003c/a\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e4. Logs of Ablation Studies\u003c/summary\u003e\n\nWe provide W\u0026B logs, including the intermediate hidden states and weights of each module, for ablation studies:\n\n\u003ca href=\"https://wandb.ai/yiwen_hu/YuLan-Mini?nw=dld21gv708t\"\u003e\u003cimg alt=\"W\u0026B Logs\" src=\"https://img.shields.io/badge/Weights_\u0026_Biases-FFCC33?style=for-the-badge\u0026logo=WeightsAndBiases\u0026logoColor=black\"\u003e\u003c/a\u003e\n\n\u003cul\u003e\n    \u003cli\u003eWeSaR Re-Param\u003c/li\u003e\n    \u003cli\u003eCerebras muP\u003c/li\u003e\n    \u003cli\u003eEmbedding LayerNorm\u003c/li\u003e\n    \u003cli\u003eTie Embedding\u003c/li\u003e\n    \u003cli\u003eQK LayerNorm\u003c/li\u003e\n    \u003cli\u003eWeight Decay\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/details\u003e\n\n\n### Datasets\n\n\n\u003cdetails\u003e\u003csummary\u003e5. The Used Open-Source Datasets \u003c/summary\u003e\n\n\u003ca href=\"https://github.com/RUC-GSAI/YuLan-Mini/blob/main/pretrain/datasets\"\u003eUsed-Datasets-List\u003c/a\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e6. Data Distribution for every phase\u003c/summary\u003e\n\n⬇️ Click for more details:\n\u003ca href=\"https://github.com/RUC-GSAI/YuLan-Mini/blob/main/pretrain/datasets/final.pdf\"\u003e\n  \u003cdiv align=center\u003e\n    \u003cimg src=\"https://github.com/RUC-GSAI/YuLan-Mini/blob/main/assets/data_distribution_for_every_phase.png\"\u003e\n  \u003c/div\u003e\n\u003c/a\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e7. Synthetic Data\u003c/summary\u003e\n\n\u003ca href=\"https://github.com/RUC-GSAI/YuLan-Mini/blob/main/pretrain/preprocess\"\u003eData cleaning\u003c/a\u003e and \u003ca href=\"https://github.com/RUC-GSAI/YuLan-Mini/blob/main/pretrain/synthesis\"\u003esynthesis\u003c/a\u003e pipeline:\n\n\u003cdiv align=center\u003e\n\u003cimg src=\"https://github.com/RUC-GSAI/YuLan-Mini/blob/main/assets/data-pipeline.png\"\u003e\n\u003c/div\u003e\n\nThe synthetic data we are using is released in \u003ca href=\"https://huggingface.co/collections/yulan-team/yulan-mini-676d214b24376739b00d95f3\"\u003e🤗 YuLan-Mini-Datasets\u003c/a\u003e\n\nClassifiers: \u003ca href=\"https://huggingface.co/collections/yulan-team/yulan-mini-resources-67b29e0086256b72099b7add\"\u003e🤗 Yulan-Mini Resources\u003c/a\u003e\n\n\u003c/details\u003e\n\n\n### What you can do with these pre-training resources\n\n1. **Pre-train** your own LLM. You can use [our data](https://huggingface.co/yulan-team/YuLan-Mini-Datasets) and curriculum to train a model that's just as powerful as YuLan-Mini.\n2. Perform your own **learning rate annealing**. During the annealing phase, YuLan-Mini's learning ability is at its peak. You can resume training from [the checkpoint before annealing](https://huggingface.co/yulan-team/YuLan-Mini-Before-Annealing) and use your own dataset for learning rate annealing.\n3. **Fine-tune** the Instruct version of the LLM. You can use the [YuLan-Mini](https://huggingface.co/yulan-team/YuLan-Mini) base model to train your own Instruct version.\n4. **Training dynamics** research. You can use YuLan-Mini's [intermediate checkpoints](https://huggingface.co/collections/yulan-team/yulan-mini-676d214b24376739b00d95f3) to explore internal changes during the pre-training process.\n5. **Synthesize** your own data. You can use YuLan-Mini's [data pipeline](https://github.com/RUC-GSAI/YuLan-Mini) to clean and generate your own dataset.\n\n---\n\n## Quick Start 💻\n\nBelow is a simple example for inference using Huggingface:\n\n**Huggingface Inference Example**\n```python\nimport torch\nfrom transformers import AutoTokenizer, AutoModelForCausalLM\n\n# Load model and tokenizer\ntokenizer = AutoTokenizer.from_pretrained(\"yulan-team/YuLan-Mini-Instruct\")\nmodel = AutoModelForCausalLM.from_pretrained(\"yulan-team/YuLan-Mini-Instruct\", torch_dtype=torch.bfloat16)\n\n# Input text\nchat = [\n    {\"role\": \"system\", \"content\": \"You are YuLan-Mini, created by RUC AI Box. You are a helpful assistant.\"},\n    {\"role\": \"user\", \"content\": \"What is Renmin University of China?\"}\n]\nformatted_chat = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)\ninputs = tokenizer(formatted_chat, return_tensors=\"pt\", add_special_tokens=False)\n\n# Completion\noutput = model.generate(inputs[\"input_ids\"], max_new_tokens=100, temperature=0.5)\nprint(tokenizer.decode(output[0][inputs['input_ids'].size(1):], skip_special_tokens=True))\n```\n\n**vLLM Serve Example**\n```bash\nvllm serve yulan-team/YuLan-Mini-Instruct --dtype bfloat16\n```\n\n**SGLang Serve Example**\n```bash\npython -m sglang.launch_server --model-path yulan-team/YuLan-Mini-Instruct --port 30000 --host 0.0.0.0\n```\n\n**Ollama**\n```bash\nollama run hf.co/mradermacher/YuLan-Mini-Instruct-GGUF:IQ4_XS\n```\n\n---\n\n## Contributing\n\nWe welcome any form of contribution, including feedback on model bad cases, feature suggestions, and example contributions. You can do so by submitting an [issue](https://github.com/RUC-GSAI/YuLan-Mini/issues).\n\n## The Team\n\nYuLan-Mini is developed and maintained by [AI Box, Renmin University of China](http://aibox.ruc.edu.cn/).\n\n## License\n\n- The code in this repository, the model weights, and optimizer states are released under the [MIT License](./LICENSE).\n- Policies regarding the use of model weights, intermediate optimizer states, and training data will be announced in future updates.\n- Limitations: Despite our efforts to mitigate safety concerns and encourage the generation of ethical and lawful text, the probabilistic nature of language models may still lead to unexpected outputs. For instance, responses might contain bias, discrimination, or other harmful content. Please refrain from disseminating such content. We are not liable for any consequences arising from the spread of harmful information.\n\n## Citation\n\nIf you find YuLan-Mini helpful for your research or development, please cite [our technical report](https://arxiv.org/abs/2412.17743) and blog:\n\n\n```\n@article{hu2024yulan,\n  title={YuLan-Mini: An Open Data-efficient Language Model},\n  author={Hu, Yiwen and Song, Huatong and Deng, Jia and Wang, Jiapeng and Chen, Jie and Zhou, Kun and Zhu, Yutao and Jiang, Jinhao and Dong, Zican and Zhao, Wayne Xin and others},\n  journal={arXiv preprint arXiv:2412.17743},\n  year={2024}\n}\n\n@article{YuLan-Mini-Instruct,\n  title={YuLan-Mini-Instruct Technical Report},\n  author={RUCAIBox YuLan-Mini-Instruct Team},\n  url={https://github.com/RUC-GSAI/YuLan-Mini},\n  year={2025}\n}\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRUC-GSAI%2FYuLan-Mini","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRUC-GSAI%2FYuLan-Mini","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRUC-GSAI%2FYuLan-Mini/lists"}