AmareshHebbar commited on
Commit
4dacce0
Β·
verified Β·
1 Parent(s): 29709dd

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-python-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 Python Coder
34
- ### Qwen2.5-Coder-7B fine-tuned to solve LeetCode problems in Python
35
 
36
  [![Hugging Face](https://img.shields.io/badge/%F0%9F%A4%97%20Model-leetcode--python--qwen25--coder--7b-FFD21E)](https://huggingface.co/AmareshHebbar/leetcode-python-qwen25-coder-7b)
37
- [![Dataset](https://img.shields.io/badge/%F0%9F%A4%97%20Dataset-leetcode--python--sft-blue)](https://huggingface.co/datasets/AmareshHebbar/leetcode-python-sft)
38
  [![GGUF](https://img.shields.io/badge/GGUF-quantized-6f42c1)](https://huggingface.co/AmareshHebbar/leetcode-python-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 Python 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.
@@ -67,14 +82,44 @@ def twoSum(nums, target):
67
  | | |
68
  |---|---|
69
  | **Base model** | [unsloth/Qwen2.5-Coder-7B-Instruct](https://huggingface.co/unsloth/Qwen2.5-Coder-7B-Instruct) |
70
- | **Method** | QLoRA, 4-bit NF4, rank 16 |
71
- | **Training data** | [leetcode-python-sft](https://huggingface.co/datasets/AmareshHebbar/leetcode-python-sft) |
72
- | **Weights here** | LoRA adapter only (~160MB) β€” load on top of the base model |
 
 
73
  | **GGUF build** | [leetcode-python-qwen25-coder-7b-GGUF](https://huggingface.co/AmareshHebbar/leetcode-python-qwen25-coder-7b-GGUF) β€” q4_k_m / q5_k_m / q8_0 |
74
  | **License** | Apache 2.0 |
75
 
76
  ---
77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  ## Benchmarks (free, reproducible)
79
 
80
  Run `benchmark_suite.py` from the deployment kit to reproduce. All numbers are pass@1 unless noted.
@@ -83,11 +128,11 @@ Run `benchmark_suite.py` from the deployment kit to reproduce. All numbers are p
83
  |---|---|---|---|---|
84
  | [HumanEval-X](https://huggingface.co/datasets/THUDM/humaneval-x) | Python | _run benchmark_suite.py_ | _run benchmark_suite.py_ | 164 problems, execution-verified |
85
  | [MultiPL-E](https://huggingface.co/datasets/nuprl/MultiPL-E) (HumanEval subset) | Python | _run benchmark_suite.py_ | β€” | cross-check vs HumanEval-X |
86
- | Held-out LeetCode test split | Python | _run benchmark_suite.py_ | β€” | from `leetcode-python-sft` test split, exact I/O match |
87
  | Tokens/sec (fp16, A40) | Python | β€” | β€” | latency benchmark, see script |
88
  | Tokens/sec (GGUF q4_k_m, CPU) | Python | β€” | β€” | latency benchmark, see script |
89
 
90
- > Numbers are intentionally left blank in this template β€” `benchmark_suite.py` fills a `results/leetcode-python-qwen25-coder-7b.json` file and this table should be regenerated from it (see deployment kit README).
91
 
92
  ---
93
 
@@ -137,6 +182,65 @@ outputs = model.generate(inputs, max_new_tokens=512, temperature=0.2, do_sample=
137
  print(tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True))
138
  ```
139
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
  ### Option B β€” Unsloth (2x faster load + inference)
141
 
142
  ```python
@@ -183,6 +287,18 @@ response = client.chat.completions.create(
183
  print(response.choices[0].message.content)
184
  ```
185
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  ### Option D β€” TGI (Text Generation Inference) {#tgi}
187
 
188
  ```bash
@@ -212,6 +328,17 @@ ollama create leetcode-python-qwen25-coder-7b -f Modelfile.python
212
  ollama run leetcode-python-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"
213
  ```
214
 
 
 
 
 
 
 
 
 
 
 
 
215
  ### Option F β€” GGUF / llama.cpp direct (mobile/edge inference)
216
 
217
  ```bash
@@ -226,19 +353,43 @@ See `export_gguf.py` in the deployment kit for building q4_k_m / q5_k_m / q8_0 v
226
 
227
  ## Training details
228
 
229
- ### Data
230
 
231
- Trained on [leetcode-python-sft](https://huggingface.co/datasets/AmareshHebbar/leetcode-python-sft), built from the `doocs/leetcode` corpus: problem statement + input/output examples + algorithm tag β†’ verified Python solution, one-to-many (problem β†’ multiple algorithm-tagged solutions).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
 
233
  ### Hyperparameters
234
 
235
  | Parameter | Value |
236
  |---|---|
 
237
  | LoRA rank (r) | 16 |
238
  | LoRA alpha | 32 |
239
  | LoRA dropout | 0 |
240
  | Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
241
- | Quantization | 4-bit NF4 (QLoRA) |
242
  | Max sequence length | 2048 |
243
  | Optimizer | paged_adamw_8bit |
244
  | LR schedule | 2e-4, cosine |
@@ -251,7 +402,8 @@ Trained on [leetcode-python-sft](https://huggingface.co/datasets/AmareshHebbar/l
251
  | **Cloud provider** | RunPod |
252
  | **CO2 estimate** | self-reported, not measured with a carbon tracker β€” treat as approximate |
253
 
254
- Fine-tuned with [Unsloth](https://github.com/unslothai/unsloth) + TRL's `SFTTrainer`.
 
255
 
256
  ---
257
 
@@ -263,19 +415,27 @@ Fine-tuned with [Unsloth](https://github.com/unslothai/unsloth) + TRL's `SFTTrai
263
 
264
  **Not exhaustive on complexity.** The model doesn't guarantee asymptotically optimal solutions β€” check the complexity claims yourself for performance-sensitive use.
265
 
 
 
266
  ---
267
 
268
  ## FAQ
269
 
270
  **Q: Can I merge the adapter into the base model?**
271
- Yes β€” `model.merge_and_unload()` after loading with PEFT, or Unsloth's `save_pretrained_merged()`.
272
 
273
- **Q: Why QLoRA instead of full fine-tuning?**
274
- 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.
 
 
 
275
 
276
  **Q: Which quantization should I use on mobile?**
277
  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.
278
 
 
 
 
279
  ---
280
 
281
  ## Related models in this suite
@@ -295,8 +455,9 @@ q4_k_m is the best size/quality tradeoff for phones; q5_k_m if you have RAM head
295
 
296
  | Version | Notes |
297
  |---|---|
 
298
  | v2.0 | Added GGUF builds, Ollama/vLLM/TGI deployment, benchmark harness (HumanEval-X, MultiPL-E, held-out test split) |
299
- | v1.0 | Initial release β€” QLoRA fine-tune on leetcode-python-sft |
300
 
301
  ---
302
 
 
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 Python Coder
48
+ ### Qwen2.5-Coder-7B, QDoRA fine-tuned to solve LeetCode problems in Python
49
 
50
  [![Hugging Face](https://img.shields.io/badge/%F0%9F%A4%97%20Model-leetcode--python--qwen25--coder--7b-FFD21E)](https://huggingface.co/AmareshHebbar/leetcode-python-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-python-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 Python 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.
 
82
  | | |
83
  |---|---|
84
  | **Base model** | [unsloth/Qwen2.5-Coder-7B-Instruct](https://huggingface.co/unsloth/Qwen2.5-Coder-7B-Instruct) |
85
+ | **Method** | QDoRA (quantized DoRA, not plain LoRA) |
86
+ | **Training data** | [leetcode-code-gen-datasets](https://huggingface.co/datasets/AmareshHebbar/leetcode-code-gen-datasets) config `python` |
87
+ | **Data provenance** | scraped from [doocs/leetcode](https://github.com/doocs/leetcode) (3,977 problems), execution-verified, no synthetic/LLM-generated solutions |
88
+ | **Data quality** | ~70% of extracted solutions verified (execution-checked against sample I/O) |
89
+ | **Weights here** | QDoRA adapter only (~160MB) β€” load on top of the base model |
90
  | **GGUF build** | [leetcode-python-qwen25-coder-7b-GGUF](https://huggingface.co/AmareshHebbar/leetcode-python-qwen25-coder-7b-GGUF) β€” q4_k_m / q5_k_m / q8_0 |
91
  | **License** | Apache 2.0 |
92
 
93
  ---
94
 
95
+ ## Why QDoRA {#why-qdora}
96
+
97
+ 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.
98
+
99
+ Concretely, versus the plain-QLoRA v1 release of this suite: DoRA adds a per-column
100
+ trainable magnitude vector on top of the usual low-rank direction update, so the
101
+ adapter can rescale a feature's importance instead of only rotating it. On a code
102
+ task where a single wrong operator or dropped edge case fails the whole solution,
103
+ that closer match to full fine-tuning's update pattern showed up as fewer
104
+ near-miss failures during our own qualitative review, at the same LoRA rank and
105
+ VRAM budget.
106
+
107
+ ```python
108
+ # training-side PEFT config (see build_language_datasets.py / trainer script for full pipeline)
109
+ from peft import LoraConfig
110
+
111
+ peft_config = LoraConfig(
112
+ r=16,
113
+ lora_alpha=32,
114
+ lora_dropout=0.0,
115
+ target_modules=["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"],
116
+ use_dora=True, # <- this is what makes it QDoRA, not QLoRA
117
+ task_type="CAUSAL_LM",
118
+ )
119
+ ```
120
+
121
+ ---
122
+
123
  ## Benchmarks (free, reproducible)
124
 
125
  Run `benchmark_suite.py` from the deployment kit to reproduce. All numbers are pass@1 unless noted.
 
128
  |---|---|---|---|---|
129
  | [HumanEval-X](https://huggingface.co/datasets/THUDM/humaneval-x) | Python | _run benchmark_suite.py_ | _run benchmark_suite.py_ | 164 problems, execution-verified |
130
  | [MultiPL-E](https://huggingface.co/datasets/nuprl/MultiPL-E) (HumanEval subset) | Python | _run benchmark_suite.py_ | β€” | cross-check vs HumanEval-X |
131
+ | Held-out LeetCode test split | Python | _run benchmark_suite.py_ | β€” | from `leetcode-code-gen-datasets` (`python`) test split, exact I/O match |
132
  | Tokens/sec (fp16, A40) | Python | β€” | β€” | latency benchmark, see script |
133
  | Tokens/sec (GGUF q4_k_m, CPU) | Python | β€” | β€” | latency benchmark, see script |
134
 
135
+ > Numbers are intentionally left blank in this template β€” `benchmark_suite.py` fills a `results/leetcode-python-qwen25-coder-7b.json` file and this table should be regenerated from it.
136
 
137
  ---
138
 
 
182
  print(tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True))
183
  ```
184
 
185
+ ### Batch inference (many problems at once)
186
+
187
+ ```python
188
+ problems = [
189
+ "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",
190
+ "Problem: Given a string s, find the length of the longest substring without repeating characters.\nAlgorithm: two pointers / sliding window",
191
+ "Problem: Merge two sorted linked lists into one sorted list.\nAlgorithm: linked list, dummy head",
192
+ ]
193
+
194
+ prompts = [
195
+ tokenizer.apply_chat_template(
196
+ [{"role": "system", "content": "You are an expert Python competitive programmer. Given a LeetCode-style problem statement and an algorithm tag, write a correct, efficient Python solution."}, {"role": "user", "content": p}],
197
+ tokenize=False, add_generation_prompt=True,
198
+ )
199
+ for p in problems
200
+ ]
201
+ tokenizer.padding_side = "left"
202
+ batch = tokenizer(prompts, return_tensors="pt", padding=True).to(model.device)
203
+ outputs = model.generate(**batch, max_new_tokens=512, temperature=0.2, do_sample=True)
204
+ for i, o in enumerate(outputs):
205
+ print(f"--- solution {i} ---")
206
+ print(tokenizer.decode(o[batch['input_ids'].shape[1]:], skip_special_tokens=True))
207
+ ```
208
+
209
+ ### Streaming output (token-by-token)
210
+
211
+ ```python
212
+ from transformers import TextIteratorStreamer
213
+ from threading import Thread
214
+
215
+ streamer = TextIteratorStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
216
+ gen_kwargs = dict(input_ids=inputs, max_new_tokens=512, temperature=0.2, do_sample=True, streamer=streamer)
217
+ Thread(target=model.generate, kwargs=gen_kwargs).start()
218
+ for token in streamer:
219
+ print(token, end="", flush=True)
220
+ ```
221
+
222
+ ### Structured JSON output (code + complexity + explanation)
223
+
224
+ ```python
225
+ json_system_prompt = (
226
+ "You are an expert Python competitive programmer. Given a LeetCode-style problem statement and an algorithm tag, write a correct, efficient Python solution. "
227
+ 'Respond ONLY with JSON: {"code": "...", "time_complexity": "...", '
228
+ '"space_complexity": "...", "explanation": "..."}'
229
+ )
230
+ messages = [
231
+ {"role": "system", "content": json_system_prompt},
232
+ {"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"},
233
+ ]
234
+ inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to(model.device)
235
+ outputs = model.generate(inputs, max_new_tokens=512, temperature=0.1, do_sample=True)
236
+ raw = tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True)
237
+
238
+ import json
239
+ result = json.loads(raw.strip().removeprefix("```json").removesuffix("```").strip())
240
+ print(result["code"])
241
+ print(result["time_complexity"], result["space_complexity"])
242
+ ```
243
+
244
  ### Option B β€” Unsloth (2x faster load + inference)
245
 
246
  ```python
 
287
  print(response.choices[0].message.content)
288
  ```
289
 
290
+ Streaming with vLLM's OpenAI-compatible endpoint:
291
+ ```python
292
+ stream = client.chat.completions.create(
293
+ model="leetcode-python-qwen25-coder-7b",
294
+ 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"}],
295
+ stream=True,
296
+ )
297
+ for chunk in stream:
298
+ if chunk.choices[0].delta.content:
299
+ print(chunk.choices[0].delta.content, end="", flush=True)
300
+ ```
301
+
302
  ### Option D β€” TGI (Text Generation Inference) {#tgi}
303
 
304
  ```bash
 
328
  ollama run leetcode-python-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"
329
  ```
330
 
331
+ Python client against a local Ollama server:
332
+ ```python
333
+ import requests
334
+ r = requests.post("http://localhost:11434/api/generate", json={
335
+ "model": "leetcode-python-qwen25-coder-7b",
336
+ "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",
337
+ "stream": False,
338
+ })
339
+ print(r.json()["response"])
340
+ ```
341
+
342
  ### Option F β€” GGUF / llama.cpp direct (mobile/edge inference)
343
 
344
  ```bash
 
353
 
354
  ## Training details
355
 
356
+ ### Why this base model
357
 
358
+ Qwen2.5-Coder-7B-Instruct was chosen over a general instruct model because its
359
+ pretraining already concentrates capacity on code β€” the QDoRA adapter only has to
360
+ specialize output format and LeetCode-specific conventions (function signatures,
361
+ in-place vs. new-array conventions, Python idioms) rather than teach the model
362
+ to code from scratch. 7B was picked as the size that still fits comfortably in a
363
+ single-GPU QDoRA run while keeping enough headroom that the base model's code
364
+ reasoning survives adaptation.
365
+
366
+ ### Data pipeline
367
+
368
+ Source: [doocs/leetcode](https://github.com/doocs/leetcode), 3,977 problems with
369
+ English documentation. Each problem can have multiple solutions spanning different
370
+ algorithm tags (greedy, DP, two pointers, etc.) β€” the pipeline treats this as a
371
+ one-to-many problem-to-solution structure rather than picking a single "canonical" answer.
372
+
373
+ | Stage | What it does |
374
+ |---|---|
375
+ | `extract_doocs.py` | pulls problem statement + I/O examples + per-solution algorithm tag from doocs/leetcode |
376
+ | `verify.py` | executes each extracted solution against its sample I/O, drops anything that fails |
377
+ | `normalize.py` | standardizes formatting/whitespace and problem/solution schema across all 4 languages |
378
+ | `build_language_datasets.py` | splits into per-language configs and writes the final train/val/test SFT rows |
379
+
380
+ ~70% of extracted solutions verified (execution-checked against sample I/O). Full extraction/verification/build code lives alongside the
381
+ [leetcode-code-gen-datasets](https://huggingface.co/datasets/AmareshHebbar/leetcode-code-gen-datasets) dataset card.
382
 
383
  ### Hyperparameters
384
 
385
  | Parameter | Value |
386
  |---|---|
387
+ | Method | QDoRA (`use_dora=True` in PEFT's `LoraConfig`) |
388
  | LoRA rank (r) | 16 |
389
  | LoRA alpha | 32 |
390
  | LoRA dropout | 0 |
391
  | Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
392
+ | Base quantization | 4-bit NF4 |
393
  | Max sequence length | 2048 |
394
  | Optimizer | paged_adamw_8bit |
395
  | LR schedule | 2e-4, cosine |
 
402
  | **Cloud provider** | RunPod |
403
  | **CO2 estimate** | self-reported, not measured with a carbon tracker β€” treat as approximate |
404
 
405
+ Fine-tuned with [Unsloth](https://github.com/unslothai/unsloth) + TRL's `SFTTrainer`,
406
+ DoRA enabled via PEFT.
407
 
408
  ---
409
 
 
415
 
416
  **Not exhaustive on complexity.** The model doesn't guarantee asymptotically optimal solutions β€” check the complexity claims yourself for performance-sensitive use.
417
 
418
+ **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.
419
+
420
  ---
421
 
422
  ## FAQ
423
 
424
  **Q: Can I merge the adapter into the base model?**
425
+ Yes β€” `model.merge_and_unload()` after loading with PEFT, or Unsloth's `save_pretrained_merged()`. DoRA adapters merge the same way LoRA adapters do.
426
 
427
+ **Q: Why QDoRA instead of plain QLoRA?**
428
+ See [Why QDoRA](#why-qdora) above β€” short version: DoRA's magnitude/direction split tracks full fine-tuning more closely, which matters for code correctness.
429
+
430
+ **Q: Why QDoRA instead of full fine-tuning?**
431
+ 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.
432
 
433
  **Q: Which quantization should I use on mobile?**
434
  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.
435
 
436
+ **Q: Does this model store or transmit my input?**
437
+ No β€” inference runs entirely on whatever infrastructure you deploy it to.
438
+
439
  ---
440
 
441
  ## Related models in this suite
 
455
 
456
  | Version | Notes |
457
  |---|---|
458
+ | v3.0 | Switched to QDoRA, added rationale + PEFT config, batch/streaming/JSON inference samples, expanded tags |
459
  | v2.0 | Added GGUF builds, Ollama/vLLM/TGI deployment, benchmark harness (HumanEval-X, MultiPL-E, held-out test split) |
460
+ | v1.0 | Initial release β€” QLoRA fine-tune |
461
 
462
  ---
463