Triangle104 commited on
Commit
e9906dc
•
1 Parent(s): aebcb39

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +97 -0
README.md CHANGED
@@ -15,6 +15,103 @@ tags:
15
  This model was converted to GGUF format from [`BitStarWalkin/SuperCorrect-7B`](https://huggingface.co/BitStarWalkin/SuperCorrect-7B) using llama.cpp via the ggml.ai's [GGUF-my-repo](https://huggingface.co/spaces/ggml-org/gguf-my-repo) space.
16
  Refer to the [original model card](https://huggingface.co/BitStarWalkin/SuperCorrect-7B) for more details on the model.
17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  ## Use with llama.cpp
19
  Install llama.cpp through brew (works on Mac and Linux)
20
 
 
15
  This model was converted to GGUF format from [`BitStarWalkin/SuperCorrect-7B`](https://huggingface.co/BitStarWalkin/SuperCorrect-7B) using llama.cpp via the ggml.ai's [GGUF-my-repo](https://huggingface.co/spaces/ggml-org/gguf-my-repo) space.
16
  Refer to the [original model card](https://huggingface.co/BitStarWalkin/SuperCorrect-7B) for more details on the model.
17
 
18
+ ---
19
+ Model details:
20
+ -
21
+ SuperCorrect: Supervising and Correcting Language Models with Error-Driven Insights
22
+
23
+ SuperCorrect: Supervising and Correcting Language Models with Error-Driven Insights Ling Yang*, Zhaochen Yu*, Tianjun Zhang, Minkai Xu, Joseph E. Gonzalez,Bin Cui, Shuicheng Yan
24
+
25
+ Peking University, Skywork AI, UC Berkeley, Stanford University
26
+
27
+ Introduction
28
+ -
29
+ This repo provides the official implementation of SuperCorrect a novel two-stage fine-tuning method for improving both reasoning accuracy and self-correction ability for LLMs.
30
+
31
+ Notably, our SupperCorrect-7B model significantly surpasses powerful DeepSeekMath-7B by 7.8%/5.3% and Qwen2.5-Math-7B by 15.1%/6.3% on MATH/GSM8K benchmarks, achieving new SOTA performance among all 7B models.
32
+ 🚨 Unlike other LLMs, we incorporate LLMs with our pre-defined hierarchical thought template ([Buffer of Thought (BoT)](https://github.com/YangLing0818/buffer-of-thought-llm)) to conduct more deliberate reasoning than conventional CoT. It should be noted that our evaluation methods relies on pure mathematical reasoning abilities of LLMs, instead of leverage other programming methods such as PoT and ToRA.
33
+
34
+ Examples
35
+ -
36
+ 🚨 For more concise and clear presentation, we omit some XML tags.
37
+ Model details
38
+
39
+ You can check our Github repo for more details.
40
+
41
+ Quick Start
42
+ -
43
+ Requirements
44
+ -
45
+ Since our current model is based on Qwen2.5-Math series, transformers>=4.37.0 is needed for Qwen2.5-Math models. The latest version is recommended.
46
+
47
+ 🚨 This is a must because `transformers` integrated Qwen2 codes since `4.37.0`.
48
+
49
+ Inference
50
+ -
51
+ 🤗 Hugging Face Transformers
52
+
53
+ from transformers import AutoModelForCausalLM, AutoTokenizer
54
+
55
+ model_name = "BitStarWalkin/SuperCorrect-7B"
56
+ device = "cuda"
57
+
58
+ model = AutoModelForCausalLM.from_pretrained(
59
+ model_name,
60
+ torch_dtype="auto",
61
+ device_map="auto"
62
+ )
63
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
64
+
65
+ prompt = "Find the distance between the foci of the ellipse \[9x^2 + \frac{y^2}{9} = 99.\]"
66
+ hierarchical_prompt = "Solve the following math problem in a step-by-step XML format, each step should be enclosed within tags like <Step1></Step1>. For each step enclosed within the tags, determine if this step is challenging and tricky, if so, add detailed explanation and analysis enclosed within <Key> </Key> in this step, as helpful annotations to help you thinking and remind yourself how to conduct reasoning correctly. After all the reasoning steps, summarize the common solution and reasoning steps to help you and your classmates who are not good at math generalize to similar problems within <Generalized></Generalized>. Finally present the final answer within <Answer> </Answer>."
67
+ # HT
68
+ messages = [
69
+ {"role": "system", "content":hierarchical_prompt },
70
+ {"role": "user", "content": prompt}
71
+ ]
72
+
73
+ text = tokenizer.apply_chat_template(
74
+ messages,
75
+ tokenize=False,
76
+ add_generation_prompt=True
77
+ )
78
+ model_inputs = tokenizer([text], return_tensors="pt").to(device)
79
+
80
+ generated_ids = model.generate(
81
+ **model_inputs,
82
+ max_new_tokens=1024
83
+ )
84
+ generated_ids = [
85
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
86
+ ]
87
+
88
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
89
+ print(response)
90
+
91
+ Performance
92
+ -
93
+ We evaluate our SupperCorrect-7B on two widely used English math benchmarks GSM8K and MATH. All evaluations are tested with our evaluation method which is zero-shot hierarchical thought based prompting.
94
+
95
+ Citation
96
+ -
97
+ @article{yang2024supercorrect,
98
+ title={SuperCorrect: Supervising and Correcting Language Models with Error-Driven Insights}
99
+ author={Yang, Ling and Yu, Zhaochen and Zhang, Tianjun and Xu, Minkai and Gonzalez, Joseph E and Cui, Bin and Yan, Shuicheng},
100
+ journal={arXiv preprint arXiv:2410.09008},
101
+ year={2024}
102
+ }
103
+ @article{yang2024buffer,
104
+ title={Buffer of Thoughts: Thought-Augmented Reasoning with Large Language Models},
105
+ author={Yang, Ling and Yu, Zhaochen and Zhang, Tianjun and Cao, Shiyi and Xu, Minkai and Zhang, Wentao and Gonzalez, Joseph E and Cui, Bin},
106
+ journal={arXiv preprint arXiv:2406.04271},
107
+ year={2024}
108
+ }
109
+
110
+ Acknowledgements
111
+ -
112
+ Our SuperCorrect is a two-stage fine-tuning model which based on several extraordinary open-source models like Qwen2.5-Math, DeepSeek-Math, Llama3-Series. Our evaluation method is based on the code base of outstanding works like Qwen2.5-Math and lm-evaluation-harness. We also want to express our gratitude for amazing works such as BoT which provides the idea of thought template.
113
+
114
+ ---
115
  ## Use with llama.cpp
116
  Install llama.cpp through brew (works on Mac and Linux)
117