bxod commited on
Commit
762fc34
·
verified ·
1 Parent(s): 7a233b8

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +24 -11
README.md CHANGED
@@ -35,29 +35,42 @@ pipeline_tag: text-generation
35
 
36
  ### Model Description
37
 
38
- Our **Llama-3.2-3B-Instruct-uz** model has been continually pretrained with context length of 2048 tokens, on 2.4B tokens (67% English, 33% Uzbek), then SFT fine-tuned. Our customized tokenizer averages 1.7 tokens per Uzbek word vs. ~3.5 in the original Llama models, meaning 2x faster inference and longer effective context length on Uzbek text. You’ll be able to run this model on just 4 GB of VRAM (with quantization), perfect for small GPUs, edge devices, or even mobile scenarios.
 
 
 
39
 
40
  ---
41
 
 
42
 
43
- ### Benchmarks
 
 
 
 
 
 
 
44
 
 
 
45
  | Model | BLEU Uz→En (Zero_shot) | BLEU En→Uz (Zero_shot) | COMET Uz→En | COMET En→Uz | Uzbek Sentiment Analysis | Uzbek News Classification | MMLU (English) (Zero_shot) |
46
  | --------------------------------- | ----: | ----: | ----: | ----: | ----: | ----: | ----: |
47
- | **Llama-3.2 1B Instruct** | 3.62 | 0.44 | 56.72 | 35.52 | 54.77 | 42.16 | 38.15 |
48
- | **Llama-3.2 1B Instruct Uz** | 10.33 | 5.29 | 74.39 | 72.34 | 65.25 | 17.14 | 27.20 |
49
- | **Llama-3.2 3B Instruct** | 11.91 | 2.54 | 71.96 | 55.62 | 56.01 | 70.60 | 52.04 |
50
- | **Llama-3.2 3B Instruct Uz** | 20.47 | **9.18** | **83.20** | 80.71 | **77.55** | 41.43 | 45.91 |
51
- | **Llama-3.1 8B Instruct** | **24.23** | 8.28 | 83.12 | **82.22** | 69.77 | **73.63** | **60.59** |
52
 
53
- The results show that our Uzbek-optimized models consistently outperform their base counterparts in translation benchmarks (BLEU and COMET) on the FLORES+ Uz-En / En-Uz evaluation datasets and sentiment analysis in Uzbek language. Also, on the MMLU benchmark, which measures general language understanding across multiple tasks in English, and News classification tasks, our Uzbek optimized model showed slight decline because of catastrophic forgetting of original English instruction following. (The official Llama model’s MMLU score may differ from our score due to our evaluation method. Refer to the links below to see evaluation details.)
54
 
55
- Looking ahead, these models are only **experimental checkpoints** with a room for improvement. We’re eager to see how these models will contribute to Uzbek open-source and be used by our Uzbek 🇺🇿 community. 🚀
56
 
 
57
 
58
  ## How to use
59
 
