CoolFace
Modelpublic

IFM/K2

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
103likes681downloads
README.md156 linesDownload Raw Back to root
1---2license: apache-2.03language:4- en5pipeline_tag: text-generation6library_name: transformers7tags:8- nlp9- llm10---11# K2: a fully-reproducible large language model outperforming Llama 2 70B using 35% less compute12 13LLM360 demystifies the training recipe used for Llama 2 70B with K2. K2 is fully transparent, meaning we’ve open-sourced all artifacts, including code, data, model checkpoints, intermediate results, and more.14 15<center><img src="k2_eval_table.png" alt="k2 eval table" /></center>16 17## About K2:18* 65 billion parameter LLM19* Tokens: 1.4T20* Languages: English21* Models Released: base, chat model22* Trained in 2 stages23* License: Apache 2.024 25K2 was developed as a collaboration between [MBZUAI](https://mbzuai.ac.ae/institute-of-foundation-models/), [Petuum](https://www.petuum.com/), and [LLM360](https://www.llm360.ai/).26 27## LLM360 Model Performance and Evaluation Collection28 29The LLM360 Performance and Evaluation Collection is a robust evaluations set consisting of general and domain specific evaluations to assess model knowledge and function. 30 31 32Evaluations include standard best practice benchmarks, medical, math, and coding knowledge. More about the evaluations can be found [here](https://www.llm360.ai/evaluation.html).33 34 35<center><img src="k2_table_of_tables.png" alt="k2 big eval table"/></center>36 37Detailed analysis can be found on the K2 Weights and Biases project [here](https://wandb.ai/llm360/K2?nw=29mu6l0zzqq)38 39## Open LLM Leaderboard40| Evaluation      | Score      | Raw Score      |41| ----------- | ----------- | ----------- | 42| IFEval   | 22.52        | 23       |43| BBH   | 28.22        | 50       |44| Math Lvl 5   | 2.04        | 2       |45| GPQA   | 3.58        | 28       |46| MUSR   | 8.55        | 40       |47| MMLU-PRO   | 22.27        | 30       |48| Average   | 14.53        | 35.17       |49 50## K2 Gallery51The K2 gallery allows one to browse the output of various prompts on intermediate K2 checkpoints, which provides an intuitive understanding on how the model develops and improves over time. This is inspired by The Bloom Book.52 53[View K2 gallery here](https://huggingface.co/spaces/LLM360/k2-gallery)54 55## Datasets and Mix56 57The following data mix was used to train K2 and achieve results in line with Llama 2 70B. 58 59The full data sequence can be found [here](https://huggingface.co/datasets/LLM360/K2Datasets/tree/main) 60 61| Dataset      | Starting Tokens      | Multiplier      | Total Tokens      |% of Total      |62| ----------- | ----------- | ----------- | ----------- | ----------- |63| dm-math   | 4.33B        | 3x       | 13B       | 1%       |64| pubmed-abstracts   | 4.77B        | 3x       | 14.3B       | 1.1%       |65| uspto   | 4.77B        | 3x       | 14.3B       | 1.1%       |66| pubmed-central   | 26B        | 1x       | 26B       | 2%       |67| [redpajama.arxiv](https://huggingface.co/datasets/cerebras/SlimPajama-627B)   | 27.3B        | 1x       | 27.3B       | 2.1%       |68| [starcoder.spm](https://huggingface.co/datasets/bigcode/starcoderdata)   | 67.6B        | 0.5x       | 33.8B       | 2.6%       |69| [starcoder.fim](https://huggingface.co/datasets/bigcode/starcoderdata)   | 67.6B        | 0.5x       | 33.8B       | 2.6%       |70| [redpajama.stackexchange](https://huggingface.co/datasets/cerebras/SlimPajama-627B)   | 61.1B        | 1x       | 61.1B       | 4.7%       |71| [starcoder](https://huggingface.co/datasets/bigcode/starcoderdata)   | 132.6B        | 0.5x       | 66.3B       | 5.1%       |72| [pile-of-law](https://huggingface.co/datasets/pile-of-law/pile-of-law)   | 76.7B        | 1x       | 76.7B       | 5.9%       |73| [redpajama.book](https://huggingface.co/datasets/cerebras/SlimPajama-627B)   | 80.6B        | 1x       | 80.6B       | 6.2%       |74| s2orc   | 107.9B        | 1x       | 107.9B       | 8.3%       |75| [redpajama.wikipedia](https://huggingface.co/datasets/cerebras/SlimPajama-627B)   | 22.1B        | 6x       | 132.6B       | 10.2%       |76| [refinedweb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb)   | 612.3B        | 1x       | 612.3B       | 47.1%       |77| Totals   | -        | -       | 1.3T       | 100%       |78 79 80# LLM360 Reasearch Suite81 82## Stage 2 - Last 10 Checkpoints83| Checkpoints      |  |84| ----------- | ----------- |85| [Checkpoint 380](https://huggingface.co/LLM360/K2/tree/ministage2_ckpt_380)     | [Checkpoint 375](https://huggingface.co/LLM360/K2/tree/ministage2_ckpt_375)       |86| [Checkpoint 379](https://huggingface.co/LLM360/K2/tree/ministage2_ckpt_379)   | [Checkpoint 374](https://huggingface.co/LLM360/K2/tree/ministage2_ckpt_374)        |87| [Checkpoint 378](https://huggingface.co/LLM360/K2/tree/ministage2_ckpt_378)   | [Checkpoint 373](https://huggingface.co/LLM360/K2/tree/ministage2_ckpt_373)        |88| [Checkpoint 377](https://huggingface.co/LLM360/K2/tree/ministage2_ckpt_377)   | [Checkpoint 372](https://huggingface.co/LLM360/K2/tree/ministage2_ckpt_372)        |89| [Checkpoint 376](https://huggingface.co/LLM360/K2/tree/ministage2_ckpt_376)   | [Checkpoint 371](https://huggingface.co/LLM360/K2/tree/ministage2_ckpt_371)        |90 91## Stage 1 - Last 10 Checkpoints92| Checkpoints      |  |93| ----------- | ----------- |94| [Checkpoint 360](https://huggingface.co/LLM360/K2/tree/ckpt_360)     | [Checkpoint 355](https://huggingface.co/LLM360/K2/tree/ckpt_355)       |95| [Checkpoint 359](https://huggingface.co/LLM360/K2/tree/ckpt_359)   | [Checkpoint 354](https://huggingface.co/LLM360/K2/tree/ckpt_354)        |96| [Checkpoint 358](https://huggingface.co/LLM360/K2/tree/ckpt_358)   | [Checkpoint 353](https://huggingface.co/LLM360/K2/tree/ckpt_353)        |97| [Checkpoint 357](https://huggingface.co/LLM360/K2/tree/ckpt_357)   | [Checkpoint 352](https://huggingface.co/LLM360/K2/tree/ckpt_352)        |98| [Checkpoint 356](https://huggingface.co/LLM360/K2/tree/ckpt_356)   | [Checkpoint 351](https://huggingface.co/LLM360/K2/tree/ckpt_351)        |99 100[to find all branches: git branch -a]101 102## LLM360 Pretraining Suite103We provide step-by-step reproducation tutorials for tech enthusiasts, AI practitioners and academic or industry researchers who want to learn pretraining techniques [here](https://www.llm360.ai/pretraining.html).104 105## LLM360 Developer Suite106We provide step-by-step finetuning tutorials for tech enthusiasts, AI practitioners and academic or industry researchers [here](https://www.llm360.ai/developer.html).107 108# Loading K2109```python110from transformers import AutoModelForCausalLM, AutoTokenizer111 112tokenizer = AutoTokenizer.from_pretrained("LLM360/K2")113model = AutoModelForCausalLM.from_pretrained("LLM360/K2")114 115prompt = 'what is the highest mountain on earth?'116 117input_ids = tokenizer(prompt, return_tensors="pt").input_ids118gen_tokens = model.generate(input_ids, do_sample=True, max_new_tokens=128)119 120print("-"*20 + "Output for model"  + 20 * '-')121print(tokenizer.batch_decode(gen_tokens)[0])122```123 124 125 126## About LLM360127LLM360 is an open research lab enabling community-owned AGI through open-source large model research and development.128 129 130LLM360 enables community-owned AGI by creating standards and tools to advance the bleeding edge of LLM capability and empower knowledge transfer, research, and development. 131 132We believe in a future where artificial general intelligence (AGI) is created by the community, for the community. Through an open ecosystem of equitable computational resources, high quality data, and flowing technical knowledge, we can ensure ethical AGI development and universal access for all innovators.133 134[Visit us](https://www.llm360.ai/)135 136## Citation137 138**BibTeX:**139 140```bibtex141@article{K2,142      title={LLM360 K2-65B: Scaling Up Fully Transparent Open-Source LLMs}, 143      author={144      Zhengzhong Liu and Bowen Tan145      and Hongyi Wang and Willie Neiswanger and Tianhua Tao146      and Haonan Li and Fajri Koto and Yuqi Wang and Suqi Sun147      and Omkar Pangarkar and Richard Fan and Yi Gu and Victor Miller148      and Liqun Ma and Liping Tang and Nikhil Ranjan and Yonghao Zhuang149      and Guowei He and Renxi Wang and Mingkai Deng and Robin Algayres 150      and Yuanzhi Li and Zhiqiang Shen and Preslav Nakov151      and Eric Xing      152      },153      year={2024},154}155 156```