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

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

Browse files
Files changed (3) hide show
  1. README.md +95 -0
  2. adapter_config.json +74 -0
  3. adapter_model.safetensors +3 -0
README.md ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: deepseek-ai/deepseek-coder-7b-instruct-v1.5
3
+ library_name: peft
4
+ license: mit
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 DeepSeek-Coder-7B-Instruct LoRA Adapter
15
+
16
+ This is a LoRA adapter for [DeepSeek-Coder-7B-Instruct-v1.5](https://huggingface.co/deepseek-ai/deepseek-coder-7b-instruct-v1.5), 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**: `deepseek-ai/deepseek-coder-7b-instruct-v1.5`
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, lm_head
30
+ - **Training cycles**: 22 (iterative self-improvement)
31
+ - **Total trained candidates**: 828
32
+ - **Admitted novel architectures**: 83 (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 | 828 |
44
+ | Valid rate (compiles + trains) | 49.5% |
45
+ | Mean 1-epoch accuracy | 33.9% (±7.9% SD across cycles) |
46
+ | ≥40% accuracy rate | 16.6% |
47
+ | Novel architectures admitted to LEMUR | 83 |
48
+
49
+ ## Usage
50
+
51
+ ```python
52
+ from transformers import AutoModelForCausalLM, AutoTokenizer
53
+ from peft import PeftModel
54
+
55
+ # Load base model
56
+ base_model = AutoModelForCausalLM.from_pretrained(
57
+ "deepseek-ai/deepseek-coder-7b-instruct-v1.5",
58
+ torch_dtype="auto",
59
+ device_map="auto"
60
+ )
61
+ tokenizer = AutoTokenizer.from_pretrained("deepseek-ai/deepseek-coder-7b-instruct-v1.5")
62
+
63
+ # Load LoRA adapter
64
+ model = PeftModel.from_pretrained(base_model, "ABrain/Delta-NAS-DeepSeek-Coder-7B")
65
+
66
+ # Generate a diff to modify a baseline architecture
67
+ prompt = """Given the following PyTorch neural network baseline:
68
+ [baseline code here]
69
+
70
+ Generate a unified diff that creates a novel architecture variant."""
71
+
72
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
73
+ outputs = model.generate(**inputs, max_new_tokens=512)
74
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
75
+ ```
76
+
77
+ ## Associated Resources
78
+
79
+ - **Code**: [ABrain-One/nn-gpt](https://github.com/ABrain-One/nn-gpt)
80
+ - **Generated models**: [ABrain-One/nn-dataset PR #204](https://github.com/ABrain-One/nn-dataset/pull/204) (197 del-* prefixed architectures)
81
+ - **Paper**: "Delta-Based Neural Architecture Search: LLM Fine-Tuning via Code Diffs" (submitted to CVPR 2026)
82
+
83
+ ## Citation
84
+
85
+ ```bibtex
86
+ @article{deltanas2026,
87
+ title={Delta-Based Neural Architecture Search: LLM Fine-Tuning via Code Diffs},
88
+ author={Adhikari, Santosh and Ignatov, Dmitry},
89
+ year={2026}
90
+ }
91
+ ```
92
+
93
+ ## License
94
+
95
+ MIT License (same as the base model and LEMUR dataset)
adapter_config.json ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": null,
6
+ "base_model_name_or_path": "deepseek-ai/deepseek-coder-7b-instruct-v1.5",
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
+ "lora_ga_config": null,
48
+ "megatron_config": null,
49
+ "megatron_core": "megatron.core",
50
+ "modules_to_save": null,
51
+ "peft_type": "LORA",
52
+ "peft_version": "0.19.0",
53
+ "qalora_group_size": 16,
54
+ "r": 32,
55
+ "rank_pattern": {},
56
+ "revision": null,
57
+ "target_modules": [
58
+ "up_proj",
59
+ "lm_head",
60
+ "gate_proj",
61
+ "o_proj",
62
+ "k_proj",
63
+ "v_proj",
64
+ "down_proj",
65
+ "q_proj"
66
+ ],
67
+ "target_parameters": null,
68
+ "task_type": "CAUSAL_LM",
69
+ "trainable_token_indices": null,
70
+ "use_bdlora": null,
71
+ "use_dora": false,
72
+ "use_qalora": false,
73
+ "use_rslora": false
74
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6d9757f113952f89efa6eee54ff1c32fa59cbdad92948815defbfec57f0977a4
3
+ size 1931261344