60
- The Llama-3.2-1B-Instruct-uz model can be used with transformers in the following way. We recommend preprocessing Uzbek input to replace apostrophe (') with sequence (APST) to achieve our model's lower tokenizer fertility.
61
 
62
 
63
  ### Use with transformers
@@ -69,7 +82,7 @@ import langid
69
 
70
  DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
71
  DTYPE = torch.bfloat16
72
- MODEL_ID = "bxod/Llama-3.2-1B-Instruct-uz"
73
  PATTERN = r"[’‘‚‛ʻʼʽʾʿˈˊˋˌˍ'\']"
74
 
75
  tok = AutoTokenizer.from_pretrained(MODEL_ID, use_fast=True)
 
35
 
36
  ### Model Description
37
 
38
+ This is the 3B parameter version of our Uzbek-optimized Llama series. Also, check out our other models:
39
+
40
+ * **[Llama-3.2-1B-Instruct-Uz](https://huggingface.co/beruniy/Llama-3.2-1B-Instruct-Uz)**
41
+ * **[Llama-3.1-8B-Instruct-Uz](https://huggingface.co/beruniy/Llama-3.1-8B-Instruct-Uz)**
42
 
43
  ---
44
 
45
+ Our **Llama-3.2-3B-Instruct-uz** model has been continually pretrained with context length of 2048 tokens, on 2.4B tokens (75% English, 25% Uzbek), then SFT fine-tuned. Our customized tokenizer averages 1.7 tokens per Uzbek word vs. ~3.5 in the original Llama models, meaning 2x faster inference and longer effective context length on Uzbek text. You’ll be able to run this model on just 2 GB of VRAM (with quantization), perfect for small GPUs, edge devices, or even mobile scenarios.
46
 
47
+ ---
48
+ ### Benchmarks 1B, 3B
49
+ | Model | BLEU Uz→En (Zero_shot) | BLEU En→Uz (Zero_shot) | COMET Uz→En | COMET En→Uz | Uzbek Sentiment Analysis | Uzbek News Classification | MMLU (English) (Zero_shot) |
50
+ | --------------------------------- | ----: | ----: | ----: | ----: | ----: | ----: | ----: |
51
+ | **[Llama-3.2 1B Instruct](https://huggingface.co/meta-llama/Llama-3.2-1B-Instruct)** | 3.62 | 0.44 | 56.72 | 35.52 | 54.77 | 42.16 | 38.15 |
52
+ | **[Llama-3.2 1B Instruct Uz](https://huggingface.co/beruniy/Llama-3.2-1B-Instruct-uz)** | 16.64 | 10.20 | 81.42 | 82.73 | 63.49 | 10.75 | 26.29 |
53
+ | **[Llama-3.2 3B Instruct](https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct)** | 11.91 | 2.54 | 71.96 | 55.62 | 56.01 | 70.60 | 52.04 |
54
+ | **[Llama-3.2 3B Instruct Uz](https://huggingface.co/beruniy/Llama-3.2-3B-Instruct-Uz)** | 25.19 | 14.66 | 85.08 | 86.82 | 81.64 | 41.56 | 45.91 |
55
 
56
+
57
+ ### Benchmarks 8B
58
  | Model | BLEU Uz→En (Zero_shot) | BLEU En→Uz (Zero_shot) | COMET Uz→En | COMET En→Uz | Uzbek Sentiment Analysis | Uzbek News Classification | MMLU (English) (Zero_shot) |
59
  | --------------------------------- | ----: | ----: | ----: | ----: | ----: | ----: | ----: |
60
+ | **[Llama-3.1 8B Instruct](https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct)** | 24.23 | 8.28 | 83.12 | 82.22 | 69.77 | 73.63 | 60.59 |
61
+ | **[Behbudiy Mistral 7B Uz](https://huggingface.co/behbudiy/Mistral-7B-Instruct-Uz)** | 28.09 | 15.96 | 86.26 | 88.42 | 83.41 | 55.51 | 47.09 |
62
+ | **[Behbudiy Llama 8B Uz](https://huggingface.co/behbudiy/Llama-3.1-8B-Instruct-Uz)** | 27.08 | 13.29 | 84.76 | 85.62 | 81.66 | 68.22 | 59.18 |
63
+ | **[Llama-3.1 8B Instruct Uz](https://huggingface.co/beruniy/Llama-3.1-8B-Instruct-Uz)** | 29.29 | 15.25 | 86.79 | 87.42 | 81.70 | 63.97 | 53.33 |
64
+ <!-- | **[Behbudiy Nemo 12B Uz](https://huggingface.co/behbudiy/Mistral-Nemo-Instruct-Uz)** | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -->
65
 
 
66
 
67
+ The results show that our Uzbek-optimized models consistently outperform their base counterparts in translation benchmarks (BLEU and COMET) on the FLORES+ Uz-En / En-Uz evaluation datasets and sentiment analysis in Uzbek language. Also, on the MMLU benchmark, which measures general language understanding across multiple tasks in English, and News classification tasks, our Uzbek optimized model showed slight decline because of catastrophic forgetting of original English instruction following. (The official Llama model’s MMLU score may differ from our score due to our evaluation method. Refer to the links below to see evaluation details.)
68
 
69
+ We’re eager to see how these models will contribute to Uzbek open-source and be used by our Uzbek 🇺🇿 community. 🚀
70
 
71
  ## How to use
72
 
73
+ The Llama-3.2-3B-Instruct-uz model can be used with transformers in the following way. We recommend preprocessing Uzbek input to replace apostrophe (') with sequence (APST) to achieve our model's lower tokenizer fertility.
74
 
75
 
76
  ### Use with transformers
 
82
 
83
  DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
84
  DTYPE = torch.bfloat16
85
+ MODEL_ID = "beruniy/Llama-3.2-3B-Instruct-uz"
86
  PATTERN = r"[’‘‚‛ʻʼʽʾʿˈˊˋˌˍ'\']"
87
 
88
  tok = AutoTokenizer.from_pretrained(MODEL_ID, use_fast=True)