Subject-Emu-5259 commited on
Commit
95bdc28
·
verified ·
1 Parent(s): c0efa78

Upload NeuralAI v2 LoRA adapter (SmolLM2-360M DPO)

Browse files
README.md CHANGED
@@ -1,3 +1,107 @@
1
  ---
 
 
 
 
 
 
 
 
 
 
 
2
  license: apache-2.0
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ base_model: HuggingFaceTB/SmolLM2-360M-Instruct
3
+ library_name: peft
4
+ pipeline_tag: text-generation
5
+ tags:
6
+ - base_model:adapter:HuggingFaceTB/SmolLM2-360M-Instruct
7
+ - lora
8
+ - transformers
9
+ - peft
10
+ - neuralai
11
+ - dpo
12
+ - smollm2
13
  license: apache-2.0
14
  ---
15
+
16
+ # NeuralAI v2 — SmolLM2-360M DPO LoRA Adapter
17
+
18
+ A PEFT/LoRA adapter for `HuggingFaceTB/SmolLM2-360M-Instruct`, fine-tuned by **De'Andrew P. Harris** as the inference-time alignment layer for the NeuralAI assistant (the intelligence backend behind the NeuralAI / NeuralLabs product).
19
+
20
+ ## Model Details
21
+
22
+ - **Base model:** [HuggingFaceTB/SmolLM2-360M-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-360M-Instruct)
23
+ - **Adapter type:** LoRA (PEFT 0.19.0)
24
+ - **Rank (r):** 16 · **alpha:** 32 · **dropout:** 0.05 · **bias:** none
25
+ - **Target modules:** `q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`, `up_proj`, `down_proj`
26
+ - **Task:** `CAUSAL_LM` (instruction-tuned text generation)
27
+ - **Training framework:** PyTorch + 🤗 Transformers + 🤗 PEFT
28
+ - **License:** Apache-2.0 (inherits from base model)
29
+
30
+ ## Training
31
+
32
+ - **Method:** Supervised fine-tuning followed by DPO preference alignment
33
+ - **Epochs:** 3
34
+ - **Learning rate:** 2e-4
35
+ - **Optimizer state:** AdamW (bf16)
36
+ - **Training samples:** 363 · **Validation samples:** 41
37
+ - **Training duration:** ~26 minutes
38
+ - **Completed:** 2026-05-17
39
+ - **Final checkpoint:** `checkpoint-69` (used as the published adapter)
40
+
41
+ See `training_log.json` in this repo for the recorded run summary.
42
+
43
+ ## Intended Use
44
+
45
+ This adapter is intended to be loaded on top of `HuggingFaceTB/SmolLM2-360M-Instruct` for the NeuralAI assistant experience: short-form instruction following, reasoning, and conversational response generation within the NeuralAI / NeuralLabs product surface.
46
+
47
+ ### Out-of-Scope Use
48
+
49
+ - Production safety-critical applications
50
+ - Use as a primary assistant without additional alignment, safety filtering, and human oversight
51
+ - Any use that violates the Apache-2.0 license terms
52
+
53
+ ## How to Use
54
+
55
+ ```python
56
+ import torch
57
+ from transformers import AutoModelForCausalLM, AutoTokenizer
58
+ from peft import PeftModel
59
+
60
+ base_id = "HuggingFaceTB/SmolLM2-360M-Instruct"
61
+ adapter_id = "Subject-Emu-5259/NeuralAI"
62
+
63
+ tokenizer = AutoTokenizer.from_pretrained(base_id)
64
+ model = AutoModelForCausalLM.from_pretrained(
65
+ base_id,
66
+ torch_dtype=torch.bfloat16,
67
+ device_map="auto",
68
+ )
69
+ model = PeftModel.from_pretrained(model, adapter_id)
70
+
71
+ prompt = "Explain quantum entanglement in one paragraph."
72
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
73
+ with torch.no_grad():
74
+ out = model.generate(**inputs, max_new_tokens=200, do_sample=True, temperature=0.7)
75
+ print(tokenizer.decode(out[0], skip_special_tokens=True))
76
+ ```
77
+
78
+ ## Files
79
+
80
+ - `adapter_config.json` — PEFT/LoRA configuration
81
+ - `adapter_model.safetensors` — LoRA adapter weights (~33 MB)
82
+ - `tokenizer.json`, `tokenizer_config.json`, `chat_template.jinja` — tokenizer + chat template
83
+ - `training_log.json` — training run summary
84
+
85
+ Training-state artifacts (`optimizer.pt`, `scheduler.pt`, `rng_state.pth`) and intermediate `checkpoint-46` were intentionally omitted from this repo to keep it lean for inference.
86
+
87
+ ## Limitations
88
+
89
+ - This is a small (360M) parameter base model — quality, factuality, and reasoning depth are bounded accordingly.
90
+ - The adapter is tuned for the NeuralAI product voice; off-domain prompts may drift.
91
+ - No RLHF safety tuning has been applied beyond DPO.
92
+
93
+ ## Citation
94
+
95
+ ```bibtex
96
+ @misc{neuralai_v2_2026,
97
+ title = {NeuralAI v2: SmolLM2-360M DPO LoRA Adapter},
98
+ author = {Harris, De'Andrew P.},
99
+ year = {2026},
100
+ url = {https://huggingface.co/Subject-Emu-5259/NeuralAI}
101
+ }
102
+ ```
103
+
104
+ ## Links
105
+
106
+ - **GitHub (source + training code):** https://github.com/Subject-Emu-5259/NeuralAI
107
+ - **Author:** De'Andrew P. Harris
adapter_config.json ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alora_invocation_tokens": null,
3
+ "alpha_pattern": {},
4
+ "arrow_config": null,
5
+ "auto_mapping": null,
6
+ "base_model_name_or_path": "HuggingFaceTB/SmolLM2-360M-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": null,
18
+ "loftq_config": {},
19
+ "lora_alpha": 32,
20
+ "lora_bias": false,
21
+ "lora_dropout": 0.05,
22
+ "lora_ga_config": null,
23
+ "megatron_config": null,
24
+ "megatron_core": "megatron.core",
25
+ "modules_to_save": null,
26
+ "peft_type": "LORA",
27
+ "peft_version": "0.19.0",
28
+ "qalora_group_size": 16,
29
+ "r": 16,
30
+ "rank_pattern": {},
31
+ "revision": null,
32
+ "target_modules": [
33
+ "down_proj",
34
+ "o_proj",
35
+ "q_proj",
36
+ "v_proj",
37
+ "gate_proj",
38
+ "k_proj",
39
+ "up_proj"
40
+ ],
41
+ "target_parameters": null,
42
+ "task_type": "CAUSAL_LM",
43
+ "trainable_token_indices": null,
44
+ "use_bdlora": null,
45
+ "use_dora": false,
46
+ "use_qalora": false,
47
+ "use_rslora": false
48
+ }
adapter_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ae92b11c70af004443a2144846036ab686fb01590fdd8566958675b78dae68f5
3
+ size 34793120
chat_template.jinja ADDED
@@ -0,0 +1 @@
 
 
1
+ {% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{ '<|im_start|>system\nYou are NeuralAI, a production-grade artificial intelligence system developed by De’Andrew Preston Harris. You are brilliant, professional, and collaborative.<|im_end|>\n' }}{% endif %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<|im_start|>",
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "<|im_end|>",
7
+ "errors": "replace",
8
+ "extra_special_tokens": [
9
+ "<|im_start|>",
10
+ "<|im_end|>"
11
+ ],
12
+ "is_local": false,
13
+ "model_max_length": 8192,
14
+ "pad_token": "<|im_end|>",
15
+ "tokenizer_class": "GPT2Tokenizer",
16
+ "unk_token": "<|endoftext|>",
17
+ "vocab_size": 49152
18
+ }
training_log.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "base_model": "HuggingFaceTB/SmolLM2-360M-Instruct",
3
+ "training_samples": 363,
4
+ "validation_samples": 41,
5
+ "epochs": 3,
6
+ "learning_rate": 0.0002,
7
+ "lora_r": 16,
8
+ "duration_seconds": 1571.376247,
9
+ "completed": "2026-05-17T08:41:01.700976"
10
+ }