Giovanni Del Papa — ricercatore indipendente, Italia · Independent researcher, Italy (progetto Lo Scienziato Dilettante GDP, Arianna Labs)
🇮🇹 Italiano · 🇬🇧 English · 📄 Articolo / Paper: paper/article_it.pdf · paper/article_en.pdf · DOI Zenodo: 10.5281/zenodo.23757652 (v1.0: 10.5281/zenodo.23757653) · Divulgativa / plain-language: paper/divulgativa_it.pdf · paper/divulgativa_en.pdf
Un adattatore LoRA (r = 16, 0,43 % dei parametri) addestrato su risposte generate dal modello stesso (auto-distillazione, senza codice, solo dati con licenza commerciale) porta l'identità dichiarata da 8 % a 100 % (test a parole chiave, 50 domande) senza differenze significative su ARC-it, GSM8K e IFEval. L'unico guadagno significativo è l'identità; non c'è alcun miglioramento di capacità.
| Test (held-out) | n | base | + LoRA (s = 1,0) | differenza [IC 95 %] | p (McNemar) |
|---|---|---|---|---|---|
| ARC-it | 1132 | 90,72 % | 90,72 % | 0 (0 / 0 item) | 1,00 |
| GSM8K | 919 | 94,78 % | 94,67 % | −0,11 [−0,99; +0,77] | 1,00 (8/9) |
| IFEval (prompt-level strict) | 341 | 83,58 % | 83,00 % | −0,59 [−2,58; +1,40] | 0,77 (5/7) |
| Identità (parole chiave) | 50 | 8 % | 100 % | +92 | 2,8·10⁻¹⁴ (46/0) |
code/pod/score.py), non da un giudice umano o da un modello. Le 4 risposte «corrette» della base (v01, v03, v18, n27) sono falsi positivi (la parola chiave è nella domanda): sulle domande vere la base ottiene 0.aya_dataset (ITA), oasst1, GSM8K-train (MIT), prompt generati da Qwen3-14B e vincoli verificabili in stile IFEval (propri, non i prompt di IFEval). Esclusi: ultrachat, personahub (OpenAI), codealpaca, numinamath-tir, no_robots, wildchat, flan, ecc. (results/MANIFEST.json).code/pod/p1_gen.py): Qwen3-14B (vLLM, bf16, no-thinking, T = 0,7) scrive le proprie risposte; la scheda identità (code/pod/identity.py) è visibile solo in generazione e assente nel training (context distillation). Filtri: dedup, niente codice, risposta GSM8K verificata, vincoli verificati. Risultato: 8601 sequenze di train + 299 di validazione (4,02 M token).code/pod/p2_train.py): r = 16, α = 16, dropout 0,05, 7 proiezioni, 64.225.280 parametri; LR 3·10⁻⁵ coseno, warm-up 3 %, 1 epoca, batch 16, 538 passi, bf16 (niente 4-bit); loss 0,299 → 0,198, val 0,188; A100 80 GB, ≈ 67 min.code/pod/make_loras.py): $\Delta W = \tfrac{\alpha}{r} B A$ e $W = W_0 + s,\Delta W$, con $s\in{0{,}3;,0{,}5;,0{,}7;,0{,}85;,1{,}0}$ realizzata scalando lora_B.code/pod/select_scale.py): scegliere la scala più piccola con identità dev ≥ 95 % (≥ 38/40), GSM8K dev ≥ base − 1 pt e IFEval dev ≥ base − 1 pt. Esito: $s = 1{,}0$. R2 = valutazione sul test una sola volta; R3 = criteri di pubblicazione (la condizione (c) «merge fisico ≈ LoRA servito» non è soddisfatta → solo adattatore).code/pod/gen.py, score.py, final_stats.py): vLLM 0.32.0 bf16, greedy, seed 1234, template Qwen3 con enable_thinking=False; ARC-it via logprob, GSM8K regex (max 512 token), IFEval lm_eval prompt-level strict (max 1024), identità a parole chiave (max 256).$$\hat p \pm z,\frac{\sqrt{\hat p(1-\hat p)/n + z^2/4n^2}}{1+z^2/n},\qquad p_{\text{McNemar}}=\min\Big(1,;2\sum_{i=0}^{\min(b,c)}\binom{b+c}{i}2^{-(b+c)}\Big)$$
code/analysis/bf16_merge_diag.py): $|\Delta W|_F/|W_0|_F \approx 0{,}106,%$; il 74 % degli elementi non cambia con l'arrotondamento a bf16 (8 bit di mantissa, errore relativo fino a $2^{-8}\approx 0{,}4,%$).# 1) Pod con GPU 80 GB (A100/H100), dentro il pod:
bash code/pod/setup.sh <max_secondi> # ambiente, download base (dl.py), dati
bash code/pod/run_all.sh # P1 generazione → P2 training → P3 scale+dev+R1 → P4 test+merge+statistiche
# 2) Analisi sul risultato:
# (scarica prima il dataset odelpa/qwen14-scienziato-v2-dati in ./dati: contiene results/, sets/, data/)
python code/analysis/paired_stats.py dati/results # statistiche appaiate (McNemar, Wald)
python code/analysis/bf16_merge_diag.py <shard_base> <adapter> out.json
python code/analysis/make_figures.py dati figures/ # figure IT/EN (legge dati/results/)
bash code/analysis/build_pdf.sh paper/article_it.md paper/article_it.pdf # PDF con formule (pandoc + tectonic)
Gli script del pod assumono la cartella /workspace e il token Hugging Face nell'ambiente (non incluso). Le generazioni per-item sono nel dataset odelpa/qwen14-scienziato-v2-dati.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
tok = AutoTokenizer.from_pretrained("Qwen/Qwen3-14B")
m = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-14B", torch_dtype="auto", device_map="auto")
m = PeftModel.from_pretrained(m, "odelpa/qwen14-scienziato-v2", subfolder="adapter") # NON fondere in bf16 (vedi limiti)
msgs = [{"role": "user", "content": "Chi sei?"}]
x = tok.apply_chat_template(msgs, add_generation_prompt=True, enable_thinking=False, return_tensors="pt").to(m.device)
print(tok.decode(m.generate(x, max_new_tokens=200, do_sample=False)[0][x.shape[1]:], skip_special_tokens=True))
Con vLLM: vllm serve Qwen/Qwen3-14B --enable-lora --lora-modules ft=<cartella adapter> (come nella valutazione).
ollama run ollamagdp/qwen14-scienziato-v2 (ollama.com/ollamagdp/qwen14-scienziato-v2) — GGUF Q4_K_M del merge fp16 (somma fp32), code/ollama/; il file GGUF è distribuito solo su Ollama (non è ospitato su Hugging Face). Non è l'oggetto valutato nell'articolo; test fatti: vedi OLLAMA_README.md.
Codice e adattatore: Apache-2.0 (base Qwen3-14B: Apache-2.0, © Alibaba Cloud / Qwen team). Testo degli articoli: CC BY 4.0. Dati: licenze commerciali (Apache-2.0, MIT; risposte generate da Qwen3-14B, Apache-2.0), elenco in results/MANIFEST.json. Nessun segreto o token è incluso.
A rank-16 LoRA adapter (0.43 % of the parameters) trained on the model's own answers (self-distillation, no code, commercially licensed data only) takes the stated identity from 8 % to 100 % (keyword test, 50 questions) with no significant difference on ARC-it, GSM8K and IFEval. The only significant gain is identity; there is no capability improvement.
| Held-out test | n | base | + LoRA (s = 1.0) | difference [95 % CI] | p (McNemar) |
|---|---|---|---|---|---|
| ARC-it | 1132 | 90.72 % | 90.72 % | 0 (0 / 0 items) | 1.00 |
| GSM8K | 919 | 94.78 % | 94.67 % | −0.11 [−0.99; +0.77] | 1.00 (8/9) |
| IFEval (prompt-level strict) | 341 | 83.58 % | 83.00 % | −0.59 [−2.58; +1.40] | 0.77 (5/7) |
| Identity (keywords) | 50 | 8 % | 100 % | +92 | 2.8·10⁻¹⁴ (46/0) |
code/pod/score.py), not by a human or a model judge. The 4 "correct" answers of the base (v01, v03, v18, n27) are false positives (the keyword is in the question): on the genuine questions the base scores 0.aya_dataset (ITA), oasst1, GSM8K-train (MIT), Qwen3-14B-generated prompts and verifiable IFEval-style constraints (our own, not IFEval prompts). Excluded: ultrachat, personahub (OpenAI), codealpaca, numinamath-tir, no_robots, wildchat, flan, etc. (results/MANIFEST.json).code/pod/p1_gen.py): Qwen3-14B (vLLM, bf16, no-thinking, T = 0.7) writes its own answers; the identity card (code/pod/identity.py) is visible only at generation time and absent from training (context distillation). Filters: dedup, no code, verified GSM8K answers, verified constraints. Result: 8,601 train + 299 validation sequences (4.02 M tokens).code/pod/p2_train.py): r = 16, α = 16, dropout 0.05, 7 projections, 64,225,280 parameters; LR 3·10⁻⁵ cosine, 3 % warm-up, 1 epoch, batch 16, 538 steps, bf16 (no 4-bit); loss 0.299 → 0.198, val 0.188; A100 80 GB, ≈ 67 min.code/pod/make_loras.py): $\Delta W = \tfrac{\alpha}{r} B A$ and $W = W_0 + s,\Delta W$ with $s\in{0.3, 0.5, 0.7, 0.85, 1.0}$, implemented by scaling lora_B.code/pod/select_scale.py): choose the smallest scale with dev identity ≥ 95 % (≥ 38/40), dev GSM8K ≥ base − 1 pt and dev IFEval ≥ base − 1 pt. Outcome: $s = 1.0$. R2 = test evaluation, once; R3 = publication criteria (condition (c) "physical merge ≈ served LoRA" is not met → adapter only).code/pod/gen.py, score.py, final_stats.py): vLLM 0.32.0 bf16, greedy, seed 1234, Qwen3 template with enable_thinking=False; ARC-it via logprobs, GSM8K regex (max 512 tokens), IFEval lm_eval prompt-level strict (max 1024), keyword identity (max 256).$$\hat p \pm z,\frac{\sqrt{\hat p(1-\hat p)/n + z^2/4n^2}}{1+z^2/n},\qquad p_{\text{McNemar}}=\min\Big(1,;2\sum_{i=0}^{\min(b,c)}\binom{b+c}{i}2^{-(b+c)}\Big)$$
code/analysis/bf16_merge_diag.py): $|\Delta W|_F/|W_0|_F \approx 0.106,%$; 74 % of the elements do not change when rounded to bf16 (8 mantissa bits, relative error up to $2^{-8}\approx 0.4,%$).# 1) GPU pod with 80 GB (A100/H100); inside the pod:
bash code/pod/setup.sh <max_seconds> # environment, base download (dl.py), data
bash code/pod/run_all.sh # P1 generation → P2 training → P3 scales+dev+R1 → P4 test+merge+stats
# 2) Analysis of the results:
# first download the dataset odelpa/qwen14-scienziato-v2-dati into ./dati (it holds results/, sets/, data/)
python code/analysis/paired_stats.py dati/results
python code/analysis/bf16_merge_diag.py <base_shard> <adapter> out.json
python code/analysis/make_figures.py dati figures/
bash code/analysis/build_pdf.sh paper/article_en.md paper/article_en.pdf # PDF with formulas (pandoc + tectonic)
The pod scripts assume the /workspace folder and a Hugging Face token in the environment (not included). Per-item generations are in the dataset odelpa/qwen14-scienziato-v2-dati.
See the Python snippet above (subfolder="adapter"), or vllm serve Qwen/Qwen3-14B --enable-lora --lora-modules ft=<adapter folder>. Do not merge in bf16 (see limitations).
ollama run ollamagdp/qwen14-scienziato-v2 (ollama.com/ollamagdp/qwen14-scienziato-v2) — Q4_K_M GGUF of the fp16 merge (fp32 summation), code/ollama/; the GGUF file is distributed on Ollama only (it is not hosted on Hugging Face). Not the object evaluated in the paper; tests done: see OLLAMA_README.md.
Code and adapter: Apache-2.0 (base Qwen3-14B: Apache-2.0, © Alibaba Cloud / Qwen team). Article text: CC BY 4.0. Data: commercially usable licences (Apache-2.0, MIT; answers generated by Qwen3-14B, Apache-2.0), listed in results/MANIFEST.json. No secrets or tokens are included.
Qwen/Qwen3-14B