Update README.md
Browse files
README.md
CHANGED
|
@@ -1,21 +1,171 @@
|
|
| 1 |
---
|
| 2 |
-
base_model: unsloth/gemma-4-31B-it
|
| 3 |
-
tags:
|
| 4 |
-
- text-generation-inference
|
| 5 |
-
- transformers
|
| 6 |
-
- unsloth
|
| 7 |
-
- gemma4
|
| 8 |
-
license: apache-2.0
|
| 9 |
language:
|
| 10 |
- en
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
-
#
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
|
| 18 |
|
| 19 |
-
|
| 20 |
|
| 21 |
-
|
|
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
language:
|
| 3 |
- en
|
| 4 |
+
- zh
|
| 5 |
+
- ko
|
| 6 |
+
- ja
|
| 7 |
+
license: apache-2.0
|
| 8 |
+
base_model: google/gemma-4-31B-it
|
| 9 |
+
tags:
|
| 10 |
+
- gemma
|
| 11 |
+
- gemma4
|
| 12 |
+
- instruction-tuned
|
| 13 |
+
- reasoning
|
| 14 |
+
- alignment
|
| 15 |
+
pipeline_tag: text-generation
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# 🌟 Gemopus-4-31B-it
|
| 19 |
+
|
| 20 |
+
> [!NOTE]
|
| 21 |
+
> **Gemopus** is an attempt at fine-tuning Gemma 4 with a core philosophy of "stability first".
|
| 22 |
+
>
|
| 23 |
+
> While preserving the original reasoning order of **Gemma 4** as much as possible, we conducted targeted refinements for answer quality, structure, clarity, and consistency.
|
| 24 |
+
>
|
| 25 |
+
> **🍎 Therefore, My fine-tuning strategy chose not to follow other teams in aggressive direct distillation from Claude. Instead, we opted for a more conservative and controllable path.**
|
| 26 |
+
|
| 27 |
+
## 🎯 Development Motivation & Industry Insights
|
| 28 |
+
|
| 29 |
+
**Gemopus-4-31B-it** is a supervised fine-tune version based on the Gemma 4 31B Instruction model.
|
| 30 |
+
|
| 31 |
+
* Although this model has "Opus" in its name, it is more of a continuation of the naming convention.
|
| 32 |
+
* There is no need for excessive imagination or superstitious replication of the **"Claude-style chain of thought (CoT)"** found in public distillation corpora. Because judging from the currently available distilled datasets, reasoning text does not necessarily equate to the teacher model's true, faithful, and transferable internal reasoning process. Simple observation suggests it is often more like a summary of the thinking process rather than genuine logically connected **"reasoning."** A series of recent studies have found that models can exhibit post-hoc rationalization in natural scenarios without explicit induction—that is, forming an answer bias first and then coming up with a plausible explanation. Other research has found that CoT faithfulness varies greatly across different model families, and the impact of training methods on faithfulness is often more significant than model scale. In other words, text that "looks like reasoning" is not necessarily a high-quality, transferable supervision signal for reasoning.
|
| 33 |
+
|
| 34 |
+
---
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
|
| 39 |
+
---
|
| 40 |
+
|
| 41 |
+
## 🔬 Supporting Evidence
|
| 42 |
+
|
| 43 |
+
Recent work:
|
| 44 |
+
|
| 45 |
+
**Ren et al., 2026 — *Rethinking Generalization in Reasoning SFT: A Conditional Analysis on Optimization, Data, and Model Capability*** ([arXiv:2604.06628](https://arxiv.org/abs/2604.06628))
|
| 46 |
+
|
| 47 |
+
<div align="center">
|
| 48 |
+
|
| 49 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/66309bd090589b7c65950665/5ZY5R4n81okA9glcV9EJV.png" width="85%"/>
|
| 50 |
+
|
| 51 |
+
</div>
|
| 52 |
+
|
| 53 |
+
<p align="center"><em>
|
| 54 |
+
Short-epoch reasoning SFT can underestimate generalization — in-domain gains may appear early, while out-of-domain improvements often require sufficient optimization.
|
| 55 |
+
</em></p>
|
| 56 |
+
|
| 57 |
+
This paper suggests that generalization in reasoning SFT is **not fixed, but conditional** — shaped jointly by optimization dynamics, training data quality, and base-model capability.
|
| 58 |
+
|
| 59 |
+
Key takeaways:
|
| 60 |
+
|
| 61 |
+
- Reasoning SFT can generalize when sufficiently optimized, often showing a **dip → recovery** pattern rather than a monotonic curve.
|
| 62 |
+
- **High-quality long-CoT data** can support cross-domain transfer, whereas weak or noisy reasoning traces may not.
|
| 63 |
+
- **Stronger models** are more likely to internalize transferable reasoning structure instead of merely imitating longer outputs.
|
| 64 |
+
- The gains are **asymmetric**: reasoning ability may improve while safety behavior can degrade.
|
| 65 |
+
|
| 66 |
+
For **Gemopus-4-31B-it**, this evidence supports a more conditional interpretation of reasoning supervision. My strategy is therefore not based on the simplistic claim that reasoning SFT never generalizes, but on a practical judgment about **which kind of reasoning supervision is worth applying to Gemma 4**. Since **Gemma 4 31B** already has a relatively orderly and restrained reasoning-chat prior, I chose not to aggressively overwrite it with public "Claude-style" traces of uneven quality. Instead, the SFT objective focuses on preserving Gemma 4's native reasoning order while improving **answer quality, structure, clarity, and interaction consistency**.
|
| 67 |
+
|
| 68 |
+
This also suggests that reasoning SFT should be viewed as a **dynamic optimization process**, rather than a static training outcome. For this project, that means prioritizing **data quality, optimization discipline, and compatibility with the base model's native strengths**, rather than assuming that longer visible reasoning alone will automatically produce a better student.
|
| 69 |
+
|
| 70 |
+
---
|
| 71 |
+
|
| 72 |
+
## 💡 Model Features & Alignment Optimization
|
| 73 |
+
|
| 74 |
+
Based on the methodological deduction above, I chose to focus my optimization efforts on the lower-risk, more consistently rewarding levels of **final answer quality and interactive experience**:
|
| 75 |
+
|
| 76 |
+
* ⚖️ **Overall Style Consistency:** Eliminated the stiff "machine translation tone" and redundant preaching feel inherent in the base model, making conversations more natural, clear, and organized.
|
| 77 |
+
* 📐 **Structural & Completeness Enhancements:** Significantly optimized the organizational structure of long responses. The model can more proficiently use Markdown syntax (e.g., lists, bolding) for hierarchical structuring and noise reduction, ensuring key points stand out visually and improving the reading experience.
|
| 78 |
+
* 🎓 **Expressive Rigor & Depth of Explanation:** In technical and popular science responses, enhanced the rigor of professional terminology and the ability to explain complex concepts simply, while avoiding mechanical, encyclopedia-like recitation.
|
| 79 |
+
|
| 80 |
+
---
|
| 81 |
+
|
| 82 |
+
## 📊 Evaluation Benchmarks (TBD)
|
| 83 |
+
|
| 84 |
+
>
|
| 85 |
+
|
| 86 |
+
---
|
| 87 |
+
|
| 88 |
+
## 🛠️ Best Practices
|
| 89 |
+
|
| 90 |
+
For the best performance, use these configurations and best practices:
|
| 91 |
+
|
| 92 |
+
### 1. Sampling Parameters
|
| 93 |
+
|
| 94 |
+
Use the following standardized sampling configuration across all use cases:
|
| 95 |
+
|
| 96 |
+
* `temperature=1.0`
|
| 97 |
+
* `top_p=0.95`
|
| 98 |
+
* `top_k=64`
|
| 99 |
+
|
| 100 |
+
### 2. Thinking Mode Configuration
|
| 101 |
+
|
| 102 |
+
Compared to Gemma 3, the models use standard `system`, `assistant`, and `user` roles. To properly manage the thinking process, use the following control tokens:
|
| 103 |
+
|
| 104 |
+
* **Trigger Thinking:** Thinking is enabled by including the `<|think|>` token at the start of the system prompt. To disable thinking, remove the token.
|
| 105 |
+
* **Standard Generation:** When thinking is enabled, the model will output its internal reasoning followed by the final answer using this structure:
|
| 106 |
+
`<|channel>thought\n` **[Internal reasoning]** `<channel|>`
|
| 107 |
+
* **Disabled Thinking Behavior:** For all models except for the E2B and E4B variants, if thinking is disabled, the model will still generate the tags but with an empty thought block:
|
| 108 |
+
`<|channel>thought\n<channel|>` **[Final answer]**
|
| 109 |
+
|
| 110 |
+
> [!NOTE]
|
| 111 |
+
> Note that many libraries like Transformers and llama.cpp handle the complexities of the chat template for you.
|
| 112 |
+
|
| 113 |
+
---
|
| 114 |
+
|
| 115 |
+
## 📚 Resources & Guides
|
| 116 |
+
|
| 117 |
+
> 🚧 The complete fine-tuning code and related notebooks for this model will be updated soon, please stay tuned!
|
| 118 |
+
|
| 119 |
+
👉 **[GitHub Repository: Jackrong-llm-finetuning-guide](https://github.com/R6410418/Jackrong-llm-finetuning-guide.git)**
|
| 120 |
+
Welcome to visit this repository to gain a deeper understanding of the codebase and reproduce the training results locally or on Colab.
|
| 121 |
+
|
| 122 |
+
### 📥 Core Technical Documentation
|
| 123 |
+
**🔗 [Qwopus3.5-27b Complete Fine-Tuning Guide (PDF)](https://github.com/R6410418/Jackrong-llm-finetuning-guide/blob/main/guidePDF/Qwopus3-5-27b-Colab_complete_guide_to_llm_finetuning.pdf)**
|
| 124 |
+
* **Complete Pipeline:** Step-by-step operational guide—covering the entire process from downloading the base model, heterogeneous data fusion, to configuring training hyperparameters and finally releasing it to Hugging Face.
|
| 125 |
+
* **Beginner Friendly:** Includes basic starter tutorials for Google Colab and Unsloth.
|
| 126 |
+
|
| 127 |
+
> *No one starts out as an expert, but all experts bravely took the first step.*
|
| 128 |
+
>
|
| 129 |
+
> All training and testing for this project are self-funded. If you find this model or guide helpful, giving a **Star ⭐️ on [GitHub](https://github.com/R6410418/Jackrong-llm-finetuning-guide.git)** is the greatest encouragement to me. 🙏
|
| 130 |
+
|
| 131 |
+
---
|
| 132 |
+
|
| 133 |
+
## 🗺️ Training Pipeline
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
```text
|
| 137 |
+
Base Model (google/gemma-4-31B-it)
|
| 138 |
+
│
|
| 139 |
+
▼
|
| 140 |
+
Targeted Supervised Fine-Tuning (SFT)
|
| 141 |
+
(Focus on Answer Quality & Structural Alignment, Retaining Restrained CoT)
|
| 142 |
+
│
|
| 143 |
+
▼
|
| 144 |
+
Gemopus-4-31B-it
|
| 145 |
+
```
|
| 146 |
+
|
| 147 |
+
### 📚 Dataset Construction & Philosophy
|
| 148 |
+
The training data specifically curates highly coherent instruction pairs with optimal structures from the open-source community, alongside natural multi-turn conversations. The goal is to guide the model to learn more mature ways of organizing and presenting conclusions, rather than mechanically imitating "fake chain of thought" without internalized logic.
|
| 149 |
+
|
| 150 |
+
---
|
| 151 |
+
|
| 152 |
+
## ⚠️ Known Issues & Ecosystem Compatibility Statement
|
| 153 |
+
|
| 154 |
+
* **Tool Calling Compatibility:** The Gemma 4 series models still have known compatibility issues with tool calling functionality in local inference ecosystems like **llama.cpp / LM Studio** (including call failures, format mismatches, continuous loops, etc.). This has been widely reported in the community and is not unique to this model. If your workflow heavily relies on tool calling, it is recommended to thoroughly test it before official use, or temporarily consider solutions with more mature ecosystem support.
|
| 155 |
+
|
| 156 |
+
* **Regarding Fine-Tuning Characteristics of the Gemma Architecture:** From an engineering practice perspective, the Gemma series does exhibit different training dynamics compared to the Qwen series during fine-tuning—including wider loss curve fluctuations and greater sensitivity of gradient stability to hyperparameters. This may be related to Google's model architecture design. Furthermore, the base Gemma 4 model objectively still has a gap compared to the Qwen 3.5 series in certain dimensions of its raw capabilities. We believe that truthfully stating these observations is more beneficial to the technical judgment of the community than selectively avoiding them.
|
| 157 |
+
|
| 158 |
+
* **Project Positioning:** The core value of Gemopus-4-31B-it lies in providing an **engineering exploration reference supported by methodology** for SFT fine-tuning under the Gemma 4 architecture, rather than a fully production-ready solution. If you are looking for a productivity model that has undergone more iterative validation and offers more stable ecosystem compatibility, I recommend looking at the **Qwopus-3.5-v3 series**—its performance after fine-tuning is much more robust.
|
| 159 |
+
|
| 160 |
---
|
| 161 |
|
| 162 |
+
## 🍎 Limitations & Usage Recommendations
|
| 163 |
|
| 164 |
+
* **Boundaries of Computation & Knowledge:** Constrained by parameter size, the breadth of its world knowledge and depth of its mathematical and logical reasoning capabilities are still not entirely equivalent to those of frontier models with hundreds of billions of parameters in the cloud (such as GPT-4 or Claude 3.5 Sonnet).
|
| 165 |
+
* **Potential Hallucinations:** When dealing with extremely highly-specialized domains, obscure knowledge points, or complex high-level math problems requiring multi-step, long-chain calculations, there is still a possibility of logic drifting or hallucinations.
|
| 166 |
+
* **Best Practices:** It is strongly recommended to use it as a **local high-quality text processing and daily logic companion assistant**, particularly suitable for scenarios demanding high response quality and tight structural organization, such as structural summarization, routine copy arrangement, and interactive coding.
|
| 167 |
+
* **Disclaimer:** This is an experimental weight optimized independently, emphasizing "stability and methodology" in local interactions. Welcome to freely conduct local deployment tests and share academic discussions.
|
| 168 |
|
| 169 |
+
## 🙏 Acknowledgements
|
| 170 |
|
| 171 |
+
Special thanks to the developers in the open-source community for building such a thriving ecosystem. Thank you to the **Unsloth** team for providing excellent and highly efficient LLM fine-tuning support, and sincere respect to the **Google** team for open-sourcing the outstanding Gemma 4 base model. Finally, thanks to all the researchers who have contributed profound insights into CoT Faithfulness and the interpretability of LLM reasoning. It is exactly these rigorous frontier academic discussions that deeply inspired the core fine-tuning methodology of this project.
|