benhaotang
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -1,202 +1,96 @@
|
|
1 |
---
|
2 |
-
base_model:
|
|
|
3 |
library_name: peft
|
|
|
|
|
4 |
---
|
5 |
|
6 |
-
#
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
## Model
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
-
|
21 |
-
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
[
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
96 |
-
|
97 |
-
#### Speeds, Sizes, Times [optional]
|
98 |
-
|
99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
100 |
-
|
101 |
-
[More Information Needed]
|
102 |
-
|
103 |
-
## Evaluation
|
104 |
-
|
105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
106 |
-
|
107 |
-
### Testing Data, Factors & Metrics
|
108 |
-
|
109 |
-
#### Testing Data
|
110 |
-
|
111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
112 |
-
|
113 |
-
[More Information Needed]
|
114 |
-
|
115 |
-
#### Factors
|
116 |
-
|
117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
118 |
-
|
119 |
-
[More Information Needed]
|
120 |
-
|
121 |
-
#### Metrics
|
122 |
-
|
123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
124 |
-
|
125 |
-
[More Information Needed]
|
126 |
-
|
127 |
-
### Results
|
128 |
-
|
129 |
-
[More Information Needed]
|
130 |
-
|
131 |
-
#### Summary
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
## Model Examination [optional]
|
136 |
-
|
137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
138 |
-
|
139 |
-
[More Information Needed]
|
140 |
-
|
141 |
-
## Environmental Impact
|
142 |
-
|
143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
144 |
-
|
145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
146 |
-
|
147 |
-
- **Hardware Type:** [More Information Needed]
|
148 |
-
- **Hours used:** [More Information Needed]
|
149 |
-
- **Cloud Provider:** [More Information Needed]
|
150 |
-
- **Compute Region:** [More Information Needed]
|
151 |
-
- **Carbon Emitted:** [More Information Needed]
|
152 |
-
|
153 |
-
## Technical Specifications [optional]
|
154 |
-
|
155 |
-
### Model Architecture and Objective
|
156 |
-
|
157 |
-
[More Information Needed]
|
158 |
-
|
159 |
-
### Compute Infrastructure
|
160 |
-
|
161 |
-
[More Information Needed]
|
162 |
-
|
163 |
-
#### Hardware
|
164 |
-
|
165 |
-
[More Information Needed]
|
166 |
-
|
167 |
-
#### Software
|
168 |
-
|
169 |
-
[More Information Needed]
|
170 |
-
|
171 |
-
## Citation [optional]
|
172 |
-
|
173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
174 |
-
|
175 |
-
**BibTeX:**
|
176 |
-
|
177 |
-
[More Information Needed]
|
178 |
-
|
179 |
-
**APA:**
|
180 |
-
|
181 |
-
[More Information Needed]
|
182 |
-
|
183 |
-
## Glossary [optional]
|
184 |
-
|
185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
186 |
-
|
187 |
-
[More Information Needed]
|
188 |
-
|
189 |
-
## More Information [optional]
|
190 |
-
|
191 |
-
[More Information Needed]
|
192 |
-
|
193 |
-
## Model Card Authors [optional]
|
194 |
-
|
195 |
-
[More Information Needed]
|
196 |
-
|
197 |
-
## Model Card Contact
|
198 |
-
|
199 |
-
[More Information Needed]
|
200 |
-
### Framework versions
|
201 |
-
|
202 |
-
- PEFT 0.13.2
|
|
|
1 |
---
|
2 |
+
base_model:
|
3 |
+
- mistralai/Mistral-Small-Instruct-2409
|
4 |
library_name: peft
|
5 |
+
datasets:
|
6 |
+
- kejian/arxiv-physics-debug-v0
|
7 |
---
|
8 |
|
9 |
+
# Mistral Physics Fine-tuned Model
|
10 |
+
|
11 |
+
This model is a fine-tuned version of [mistralai/Mistral-Small-Instruct-2409](https://huggingface.co/mistralai/Mistral-Small-Instruct-2409) on [kejian/arxiv-physics-debug-v0](https://huggingface.co/datasets/kejian/arxiv-physics-debug-v0). Mostly for concept proofing, don't trust it for real physics (I mean, even Claude 3.5 can be wrong on graduate physics plenty of times, let alone a 22B model, but this hould perform a lot better than [benhaotang/llama3.2-1B-physics-finetuned](https://huggingface.co/benhaotang/llama3.2-1B-physics-finetuned))!
|
12 |
+
|
13 |
+
Sorry for not having F16 version, there is no way to fit everything into VRAM or RAM at the same time in my current configuration.
|
14 |
+
|
15 |
+
## Model description
|
16 |
+
- Base model: [mistralai/Mistral-Small-Instruct-2409](https://huggingface.co/mistralai/Mistral-Small-Instruct-2409)
|
17 |
+
- Training data: [kejian/arxiv-physics-debug-v0](https://huggingface.co/datasets/kejian/arxiv-physics-debug-v0)
|
18 |
+
- Fine-tuning type: LoRA
|
19 |
+
- Use case: Physics domain questions
|
20 |
+
- Training Arguments:
|
21 |
+
- Learning Rate: 2e-5
|
22 |
+
- Epochs: 3
|
23 |
+
- Gradient Accumulation Steps: 8
|
24 |
+
- Training setup: Colab with Nvidia L4
|
25 |
+
|
26 |
+
## Usage
|
27 |
+
```python
|
28 |
+
from transformers import AutoModelForCausalLM, BitsAndBytesConfig
|
29 |
+
import torch
|
30 |
+
bnb_config = BitsAndBytesConfig(
|
31 |
+
load_in_8bit=False,
|
32 |
+
llm_int8_enable_fp32_cpu_offload=True
|
33 |
+
)
|
34 |
+
model = AutoModelForCausalLM.from_pretrained(
|
35 |
+
"benhaotang/mistral-small-physics-finetuned-bnb-4bit",
|
36 |
+
device_map="auto",
|
37 |
+
torch_dtype=torch.float16,
|
38 |
+
offload_folder="offload_folder",
|
39 |
+
quantization_config=bnb_config
|
40 |
+
)
|
41 |
+
tokenizer = AutoTokenizer.from_pretrained("benhaotang/mistral-small-physics-finetuned-bnb-4bit")
|
42 |
+
|
43 |
+
# Example usage
|
44 |
+
text = "Give me a short intodcution to renormalization group(RG) flow in physcis?\n"
|
45 |
+
inputs = tokenizer(text, return_tensors="pt").to("cuda")
|
46 |
+
outputs = model.generate(**inputs, max_length=2048)
|
47 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
48 |
+
```
|
49 |
+
|
50 |
+
Example output:
|
51 |
+
|
52 |
+
> The Renormalization Group (RG) flow is a fundamental concept in physics, particularly in the study of phase transitions and critical phenomena. It describes how the behavior of a system changes with scale, such as the size of the system or the length scale of fluctuations. Here's a brief introduction:
|
53 |
+
>
|
54 |
+
> 1. **Scale Dependence**: Many physical systems exhibit properties that depend on the scale at which they are observed. For example, a fluid might appear smooth on a large scale but exhibit turbulent behavior on a small scale.
|
55 |
+
>
|
56 |
+
> 2. **RG Transformation**: The RG flow involves a transformation that systematically integrates out short-distance fluctuations to obtain an effective theory that describes the system at longer distances. This is often done by progressively eliminating high-momentum modes in the system.
|
57 |
+
>
|
58 |
+
> 3. **Fixed Points and Universality**: The RG flow can lead to fixed points, which are scale-invariant solutions. Systems that flow to the same fixed point under RG transformation exhibit universal behavior, meaning their large-scale properties are the same regardless of the details of the system at small scales.
|
59 |
+
>
|
60 |
+
> 4. **Relevant and Irrelevant Operators**: In the vicinity of a fixed point, operators can be classified as relevant (grow under RG flow), irrelevant (shrink), or marginal (remain constant). Relevant operators drive the system away from the fixed point, while irrelevant ones become negligible at large scales.
|
61 |
+
>
|
62 |
+
> 5. **Applications**: RG flow is crucial in understanding critical phenomena, such as phase transitions in statistical mechanics, and has applications in condensed matter physics, quantum field theory, and even in areas like biology and computer science.
|
63 |
+
>
|
64 |
+
> In essence, RG flow helps us understand how the microscopic details of a system influence its macroscopic behavior, and how universal properties emerge from complex systems.
|
65 |
+
|
66 |
+
### Training
|
67 |
+
|
68 |
+
| Step | Training Loss | Validation Loss |
|
69 |
+
|:----:|:-------------:|:---------------:|
|
70 |
+
| 50 | 2.407400 | 1.798349 |
|
71 |
+
| 100 | 1.452000 | 1.765856 |
|
72 |
+
| 150 | 1.161300 | 1.716366 |
|
73 |
+
| 200 | 1.223700 | 1.704631 |
|
74 |
+
| 250 | 1.135900 | 1.683653 |
|
75 |
+
| 300 | 1.371900 | 1.677721 |
|
76 |
+
| 350 | 1.208500 | 1.657915 |
|
77 |
+
| 400 | 1.303400 | 1.657678 |
|
78 |
+
| 450 | 1.233700 | 1.642972 |
|
79 |
+
| 500 | 1.081900 | 1.653393 |
|
80 |
+
| 550 | 1.117700 | 1.645338 |
|
81 |
+
| 600 | 1.109500 | 1.651868 |
|
82 |
+
| 650 | 1.190100 | 1.689853 |
|
83 |
+
| 700 | 1.000000 | 1.663633 |
|
84 |
+
| 750 | 1.020100 | 1.647308 |
|
85 |
+
| 800 | 1.033400 | 1.675173 |
|
86 |
+
| 850 | 1.082300 | 1.652737 |
|
87 |
+
| 900 | 1.074000 | 1.665859 |
|
88 |
+
| 950 | 0.975300 | 1.661394 |
|
89 |
+
| 1000 | 0.955000 | 1.672116 |
|
90 |
+
| 1050 | 1.017000 | 1.656730 |
|
91 |
+
| 1100 | 0.941500 | 1.652197 |
|
92 |
+
| 1150 | 1.003100 | 1.657381 |
|
93 |
+
| 1200 | 0.891100 | 1.662021 |
|
94 |
+
| 1250 | 0.931000 | 1.662401 |
|
95 |
+
| 1300 | 0.932800 | 1.662421 |
|
96 |
+
| 1350 | 1.042000 | 1.665535 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|