Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,98 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
---
|
| 7 |
+
|
| 8 |
+
This repo contains the Base (completed pretrain cudalm checkpoint) variant of LS-Micro. The FP32 checkpoint and optimiser is provided, and can be used by tinylm chat.
|
| 9 |
+
- Model size: 28.1MB (FP32)
|
| 10 |
+
- Cudalm QLM optimiser: 26.1MB
|
| 11 |
+
- Ngrams container: 14.4MB
|
| 12 |
+
- T1 sidecar: 48KB
|
| 13 |
+
- Environment vars: 295B
|
| 14 |
+
|
| 15 |
+
# LS-Micro-Base: Smallest and fastest model in the LS family.
|
| 16 |
+
|
| 17 |
+
| | HellaSwag | ARC-E | ARC-C | PIQA | LAMBADA | ArithMark | II* |
|
| 18 |
+
| ------------- | --------- | ----- | ----- | -------- | ------- | --------- | ---- |
|
| 19 |
+
| LS-Micro-Base | 27.41 | 34.72 | 21.93 | 54.84 | 11.06 | 35.50 | 7.24 |
|
| 20 |
+
| LS-Tiny-Base | 27.11 | 32.24 | 24.49 | 53.81 | 2.99 | 34.00 | 6.22 |
|
| 21 |
+
|
| 22 |
+
LS-Micro is 3x smaller than LS-TIny (11M vs 31M), and has 3x less active parameters (5M vs 15M), yet has a 16% higher intelligence index.
|
| 23 |
+
|
| 24 |
+
\* Intelligence Index was calculated using the formula from [Open SLM Leaderboard](https://huggingface.co/spaces/AxiomicLabs/Open_SLM_Leaderboard). (*Results reproducable via Cudalm's built in bench tool, see bottom quickstart*)
|
| 25 |
+
|
| 26 |
+
Pushing the limits of size to quality, LS-Micro-Base is a sparse 11.49M MoE model (A5.52M) pretrained on 5.7B tokens.
|
| 27 |
+
Training at a speed of 255.6k tokens/s on a 5060ti 16GB, it offers an incredible training efficiency at ~2.9x faster tokens seen compared to LS2.5's 108M-A17M model.
|
| 28 |
+
Fully trained in ~6 hours.
|
| 29 |
+
|
| 30 |
+
| **Model specs** | |
|
| 31 |
+
|----------------------|--------|
|
| 32 |
+
| Total parameters: | 11.49M |
|
| 33 |
+
| Backbone: | 7.28M |
|
| 34 |
+
| Active: | 5.52M |
|
| 35 |
+
| Ngrams: | 4.21M |
|
| 36 |
+
| Context length: | 2048 |
|
| 37 |
+
| **Pretrain details** | |
|
| 38 |
+
| Tokens seen: | ~5.7M |
|
| 39 |
+
| GPU time (5060ti): | 22310s |
|
| 40 |
+
|
| 41 |
+
*Note that it was trained with a 16k vocab, so 3.15M of the 5.52M active parameters are embedding.
|
| 42 |
+
|
| 43 |
+
## Chatbench results:
|
| 44 |
+
|
| 45 |
+
Multiple choice:
|
| 46 |
+
| category | n | acc | accnorm | chance |
|
| 47 |
+
| ------------- | --- | --------- | ----------- | ------ |
|
| 48 |
+
| fact | 25 | 48.0% | 60.0% | 25.0% |
|
| 49 |
+
| commonsense | 20 | 65.0% | 55.0% | 25.0% |
|
| 50 |
+
| instruct | 20 | 55.0% | 50.0% | 25.0% |
|
| 51 |
+
| relevance | 20 | 5.0% | 30.0% | 25.0% |
|
| 52 |
+
| consistency | 18 | 61.1% | 72.2% | 25.0% |
|
| 53 |
+
| arithmetic | 15 | 46.7% | 46.7% | 25.0% |
|
| 54 |
+
| ALL: LS-Micro | 118 | **46.6%** | **52.5%** | 25.0% |
|
| 55 |
+
| ALL: LS-Tiny | 118 | 40.7% | 47.5% | 25.0% |
|
| 56 |
+
|
| 57 |
+
Open ended generation:
|
| 58 |
+
| category | n | eot | kw | degen | rel/tok | relwin |
|
| 59 |
+
| -------- | -- | ------ | ----- | ----- | ------- | ------ |
|
| 60 |
+
| greet | 8 | 75.0% | 62.5% | 12.5% | +0.428 | 100.0% |
|
| 61 |
+
| explain | 16 | 62.5% | 75.0% | 6.2% | +0.624 | 100.0% |
|
| 62 |
+
| advice | 16 | 37.5% | 68.8% | 6.2% | +0.436 | 100.0% |
|
| 63 |
+
| creative | 16 | 62.5% | 93.8% | 0.0% | +0.925 | 100.0% |
|
| 64 |
+
| list | 16 | 68.8% | 43.8% | 6.2% | +0.806 | 100.0% |
|
| 65 |
+
| howto | 12 | 25.0% | 58.3% | 8.3% | +0.334 | 100.0% |
|
| 66 |
+
| opinion | 8 | 75.0% | 62.5% | 0.0% | +1.104 | 100.0% |
|
| 67 |
+
| math | 4 | 100.0% | 0.0% | 0.0% | +2.438 | 100.0% |
|
| 68 |
+
| ALL | 96 | 58.3% | 64.6% | 5.2% | +0.736 | 100.0% |
|
| 69 |
+
|
| 70 |
+
## The base model is horrendous at chat, and is intended to be used as a base to be finetuned for specialised tasks.
|
| 71 |
+
To try LS-Micro or to train/finetune the model, follow this quickstart guide:
|
| 72 |
+
1. Clone the latest version of Cudalm [here](https://github.com/Dsg2/cudalm-c) (only windows supported currently, optimised for Blackwell 2.0/CPU).
|
| 73 |
+
2. Build with `build.py`/'build.py --cpu'. Run cudalm to init all folders.
|
| 74 |
+
3. Download all LS-Micro files from `Checkpoint\\` and drop them in `<cudalm.exe>\models\\`. Cudalm then automatically detect the model.
|
| 75 |
+
|
| 76 |
+
Voila, you can now start experimenting with the model. Some basic stuff you can try first:
|
| 77 |
+
|
| 78 |
+
- Check the model's config, and settings used to train it. `> Model info`
|
| 79 |
+
- Run the model: `> Generate`
|
| 80 |
+
|
| 81 |
+
## Finetune guide:
|
| 82 |
+
To finetune the model, you first need to prepare some data.
|
| 83 |
+
|
| 84 |
+
Navigate to `> Data tools...`. You can download preconfigured mixtures of data, use files on your system or nitpick your own datasets.
|
| 85 |
+
- To use a preset corpus, navigate into `> Data tools... > Download text`.
|
| 86 |
+
- Otherwise, find a dataset on hugginface and navigate to `> Data tools... > Browse Hugging Face`, and pick out your chosen dataset from there. Note that datasets with gated access requires your `HF_TOKEN` to be set.
|
| 87 |
+
|
| 88 |
+
This guide will use the dataset [MiniCPM5-2B-distill](https://huggingface.co/datasets/Dsg2/MiniCPM5-2B-distill) as an example. For your own text or other datasets, simply select the folder while tokenizing.
|
| 89 |
+
|
| 90 |
+
Navigate to `> Data tools... > Browse Hugging Face`, and search for "MiniCPM5-2B-distill". Cudalm automatically detects the format, so all you need to do is download it (~250MB).
|
| 91 |
+
|
| 92 |
+
Then you will need to tokenize the text so that the model can be trained on it. To do this, you will need a trained tokenizer. Luckily, you can extract an existing model's tokenizer. Use `> Data tools... > Tokenizer from model` and pull out LS-Micro-Base's tokenizer.
|
| 93 |
+
|
| 94 |
+
Now you can tokenize your data. Go to `> Data tools... > Build corpus` and set `mode` to "new" and give it a corpus name. For your own datasets or text, navigate to the folder the text files are in. Otherwise, select `<cudalm.exe>\data\hf_MiniCPM5-2B-distill`, then use the extracted tokenizer and select `Run`. It should take ~10s and produce `<cudalm.exe>\data\<corpus name>`
|
| 95 |
+
|
| 96 |
+
You're now ready to start fine tuning!
|
| 97 |
+
|
| 98 |
+
Go to `> Train` and select "LS-Micro-Base" as the model, and the tokenized corpus as the data directory (both auto-detected). Select Run to start training the model on the selected corpus. Progress prints and periodic saves will occur every few hundred iters.
|