AmareshHebbar commited on
Commit
b636ebc
Β·
verified Β·
1 Parent(s): 6116852

docs: v3 model card - QDoRA rationale, richer inference samples, expanded tags

Browse files
Files changed (1) hide show
  1. README.md +181 -20
README.md CHANGED
@@ -8,15 +8,29 @@ tags:
8
  - code-generation
9
  - competitive-programming
10
  - qwen2.5-coder
11
- - qlora
12
- - unsloth
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  - algorithms
14
  language:
15
  - en
16
  library_name: peft
17
  pipeline_tag: text-generation
18
  datasets:
19
- - AmareshHebbar/leetcode-java-sft
20
  co2_eq_emissions:
21
  emissions: 0
22
  source: "estimate, not measured with a carbon-tracking tool"
@@ -31,18 +45,19 @@ model-index:
31
  <div align="center">
32
 
33
  # β˜• LeetCode Java Coder
34
- ### Qwen2.5-Coder-7B fine-tuned to solve LeetCode problems in Java
35
 
36
  [![Hugging Face](https://img.shields.io/badge/%F0%9F%A4%97%20Model-leetcode--java--qwen25--coder--7b-FFD21E)](https://huggingface.co/AmareshHebbar/leetcode-java-qwen25-coder-7b)
37
- [![Dataset](https://img.shields.io/badge/%F0%9F%A4%97%20Dataset-leetcode--java--sft-blue)](https://huggingface.co/datasets/AmareshHebbar/leetcode-java-sft)
38
  [![GGUF](https://img.shields.io/badge/GGUF-quantized-6f42c1)](https://huggingface.co/AmareshHebbar/leetcode-java-qwen25-coder-7b-GGUF)
39
  [![License](https://img.shields.io/badge/license-Apache%202.0-green)](https://www.apache.org/licenses/LICENSE-2.0)
40
  [![Base Model](https://img.shields.io/badge/base-Qwen2.5--Coder--7B-orange)](https://huggingface.co/unsloth/Qwen2.5-Coder-7B-Instruct)
 
41
  [![Ollama](https://img.shields.io/badge/-Ollama-000000?logo=ollama)](#ollama)
42
  [![vLLM](https://img.shields.io/badge/-vLLM-333333)](#vllm)
43
  [![TGI](https://img.shields.io/badge/-TGI-yellow)](#tgi)
44
 
45
- *Part of the [LeetCode Multi-Language Coder Suite](https://huggingface.co/collections/AmareshHebbar/leetcode-multi-language-coder-suite) β€” 4 language specialists, one base model*
46
 
47
  </div>
48
 
@@ -50,7 +65,7 @@ model-index:
50
 
51
  ## TL;DR
52
 
53
- Given a LeetCode-style problem statement and an algorithm tag, generates a working Java solution.
54
 
55
  ```
56
  PROBLEM: Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
@@ -73,14 +88,44 @@ class Solution {
73
  | | |
74
  |---|---|
75
  | **Base model** | [unsloth/Qwen2.5-Coder-7B-Instruct](https://huggingface.co/unsloth/Qwen2.5-Coder-7B-Instruct) |
76
- | **Method** | QLoRA, 4-bit NF4, rank 16 |
77
- | **Training data** | [leetcode-java-sft](https://huggingface.co/datasets/AmareshHebbar/leetcode-java-sft) |
78
- | **Weights here** | LoRA adapter only (~160MB) β€” load on top of the base model |
 
 
79
  | **GGUF build** | [leetcode-java-qwen25-coder-7b-GGUF](https://huggingface.co/AmareshHebbar/leetcode-java-qwen25-coder-7b-GGUF) β€” q4_k_m / q5_k_m / q8_0 |
80
  | **License** | Apache 2.0 |
81
 
82
  ---
83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  ## Benchmarks (free, reproducible)
85
 
86
  Run `benchmark_suite.py` from the deployment kit to reproduce. All numbers are pass@1 unless noted.
@@ -89,11 +134,11 @@ Run `benchmark_suite.py` from the deployment kit to reproduce. All numbers are p
89
  |---|---|---|---|---|
90
  | [HumanEval-X](https://huggingface.co/datasets/THUDM/humaneval-x) | Java | _run benchmark_suite.py_ | _run benchmark_suite.py_ | 164 problems, execution-verified |
91
  | [MultiPL-E](https://huggingface.co/datasets/nuprl/MultiPL-E) (HumanEval subset) | Java | _run benchmark_suite.py_ | β€” | cross-check vs HumanEval-X |
92
- | Held-out LeetCode test split | Java | _run benchmark_suite.py_ | β€” | from `leetcode-java-sft` test split, exact I/O match |
93
  | Tokens/sec (fp16, A40) | Java | β€” | β€” | latency benchmark, see script |
94
  | Tokens/sec (GGUF q4_k_m, CPU) | Java | β€” | β€” | latency benchmark, see script |
95
 
96
- > Numbers are intentionally left blank in this template β€” `benchmark_suite.py` fills a `results/leetcode-java-qwen25-coder-7b.json` file and this table should be regenerated from it (see deployment kit README).
97
 
98
  ---
99
 
@@ -143,6 +188,65 @@ outputs = model.generate(inputs, max_new_tokens=512, temperature=0.2, do_sample=
143
  print(tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True))
144
  ```
145
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  ### Option B β€” Unsloth (2x faster load + inference)
147
 
148
  ```python
@@ -189,6 +293,18 @@ response = client.chat.completions.create(
189
  print(response.choices[0].message.content)
190
  ```
191
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  ### Option D β€” TGI (Text Generation Inference) {#tgi}
193
 
194
  ```bash
@@ -218,6 +334,17 @@ ollama create leetcode-java-qwen25-coder-7b -f Modelfile.java
218
  ollama run leetcode-java-qwen25-coder-7b "Problem: Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.\nAlgorithm: Hash Map"
219
  ```
220
 
 
 
 
 
 
 
 
 
 
 
 
221
  ### Option F β€” GGUF / llama.cpp direct (mobile/edge inference)
222
 
223
  ```bash
@@ -232,19 +359,43 @@ See `export_gguf.py` in the deployment kit for building q4_k_m / q5_k_m / q8_0 v
232
 
233
  ## Training details
234
 
235
- ### Data
236
 
237
- Trained on [leetcode-java-sft](https://huggingface.co/datasets/AmareshHebbar/leetcode-java-sft), built from the `doocs/leetcode` corpus: problem statement + input/output examples + algorithm tag β†’ verified Java solution, one-to-many (problem β†’ multiple algorithm-tagged solutions).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
 
239
  ### Hyperparameters
240
 
241
  | Parameter | Value |
242
  |---|---|
 
243
  | LoRA rank (r) | 16 |
244
  | LoRA alpha | 32 |
245
  | LoRA dropout | 0 |
246
  | Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
247
- | Quantization | 4-bit NF4 (QLoRA) |
248
  | Max sequence length | 2048 |
249
  | Optimizer | paged_adamw_8bit |
250
  | LR schedule | 2e-4, cosine |
@@ -257,7 +408,8 @@ Trained on [leetcode-java-sft](https://huggingface.co/datasets/AmareshHebbar/lee
257
  | **Cloud provider** | RunPod |
258
  | **CO2 estimate** | self-reported, not measured with a carbon tracker β€” treat as approximate |
259
 
260
- Fine-tuned with [Unsloth](https://github.com/unslothai/unsloth) + TRL's `SFTTrainer`.
 
261
 
262
  ---
263
 
@@ -269,19 +421,27 @@ Fine-tuned with [Unsloth](https://github.com/unslothai/unsloth) + TRL's `SFTTrai
269
 
270
  **Not exhaustive on complexity.** The model doesn't guarantee asymptotically optimal solutions β€” check the complexity claims yourself for performance-sensitive use.
271
 
 
 
272
  ---
273
 
274
  ## FAQ
275
 
276
  **Q: Can I merge the adapter into the base model?**
277
- Yes β€” `model.merge_and_unload()` after loading with PEFT, or Unsloth's `save_pretrained_merged()`.
278
 
279
- **Q: Why QLoRA instead of full fine-tuning?**
280
- Qwen2.5-Coder-7B already has strong code priors from pretraining; QLoRA specializes the output format and LeetCode-specific patterns without the cost of full fine-tuning.
 
 
 
281
 
282
  **Q: Which quantization should I use on mobile?**
283
  q4_k_m is the best size/quality tradeoff for phones; q5_k_m if you have RAM headroom; avoid q2/q3 for code generation β€” correctness drops sharply below 4-bit.
284
 
 
 
 
285
  ---
286
 
287
  ## Related models in this suite
@@ -301,8 +461,9 @@ q4_k_m is the best size/quality tradeoff for phones; q5_k_m if you have RAM head
301
 
302
  | Version | Notes |
303
  |---|---|
 
304
  | v2.0 | Added GGUF builds, Ollama/vLLM/TGI deployment, benchmark harness (HumanEval-X, MultiPL-E, held-out test split) |
305
- | v1.0 | Initial release β€” QLoRA fine-tune on leetcode-java-sft |
306
 
307
  ---
308
 
 
8
  - code-generation
9
  - competitive-programming
10
  - qwen2.5-coder
11
+ - dora
12
+ - qdora
13
+ - weight-decomposed-lora
14
+ - instruction-tuned
15
+ - sft
16
+ - algorithm-generation
17
+ - function-generation
18
+ - coding-assistant
19
+ - on-device
20
+ - gguf
21
+ - ollama
22
+ - vllm
23
+ - text-generation-inference
24
+ - doocs-leetcode
25
+ - synthetic-verification
26
+ - quantized
27
  - algorithms
28
  language:
29
  - en
30
  library_name: peft
31
  pipeline_tag: text-generation
32
  datasets:
33
+ - AmareshHebbar/leetcode-code-gen-datasets
34
  co2_eq_emissions:
35
  emissions: 0
36
  source: "estimate, not measured with a carbon-tracking tool"
 
45
  <div align="center">
46
 
47
  # β˜• LeetCode Java Coder
48
+ ### Qwen2.5-Coder-7B, QDoRA fine-tuned to solve LeetCode problems in Java
49
 
50
  [![Hugging Face](https://img.shields.io/badge/%F0%9F%A4%97%20Model-leetcode--java--qwen25--coder--7b-FFD21E)](https://huggingface.co/AmareshHebbar/leetcode-java-qwen25-coder-7b)
51
+ [![Dataset](https://img.shields.io/badge/%F0%9F%A4%97%20Dataset-leetcode--code--gen--datasets-blue)](https://huggingface.co/datasets/AmareshHebbar/leetcode-code-gen-datasets)
52
  [![GGUF](https://img.shields.io/badge/GGUF-quantized-6f42c1)](https://huggingface.co/AmareshHebbar/leetcode-java-qwen25-coder-7b-GGUF)
53
  [![License](https://img.shields.io/badge/license-Apache%202.0-green)](https://www.apache.org/licenses/LICENSE-2.0)
54
  [![Base Model](https://img.shields.io/badge/base-Qwen2.5--Coder--7B-orange)](https://huggingface.co/unsloth/Qwen2.5-Coder-7B-Instruct)
55
+ [![Method](https://img.shields.io/badge/method-QDoRA-critical)](#why-qdora)
56
  [![Ollama](https://img.shields.io/badge/-Ollama-000000?logo=ollama)](#ollama)
57
  [![vLLM](https://img.shields.io/badge/-vLLM-333333)](#vllm)
58
  [![TGI](https://img.shields.io/badge/-TGI-yellow)](#tgi)
59
 
60
+ *Part of the [LeetCode Multi-Language Coder Suite](https://huggingface.co/collections/AmareshHebbar/leetcode-multi-language-coder-suite) β€” 4 language specialists, one base model, one pipeline*
61
 
62
  </div>
63
 
 
65
 
66
  ## TL;DR
67
 
68
+ Given a LeetCode-style problem statement, its sample input/output, and an algorithm tag, generates a working Java solution.
69
 
70
  ```
71
  PROBLEM: Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
 
88
  | | |
89
  |---|---|
90
  | **Base model** | [unsloth/Qwen2.5-Coder-7B-Instruct](https://huggingface.co/unsloth/Qwen2.5-Coder-7B-Instruct) |
91
+ | **Method** | QDoRA (quantized DoRA, not plain LoRA) |
92
+ | **Training data** | [leetcode-code-gen-datasets](https://huggingface.co/datasets/AmareshHebbar/leetcode-code-gen-datasets) config `java` |
93
+ | **Data provenance** | scraped from [doocs/leetcode](https://github.com/doocs/leetcode) (3,977 problems), execution-verified, no synthetic/LLM-generated solutions |
94
+ | **Data quality** | execution-checked against sample I/O (see dataset card for exact rate) |
95
+ | **Weights here** | QDoRA adapter only (~160MB) β€” load on top of the base model |
96
  | **GGUF build** | [leetcode-java-qwen25-coder-7b-GGUF](https://huggingface.co/AmareshHebbar/leetcode-java-qwen25-coder-7b-GGUF) β€” q4_k_m / q5_k_m / q8_0 |
97
  | **License** | Apache 2.0 |
98
 
99
  ---
100
 
101
+ ## Why QDoRA {#why-qdora}
102
+
103
+ DoRA splits each adapted weight into magnitude + direction and trains both, which follows full fine-tuning's behavior more closely than plain LoRA β€” important for code where small precision errors break correctness outright. 4-bit NF4 quantization of the frozen base keeps this affordable on a single 48GB GPU.
104
+
105
+ Concretely, versus the plain-QLoRA v1 release of this suite: DoRA adds a per-column
106
+ trainable magnitude vector on top of the usual low-rank direction update, so the
107
+ adapter can rescale a feature's importance instead of only rotating it. On a code
108
+ task where a single wrong operator or dropped edge case fails the whole solution,
109
+ that closer match to full fine-tuning's update pattern showed up as fewer
110
+ near-miss failures during our own qualitative review, at the same LoRA rank and
111
+ VRAM budget.
112
+
113
+ ```python
114
+ # training-side PEFT config (see build_language_datasets.py / trainer script for full pipeline)
115
+ from peft import LoraConfig
116
+
117
+ peft_config = LoraConfig(
118
+ r=16,
119
+ lora_alpha=32,
120
+ lora_dropout=0.0,
121
+ target_modules=["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"],
122
+ use_dora=True, # <- this is what makes it QDoRA, not QLoRA
123
+ task_type="CAUSAL_LM",
124
+ )
125
+ ```
126
+
127
+ ---
128
+
129
  ## Benchmarks (free, reproducible)
130
 
131
  Run `benchmark_suite.py` from the deployment kit to reproduce. All numbers are pass@1 unless noted.
 
134
  |---|---|---|---|---|
135
  | [HumanEval-X](https://huggingface.co/datasets/THUDM/humaneval-x) | Java | _run benchmark_suite.py_ | _run benchmark_suite.py_ | 164 problems, execution-verified |
136
  | [MultiPL-E](https://huggingface.co/datasets/nuprl/MultiPL-E) (HumanEval subset) | Java | _run benchmark_suite.py_ | β€” | cross-check vs HumanEval-X |
137
+ | Held-out LeetCode test split | Java | _run benchmark_suite.py_ | β€” | from `leetcode-code-gen-datasets` (`java`) test split, exact I/O match |
138
  | Tokens/sec (fp16, A40) | Java | β€” | β€” | latency benchmark, see script |
139
  | Tokens/sec (GGUF q4_k_m, CPU) | Java | β€” | β€” | latency benchmark, see script |
140
 
141
+ > Numbers are intentionally left blank in this template β€” `benchmark_suite.py` fills a `results/leetcode-java-qwen25-coder-7b.json` file and this table should be regenerated from it.
142
 
143
  ---
144
 
 
188
  print(tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True))
189
  ```
190
 
191
+ ### Batch inference (many problems at once)
192
+
193
+ ```python
194
+ problems = [
195
+ "Problem: Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.\nAlgorithm: Hash Map",
196
+ "Problem: Given a string s, find the length of the longest substring without repeating characters.\nAlgorithm: two pointers / sliding window",
197
+ "Problem: Merge two sorted linked lists into one sorted list.\nAlgorithm: linked list, dummy head",
198
+ ]
199
+
200
+ prompts = [
201
+ tokenizer.apply_chat_template(
202
+ [{"role": "system", "content": "You are an expert Java competitive programmer. Given a LeetCode-style problem statement and an algorithm tag, write a correct, efficient Java solution."}, {"role": "user", "content": p}],
203
+ tokenize=False, add_generation_prompt=True,
204
+ )
205
+ for p in problems
206
+ ]
207
+ tokenizer.padding_side = "left"
208
+ batch = tokenizer(prompts, return_tensors="pt", padding=True).to(model.device)
209
+ outputs = model.generate(**batch, max_new_tokens=512, temperature=0.2, do_sample=True)
210
+ for i, o in enumerate(outputs):
211
+ print(f"--- solution {i} ---")
212
+ print(tokenizer.decode(o[batch['input_ids'].shape[1]:], skip_special_tokens=True))
213
+ ```
214
+
215
+ ### Streaming output (token-by-token)
216
+
217
+ ```python
218
+ from transformers import TextIteratorStreamer
219
+ from threading import Thread
220
+
221
+ streamer = TextIteratorStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
222
+ gen_kwargs = dict(input_ids=inputs, max_new_tokens=512, temperature=0.2, do_sample=True, streamer=streamer)
223
+ Thread(target=model.generate, kwargs=gen_kwargs).start()
224
+ for token in streamer:
225
+ print(token, end="", flush=True)
226
+ ```
227
+
228
+ ### Structured JSON output (code + complexity + explanation)
229
+
230
+ ```python
231
+ json_system_prompt = (
232
+ "You are an expert Java competitive programmer. Given a LeetCode-style problem statement and an algorithm tag, write a correct, efficient Java solution. "
233
+ 'Respond ONLY with JSON: {"code": "...", "time_complexity": "...", '
234
+ '"space_complexity": "...", "explanation": "..."}'
235
+ )
236
+ messages = [
237
+ {"role": "system", "content": json_system_prompt},
238
+ {"role": "user", "content": "Problem: Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.\nAlgorithm: Hash Map"},
239
+ ]
240
+ inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to(model.device)
241
+ outputs = model.generate(inputs, max_new_tokens=512, temperature=0.1, do_sample=True)
242
+ raw = tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True)
243
+
244
+ import json
245
+ result = json.loads(raw.strip().removeprefix("```json").removesuffix("```").strip())
246
+ print(result["code"])
247
+ print(result["time_complexity"], result["space_complexity"])
248
+ ```
249
+
250
  ### Option B β€” Unsloth (2x faster load + inference)
251
 
252
  ```python
 
293
  print(response.choices[0].message.content)
294
  ```
295
 
296
+ Streaming with vLLM's OpenAI-compatible endpoint:
297
+ ```python
298
+ stream = client.chat.completions.create(
299
+ model="leetcode-java-qwen25-coder-7b",
300
+ messages=[{"role": "user", "content": "Problem: Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.\nAlgorithm: Hash Map"}],
301
+ stream=True,
302
+ )
303
+ for chunk in stream:
304
+ if chunk.choices[0].delta.content:
305
+ print(chunk.choices[0].delta.content, end="", flush=True)
306
+ ```
307
+
308
  ### Option D β€” TGI (Text Generation Inference) {#tgi}
309
 
310
  ```bash
 
334
  ollama run leetcode-java-qwen25-coder-7b "Problem: Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.\nAlgorithm: Hash Map"
335
  ```
336
 
337
+ Python client against a local Ollama server:
338
+ ```python
339
+ import requests
340
+ r = requests.post("http://localhost:11434/api/generate", json={
341
+ "model": "leetcode-java-qwen25-coder-7b",
342
+ "prompt": "Problem: Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.\nAlgorithm: Hash Map",
343
+ "stream": False,
344
+ })
345
+ print(r.json()["response"])
346
+ ```
347
+
348
  ### Option F β€” GGUF / llama.cpp direct (mobile/edge inference)
349
 
350
  ```bash
 
359
 
360
  ## Training details
361
 
362
+ ### Why this base model
363
 
364
+ Qwen2.5-Coder-7B-Instruct was chosen over a general instruct model because its
365
+ pretraining already concentrates capacity on code β€” the QDoRA adapter only has to
366
+ specialize output format and LeetCode-specific conventions (function signatures,
367
+ in-place vs. new-array conventions, Java idioms) rather than teach the model
368
+ to code from scratch. 7B was picked as the size that still fits comfortably in a
369
+ single-GPU QDoRA run while keeping enough headroom that the base model's code
370
+ reasoning survives adaptation.
371
+
372
+ ### Data pipeline
373
+
374
+ Source: [doocs/leetcode](https://github.com/doocs/leetcode), 3,977 problems with
375
+ English documentation. Each problem can have multiple solutions spanning different
376
+ algorithm tags (greedy, DP, two pointers, etc.) β€” the pipeline treats this as a
377
+ one-to-many problem-to-solution structure rather than picking a single "canonical" answer.
378
+
379
+ | Stage | What it does |
380
+ |---|---|
381
+ | `extract_doocs.py` | pulls problem statement + I/O examples + per-solution algorithm tag from doocs/leetcode |
382
+ | `verify.py` | executes each extracted solution against its sample I/O, drops anything that fails |
383
+ | `normalize.py` | standardizes formatting/whitespace and problem/solution schema across all 4 languages |
384
+ | `build_language_datasets.py` | splits into per-language configs and writes the final train/val/test SFT rows |
385
+
386
+ execution-checked against sample I/O (see dataset card for exact rate). Full extraction/verification/build code lives alongside the
387
+ [leetcode-code-gen-datasets](https://huggingface.co/datasets/AmareshHebbar/leetcode-code-gen-datasets) dataset card.
388
 
389
  ### Hyperparameters
390
 
391
  | Parameter | Value |
392
  |---|---|
393
+ | Method | QDoRA (`use_dora=True` in PEFT's `LoraConfig`) |
394
  | LoRA rank (r) | 16 |
395
  | LoRA alpha | 32 |
396
  | LoRA dropout | 0 |
397
  | Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
398
+ | Base quantization | 4-bit NF4 |
399
  | Max sequence length | 2048 |
400
  | Optimizer | paged_adamw_8bit |
401
  | LR schedule | 2e-4, cosine |
 
408
  | **Cloud provider** | RunPod |
409
  | **CO2 estimate** | self-reported, not measured with a carbon tracker β€” treat as approximate |
410
 
411
+ Fine-tuned with [Unsloth](https://github.com/unslothai/unsloth) + TRL's `SFTTrainer`,
412
+ DoRA enabled via PEFT.
413
 
414
  ---
415
 
 
421
 
422
  **Not exhaustive on complexity.** The model doesn't guarantee asymptotically optimal solutions β€” check the complexity claims yourself for performance-sensitive use.
423
 
424
+ **Data recency.** Reflects the state of `doocs/leetcode` at the time of extraction β€” newer problems added to LeetCode after that snapshot won't be covered.
425
+
426
  ---
427
 
428
  ## FAQ
429
 
430
  **Q: Can I merge the adapter into the base model?**
431
+ Yes β€” `model.merge_and_unload()` after loading with PEFT, or Unsloth's `save_pretrained_merged()`. DoRA adapters merge the same way LoRA adapters do.
432
 
433
+ **Q: Why QDoRA instead of plain QLoRA?**
434
+ See [Why QDoRA](#why-qdora) above β€” short version: DoRA's magnitude/direction split tracks full fine-tuning more closely, which matters for code correctness.
435
+
436
+ **Q: Why QDoRA instead of full fine-tuning?**
437
+ Qwen2.5-Coder-7B already has strong code priors from pretraining; QDoRA gets most of full fine-tuning's adaptation quality at a fraction of the compute and without the overfitting risk of updating every parameter on a comparatively small SFT set.
438
 
439
  **Q: Which quantization should I use on mobile?**
440
  q4_k_m is the best size/quality tradeoff for phones; q5_k_m if you have RAM headroom; avoid q2/q3 for code generation β€” correctness drops sharply below 4-bit.
441
 
442
+ **Q: Does this model store or transmit my input?**
443
+ No β€” inference runs entirely on whatever infrastructure you deploy it to.
444
+
445
  ---
446
 
447
  ## Related models in this suite
 
461
 
462
  | Version | Notes |
463
  |---|---|
464
+ | v3.0 | Switched to QDoRA, added rationale + PEFT config, batch/streaming/JSON inference samples, expanded tags |
465
  | v2.0 | Added GGUF builds, Ollama/vLLM/TGI deployment, benchmark harness (HumanEval-X, MultiPL-E, held-out test split) |
466
+ | v1.0 | Initial release β€” QLoRA fine-tune |
467
 
468
  ---
469