LLaMAX commited on
Commit
042bc28
β€’
1 Parent(s): 77d70d5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +77 -73
README.md CHANGED
@@ -1,73 +1,77 @@
1
-
2
- ### Model Sources
3
- - **Paper**: LLaMAX: Scaling Linguistic Horizons of LLM by Enhancing Translation Capabilities Beyond 100 Languages
4
- - **Link**: https://arxiv.org/pdf/2407.05975
5
- - **Repository**: https://github.com/CONE-MT/LLaMAX/
6
-
7
- ### Model Description
8
-
9
- πŸ”₯ LLaMAX2-7B-MetaMath is fully fine-tuned on the MetaMathQA dataset based on the powerful multilingual model LLaMAX2-7B.
10
-
11
- πŸ”₯ Compared with the [MetaMath-7B](https://huggingface.co/meta-math/MetaMath-7B-V1.0), LLaMAX2-7B-MetaMath performs significantly better in mathematical reasoning in low-resource languages, improving the average accuracy of low-resource languages on MGSM dataset by up to 18.8%.
12
-
13
- πŸ”₯ LLaMAX2-7B-MetaMath demonstrates good multilingual math reasoning capability in all languages, improving the average accuracy by 6.2% across all languages in MGSM dataset.
14
-
15
- ### Experiments
16
- We evaluated LLaMAX2-7B-MetaMath on the MGSM dataset. Compared with MetaMath-7B, LLaMAX-7B-MetaMath achieves a leading on both high-resource languages (Hrl.) and low-resource languages (Lrl.).
17
-
18
- | MGSM | Avg. | Lrl. | Hrl. | Bn | Th | Sw | Ja | Zh | De | Fr | Ru | Es | En |
19
- |---------------------------|---------|------|--------|--------|------|----|----|------|----|----|------|------|--------|
20
- | MetaMath-7B (official) | 38.32 | 6.9 | 51.8 | 6.8 | 7.2 |6.8| 36.4 | 38.4 | 55.2|54.4| 52.0 |57.2|68.8|
21
- | MetaMath-7B (Reproduced) | 38.08 | 6.8 | 51.5 | 6.0 | 10.0 |4.4| 36.4 |42.8|52.8|56.0|48.8|58.8|64.8|
22
- | LLaMAX2-7B-MetaMath | 44.28 | 25.6 | 52.3 | 26.8 | 24.0 |26.0| 35.6 |42.4|56.8|55.2|53.6|56.8|65.6|
23
-
24
-
25
-
26
- ### Model Usage
27
-
28
- Prompt template:
29
- ```angular2html
30
- def Prompt_template(query):
31
- prompt = (
32
- "Below is an instruction that describes a task. "
33
- "Write a response that appropriately completes the request.\n\n"
34
- f"### Instruction:\n{query}\n\n### Response: Let's think step by step."
35
- )
36
- return prompt
37
- ```
38
-
39
- Code Example:
40
- ```angular2html
41
- from transformers import AutoTokenizer, LlamaForCausalLM
42
-
43
- model = LlamaForCausalLM.from_pretrained(PATH_TO_CONVERTED_WEIGHTS)
44
- tokenizer = AutoTokenizer.from_pretrained(PATH_TO_CONVERTED_TOKENIZER)
45
-
46
- query = "Bert fills out the daily crossword puzzle in the newspaper every day. He uses a pencil to fill out the puzzles every two weeks. On average, it takes him 1050 words to use up a pencil. How many words are in each crossword puzzle on average?"
47
- prompt = Prompt_template(query)
48
- inputs = tokenizer(prompt, return_tensors="pt")
49
-
50
- generate_ids = model.generate(inputs.input_ids, max_length=30)
51
- tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
52
-
53
- # => "If Bert uses up a pencil to fill out the puzzles every two weeks and it takes him 1050
54
- words to use up a pencil, then he must be filling out 1050 words of crossword puzzles every
55
- two weeks. To find out how many words are in each daily crossword puzzle, we need to divide
56
- the total number of words (1050) by the number of days in two weeks (14). So, there are
57
- 1050/14 = 75 words in each daily crossword puzzle on average. #### The answer is: 75β€œ
58
- ```
59
-
60
- ### Citation
61
- if our model helps your work, please cite this paper:
62
-
63
- ```
64
- @misc{lu2024llamaxscalinglinguistichorizons,
65
- title={LLaMAX: Scaling Linguistic Horizons of LLM by Enhancing Translation Capabilities Beyond 100 Languages},
66
- author={Yinquan Lu and Wenhao Zhu and Lei Li and Yu Qiao and Fei Yuan},
67
- year={2024},
68
- eprint={2407.05975},
69
- archivePrefix={arXiv},
70
- primaryClass={cs.CL},
71
- url={https://arxiv.org/abs/2407.05975},
72
- }
73
- ```
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - Multilingual
4
+ ---
5
+
6
+ ### Model Sources
7
+ - **Paper**: LLaMAX: Scaling Linguistic Horizons of LLM by Enhancing Translation Capabilities Beyond 100 Languages
8
+ - **Link**: https://arxiv.org/pdf/2407.05975
9
+ - **Repository**: https://github.com/CONE-MT/LLaMAX/
10
+
11
+ ### Model Description
12
+
13
+ πŸ”₯ LLaMAX2-7B-MetaMath is fully fine-tuned on the MetaMathQA dataset based on the powerful multilingual model LLaMAX2-7B.
14
+
15
+ πŸ”₯ Compared with the [MetaMath-7B](https://huggingface.co/meta-math/MetaMath-7B-V1.0), LLaMAX2-7B-MetaMath performs significantly better in mathematical reasoning in low-resource languages, improving the average accuracy of low-resource languages on MGSM dataset by up to 18.8%.
16
+
17
+ πŸ”₯ LLaMAX2-7B-MetaMath demonstrates good multilingual math reasoning capability in all languages, improving the average accuracy by 6.2% across all languages in MGSM dataset.
18
+
19
+ ### Experiments
20
+ We evaluated LLaMAX2-7B-MetaMath on the MGSM dataset. Compared with MetaMath-7B, LLaMAX-7B-MetaMath achieves a leading on both high-resource languages (Hrl.) and low-resource languages (Lrl.).
21
+
22
+ | MGSM | Avg. | Lrl. | Hrl. | Bn | Th | Sw | Ja | Zh | De | Fr | Ru | Es | En |
23
+ |---------------------------|---------|------|--------|--------|------|----|----|------|----|----|------|------|--------|
24
+ | MetaMath-7B (official) | 38.32 | 6.9 | 51.8 | 6.8 | 7.2 |6.8| 36.4 | 38.4 | 55.2|54.4| 52.0 |57.2|68.8|
25
+ | MetaMath-7B (Reproduced) | 38.08 | 6.8 | 51.5 | 6.0 | 10.0 |4.4| 36.4 |42.8|52.8|56.0|48.8|58.8|64.8|
26
+ | LLaMAX2-7B-MetaMath | 44.28 | 25.6 | 52.3 | 26.8 | 24.0 |26.0| 35.6 |42.4|56.8|55.2|53.6|56.8|65.6|
27
+
28
+
29
+
30
+ ### Model Usage
31
+
32
+ Prompt template:
33
+ ```angular2html
34
+ def Prompt_template(query):
35
+ prompt = (
36
+ "Below is an instruction that describes a task. "
37
+ "Write a response that appropriately completes the request.\n\n"
38
+ f"### Instruction:\n{query}\n\n### Response: Let's think step by step."
39
+ )
40
+ return prompt
41
+ ```
42
+
43
+ Code Example:
44
+ ```angular2html
45
+ from transformers import AutoTokenizer, LlamaForCausalLM
46
+
47
+ model = LlamaForCausalLM.from_pretrained(PATH_TO_CONVERTED_WEIGHTS)
48
+ tokenizer = AutoTokenizer.from_pretrained(PATH_TO_CONVERTED_TOKENIZER)
49
+
50
+ query = "Bert fills out the daily crossword puzzle in the newspaper every day. He uses a pencil to fill out the puzzles every two weeks. On average, it takes him 1050 words to use up a pencil. How many words are in each crossword puzzle on average?"
51
+ prompt = Prompt_template(query)
52
+ inputs = tokenizer(prompt, return_tensors="pt")
53
+
54
+ generate_ids = model.generate(inputs.input_ids, max_length=30)
55
+ tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
56
+
57
+ # => "If Bert uses up a pencil to fill out the puzzles every two weeks and it takes him 1050
58
+ words to use up a pencil, then he must be filling out 1050 words of crossword puzzles every
59
+ two weeks. To find out how many words are in each daily crossword puzzle, we need to divide
60
+ the total number of words (1050) by the number of days in two weeks (14). So, there are
61
+ 1050/14 = 75 words in each daily crossword puzzle on average. #### The answer is: 75β€œ
62
+ ```
63
+
64
+ ### Citation
65
+ if our model helps your work, please cite this paper:
66
+
67
+ ```
68
+ @misc{lu2024llamaxscalinglinguistichorizons,
69
+ title={LLaMAX: Scaling Linguistic Horizons of LLM by Enhancing Translation Capabilities Beyond 100 Languages},
70
+ author={Yinquan Lu and Wenhao Zhu and Lei Li and Yu Qiao and Fei Yuan},
71
+ year={2024},
72
+ eprint={2407.05975},
73
+ archivePrefix={arXiv},
74
+ primaryClass={cs.CL},
75
+ url={https://arxiv.org/abs/2407.05975},
76
+ }
77
+ ```