CoolFace
Modelpublic

WizardLMTeam/WizardCoder-15B-V1.0

sourceHugging Facebigscience-openrail-mupdated 3y agoView on Hugging Face
762likes864downloads
README.md305 linesDownload Raw Back to root
1---2license: bigscience-openrail-m3metrics:4- code_eval5library_name: transformers6tags:7- code8model-index:9- name: WizardCoder10  results:11  - task:12      type: text-generation13    dataset:14      type: openai_humaneval15      name: HumanEval16    metrics:17    - name: pass@118      type: pass@119      value: 0.57320      verified: false21---22 23## WizardCoder: Empowering Code Large Language Models with Evol-Instruct24 25<p style="font-size:28px;" align="center">26๐Ÿ  <a href="https://wizardlm.github.io/" target="_blank">Home Page</a> </p>27<p align="center">28<p align="center">29๐Ÿค— <a href="https://huggingface.co/WizardLM" target="_blank">HF Repo</a>  โ€ข๐Ÿฑ <a href="https://github.com/nlpxucan/WizardLM" target="_blank">Github Repo</a> โ€ข ๐Ÿฆ <a href="https://twitter.com/WizardLM_AI" target="_blank">Twitter</a> </p>30<p align="center">31 ๐Ÿ“ƒ <a href="https://arxiv.org/abs/2304.12244" target="_blank">[WizardLM]</a>  โ€ข ๐Ÿ“ƒ <a href="https://arxiv.org/abs/2306.08568" target="_blank">[WizardCoder]</a>   โ€ข ๐Ÿ“ƒ <a href="https://arxiv.org/abs/2308.09583" target="_blank">[WizardMath]</a>  <br>32</p>33<p align="center">34    ๐Ÿ‘‹ Join our <a href="https://discord.gg/VZjjHtWrKs" target="_blank">Discord</a>35</p>36 37## News38 39[2024/01/04] ๐Ÿ”ฅ We released **WizardCoder-33B-V1.1**  trained from deepseek-coder-33b-base, the **SOTA OSS Code LLM** on [EvalPlus Leaderboard](https://evalplus.github.io/leaderboard.html), achieves **79.9 pass@1** on HumanEval, **73.2 pass@1** on HumanEval-Plus, **78.9 pass@1** on MBPP, and **66.9 pass@1** on MBPP-Plus.40 41[2024/01/04] ๐Ÿ”ฅ **WizardCoder-33B-V1.1** outperforms **ChatGPT 3.5**, **Gemini Pro**, and **DeepSeek-Coder-33B-instruct** on HumanEval and HumanEval-Plus pass@1.42 43[2024/01/04] ๐Ÿ”ฅ **WizardCoder-33B-V1.1** is comparable with **ChatGPT 3.5**, and surpasses **Gemini Pro** on MBPP and MBPP-Plus pass@1.44 45|  Model  |  Checkpoint  | Paper    | HumanEval  |   HumanEval+ | MBPP | MBPP+ | License |46| ----- |------| ---- |------|-------| ----- |  ----- |----- | 47|  GPT-4-Turbo (Nov 2023)  | - | - | 85.4  | 81.7 | 83.0 | 70.7 |-|48|  GPT-4 (May 2023)  | - | - | 88.4  | 76.8 | - | - |-|49|  GPT-3.5-Turbo (Nov 2023)  | - | - | 72.6  | 65.9 | 81.7 | 69.4 |-|50|  Gemini Pro  | - | - | 63.4  | 55.5 | 72.9 | 57.9 |-|51|  DeepSeek-Coder-33B-instruct | - | - |  78.7 | 72.6 | 78.7 | 66.7 |-|52|  **WizardCoder-33B-V1.1**  |   ๐Ÿค— <a href="https://huggingface.co/WizardLM/WizardCoder-33B-V1.1" target="_blank">HF Link</a>   |  ๐Ÿ“ƒ <a href="https://arxiv.org/abs/2306.08568" target="_blank">[WizardCoder]</a>  |  79.9  | 73.2 | 78.9 | 66.9 |  <a href="https://huggingface.co/WizardLM/WizardMath-7B-V1.1/resolve/main/LICENSE" target="_blank">MSFTResearch</a>  |53|  WizardCoder-Python-34B-V1.0  |   ๐Ÿค— <a href="https://huggingface.co/WizardLM/WizardCoder-Python-34B-V1.0" target="_blank">HF Link</a>   |  ๐Ÿ“ƒ <a href="https://arxiv.org/abs/2306.08568" target="_blank">[WizardCoder]</a>  |  73.2   | 64.6 | 73.2 | 59.9 |  <a href="https://ai.meta.com/resources/models-and-libraries/llama-downloads/" target="_blank">Llama2</a>  |54|  WizardCoder-15B-V1.0  |   ๐Ÿค— <a href="https://huggingface.co/WizardLM/WizardCoder-15B-V1.0" target="_blank">HF Link</a>   |  ๐Ÿ“ƒ <a href="https://arxiv.org/abs/2306.08568" target="_blank">[WizardCoder]</a>  |  59.8   | 52.4 | -- | -- |  <a href="https://huggingface.co/spaces/bigcode/bigcode-model-license-agreement" target="_blank">OpenRAIL-M</a>  |55|  WizardCoder-Python-13B-V1.0  |   ๐Ÿค— <a href="https://huggingface.co/WizardLM/WizardCoder-Python-13B-V1.0" target="_blank">HF Link</a>   |  ๐Ÿ“ƒ <a href="https://arxiv.org/abs/2306.08568" target="_blank">[WizardCoder]</a>  |  64.0   | -- | -- | -- |  <a href="https://ai.meta.com/resources/models-and-libraries/llama-downloads/" target="_blank">Llama2</a>  |56|  WizardCoder-Python-7B-V1.0  |   ๐Ÿค— <a href="https://huggingface.co/WizardLM/WizardCoder-Python-7B-V1.0" target="_blank">HF Link</a>   |  ๐Ÿ“ƒ <a href="https://arxiv.org/abs/2306.08568" target="_blank">[WizardCoder]</a>  |  55.5   | -- | -- | -- |  <a href="https://ai.meta.com/resources/models-and-libraries/llama-downloads/" target="_blank">Llama2</a>  |57|  WizardCoder-3B-V1.0  |   ๐Ÿค— <a href="https://huggingface.co/WizardLM/WizardCoder-3B-V1.0" target="_blank">HF Link</a>   |  ๐Ÿ“ƒ <a href="https://arxiv.org/abs/2306.08568" target="_blank">[WizardCoder]</a>  |  34.8   | -- | -- | -- |  <a href="https://huggingface.co/spaces/bigcode/bigcode-model-license-agreement" target="_blank">OpenRAIL-M</a>  |58|  WizardCoder-1B-V1.0  |   ๐Ÿค— <a href="https://huggingface.co/WizardLM/WizardCoder-1B-V1.0" target="_blank">HF Link</a>   |  ๐Ÿ“ƒ <a href="https://arxiv.org/abs/2306.08568" target="_blank">[WizardCoder]</a>  |  23.8   | -- | -- | -- |  <a href="https://huggingface.co/spaces/bigcode/bigcode-model-license-agreement" target="_blank">OpenRAIL-M</a>  |59 60<p align="center" width="100%">61<a ><img src="https://raw.githubusercontent.com/nlpxucan/WizardLM/main/WizardCoder/imgs/compare_sota.png" alt="WizardCoder" style="width: 96%; min-width: 300px; display: block; margin: auto;"></a>62</p>63 64- ๐Ÿ”ฅ [08/11/2023] We release **WizardMath** Models.65- ๐Ÿ”ฅ Our **WizardMath-70B-V1.0** model slightly outperforms some closed-source LLMs on the GSM8K, including **ChatGPT 3.5**, **Claude Instant 1** and **PaLM 2 540B**.66- ๐Ÿ”ฅ Our **WizardMath-70B-V1.0** model achieves  **81.6 pass@1** on the [GSM8k Benchmarks](https://github.com/openai/grade-school-math), which is **24.8** points higher than the SOTA open-source LLM.67- ๐Ÿ”ฅ Our **WizardMath-70B-V1.0** model achieves  **22.7 pass@1** on the [MATH Benchmarks](https://github.com/hendrycks/math), which is **9.2** points higher than the SOTA open-source LLM.68 69| Model | Checkpoint | Paper  | GSM8k | MATH  |Online Demo| License|70| ----- |------| ---- |------|-------| ----- | ----- |71| WizardMath-70B-V1.0 | ๐Ÿค— <a href="https://huggingface.co/WizardLM/WizardMath-70B-V1.0" target="_blank">HF Link</a> |  ๐Ÿ“ƒ <a href="https://arxiv.org/abs/2308.09583" target="_blank">[WizardMath]</a>| **81.6**  |  **22.7**	|[Demo](http://47.103.63.15:50083/)| <a href="https://ai.meta.com/resources/models-and-libraries/llama-downloads/" target="_blank">Llama 2  </a> |72| WizardMath-13B-V1.0 | ๐Ÿค— <a href="https://huggingface.co/WizardLM/WizardMath-13B-V1.0" target="_blank">HF Link</a> |  ๐Ÿ“ƒ <a href="https://arxiv.org/abs/2308.09583" target="_blank">[WizardMath]</a>| **63.9**  |  **14.0** |[Demo](http://47.103.63.15:50082/)| <a href="https://ai.meta.com/resources/models-and-libraries/llama-downloads/" target="_blank">Llama 2 </a> |73| WizardMath-7B-V1.0 | ๐Ÿค— <a href="https://huggingface.co/WizardLM/WizardMath-7B-V1.0" target="_blank">HF Link</a>  |  ๐Ÿ“ƒ <a href="https://arxiv.org/abs/2308.09583" target="_blank">[WizardMath]</a>| 	 **54.9**  |  **10.7** | [Demo](http://47.103.63.15:50080/)|  <a href="https://ai.meta.com/resources/models-and-libraries/llama-downloads/" target="_blank">Llama 2  </a>|    74 75 76<font size=4>77    78| <sup>Model</sup> | <sup>Checkpoint</sup> | <sup>Paper</sup> |<sup>MT-Bench</sup> | <sup>AlpacaEval</sup> | <sup>WizardEval</sup> | <sup>HumanEval</sup>  | <sup>License</sup>|79| ----- |------| ---- |------|-------| ----- | ----- | ----- |80| <sup>WizardLM-13B-V1.2</sup> | <sup>๐Ÿค— <a href="https://huggingface.co/WizardLM/WizardLM-13B-V1.2" target="_blank">HF Link</a> </sup>|  | <sup>7.06</sup> | <sup>89.17%</sup>	 | <sup>101.4% </sup>|<sup>36.6  pass@1</sup>|<sup> <a href="https://ai.meta.com/resources/models-and-libraries/llama-downloads/" target="_blank">Llama 2 License </a></sup> |81| <sup>WizardLM-13B-V1.1</sup> |<sup> ๐Ÿค— <a href="https://huggingface.co/WizardLM/WizardLM-13B-V1.1" target="_blank">HF Link</a> </sup> |  | <sup>6.76</sup>  |<sup>86.32%</sup>	 | <sup>99.3% </sup> |<sup>25.0  pass@1</sup>| <sup>Non-commercial</sup>|82| <sup>WizardLM-30B-V1.0</sup> | <sup>๐Ÿค— <a href="https://huggingface.co/WizardLM/WizardLM-30B-V1.0" target="_blank">HF Link</a></sup>  | | <sup>7.01</sup> |  |  <sup>97.8% </sup> | <sup>37.8  pass@1</sup>| <sup>Non-commercial</sup> |83| <sup>WizardLM-13B-V1.0</sup> | <sup>๐Ÿค— <a href="https://huggingface.co/WizardLM/WizardLM-13B-V1.0" target="_blank">HF Link</a> </sup> |  | <sup>6.35</sup> | <sup>75.31%</sup> |  <sup>89.1% </sup> |<sup> 24.0 pass@1 </sup> | <sup>Non-commercial</sup>|84| <sup>WizardLM-7B-V1.0 </sup>|  <sup>๐Ÿค— <a href="https://huggingface.co/WizardLM/WizardLM-7B-V1.0" target="_blank">HF Link</a> </sup> |<sup> ๐Ÿ“ƒ <a href="https://arxiv.org/abs/2304.12244" target="_blank">[WizardLM]</a> </sup>|  |  |  <sup>78.0% </sup> |<sup>19.1 pass@1 </sup>|<sup> Non-commercial</sup>|85</font>86 87 88 89 90 91# WizardCoder: Empowering Code Large Language Models with Evol-Instruct92 93 94To develop our WizardCoder model, we begin by adapting the Evol-Instruct method specifically for coding tasks. This involves tailoring the prompt to the domain of code-related instructions. Subsequently, we fine-tune the Code LLM, StarCoder, utilizing the newly created instruction-following training set.95 96## News97 98- ๐Ÿ”ฅ Our **WizardCoder-15B-v1.0** model achieves the **57.3 pass@1** on the [HumanEval Benchmarks](https://github.com/openai/human-eval), which is **22.3** points higher than the SOTA open-source Code LLMs.99- ๐Ÿ”ฅ We released **WizardCoder-15B-v1.0** trained with **78k** evolved code instructions. Please checkout the [Model Weights](https://huggingface.co/WizardLM/WizardCoder-15B-V1.0), and [Paper]().100- &#x1F4E3; Please refer to our Twitter account https://twitter.com/WizardLM_AI and HuggingFace Repo https://huggingface.co/WizardLM . We will use them to announce any new release at the 1st time. 101 102 103## Comparing WizardCoder with the Closed-Source Models.104 105 106๐Ÿ”ฅ The following figure shows that our **WizardCoder attains the third position in this benchmark**, surpassing Claude-Plus (59.8 vs. 53.0) and Bard (59.8 vs. 44.5). Notably, our model exhibits a substantially smaller size compared to these models.107 108<p align="center" width="100%">109<a ><img src="https://raw.githubusercontent.com/nlpxucan/WizardLM/main/WizardCoder/imgs/pass1.png" alt="WizardCoder" style="width: 86%; min-width: 300px; display: block; margin: auto;"></a>110</p>111 112โ—**Note: In this study, we copy the scores for HumanEval and HumanEval+ from the [LLM-Humaneval-Benchmarks](https://github.com/my-other-github-account/llm-humaneval-benchmarks). Notably, all the mentioned models generate code solutions for each problem utilizing a **single attempt**, and the resulting pass rate percentage is reported. Our **WizardCoder** generates answers using greedy decoding and tests with the same [code](https://github.com/evalplus/evalplus).**113 114## Comparing WizardCoder with the Open-Source Models.115 116The following table clearly demonstrates that our **WizardCoder** exhibits a substantial performance advantage over all the open-source models. โ—**If you are confused with the different scores of our model (57.3 and 59.8), please check the Notes.**117 118 119| Model            | HumanEval Pass@1 | MBPP Pass@1 |120|------------------|------------------|-------------|121| CodeGen-16B-Multi| 18.3             |20.9         |122| CodeGeeX         | 22.9             |24.4         |123| LLaMA-33B        | 21.7             |30.2         |124| LLaMA-65B        | 23.7             |37.7         |125| PaLM-540B        | 26.2             |36.8         |126| PaLM-Coder-540B  | 36.0             |47.0         |127| PaLM 2-S         | 37.6             |50.0         |128| CodeGen-16B-Mono | 29.3             |35.3         |129| Code-Cushman-001 | 33.5             |45.9         |130| StarCoder-15B    | 33.6             |43.6*        |131| InstructCodeT5+  | 35.0             |--           |132| WizardLM-30B  1.0| 37.8             |--           |133| WizardCoder-15B  1.0 | **57.3**     |**51.8**     |134 135 136โ—**Note: The reproduced result of StarCoder on MBPP.**137 138โ—**Note: The above table conducts a comprehensive comparison of our **WizardCoder** with other models on the HumanEval and MBPP benchmarks. We adhere to the approach outlined in previous studies by generating **20 samples** for each problem to estimate the pass@1 score and evaluate with the same [code](https://github.com/openai/human-eval/tree/master). The scores of GPT4 and GPT3.5 reported by [OpenAI](https://openai.com/research/gpt-4) are 67.0 and 48.1 (maybe these are the early version GPT4&3.5).**139 140## Call for Feedbacks141We welcome everyone to use your professional and difficult instructions to evaluate WizardCoder, and show us examples of poor performance and your suggestions in the [issue discussion](https://github.com/nlpxucan/WizardLM/issues) area. We are focusing on improving the Evol-Instruct now and hope to relieve existing weaknesses and issues in the the next version of WizardCoder. After that, we will open the code and pipeline of up-to-date Evol-Instruct algorithm and work with you together to improve it.142 143 144## Contents145 1461. [Online Demo](#online-demo)147 1482. [Fine-tuning](#fine-tuning)149 1503. [Inference](#inference)151 1524. [Evaluation](#evaluation)153 1545. [Citation](#citation)155 1566. [Disclaimer](#disclaimer)157 158## Online Demo159 160We will provide our latest models for you to try for as long as possible. If you find a link is not working, please try another one. At the same time, please try as many **real-world** and **challenging** code-related problems that you encounter in your work and life as possible. We will continue to evolve our models with your feedbacks.161 162 163 164## Fine-tuning165 166We fine-tune WizardCoder using the modified code `train.py` from [Llama-X](https://github.com/AetherCortex/Llama-X).167We fine-tune StarCoder-15B with the following hyperparameters:168 169| Hyperparameter | StarCoder-15B |170|----------------|---------------|171| Batch size     | 512           |172| Learning rate  | 2e-5          |173| Epochs         | 3             |174| Max length     | 2048          |175| Warmup step    | 30            |176| LR scheduler   | cosine        |177 178To reproduce our fine-tuning of WizardCoder, please follow the following steps:1791. According to the instructions of [Llama-X](https://github.com/AetherCortex/Llama-X), install the environment, download the training code, and deploy. (Note: `deepspeed==0.9.2` and `transformers==4.29.2`)1802. Replace the `train.py` with the `train_wizardcoder.py` in our repo (`src/train_wizardcoder.py`)1813. Login Huggingface:182```bash183huggingface-cli login184```1854. Execute the following training command:186```bash187deepspeed train_wizardcoder.py \188    --model_name_or_path "bigcode/starcoder" \189    --data_path "/your/path/to/code_instruction_data.json" \190    --output_dir "/your/path/to/ckpt" \191    --num_train_epochs 3 \192    --model_max_length 2048 \193    --per_device_train_batch_size 16 \194    --per_device_eval_batch_size 1 \195    --gradient_accumulation_steps 4 \196    --evaluation_strategy "no" \197    --save_strategy "steps" \198    --save_steps 50 \199    --save_total_limit 2 \200    --learning_rate 2e-5 \201    --warmup_steps 30 \202    --logging_steps 2 \203    --lr_scheduler_type "cosine" \204    --report_to "tensorboard" \205    --gradient_checkpointing True \206    --deepspeed configs/deepspeed_config.json \207    --fp16 True208```209 210## Inference211 212We provide the decoding script for WizardCoder, which reads a input file and generates corresponding responses for each sample, and finally consolidates them into an output file.213 214You can specify `base_model`, `input_data_path` and `output_data_path` in `src\inference_wizardcoder.py` to set the decoding model, path of input file and path of output file.215 216```bash217pip install jsonlines218```219 220The decoding command is:221```222python src\inference_wizardcoder.py \223    --base_model "/your/path/to/ckpt" \224    --input_data_path "/your/path/to/input/data.jsonl" \225    --output_data_path "/your/path/to/output/result.jsonl"226```227 228The format of `data.jsonl` should be:229```230{"idx": 11, "Instruction": "Write a Python code to count 1 to 10."}231{"idx": 12, "Instruction": "Write a Jave code to sum 1 to 10."}232```233 234The prompt for our WizardCoder in `src\inference_wizardcoder.py` is:235```236Below is an instruction that describes a task. Write a response that appropriately completes the request.237 238### Instruction:239{instruction}240 241### Response:242```243 244## Evaluation245 246We provide the evaluation script on HumanEval for WizardCoder.247 2481. According to the instructions of [HumanEval](https://github.com/openai/human-eval), install the environment.2492. Run the following script to generate the answer.250```bash251model="/path/to/your/model"252temp=0.2253max_len=2048254pred_num=200255num_seqs_per_iter=2256 257output_path=preds/T${temp}_N${pred_num}258 259mkdir -p ${output_path}260echo 'Output path: '$output_path261echo 'Model to eval: '$model262 263# 164 problems, 21 per GPU if GPU=8264index=0265gpu_num=8266for ((i = 0; i < $gpu_num; i++)); do267  start_index=$((i * 21))268  end_index=$(((i + 1) * 21))269 270  gpu=$((i))271  echo 'Running process #' ${i} 'from' $start_index 'to' $end_index 'on GPU' ${gpu}272  ((index++))273  (274    CUDA_VISIBLE_DEVICES=$gpu python humaneval_gen.py --model ${model} \275      --start_index ${start_index} --end_index ${end_index} --temperature ${temp} \276      --num_seqs_per_iter ${num_seqs_per_iter} --N ${pred_num} --max_len ${max_len} --output_path ${output_path}277  ) &278  if (($index % $gpu_num == 0)); then wait; fi279done280```2813. Run the post processing code `src/process_humaneval.py` to collect the code completions from all answer files.282```bash283output_path=preds/T${temp}_N${pred_num}284 285echo 'Output path: '$output_path286python process_humaneval.py --path ${output_path} --out_path ${output_path}.jsonl --add_prompt287 288evaluate_functional_correctness ${output_path}.jsonl289```290 291## Citation292 293Please cite the repo if you use the data, method or code in this repo.294 295```296@article{luo2023wizardcoder,297  title={WizardCoder: Empowering Code Large Language Models with Evol-Instruct},298  author={Luo, Ziyang and Xu, Can and Zhao, Pu and Sun, Qingfeng and Geng, Xiubo and Hu, Wenxiang and Tao, Chongyang and Ma, Jing and Lin, Qingwei and Jiang, Daxin},299  journal={arXiv preprint arXiv:2306.08568},300  year={2023}301}302```303## Disclaimer304 305WizardCoder model follows the same license as StarCoder. The content produced by any version of WizardCoder is influenced by uncontrollable variables such as randomness, and therefore, the accuracy of the output cannot be guaranteed by this project. This project does not accept any legal liability for the content of the model output, nor does it assume responsibility for any losses incurred due to the use of associated resources and output results.