Views
No views yet
<think> tags, teaching the model to show its reasoning step-by-step.<think> tags| Parameter | Value |
|---|---|
| Base Model | google/gemma-4-E2B-it |
| Model Parameters | E2B |
| Training Method | LoRA (Low-Rank Adaptation) |
| LoRA Rank | 16 |
| LoRA Alpha | 32 |
| Epochs | 1 |
| Batch Size | None × 4 (effective) |
| Learning Rate | 0.0002 |
| Max Sequence Length | 2048 |
| Precision | 4-bit quantization |
| Framework | Unsloth + TRL |
| Metric | Value |
|---|---|
| Final Loss | 1.8077 |
| Training Time | 3.55 hours |
| Steps | 3295 |
<think> tags)1from transformers import AutoModelForCausalLM, AutoTokenizer
2from peft import PeftModel
3
4# Load base model
5base_model = AutoModelForCausalLM.from_pretrained(
6 "google/gemma-4-E2B-it",
7 torch_dtype="auto",
8 device_map="auto",
9)
10tokenizer = AutoTokenizer.from_pretrained("google/gemma-4-E2B-it")
11
12# Load LoRA adapter
13model = PeftModel.from_pretrained(base_model, "YOUR_USERNAME/gemma4-e2b-Gemini-3.1-Pro-Reasoning-Distill")
14
15# Generate with thinking
16messages = [{
17 "role": "user",
18 "content": "Prove that the square root of 2 is irrational."
19}]
20
21inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
22outputs = model.generate(inputs, max_new_tokens=2048, temperature=0.7)
23print(tokenizer.decode(outputs[0], skip_special_tokens=True))1from unsloth import FastModel
2
3model, tokenizer = FastModel.from_pretrained(
4 "YOUR_USERNAME/gemma4-e2b-Gemini-3.1-Pro-Reasoning-Distill",
5 max_seq_length=2048,
6 load_in_4bit=True,
7)
8
9# Use the same generation code as above**Domain:** Number Theory
**Concept:** Proof by Contradiction
Prove that there are infinitely many prime numbers.<think>
I need to prove there are infinitely many primes. The classic approach is Euclid's proof
by contradiction...
Assume there are finitely many primes: p₁, p₂, ..., pₙ
Consider N = (p₁ × p₂ × ... × pₙ) + 1
N is either prime or composite. If prime, we found a new prime not in our list.
If composite, it must have a prime factor. But N leaves remainder 1 when divided
by any pᵢ, so its prime factors aren't in our list.
Either way, contradiction! So there must be infinitely many primes.
</think>
**Proof (Euclid's Theorem):**
Suppose, for contradiction, that there are only finitely many primes: p₁, p₂, ..., pₙ.
Consider the number N = p₁p₂...pₙ + 1.
Since N > 1, either N is prime or N has a prime factorization.
- If N is prime, then N is a prime not in our list (since N > pᵢ for all i), contradiction.
- If N is composite, let p be a prime factor of N. Then p must be one of p₁, ..., pₙ.
But N ≡ 1 (mod pᵢ) for all i, so p cannot divide N, contradiction.
Therefore, there must be infinitely many primes. ∎1@misc{gemma4-Gemini-3.1-Pro-Reasoning-Distill-2026,
2 title={Gemma-4-E2B Hard Reasoning},
3 author={Fine-tuned with Unsloth},
4 year={2026},
5 publisher={HuggingFace},
6 url={https://huggingface.co/Ayodele01/gemma4-e2b-Gemini-3.1-Pro-Reasoning-Distill}
7}