SelfCodeAlign: Self-Alignment for Code Generation
Paper • 2410.24198 • Published • 24
Türkçe kod yazma, reasoning ve tool calling yeteneklerine sahip fine-tuned Qwen3-8B modeli.
A fine-tuned Qwen3-8B model specialized for Turkish code generation, chain-of-thought reasoning, and tool calling capabilities. Trained on Apple Silicon using MLX framework with QLoRA.
| Özellik | Değer |
|---|---|
| Base Model | Qwen/Qwen3-8B |
| Parameters | 8.19B (6.06M trainable via LoRA) |
| Quantization | Merged QLoRA adapters (rank=16, 10 layers) |
| Framework | MLX (Apple Silicon optimized) |
| Training Hardware | Apple M4 Pro 24GB Unified Memory |
| License | Apache-2.0 |
| Language | Turkish (tr), English (en) |
Model, 3 aşamalı bir curriculum learning pipeline ile eğitilmiştir:
| Aşama | İterasyon | Learning Rate | Açıklama |
|---|---|---|---|
| SFT-General | 800 | 2e-5 | Genel talimat takibi + temel kod yazma (zorluk 1-3) |
| SFT-Expert | 500 | 1e-5 | İleri kod + algoritma + sistem tasarımı (zorluk 3-5) |
| DPO Alignment | 200 | 5e-6 | Kod kalitesi, verimlilik, güvenlik hizalaması |
Toplam 1701 filtreli örnek (2249 ham → %24.4 azalma, diversity score: 0.877):
| Kategori | Örnek Sayısı | Metodoloji |
|---|---|---|
| Kod (14 kategori) | 780 | Evol-Instruct + OSS-Instruct + SelfCodeAlign |
| Chain-of-Thought | 580 | GPT-4o-mini ile 6 reasoning kategorisi |
| Tool Calling | 245 | Hermes function calling format |
| DPO Pairs | 214 | Kod kalitesi, verimlilik, güvenlik, test, açıklama |
| Türkçe Kültür | 160 | Atasözleri, dilbilgisi, tarih, internet jargonu |
Kod kategorileri: Python (fundamentals + advanced), algorithms & data structures, data science, web development, JavaScript/TypeScript, SQL, DevOps/Shell, testing, design patterns, agent development, system design, debugging, Java enterprise.
| Benchmark | Skor | Açıklama |
|---|---|---|
| HumanEval-TR | 70% pass@1 | Türkçe açıklamalı klasik HumanEval problemleri |
| MBPP-TR | 50% pass@1 | Basit Python görevleri, 3 test case ile |
| CodeQA-TR | 100% | Kod açıklama ve hata bulma soruları |
| MultiLang | 100% | JavaScript (%100), SQL (%100) |
| TR-BFCL | 37.5% | Türkçe function calling (multi-tool %100, negative %100) |
from mlx_lm import load, generate
model, tokenizer = load("engomeryasir/Jarvis-Qwen3-8B-Turkish-v2")
prompt = "Python ile binary search algoritması yaz ve karmaşıklığını açıkla."
messages = [{"role": "user", "content": prompt}]
text = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
response = generate(model, tokenizer, prompt=text, max_tokens=1024)
print(response)
# Sunucuyu başlat
python -m mlx_lm.server --model engomeryasir/Jarvis-Qwen3-8B-Turkish-v2 --port 11435
# API isteği
curl http://localhost:11435/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"messages":[{"role":"user","content":"FastAPI ile REST API yaz"}],"max_tokens":500}'
<think>...</think> blokları ile şeffaf düşünme süreci@misc{jarvis-qwen3-8b-turkish-v2,
title={Jarvis-Qwen3-8B-Turkish-v2: A Fine-tuned Turkish Code & Reasoning Model},
author={Ömer Yasir Önal},
year={2026},
url={https://huggingface.co/engomeryasir/Jarvis-Qwen3-8B-Turkish-v2}
}
4-bit