GRMR-V3-Q1.7B is a grammar correction model built on Qwen3 1.7B base model. It has been fine-tuned on a large dataset of grammar correction examples to help improve text quality by fixing grammatical errors, punctuation, spelling, and other language issues.
The model uses a specialized chat template that structures inputs as "text" and outputs as "corrected" to maintain a clear distinction between original and corrected content.
Here are a few examples of grammar corrections this model can handle:
Original Text
Corrected Text
i dont know weather to bring a umbrella today
I don't know whether to bring an umbrella today.
she go to the store yesterday
She went to the store yesterday.
they is going to be late for the meeting
They are going to be late for the meeting.
the cat laying on the floor all day
The cat is laying on the floor all day.
Training procedure
The model was fine-tuned using full parameter fine-tuning (not LoRA) on the GRMR-V4-60K dataset. The training was optimized using the Unsloth framework for efficient training of LLMs.
Training hyperparameters
Batch size: 8
Gradient accumulation steps: 2
Learning rate: 5e-5
Epochs: 1
Optimizer: AdamW (8-bit)
Weight decay: 0.01
LR scheduler: Cosine
Warmup steps: 180
Max sequence length: 16,384
Training precision: Mixed precision (BF16 where available, FP16 otherwise)
Intended uses & limitations
This model is designed for grammar correction tasks. It can be used to:
Fix grammatical errors in written text
Correct punctuation
Address spelling mistakes
Improve sentence structure and clarity
Limitations
The model may struggle with highly technical or domain-specific content
It may not fully understand context-dependent grammar rules in all cases
Performance may vary for non-standard English or text with multiple errors
How to use
Projects based on Hugging Face transformers should be able to run this model easily.
For pure transformers code, you can refer here:
python
1from transformers import AutoModelForCausalLM, AutoTokenizer
2# Load model and tokenizer3model_name ="qingy2024/GRMR-V3-Q1.7B"4tokenizer = AutoTokenizer.from_pretrained(model_name)5model = AutoModelForCausalLM.from_pretrained(model_name)6# Text with grammar errors to correct7text_to_correct ="i am going to the store tommorow and buy some thing for dinner"8# Format as messages9messages =[10{"role":"user","content": text_to_correct}11]12# Apply the custom chat template13prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)14# Tokenize and generate15inputs = tokenizer(prompt, return_tensors="pt").to(model.device)16outputs = model.generate(17 inputs["input_ids"],18 max_new_tokens=512,19 temperature=0.1,# NOTE: For best results, use the recommended temperature of 0.720 do_sample=True21)22# Decode and print the corrected text23corrected_text = tokenizer.decode(outputs[0], skip_special_tokens=True)24print(corrected_text)
Using with the Hugging Face pipeline
python
1from transformers import pipeline
2pipe = pipeline(3"text-generation",4 model="qingy2024/GRMR-V3-Q1.7B",5 torch_dtype="auto",6 device_map="auto"7)8messages =[9{"role":"user","content":"i dont know weather to bring a umbrella today"}10]11result = pipe(12 messages,13 max_new_tokens=100,14 temperature=0.1,# NOTE: For best results, use the recommended temperature of 0.715 do_sample=True,16 return_full_text=False17)[0]["generated_text"]18print(result)
Note: The Python examples above use temperature=0.1 for reproducibility in quick tests. For optimal grammar correction quality, please use the recommended sampler settings, especially temperature=0.7.
Custom Chat Template
The model uses a custom chat template with special formatting for grammar correction:
User inputs are formatted with <|text_start|> and <|text_end|> tags
Model outputs are formatted with <|corrected_start|> and <|corrected_end|> tags
The model was fine-tuned on the qingy2024/grmr-v4-60k dataset, which contains 60,000 examples of original text and their grammatically corrected versions.
Bias, Risks, and Limitations
The model may reflect biases present in the training data
It may not perform equally well across different writing styles or domains
The model might occasionally introduce errors or change the meaning of text
It focuses on grammatical correctness rather than stylistic improvements