U2DIA commited on
Commit
3dfdff5
·
verified ·
1 Parent(s): 62ef87a

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +145 -0
README.md ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ - ko
5
+ license: apache-2.0
6
+ library_name: llama.cpp
7
+ base_model: google/gemma-3-4b-it
8
+ tags:
9
+ - gemma-4
10
+ - unsloth
11
+ - lora
12
+ - qlora
13
+ - physics
14
+ - education
15
+ - particle-simulation
16
+ - gguf
17
+ - ollama
18
+ - kaggle-gemma-4-good-hackathon
19
+ pipeline_tag: text-generation
20
+ model-index:
21
+ - name: gemma4-particle-edu-e4b
22
+ results:
23
+ - task:
24
+ type: text-generation
25
+ name: Physics Simulation JSON Generation
26
+ metrics:
27
+ - type: json_parse_rate
28
+ value: 70
29
+ name: JSON parse rate (%)
30
+ - type: physics_accuracy
31
+ value: 77
32
+ name: Physics accuracy (%)
33
+ ---
34
+
35
+ # Gemma 4 Particle Edu — E4B Fine-tuned (Q4_K_M GGUF)
36
+
37
+ Fine-tuned **Gemma 4 E4B (4.5B active)** for physics simulation parameter generation. Part of the [Gemma 4 Particle Edu](https://github.com/U2SY26/gemma4-particle-edu) Kaggle Good Hackathon submission.
38
+
39
+ ## What this model does
40
+
41
+ Given a natural language physics scenario (e.g., "DNA double helix at body temperature"), this model outputs a JSON simulation specification with SI-unit physics parameters:
42
+
43
+ ```json
44
+ {
45
+ "simulation": {
46
+ "prompt": "dna",
47
+ "title": "DNA Double Helix",
48
+ "domain": "biology",
49
+ "physics": {
50
+ "gravity": 0,
51
+ "damping": 0.99,
52
+ "springStiffness": 30,
53
+ "particleCount": 22000,
54
+ "temperature": 310,
55
+ "density": 1700
56
+ }
57
+ }
58
+ }
59
+ ```
60
+
61
+ ## Training details
62
+
63
+ - **Method**: Unsloth QLoRA (r=16)
64
+ - **Base**: Gemma 4 E4B (4.5B active parameters)
65
+ - **Dataset**: 907 Alpaca-format physics simulation pairs
66
+ - **Hardware**: Lambda A10 (24GB)
67
+ - **Cost**: **$0.55**
68
+ - **Quantization**: llama.cpp Q4_K_M (CPU-only conversion)
69
+
70
+ ## Benchmark vs other Gemma 4 sizes
71
+
72
+ All 4 sizes fine-tuned on the same 907-pair dataset:
73
+
74
+ | Model | Type | JSON parse | Physics | Time | Cost |
75
+ |-------|------|------------|---------|------|------|
76
+ | Base Gemma 4 9B | Dense | 30% | 0% | 12.7s | - |
77
+ | **E4B FT (this model)** | **QLoRA r=16** | **70%** | **77%** | **8.9s** | **$0.55** |
78
+ | Base Gemma 4 26B MoE | MoE | 95% | 22% | 9.3s | - |
79
+ | 26B FT | QLoRA r=8 | 90% | 31% | 9.3s | $2.40 |
80
+ | Base Gemma 4 31B | Dense | 100% | 21% | 20.6s | - |
81
+ | 31B shallow FT | r=8, 1ep | 100% | 18% | 21.1s | $2.55 |
82
+ | 31B deep FT | r=64, 3ep | 100% | 18% | 20.0s | $2.55 |
83
+
84
+ **Finding**: E4B QLoRA is cost-optimal — $0.55 delivers +40%p JSON success and +77%p physics accuracy over the 9B base. Larger bases (26B/31B) already achieve 95-100% JSON parsing, so the 907-pair dataset cannot move them further.
85
+
86
+ ## How to use
87
+
88
+ ### Ollama (recommended)
89
+
90
+ ```bash
91
+ # Pull this repo and register with Ollama
92
+ huggingface-cli download U2DIA/gemma4-particle-edu-e4b --local-dir ./gemma4-e4b
93
+ cd gemma4-e4b
94
+ ollama create gemma4-physics-edu -f Modelfile
95
+ ollama run gemma4-physics-edu
96
+ ```
97
+
98
+ ### llama.cpp
99
+
100
+ ```bash
101
+ ./llama-cli -m gemma4-physics-edu-Q4_K_M.gguf -p "Simulate a DNA double helix"
102
+ ```
103
+
104
+ ## Files
105
+
106
+ | File | Size | Description |
107
+ |------|------|-------------|
108
+ | `gemma4-physics-edu-Q4_K_M.gguf` | 5.3 GB | Merged Q4_K_M quantized weights |
109
+ | `config.json` | 6 KB | Hugging Face model config |
110
+ | `tokenizer.json` | 31 MB | Tokenizer |
111
+ | `Modelfile` | 241 B | Ollama Modelfile |
112
+
113
+ ## Related resources
114
+
115
+ - **GitHub**: https://github.com/U2SY26/gemma4-particle-edu
116
+ - **Live Demo**: https://gemma4-particle-edu.vercel.app
117
+ - **Kaggle Writeup**: https://www.kaggle.com/competitions/gemma-4-good-hackathon/writeups/gemma-4-particle-edu-free-3d-physics-simulation-v
118
+ - **Kaggle Benchmark Dataset**: https://www.kaggle.com/datasets/syu21125/gemma4-particle-edu-benchmark-300
119
+ - **Kaggle Ollama Live Demo**: https://www.kaggle.com/code/syu21125/gemma-4-particle-edu-ollama-live-demo
120
+ - **3dweb (production app, 8,470 installs)**: https://play.google.com/store/apps/details?id=com.sciencelab.science_lab_flutter
121
+
122
+ ## Limitations
123
+
124
+ - 70% JSON parse rate means ~30% of outputs need retry or fallback
125
+ - Physics accuracy was measured on 20 scenarios; full 300-scenario benchmark requires the 31B model
126
+ - Fine-tuned on English prompts; Korean prompts fall back to the base model's multilingual capability
127
+ - Not suitable for production medical, safety-critical, or regulatory-compliant simulations
128
+
129
+ ## Competition
130
+
131
+ Submitted to [Kaggle Gemma 4 Good Hackathon](https://www.kaggle.com/competitions/gemma-4-good-hackathon) (2026-05-18 deadline).
132
+
133
+ Tracks: Impact (Education) + Special Technology (Ollama + Unsloth)
134
+
135
+ ## Citation
136
+
137
+ ```bibtex
138
+ @misc{gemma4-particle-edu-e4b,
139
+ author = {Yun (U2DIA)},
140
+ title = {Gemma 4 Particle Edu — E4B Fine-tuned},
141
+ year = {2026},
142
+ publisher = {HuggingFace},
143
+ url = {https://huggingface.co/U2DIA/gemma4-particle-edu-e4b}
144
+ }
145
+ ```