bernardw commited on
Commit
187a952
·
verified ·
1 Parent(s): d760847

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +32 -0
README.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: Qwen/Qwen3-4B
4
+ tags: [code-review, distillation, taid, knowledge-distillation, mlx, qwen3]
5
+ language: [en]
6
+ pipeline_tag: text-generation
7
+ ---
8
+
9
+ # Qwen3-4B Code-Review (TAID, from Qwen3-8B)
10
+
11
+ A **Qwen3-4B** student distilled (forward-KL logit-level KD / TAID) from the **Qwen3-8B**
12
+ teacher to emit structured JSON code-review findings.
13
+
14
+ - **Held-out F1:** **0.562** on `eval_set_100` (precision 0.517 / recall 0.616).
15
+ - **Best model in the project.** Beats the prior best single student (0.509) by +0.053 and the best weight-space merge (0.535) by +0.027, with the highest precision AND recall of any student.
16
+ - **License:** Apache-2.0 (pure Qwen3 lineage -- no third-party teacher-license strings).
17
+
18
+ **Method.** Cached-logit knowledge distillation on Apple MLX. The **Qwen3-8B** teacher (8-bit) reviews
19
+ each chunk once (thinking disabled -> clean JSON targets); we cache its top-k=50 logits over the
20
+ *response* positions and train a LoRA student (rank 16 / 16 layers, lr 1e-4, seq 768, 30 epochs) toward
21
+ that distribution (forward-KL / TAID, native temperature), then fuse. All Qwen3 sizes share a tokenizer,
22
+ so logit-level distillation from the 8B works directly.
23
+
24
+ **Prompt contract.** Given a numbered code chunk, emit one JSON object
25
+ `{"findings":[{category, subtype, severity, confidence, title, body, evidence, line}]}`; `evidence` is a
26
+ verbatim source substring, `line` 1-based. Held-out eval: `eval_set_100` (100 labeled chunks, py/js/c/go).
27
+
28
+ **Why this teacher.** The project's dominant finding was that *teacher quality* is the single biggest
29
+ lever. Swapping the Qwen2.5-Coder-7B / Gemma-9B teachers (best prior student F1 0.509, best merge 0.535)
30
+ for Qwen3-8B produced a new best on the first attempt, at both sizes -- while a dozen objective/capacity
31
+ tricks (reverse-KL, temperature, hybrid loss, LoRA depth, on-policy GKD) all failed to move the ceiling.
32
+