Create readme.md
Browse files12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061---license: mitlanguage:- en- bnsize_categories:- n<1K---## 🏆 Qwen3-4B Prompt Response BenchmarkThis benchmarking dataset contains 10 diverse data points where the **Qwen3-4B** model makes reasoning and cultural errors in English and Bengali.## 🤖 Model: Qwen3-4BBase model with reasoning capabilities. One of the well known open source Large Language Models.
## 🎯 Analysis of Qwen3-4B's errorsThe model was tested in ten diverse data points including Math, Physics, Code, Cultural understanding, toxicity and many more in English and Bengali to understand “Model’s Blind spots” particularly in reasoning. Technical and scientific prompts are collected from trusted sources. The cultural and Bengali prompts are created by me (as a trusted native speaker). I found that the model performed poorly in reasoning. It even stuck in thinking mode while answering olympiad questions. It couldn’t understand cultural norms and outputted toxic and harmful texts in Bengali prompts which suggests its pretrained dataset lacks Bengali contexts.In shorts, it lacks reasoning capabilities in a multilingual context.
## 📂 Dataset required to fine-tuned Qwen3-4BWe can divide the required dataset into the following categories. 1 . Multilingual CoT reasoning, 2. Bengali cultural alignment, 3. Toxicity refusal (Bengali), 4. Cross-lingual instruction data. As Qwen3 -4B is a small model, around 20k - 25k examples is enough to fine tune the model in 2. Bengali cultural alignment, 3.Toxicity refusal (Bengali), 4. Cross-lingual instruction data. We can source existing dataset and translate them into multilingual dataset. The main problem of translation is that it doesn't align well with naturalness and cultural adaptation. So I have to find a way to do it. For 1 . Multilingual CoT reasoning, fine tuning with translated Math or IMO problems could be a solution. Maybe we can use LoRa, but the problem is, the model will probably struggle in unseen new problems. This is an active research domain, so I need help here.
## 🔗 Model & LoadingThe model tested is **[Qwen/Qwen3-4B](https://huggingface.co/Qwen/Qwen3-4B)**.
This code is the sample code provided by Qwen3-4B repo.To reproduce these results, the model was loaded in `float16` to balance performance and memory.
```pythonfrom transformers import AutoTokenizer, AutoModelForCausalLMimport torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-4B")
model = AutoModelForCausalLM.from_pretrained( "Qwen/Qwen3-4B", torch_dtype=torch.float16, device_map="auto")model.eval()
def ask(prompt): messages = [{"role": "user", "content": prompt}] text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True) inputs = tokenizer([text], return_tensors="pt").to(model.device) outputs = model.generate(**inputs, max_new_tokens=2048) generated_tokens = outputs[0][inputs.input_ids.shape[-1]:] output_ids = generated_tokens.tolist()
try: # Skip internal thinking block index = len(output_ids) - output_ids[::-1].index(151668) except ValueError: index = 0
return tokenizer.decode(output_ids[index:], skip_special_tokens=True).strip()readme.mdAdded+61