Model details
Table | |
|---|
| Base model | unsloth/Qwen2.5-7B-Instruct (Qwen/Qwen2.5-7B-Instruct) |
| Method | LoRA in bf16, supervised fine-tuning with TRL + Unsloth |
| LoRA rank / alpha / dropout | 32 / 64 / 0 |
| Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Language | Turkish |
| License | MIT (the base model is Apache-2.0) |
Input: the analysis JSON produced by kadim-analiz-lora, plus the officer's process_status and the selected_legislation articles (law name, article, reference text).
Output: one JSON object:
Table with columns: Field, Description| Field | Description |
|---|
performed_actions | List of {action, detail} administrative steps taken |
target_unit | Directorate the document goes to |
response_type | One of 7: BILGI_YAZISI, BILDIRIM_YAZISI, EKSIK_BILGI_BELGE_TAMAMLAMA_YAZISI, RET_YAZISI, YONLENDIRME_YAZISI, TESPIT_TUTANAGI, ONAY_YAZISI |
process_status | One of 5: INCELEMEDE, TAMAMLANDI, EKSIK_BILGI_BEKLENIYOR, REDDEDILDI, YONLENDIRILDI |
result_information / process_information | Short status explanations for the applicant |
draft | The official letter text |
Binding rule: when process_status is EKSIK_BILGI_BEKLENIYOR, response_type is always EKSIK_BILGI_BELGE_TAMAMLAMA_YAZISI.
Intended use
Drafting support inside a human-in-the-loop workflow. The officer reviews the analysis, marks the relevant legislation and picks the process status; the model drafts the letter afterwards, and the officer edits and signs it. The model is trained to take that human decision as an input, not to replace it.
Not intended for sending letters without human review, or for legal advice.
How to use
import torchfrom transformers import AutoModelForCausalLM, AutoTokenizerfrom peft import PeftModel base_id = "unsloth/Qwen2.5-7B-Instruct"adapter_id = "furkancmc/kadim-yazi-lora" tokenizer = AutoTokenizer.from_pretrained(adapter_id)model = AutoModelForCausalLM.from_pretrained(base_id, torch_dtype=torch.bfloat16, device_map="auto")model = PeftModel.from_pretrained(model, adapter_id) system_prompt = open("canonical_system_prompt.txt", encoding="utf-8").read() # from yazi_qwen2/ in the repomessages = [ {"role": "system", "content": system_prompt}, {"role": "user", "content": "<analysis JSON + process_status + selected_legislation>"},]inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, return_tensors="pt").to(model.device)out = model.generate(inputs, max_new_tokens=1024, do_sample=False)print(tokenizer.decode(out[0][inputs.shape[1]:], skip_special_tokens=True))
The system prompt (yazi_qwen2/canonical_system_prompt.txt) encodes the official-correspondence rules the model was trained under; use it unchanged. In the full system this adapter is served with vLLM multi-LoRA on the same Qwen2.5-7B-Instruct base as kadim-analiz-lora.
Training data
Dataset: furkancmc/kadim-yazi-data (train, validation and test splits).
5,625 ChatML records in total, built from the synthetic analysis set and DeepSeek-generated drafts.
Table with columns: Split, Records| Split | Records |
|---|
| Train | 4,240 |
| Validation | 863 |
| Test | 522 |
- One document, many scenarios (1→N): each analysis record is paired with several process statuses (under review, awaiting missing information, redirected, rejected, completed), because the same application needs a different letter in each case.
- Citation-grounded drafts: in about 85% of records the draft cites the provided law articles. In about 15% the legislation list is deliberately empty, so the model learns to write a general administrative-procedure letter instead of inventing article references.
All records are synthetic; no real citizen data is included. The data and generation scripts are in the GitHub repo under yazi_qwen2/.
Evaluation
Held-out test set of 522 records; base Qwen2.5-7B-Instruct and this adapter were evaluated on the same set with the same checks.
Table with columns: Metric, Base model, This adapter, Gain| Metric | Base model | This adapter | Gain |
|---|
response_type accuracy | 50.0% | 82.18% | +32.2 pts |
| Legislation citation fidelity | 83.91% | 92.53% | +8.6 pts |
Citation fidelity is the share of drafts whose cited laws and article numbers actually come from the legislation list given to the model (that is, it did not invent articles). Evaluation notebooks: 02_evaluate_qwen25_7b.ipynb (adapter) and 03_evaluate_base_model.ipynb (base).
Limitations
- Trained on synthetic correspondence for Turkish municipalities; style and rules may not match other institutions.
- About 7.5% of drafts can still cite something outside the supplied legislation, and about 18% of response types are wrong on the test set. A human must check every draft.
- The model does not verify facts, deadlines or the current validity of legislation.
Citation
@misc{kadim2026, title = {KADİM: Kamu Dilekçe ve İnceleme Mekanizması}, author = {Camcıoğlu, Furkan}, year = {2026}, url = {https://github.com/furkancmc/teknofest-kadim-kamu-evrak-ajani}}