tungluuai commited on
Commit
8c218ea
·
verified ·
1 Parent(s): bf91c1b

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +155 -0
README.md ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ language:
4
+ - vi
5
+ - en
6
+ - zh
7
+ - id
8
+ - th
9
+ base_model:
10
+ - Qwen/Qwen2.5-14B-Instruct
11
+ pipeline_tag: text2text-generation
12
+ ---
13
+
14
+
15
+ # GreenMind-Medium-14B-R1
16
+
17
+ We release **GreenMind-Medium-14B-R1**, a medium-sized Vietnamese language model capable of effectively addressing questions that require intermediate-level reasoning, such as general knowledge, mathematics, natural science and social science topics. By leveraging the Group Relative Policy Optimization strategy for fine-tuning, we guide the model to generate logically coherent responses.
18
+
19
+ ## Model Description
20
+
21
+ - **Model Type:** Causal Language Models
22
+ - **Base Model:** [Qwen/Qwen2.5-14B-Instruct](https://huggingface.co/Qwen/Qwen2.5-14B-Instruct)
23
+ - **Parameters:** 14.7B
24
+ - **Context Length:** Full 131,072 tokens and generation 8192 tokens
25
+ - **Language:** Vietnamese
26
+
27
+ ## Quickstart
28
+
29
+ Here provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents.
30
+
31
+ ```python
32
+ from transformers import AutoModelForCausalLM, AutoTokenizer
33
+
34
+ model_name = "GreenNode/GreenMind-Medium-14B-R1"
35
+
36
+ model = AutoModelForCausalLM.from_pretrained(
37
+ model_name,
38
+ torch_dtype="auto",
39
+ device_map="auto"
40
+ )
41
+
42
+ tokenizer = AutoTokenizer.from_pretrained(
43
+ model_name,
44
+ revision='main',
45
+ trust_remote_code=False,
46
+ )
47
+ prompt = r"""Vừa gà vừa chó
48
+ Bó lại cho tròn
49
+ Ba mươi sáu con
50
+ Một trăm chân chẵn
51
+ Hỏi có bao nhiêu con gà, bao nhiêu con chó?"""
52
+
53
+ messages = [
54
+ {
55
+ "role": "system",
56
+ "content": "Bạn là một trợ lý ảo hữu ích trong việc trả lời câu hỏi. Hãy suy luận từng bước, và đưa ra đáp án trong thẻ <answer> </answer>."
57
+ },
58
+ {
59
+ "role": "user",
60
+ "content": f"{prompt} Hãy suy luận từng bước trong thẻ <think> </think>. Và trả về đáp án trong thẻ <answer> </answer>."
61
+ },
62
+ {
63
+ "role": "assistant",
64
+ "content": "Hãy để tôi giải quyết từng bước.\n<think>"
65
+ }
66
+ ]
67
+
68
+ text = tokenizer.apply_chat_template(
69
+ messages,
70
+ tokenize=False,
71
+ continue_final_message=True)
72
+
73
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
74
+
75
+ generated_ids = model.generate(
76
+ **model_inputs,
77
+ max_new_tokens=1024
78
+ )
79
+
80
+ generated_ids = [
81
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
82
+ ]
83
+
84
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
85
+ print(response)
86
+ # Đầu tiên, chúng ta cần thiết lập hai phương trình dựa trên thông tin đề bài:
87
+ # 1. Tổng số con gà và chó là 36: x + y = 36
88
+ # 2. Tổng số chân là 100: 2x + 4y = 100
89
+ # Trong đó, x là số con gà và y là số con chó.
90
+ # Tiếp theo, chúng ta giải hệ phương trình này:
91
+ # Từ phương trình thứ nhất, ta có: x = 36 - y
92
+ # Thay vào phương trình thứ hai: 2(36 - y) + 4y = 100
93
+ # => 72 - 2y + 4y = 100
94
+ # => 2y = 28
95
+ # => y = 14 (số con chó)
96
+ # Thay y = 14 vào phương trình x + y = 36:
97
+ # => x = 36 - 14 = 22 (số con gà)
98
+ # Vậy, có 22 con gà và 14 con chó.
99
+ # </think>
100
+ # <answer>Có 22 con gà và 14 con chó.</answer>
101
+ ```
102
+
103
+ ## Evaluation
104
+
105
+ **Table 1. SeaExam Dataset.** GreenMind-Medium-14B-R1 compared to base model and some models with larger size.
106
+ | **Model** | **SeaExam-ID** | **SeaExam-TH** | **SeaExam-VI** | **Avg** |
107
+ |----------------------------------|----------------|----------------|----------------|----------|
108
+ | Meta-Llama-3.1-70B-Instruct | 65.8 | **70.6** | 72.6 | 69.7 |
109
+ | gemma3-27b-it | 64.4 | 67.5 | 73.1 | 68.4 |
110
+ | Qwen2.5-14B-Instruct | 67.6 | 68.8 | 73.1 | 69.8 |
111
+ | **GreenMind-Medium-14B-R1** | **74.36** | 69.75 | **74.44** | **72.79** |
112
+
113
+ **Table 2. VLSP 2023 Challenge:** The performance of our model outperforms most SOTA models.
114
+
115
+ | **Model** | **ComprehensionQA-vi ↑** | **Exams-vi ↑** | **LAMBADA-vi ↓** | **WikiQA-vi ↑** | **MMLU-vi ↑** |
116
+ |----------------------------------|---------------------------|----------------|------------------|-----------------|---------------|
117
+ | cpt-smartbot-13b | 0.6633 | 0.3473 | 21.9864 | 0.4455 | 0.414 |
118
+ | ura-llama-13b | 0.6556 | 0.342 | 17.5614 | 0.438 | 0.3973 |
119
+ | greennode-7b (prior work) | 0.6122 | 0.2892 | 189.7782 | 0.3335 | 0.387 |
120
+ | greennode-14b (prior work) | 0.6711 | 0.3672 | 29.5967 | 0.468 | 0.5281 |
121
+ | **GreenMind-Medium-14B-R1 (Ours)** | **0.8689** | **0.7796** | **10.7609** | **0.7915** | **0.7124** |
122
+
123
+ **Table 3. VMLU Dataset.** The performance compared to fine-tuned models.
124
+
125
+ | **Model** | **Access** | **STEM** | **Social Science** | **Humanities** | **Others** | **Avg** |
126
+ |----------------------------------|-----------|----------|---------------------|----------------|------------|----------|
127
+ | VNPTAI.IO-Medium-R1 | Private | 77.09 | 82.3 | 78.85 | 69.98 | 77.43 |
128
+ | MISA-Llama3-v1.1 | Private | 77.5 | 80.75 | 76.62 | 71.6 | 76.87 |
129
+ | BnK-AI-Medium-v2 | Private | 80.94 | 80.76 | 70.7 | 74.06 | 76.66 |
130
+ | VNPTAI.IO-Large-v4 | Private | 78.05 | 79.05 | 75.39 | 70.37 | 76.21 |
131
+ | GreenNode-xMedium-v1 | Private | 75.7 | 81.09 | 75.25 | 69.33 | 75.5 |
132
+ | **GreenMind-Medium-14B-R1 (Ours)** | Weight | 76.78 | 77.36 | 72.32 | 69.03 | 74.29 |
133
+ | CakebyVPBank-Large | Private | 77.75 | 78.11 | 70.38 | 67.82 | 73.99 |
134
+ | DeepSeek-R1-Distill-Llama-70B | Weight | 76.77 | 76.23 | 67.98 | 66.82 | 72.41 |
135
+
136
+ ## Follow us
137
+
138
+ https://x.com/greennode23
139
+
140
+ ## Support
141
+
142
+ https://discord.gg/B6MJFM3J3a
143
+
144
+ ## License
145
+
146
+ This repository and the model weights are licensed under the [MIT License](LICENSE).
147
+
148
+ ## Citation
149
+
150
+ ### BibTeX
151
+
152
+ ## Contact Us
153
+
154
+ - General & Collaboration: tung.vu@greennode.ai, thuvt@greennode.ai
155
+ - Technical: viethq5@greennode.ai