Qwen3-4B-Turkish-Legal-QA-v1
Turkish legal QA model
2 min readupdated
The Qwen3-4B-Turkish-Legal-QA-v1 model is a specialized language model (LLM) trained on a large corpus of verified data covering Turkish legislation. Built on top of Qwen/Qwen3-4B, it was fine-tuned using QLoRA (an efficient low-precision fine-tuning method). The model provides direct and structured legal answers with references to law articles while omitting extra thinking blocks. It is useful for developers of legal services and legal researchers.
Key features
- Trained on a dataset of 278,550 cleaned examples of Turkish legislation.
- Zero leakage: data is split into articles the model has seen and completely unseen articles.
- Internal reasoning is disabled via the
enable_thinking=Falseparameter for fast answers. - Ready-to-use weights and GGUF versions are available for local execution.
What you can do
- Integrate the model into a local chatbot for preliminary Turkish legal consulting.
- Use it alongside search systems (RAG) to verify the accuracy of articles and codes.
- Run it on consumer graphics cards using ready-to-use quantized GGUF versions.
Example
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "sinanelms/Qwen3-4B-Turkish-Legal-QA-v1"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
text = tok.apply_chat_template(
[{"role": "user", "content": "CMK m. 100 nedir?"}],
tokenize=False,
add_generation_prompt=True,
enable_thinking=False,
)
inputs = tok(text, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=128)
print(tok.decode(out[0], skip_special_tokens=True))
Read more
DetailsMethod: 4-bit NF4 QLoRA (r=64, alpha=128).
Hardware requirements: Suitable for RTX 5070-class graphics cards and similar.
Limitations: Does not replace full legal counseling and requires verification via RAG for complex cases.










Comments