Views
No views yet
embed_tokens) and the language modeling head (lm_head). These components were optimized using a lower learning rate than the LoRA parameters, allowing for gradual adaptation of the vocabulary representations and output distribution. This was particularly beneficial for the special tokens, whose embedding vectors in the base model were initially identical, enabling them to learn meaningful and distinct representations during fine-tuning.| Parameter | Value |
|---|---|
| Epochs | 1 |
| Batch Size | 4 |
| Gradient Accumulation | 8 |
| Effective Batch Size | 32 |
| Optimizer | AdamW Fused |
| Learning rate | 2.5e-4 |
| Embedding Learning Rate | 5e-5 |
| LoRA Rank | 32 |
| LoRA Alpha | 64 |
| Scheduler | Cosine |
| Warmup | 3% |
| Gradient Checkpointing | False |
| Packing | True |
q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj and down_proj.| Benchmark | Score |
|---|---|
| MMLU-Pro | 37.91 |
| GSM8K | 71.27 |
| HellaSwag | 62.28 |
| TruthfulQA mc2 | 51.62 |
| ARC Challenge | 44.97 |
| IFEval strict prompt | 33.09 |
1from unsloth import FastLanguageModel
2
3model, tokenizer = FastLanguageModel.from_pretrained(
4 model_name = "ayushshah/Qwen3-1.7B-UltraChat-SFT",
5 max_seq_length = 2048,
6 dtype = "bfloat16",
7 load_in_4bit = False,
8)
9
10FastLanguageModel.for_inference(model)
11
12prompt = "Explain gradient descent simply."
13messages = [
14 {"role": "system", "content": "You are a helpful assistant."},
15 {"role": "user", "content": prompt}
16]
17
18inputs = tokenizer.apply_chat_template(
19 messages,
20 tokenize = True,
21 add_generation_prompt = True,
22 return_tensors = "pt",
23).to(model.device)
24
25outputs = model.generate(
26 input_ids = inputs,
27 max_new_tokens = 2048,
28)
29
30input_length = inputs.shape[1]
31new_tokens = outputs[0][input_length:]
32
33raw_text = tokenizer.decode(new_tokens, skip_special_tokens=True)
34print(raw_text)1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3tokenizer = AutoTokenizer.from_pretrained("ayushshah/Qwen3-1.7B-UltraChat-SFT")
4model = AutoModelForCausalLM.from_pretrained(
5 "ayushshah/Qwen3-1.7B-UltraChat-SFT",
6 torch_dtype="auto",
7 device_map="auto"
8)
9
10prompt = "Explain gradient descent simply."
11messages = [
12 {"role": "system", "content": "You are a helpful assistant."},
13 {"role": "user", "content": prompt}
14]
15
16inputs = tokenizer.apply_chat_template(
17 messages,
18 tokenize = True,
19 add_generation_prompt = True,
20 return_tensors = "pt",
21).to(model.device)
22
23outputs = model.generate(
24 input_ids = inputs["input_ids"],
25 max_new_tokens = 2048,
26)
27
28input_length = inputs["input_ids"].shape[1]
29new_tokens = outputs[0][input_length:]
30
31raw_text = tokenizer.decode(new_tokens, skip_special_tokens=True)
32print(raw_text)@misc{qwen3technicalreport,
title={Qwen3 Technical Report},
author={Qwen Team},
year={2025},
eprint={2505.09388},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2505.09388},
}