Qwen3 8B [V3] is a LoRA adapter fine-tuned on top of
Qwen/Qwen3-8B to improve Italian cultural alignment using a hybrid training technique — interleaving thinking-format and non-thinking-format examples in a single SFT pass via
ThinkingMode.MIXED. Trained on the
Mult-IT dataset and evaluated on the
ITALIC benchmark. V3 is the final version in the series and the only configuration where both inference modes improved simultaneously.
Author: Maruf Bepary, King's College London
Research report: Alignment in Large Language Models
The hybrid training technique is the only configuration in the Qwen3 series where both inference modes improved simultaneously:
V1 improved No Thinking but collapsed Thinking (59.33%, −15.16 pp). V2 recovered Thinking (77.87%) but left No Thinking nearly unchanged (70.27%). V3 interleaves both formats in training, allowing the model to simultaneously retain chain-of-thought capability and improve Italian cultural knowledge.
Benchmark: ITALIC (NAACL 2025) — Italian Culture-Aware Natural Language Benchmark
Format: Zero-shot, multiple-choice (12 categories, 10,000 questions)
System prompt: "Sei un assistente utile."
Baseline = Qwen3 8B (No Thinking), no fine-tuning.
Baseline = Qwen3 8B (Thinking), no fine-tuning.
Both thinking and no-thinking modes work well with this adapter.
1from transformers import AutoTokenizer, AutoModelForCausalLM
2from peft import PeftModel
3import torch
4
5base_model_id = "Qwen/Qwen3-8B"
6adapter_id = "maruf-bepary/qwen3-8b-italian-v3-mixed"
7
8# Load tokeniser and base model
9tokenizer = AutoTokenizer.from_pretrained(base_model_id)
10model = AutoModelForCausalLM.from_pretrained(
11 base_model_id,
12 torch_dtype=torch.bfloat16,
13 device_map="auto",
14)
15
16# Load LoRA adapter
17model = PeftModel.from_pretrained(model, adapter_id)
18model.eval()
19
20messages = [
21 {"role": "system", "content": "Sei un assistente utile."},
22 {
23 "role": "user",
24 "content": (
25 "Qual è la capitale d'Italia?\n"
26 "A) Milano\nB) Roma\nC) Napoli\nD) Torino\n\n"
27 "Rispondi con la lettera della risposta corretta."
28 ),
29 },
30]
31
32# Thinking mode — chain-of-thought is fully functional in V3
33text = tokenizer.apply_chat_template(
34 messages,
35 tokenize=False,
36 add_generation_prompt=True,
37 enable_thinking=True,
38)
39
40inputs = tokenizer(text, return_tensors="pt").to(model.device)
41
42with torch.no_grad():
43 outputs = model.generate(
44 **inputs,
45 max_new_tokens=1024,
46 do_sample=False,
47 )
48
49response = tokenizer.decode(
50 outputs[0][inputs["input_ids"].shape[-1]:],
51 skip_special_tokens=True,
52)
53print(response)
1# No Thinking mode — also fully functional in V3
2text = tokenizer.apply_chat_template(
3 messages,
4 tokenize=False,
5 add_generation_prompt=True,
6 enable_thinking=False,
7)
8
9inputs = tokenizer(text, return_tensors="pt").to(model.device)
10
11with torch.no_grad():
12 outputs = model.generate(
13 **inputs,
14 max_new_tokens=64,
15 do_sample=False,
16 temperature=None,
17 top_p=None,
18 )
19
20response = tokenizer.decode(
21 outputs[0][inputs["input_ids"].shape[-1]:],
22 skip_special_tokens=True,
23)
24print(response)
25# Expected output: "B"