wezzel98765 commited on
Commit
1d31e3b
·
verified ·
1 Parent(s): a962c20

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +142 -0
README.md CHANGED
@@ -1,3 +1,145 @@
1
  ---
2
  license: apache-2.0
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ base_model:
4
+ - ProCreations/grug-27b
5
+ library_name: mlx
6
  ---
7
+
8
+ # grug-27b-oQ5E-fp16
9
+
10
+ **Grug 27B** quantized with **oMLX oQ5E** (exponent-aware 5-bit) at **float16** precision. A token-efficient, reasoning-optimized variant of [ProCreations/grug-27b](https://huggingface.co/ProCreations/grug-27b), built on the Qwen3.6-27B architecture.
11
+
12
+ ## Model Description
13
+
14
+ Grug 27B is a LoRA fine-tuned reasoning model that adopts the "grug" thinking style — producing concise, token-efficient chain-of-thought reasoning. The model was fine-tuned with `r=32` on all text-stack linear layers and the LoRA weights were merged back into the base bf16 weights. This quantized variant converts the model to **float16** for ~20% faster prefill on Apple Silicon (M1/M2/M3/M4), then applies the **oQ5E** exponent-aware 5-bit quantization scheme from oMLX v0.5.7.
15
+
16
+ The "grug" thinking style achieves **8–40× fewer tokens** than the base model while maintaining strong benchmark performance, with zero repetition loops observed in stress testing.
17
+
18
+ ### Architecture (Qwen3 Decoder-Only Transformer)
19
+
20
+ | Parameter | Value |
21
+ |---|---|
22
+ | Hidden size | 5,120 |
23
+ | Num hidden layers | 40 |
24
+ | Num attention heads | 40 |
25
+ | Num key-value heads (GQA) | 8 |
26
+ | Intermediate size | 29,568 |
27
+ | Max position embeddings | 131,072 |
28
+ | Layer norm eps | 1e-06 |
29
+ | RMS norm eps | 1e-05 |
30
+ | RoPE theta | 1,000,000.0 |
31
+ | Vocabulary size | 152,064 |
32
+
33
+ ## Quantization Details
34
+
35
+ | Property | Value |
36
+ |---|---|
37
+ | Quantization format | oQ5E (oMLX 5-bit exponent-aware) |
38
+ | oMLX version | 0.5.7 |
39
+ | Bits per weight | ~5.8 BPW |
40
+ | Base dtype | float16 (fp16) |
41
+ | Original dtype | bfloat16 |
42
+ | Exponent aware | Yes |
43
+ | Quality loss vs bf16 | 1–3% perplexity increase |
44
+ | Memory savings | ~62–65% reduction from full precision |
45
+ | Estimated quantized size | ~19–21 GB |
46
+
47
+ The oQ5E format uses exponent-aware quantization to preserve the dynamic range of larger-magnitude weights while compressing the bulk of the weight distribution. The fp16 base dtype was chosen over bf16 for ~20% faster prefill throughput on Apple Silicon GPUs.
48
+
49
+ ## Training Details
50
+
51
+ | Property | Value |
52
+ |---|---|
53
+ | Base model | Qwen/Qwen3.6-27B |
54
+ | Fine-tune method | LoRA (r=32, all text-stack linears) |
55
+ | LoRA merge | Merged into bf16 weights |
56
+ | Training data | grug-think-v3-10k agent trajectories + fresh GPT-5.5 set |
57
+ | Loss function | Think-only loss on trajectory data; full loss on fresh high-quality data |
58
+
59
+ ## Performance Benchmarks (v2.1)
60
+
61
+ | Benchmark | Metric | Score |
62
+ |---|---|---|
63
+ | HumanEval | pass@1 | 87.2 |
64
+ | MBPP | pass@1 | 85.0 |
65
+ | GSM8K | exact match | 95.5 |
66
+ | MATH-500 | (unseen surface) | 68.7 |
67
+ | SWE-bench Tool | valid / match / args | 97.1 / 92.6 / 100.0 |
68
+
69
+ Token efficiency: **8–40× fewer tokens** than the base Qwen3.6-27B model across reasoning tasks.
70
+
71
+ ## Hardware Requirements
72
+
73
+ | Requirement | Minimum | Recommended |
74
+ |---|---|---|
75
+ | RAM / Unified Memory | 16 GB (M1/M2/M3/M4 base) | 24 GB+ (M1/M2/M3/M4 Pro/Max) |
76
+ | Disk space | ~22 GB | ~22 GB |
77
+
78
+ ## Usage
79
+
80
+ ### Python (mlx-lm)
81
+
82
+ ```python
83
+ from mlx_lm import load, generate
84
+
85
+ model, tokenizer = load("your-username/grug-27b-oQ5E-fp16")
86
+ response = generate(
87
+ model, tokenizer,
88
+ prompt="Your prompt here",
89
+ max_tokens=1024,
90
+ temp=0.6,
91
+ top_p=0.95
92
+ )
93
+ print(response)
94
+ ```
95
+
96
+ ### CLI
97
+
98
+ ```bash
99
+ mlx_lm.run --model your-username/grug-27b-oQ5E-fp16 --max-tokens 4096 --temp 0.6 --top-p 0.95
100
+ ```
101
+
102
+ ### Recommended Inference Parameters
103
+
104
+ | Parameter | Value | Notes |
105
+ |---|---|---|
106
+ | `temp` | 0.6 | Balanced creativity / determinism |
107
+ | `top_p` | 0.95 | Standard nucleus sampling |
108
+ | `max_tokens` | 4096–16384 | Adjust based on task length |
109
+
110
+ ## License
111
+
112
+ This quantized model card and accompanying files are released under the **Apache License 2.0**, inherited from the original [ProCreations/grug-27b](https://huggingface.co/ProCreations/grug-27b) model. The base architecture is derived from [Qwen/Qwen3.6-27B](https://huggingface.co/Qwen/Qwen3.6-27B).
113
+
114
+ See the original model card for full license terms: https://huggingface.co/ProCreations/grug-27b
115
+
116
+ ## Citation
117
+
118
+ ```bibtex
119
+ @misc{grug27b,
120
+ title={Grug 27B — Token-Efficient Reasoning with the "Grug" Thinking Style},
121
+ author={ProCreations},
122
+ year={2025},
123
+ url={https://huggingface.co/ProCreations/grug-27b}
124
+ }
125
+
126
+ @misc{qwen3,
127
+ title={Qwen3.6-27B Technical Report},
128
+ author={Qwen Team},
129
+ year={2025},
130
+ url={https://huggingface.co/Qwen/Qwen3.6-27B}
131
+ }
132
+ ```
133
+
134
+ ## Acknowledgements
135
+
136
+ - **Qwen Team** for the Qwen3.6-27B base architecture
137
+ - **ProCreations** for the original grug-27b model and training methodology
138
+ - **oMLX** team for the exponent-aware oQ5E quantization scheme (v0.5.7)
139
+ - **mlx-lm** for the inference runtime
140
+
141
+ ## Links
142
+
143
+ - Original model: https://huggingface.co/ProCreations/grug-27b
144
+ - Base model: https://huggingface.co/Qwen/Qwen3.6-27B
145
+ - oMLX quantization: https://github.com/ml-explore/mlx-examples