ABrain-One commited on
Commit
b70a8ee
·
verified ·
1 Parent(s): 23849da

Add Delta-NAS fine-tuned LoRA adapter (22 cycles)

Browse files
Files changed (3) hide show
  1. README.md +96 -0
  2. adapter_config.json +72 -0
  3. adapter_model.safetensors +3 -0
README.md ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: Qwen/Qwen2.5-Coder-7B-Instruct
3
+ library_name: peft
4
+ license: apache-2.0
5
+ pipeline_tag: text-generation
6
+ tags:
7
+ - lora
8
+ - code-generation
9
+ - neural-architecture-search
10
+ - delta-nas
11
+ - pytorch
12
+ ---
13
+
14
+ # Delta-NAS Qwen2.5-Coder-7B-Instruct LoRA Adapter
15
+
16
+ This is a LoRA adapter for [Qwen2.5-Coder-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct), fine-tuned for **delta-based Neural Architecture Search (NAS)** — generating novel PyTorch image-classification architectures via unified code diffs.
17
+
18
+ ## Model Description
19
+
20
+ This adapter is the result of 22 iterative fine-tuning cycles on the delta-NAS pipeline described in **"Delta-Based Neural Architecture Search: LLM Fine-Tuning via Code Diffs"**. The model generates unified diffs that modify a baseline neural network architecture to produce new, functional PyTorch models.
21
+
22
+ ### Training Details
23
+
24
+ - **Base model**: `Qwen/Qwen2.5-Coder-7B-Instruct`
25
+ - **Fine-tuning method**: LoRA (Low-Rank Adaptation)
26
+ - **LoRA rank (r)**: 32
27
+ - **LoRA alpha**: 32
28
+ - **LoRA dropout**: 0.05
29
+ - **Target modules**: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
30
+ - **Training cycles**: 22 (iterative self-improvement)
31
+ - **Total trained candidates**: 793
32
+ - **Admitted novel architectures**: 51 (MinHash-Jaccard novelty filter + τ_acc ≥ 0.40)
33
+
34
+ ### Evaluation Datasets
35
+
36
+ Models were evaluated on 6 LEMUR image-classification benchmarks:
37
+ - CIFAR-10, CIFAR-100, MNIST, SVHN, ImageNette, CelebA-Gender
38
+
39
+ ### Key Results
40
+
41
+ | Metric | Value |
42
+ |--------|-------|
43
+ | Trained candidates | 793 |
44
+ | Valid rate (compiles + trains) | 71.8% |
45
+ | Mean 1-epoch accuracy | 64.6% (±5.7% SD across cycles) |
46
+ | ≥40% accuracy rate | 74.5% |
47
+ | Best single-model accuracy | 99.5% (MNIST) |
48
+ | Novel architectures admitted to LEMUR | 51 |
49
+
50
+ ## Usage
51
+
52
+ ```python
53
+ from transformers import AutoModelForCausalLM, AutoTokenizer
54
+ from peft import PeftModel
55
+
56
+ # Load base model
57
+ base_model = AutoModelForCausalLM.from_pretrained(
58
+ "Qwen/Qwen2.5-Coder-7B-Instruct",
59
+ torch_dtype="auto",
60
+ device_map="auto"
61
+ )
62
+ tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-Coder-7B-Instruct")
63
+
64
+ # Load LoRA adapter
65
+ model = PeftModel.from_pretrained(base_model, "ABrain/Delta-NAS-Qwen2.5-Coder-7B")
66
+
67
+ # Generate a diff to modify a baseline architecture
68
+ prompt = """Given the following PyTorch neural network baseline:
69
+ [baseline code here]
70
+
71
+ Generate a unified diff that creates a novel architecture variant."""
72
+
73
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
74
+ outputs = model.generate(**inputs, max_new_tokens=512)
75
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
76
+ ```
77
+
78
+ ## Associated Resources
79
+
80
+ - **Code**: [ABrain-One/nn-gpt](https://github.com/ABrain-One/nn-gpt)
81
+ - **Generated models**: [ABrain-One/nn-dataset PR #204](https://github.com/ABrain-One/nn-dataset/pull/204) (197 del-* prefixed architectures)
82
+ - **Paper**: "Delta-Based Neural Architecture Search: LLM Fine-Tuning via Code Diffs" (submitted to CVPR 2026)
83
+
84
+ ## Citation
85
+
86
+ ```bibtex
87
+ @article{deltanas2026,
88
+ title={Delta-Based Neural Architecture Search: LLM Fine-Tuning via Code Diffs},
89
+ author={Adhikari, Santosh and Ignatov, Dmitry},
90
+ year={2026}
91
+ }
92
+ ```
93
+
94
+ ## License
95
+
96
+ Apache 2.0 License (same as the base model)
adapter_config.json ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": null,
6
+ "base_model_name_or_path": "Qwen/Qwen2.5-Coder-7B-Instruct",
7
+ "bias": "none",
8
+ "corda_config": null,
9
+ "ensure_weight_tying": false,
10
+ "eva_config": null,
11
+ "exclude_modules": null,
12
+ "fan_in_fan_out": false,
13
+ "inference_mode": true,
14
+ "init_lora_weights": true,
15
+ "layer_replication": null,
16
+ "layers_pattern": null,
17
+ "layers_to_transform": [
18
+ 0,
19
+ 1,
20
+ 2,
21
+ 3,
22
+ 4,
23
+ 5,
24
+ 6,
25
+ 7,
26
+ 8,
27
+ 9,
28
+ 10,
29
+ 11,
30
+ 12,
31
+ 13,
32
+ 14,
33
+ 15,
34
+ 16,
35
+ 17,
36
+ 18,
37
+ 19,
38
+ 20,
39
+ 21,
40
+ 22,
41
+ 23
42
+ ],
43
+ "loftq_config": {},
44
+ "lora_alpha": 32,
45
+ "lora_bias": false,
46
+ "lora_dropout": 0.05,
47
+ "megatron_config": null,
48
+ "megatron_core": "megatron.core",
49
+ "modules_to_save": null,
50
+ "peft_type": "LORA",
51
+ "peft_version": "0.18.1",
52
+ "qalora_group_size": 16,
53
+ "r": 32,
54
+ "rank_pattern": {},
55
+ "revision": null,
56
+ "target_modules": [
57
+ "v_proj",
58
+ "lm_head",
59
+ "q_proj",
60
+ "k_proj",
61
+ "gate_proj",
62
+ "down_proj",
63
+ "up_proj",
64
+ "o_proj"
65
+ ],
66
+ "target_parameters": null,
67
+ "task_type": "CAUSAL_LM",
68
+ "trainable_token_indices": null,
69
+ "use_dora": false,
70
+ "use_qalora": false,
71
+ "use_rslora": false
72
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7218bea771fc62cc4c66fb4a2aca55c962af59efef09a41921f45241dad23d1c
3
+ size 2476782960