A finetuned Qwen3-4B model specialized for German language teaching at A1-B1 CEFR levels. This model excels at:
Grammar Error Detection: Identifying grammatical mistakes in German sentences
Error Correction: Providing correct forms with clear explanations
Grammar Judgment: Binary classification of sentence grammaticality (CoLA-style)
Teaching Explanations: Clear, learner-friendly explanations of German grammar rules
Model Details
Property
Value
Base Model
Qwen/Qwen3-4B
Parameters
4B
Training Method
SFT (Supervised Fine-Tuning) with LoRA
LoRA Rank
32
LoRA Alpha
64
Training Epochs
2
Learning Rate
2e-4
Context Length
4096 tokens
Performance
Evaluated on a custom German grammar benchmark:
Metric
Score
Description
CoLA MCC
0.721
Matthews Correlation Coefficient for grammaticality judgment
GEC F1
0.349
Macro F1 for grammar error correction
Generation Quality
3.99/5.0
Human-evaluated response quality
Overall Score
0.633
Weighted composite score
Benchmark Comparison
Comparison with SmolLM3-German-V6 (3B parameters, Q4 quantized):
Metric
Qwen3 German Teacher (4B)
SmolLM3-German-V6 (3B)
Improvement
CoLA MCC
0.721
0.624
+15.5%
GEC F1
0.349
0.145
+140.7%
Generation Quality
3.99
3.19
+25.1%
Overall Score
0.633
0.492
+28.7%
Key advantages of this model:
Superior grammaticality judgment: 15.5% higher CoLA MCC score
Much better error correction: 2.4x better GEC F1 score
Higher quality responses: 0.8 points higher on 5-point scale
Training Data
The model was trained on ~9,000 examples with the following composition:
Category
Percentage
Purpose
Grammar Correction
35%
Error correction patterns
Grammar Judgment
25%
CoLA-style "Is this correct?" examples
Structured Teaching
20%
Verb conjugations, grammar explanations
General Conversation
20%
Fluency preservation
Key Training Focus Areas
haben/sein auxiliary verbs: Movement verbs require "sein" (e.g., "Ich bin gefahren" not "Ich habe gefahren")
Article gender (der/die/das)
Case usage (Nominativ, Akkusativ, Dativ, Genitiv)
Word order in German sentences
Usage
With Transformers
python
1from transformers import AutoModelForCausalLM, AutoTokenizer
23model = AutoModelForCausalLM.from_pretrained("jaigouk/qwen3-4b-german-teacher")4tokenizer = AutoTokenizer.from_pretrained("jaigouk/qwen3-4b-german-teacher")56messages =[7{"role":"system","content":"Du bist ein freundlicher Deutschlehrer für A1-B1 Lernende."},8{"role":"user","content":"Is this German sentence correct? 'Ich habe nach Berlin gefahren.'"}9]1011text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)12inputs = tokenizer(text, return_tensors="pt")13outputs = model.generate(**inputs, max_new_tokens=256)14print(tokenizer.decode(outputs[0], skip_special_tokens=True))
With Ollama (GGUF)
Download the GGUF file: qwen3-german-teacher-Q4_K_M.gguf
Create a Modelfile:
dockerfile
1FROM ./qwen3-german-teacher-Q4_K_M.gguf23TEMPLATE """{{- if .System }}<|im_start|>system
4{{ .System }}<|im_end|>
5{{ end }}<|im_start|>user
6{{ .Prompt }}<|im_end|>
7<|im_start|>assistant
8<think>
910</think>
1112{{ .Response }}<|im_end|>
13"""
1415PARAMETER stop "<|im_end|>"
16PARAMETER stop "<|endoftext|>"
17PARAMETER temperature 0.7
18PARAMETER top_p 0.9
19PARAMETER num_ctx 4096
2021SYSTEM """Du bist ein freundlicher Deutschlehrer für A1-B1 Lernende. Erkläre Grammatikfehler klar und einfach. Beurteile grammatische Korrektheit sorgfältig."""
Create and run:
bash
1ollama create qwen3-german-teacher -f Modelfile
2ollama run qwen3-german-teacher "Is 'Ich habe nach Berlin gefahren' correct?"
Example Interactions
Grammar Error Detection
User: Is this German sentence grammatically correct? "Ich habe nach Berlin gefahren."
Model: No, this sentence is incorrect. The verb "fahren" describes movement from one place to another, so it requires "sein" as the auxiliary verb, not "haben".
Correct: "Ich bin nach Berlin gefahren."
Grammar Explanation
User: Explain when to use "sein" vs "haben" in the Perfekt tense.
Model: In German, most verbs use "haben" in the Perfekt tense, but verbs that describe:
Movement from A to B: gehen, fahren, fliegen, kommen, laufen
Change of state: aufwachen, einschlafen, sterben, werden
These verbs use "sein" instead. For example:
Ich bin nach Hause gegangen. (movement)
Er ist eingeschlafen. (change of state)
Conjugation Help
User: Conjugate "sein" in present tense.
Model: Here is the conjugation of "sein" (to be) in present tense:
Person
Conjugation
ich
bin
du
bist
er/sie/es
ist
wir
sind
ihr
seid
sie/Sie
sind
Limitations
Optimized for A1-B1 level German; may oversimplify advanced grammar concepts
Focused on grammar teaching; not designed for creative writing or translation
Best performance with clear, focused grammar questions
Training Methodology
Research-Informed Approach
This model was developed using insights from recent research on instruction-tuning and continual learning:
"Instructions paired with responses sampled from other LLMs are often out of the distribution of the target model, which can lead to diminishing returns and even hurt performance"
Key insight: Rather than using responses generated by larger models (GPT-4, Claude), we curated training examples that align with Qwen3's natural output distribution. This prevents the model from learning patterns it cannot reliably reproduce.
CoLA-Style Judgment Training
The breakthrough in V4 was adding 25% explicit grammaticality judgment examples. This teaches the model to reason about correctness rather than just generate correct text:
User: Ist der Satz grammatisch korrekt? "Der Frau ist schön."
Assistant: Nein, der Satz ist nicht korrekt.
Fehler: "Der" ist maskulin, aber "Frau" ist feminin.
Korrektur: "Die Frau ist schön."
Stage 3: RL/GRPO (Reinforcement Learning with Grammar Rewards)
Our training script design followed the MiroThinker paper's architecture, including:
Higher LoRA rank (r=32, alpha=64) as recommended for multi-stage training stability
Full target modules (q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj) for comprehensive adaptation
However, this model uses only SFT because our experiments with preference optimization showed a fundamental trade-off:
Why DPO/SimPO Failed for Our Use Case
Model
CoLA MCC
GEC F1
Generation
Overall
Status
V6 SFT (Baseline)
0.624
0.191
3.29
0.516
Reference
V8 (DPO)
0.583
0.063
3.63
0.473
-8% overall
V9 (SimPO)
0.567
0.073
3.72
0.479
-7% overall
Key findings:
DPO improved generation quality (+10%) but destroyed GEC accuracy (-67%)
SimPO achieved best generation (3.72) but still regressed accuracy significantly
This confirms the "alignment tax" documented in 2025 research: 76% of preference optimization causes regression on specific tasks
For grammar teaching, accuracy is more important than fluency, so we stayed with pure SFT. The V4 dataset composition (25% CoLA-style judgment examples) proved more effective than preference optimization for our metrics.
SFT Training Configuration
Configuration based on MiroThinker recommendations for multi-stage training:
The Q4_K_M quantization reduces model size from ~8GB to 2.5GB while maintaining high quality.
Technical Specifications
Framework: Unsloth + Transformers + TRL + PEFT
Hardware: NVIDIA RTX 4090 (24GB VRAM)
Training Time: ~45 minutes for 2 epochs
Quantization: GGUF Q4_K_M (2.5GB)
Citation
If you use this model, please cite:
bibtex
1@misc{qwen3-4b-german-teacher-2025,
2 author = {Jaigouk Kim},
3 title = {Qwen3-4B German Teacher: A Finetuned Model for German Grammar Teaching},
4 year = {2025},
5 publisher = {HuggingFace},
6 url = {https://huggingface.co/jaigouk/qwen3-4b-german-teacher}
7}
License
This model is released under the Apache 2.0 license, following the base Qwen3 model license.