SEE7 commited on
Commit
0bfdd04
·
verified ·
1 Parent(s): 2b66baf

Present Astheral v2 capabilities, measured comparisons and deterministic inference defaults

Browse files
Files changed (4) hide show
  1. README.md +54 -40
  2. artifact_manifest.json +6 -6
  3. generation_config.json +7 -5
  4. inference.py +8 -2
README.md CHANGED
@@ -12,47 +12,61 @@ tags:
12
  - llama
13
  - instruct
14
  - reasoning
 
15
  ---
16
 
17
  # Astheral
18
 
19
- Built with Llama. Astheral is SEE7's 8.03B assistant with instruct and thinking modes, custom system instructions, and deterministic inference defaults.
20
-
21
- Version 2 combines a broad instruction/coding/math training stage with a native BF16 repair stage for structured output, complete code, and multi-step balances. Rank-32 adapters update attention and feed-forward projections. Training and inference verification run remotely on a 24 GB NVIDIA A10G.
22
-
23
- Exact training stages, source revisions, data, adapter weights, merged Safetensors and measured comparisons are included. Use inference.py with --mode instruct or --mode thinking. Use --system to supply your own instructions and --sample for creative variation.
24
-
25
- Derived from Nous Research DeepHermes 3 8B Preview and Meta Llama 3.1. See LICENSE, UPSTREAM_LLAMA3_LICENSE, NOTICE and data_sources.json.
26
-
27
- ## Verified core results
28
-
29
- {
30
- "regression": {
31
- "passed": 2,
32
- "total": 2
33
- },
34
- "fresh": {
35
- "passed": 36,
36
- "total": 36
37
- },
38
- "exact": {
39
- "passed": 10,
40
- "total": 10
41
- },
42
- "json": {
43
- "passed": 4,
44
- "total": 4
45
- },
46
- "number": {
47
- "passed": 16,
48
- "total": 16
49
- },
50
- "code": {
51
- "passed": 6,
52
- "total": 6
53
- },
54
- "confirmation": {
55
- "passed": 16,
56
- "total": 16
57
- }
58
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  - llama
13
  - instruct
14
  - reasoning
15
+ - qlora
16
  ---
17
 
18
  # Astheral
19
 
20
+ **Built with Llama.** Astheral is SEE7's 8.03B assistant for instruction following, coding, concise explanations and fictional roleplay.
21
+
22
+ ## Instruct and thinking
23
+
24
+ Choose **instruct** for direct answers or **thinking** for a worked solution before the final answer. Both modes use the same trained weights. The included inference script selects the mode and accepts your own system instructions with --system.
25
+
26
+ ## What's changed in v2
27
+
28
+ - Balanced training across general instruction tasks, formatting, text editing, Python, and multi-step mathematics.
29
+ - Rank-32 adapters across attention and feed-forward projections.
30
+ - Explicit training to account for all groups in counting problems and preserve requested output structure.
31
+ - Short, complete worked solutions in thinking mode.
32
+ - A saved, merged BF16 checkpoint plus the separately downloadable adapter.
33
+
34
+ Training used **4,080 examples**, **1084 optimizer steps**, and **83,886,080 trainable adapter parameters** on a remote **NVIDIA A10G**. The original DeepHermes weights provide the starting model.
35
+
36
+ ## Measured results
37
+
38
+ Both models used identical prompts and deterministic generation settings: up to 384 new tokens for instruct and 1,024 for thinking. The core suite contains 14 formatting tasks, 16 numerical reasoning tasks and six executable Python tasks.
39
+
40
+ | Check | DeepHermes base | Astheral v2 |
41
+ |---|---:|---:|
42
+ | Formatting | 9/14 | 14/14 |
43
+ | Numerical reasoning | 16/16 | 16/16 |
44
+ | Executable Python | 4/6 | 6/6 |
45
+ | Core checks total | 29/36 | 36/36 |
46
+ | Known regression cases | 1/2 | 2/2 |
47
+
48
+ The two regression cases cover the alpha/omega line format and counting the remaining red and blue balls together. Full prompts, answers, checker code and run metrics are available in evaluate.py, base_outputs.json, astheral_merged_outputs.json and evaluation.json. Six additional samples cover roleplay, prompt design, authorized networking explanations, uncertainty, debugging and summarization.
49
+
50
+ Default mode formatting was verified in **60/60 responses**: instruct responses omit thinking tags; thinking responses contain a completed thinking block.
51
+
52
+ The saved checkpoint also passed **16/16 additional confirmation cases** covering new CSV records, literal copying, fraction-based balances, time conversion and complete Python functions. Their prompts and answers are in confirmation_outputs.json.
53
+
54
+ ## Run on a remote GPU
55
+
56
+ Install a CUDA-enabled PyTorch build and requirements.txt, then download inference.py from this repository.
57
+
58
+ python inference.py "Explain Python generators." --mode instruct
59
+ python inference.py "A box has 23 red and 17 blue beads; 6 red are removed. How many remain?" --mode thinking
60
+ python inference.py "Write a fictional starship announcement." --mode instruct --load-in-4bit
61
+
62
+ Use --system "Your instructions" to replace the default assistant instructions. Decoding is deterministic by default; add --sample for creative variation. BF16 weights occupy about 16 GB; --load-in-4bit loads the weights in NF4 for lower GPU memory use. The script loads SEE7/Astheral directly. Dockerfile includes the CUDA runtime and compiler dependencies for the 4-bit backend.
63
+
64
+ ## Files and reproducibility
65
+
66
+ The repository includes merged Safetensors weights, the adapter folder, train.py, prepare_data.py, the exact training and validation examples, trainer logs, data source revisions, output comparisons and artifact hashes. The merged checkpoint was saved, reloaded, and evaluated before release.
67
+
68
+ ## Training data and attribution
69
+
70
+ Training combines original Astheral examples with selected components of HuggingFaceTB/smoltalk (Apache 2.0), the openai/gsm8k training split (MIT), and bigcode/self-oss-instruct-sc2-exec-filter-50k (ODC Attribution). See data_sources.json, DATA.md, DATA_LICENSE files and NOTICE.
71
+
72
+ Astheral is fine-tuned from NousResearch/DeepHermes-3-Llama-3-8B-Preview, revision 53d902c7dcfa4c749a3b455149064f82af2e2549, built on Meta Llama 3.1 8B. The project is Astheral; the distributed model name is Llama-3.1-Astheral. See LICENSE and UPSTREAM_LLAMA3_LICENSE.
artifact_manifest.json CHANGED
@@ -52,8 +52,8 @@
52
  "sha256": "e5a038e1955ffd829ccb9ec510bba1c6a990cf9d2c3c7a3f502c5110a75a9528"
53
  },
54
  "generation_config.json": {
55
- "bytes": 264,
56
- "sha256": "600226d04de07399e276b27693db6f84e40473b6005a0ae9bf74a1b504f3584e"
57
  },
58
  "model-00001-of-00005.safetensors": {
59
  "bytes": 3986791344,
@@ -144,8 +144,8 @@
144
  "sha256": "56f15e83ef3031f8b64c77df07320c599c41eb95410ca9a94d00b2f6446e7073"
145
  },
146
  "inference.py": {
147
- "bytes": 2390,
148
- "sha256": "d7058ae7b4f67fb2aa6d83b738e3a3a66399b0f73528f2af4e7105d2366b3cfd"
149
  },
150
  "requirements.txt": {
151
  "bytes": 117,
@@ -156,8 +156,8 @@
156
  "sha256": "fda689d55ae71fc8ca8151b131078b9663843ef965b5d69cad8d2618235edef5"
157
  },
158
  "README.md": {
159
- "bytes": 1531,
160
- "sha256": "12e4b56ad743a412e60b566f92cf03efa68d5dbb0cdc49cc4f5b73805c73ca7f"
161
  },
162
  "adapter/README.md": {
163
  "bytes": 5242,
 
52
  "sha256": "e5a038e1955ffd829ccb9ec510bba1c6a990cf9d2c3c7a3f502c5110a75a9528"
53
  },
54
  "generation_config.json": {
55
+ "bytes": 305,
56
+ "sha256": "79db16a2918647878da86e0e215e8fc461e2918e6cbdafa84c2f8b8356b57c34"
57
  },
58
  "model-00001-of-00005.safetensors": {
59
  "bytes": 3986791344,
 
144
  "sha256": "56f15e83ef3031f8b64c77df07320c599c41eb95410ca9a94d00b2f6446e7073"
145
  },
146
  "inference.py": {
147
+ "bytes": 2741,
148
+ "sha256": "c4cfc3f09840a024f6464a2114b3ecf9cf08766a624c5031c39937b3e40c324e"
149
  },
150
  "requirements.txt": {
151
  "bytes": 117,
 
156
  "sha256": "fda689d55ae71fc8ca8151b131078b9663843ef965b5d69cad8d2618235edef5"
157
  },
158
  "README.md": {
159
+ "bytes": 4350,
160
+ "sha256": "f65acc0e71be56b27cab016ae9ea695921b5ec9736d2f4f0d08ab503211a503a"
161
  },
162
  "adapter/README.md": {
163
  "bytes": 5242,
generation_config.json CHANGED
@@ -1,7 +1,7 @@
1
  {
2
  "_from_model_config": true,
3
  "bos_token_id": 128000,
4
- "do_sample": true,
5
  "eos_token_id": [
6
  128001,
7
  128008,
@@ -9,7 +9,9 @@
9
  ],
10
  "max_length": 131072,
11
  "pad_token_id": 128004,
12
- "temperature": 0.6,
13
- "top_p": 0.9,
14
- "transformers_version": "4.56.2"
15
- }
 
 
 
1
  {
2
  "_from_model_config": true,
3
  "bos_token_id": 128000,
4
+ "do_sample": false,
5
  "eos_token_id": [
6
  128001,
7
  128008,
 
9
  ],
10
  "max_length": 131072,
11
  "pad_token_id": 128004,
12
+ "temperature": 1.0,
13
+ "top_p": 1.0,
14
+ "transformers_version": "4.56.2",
15
+ "top_k": 50,
16
+ "max_new_tokens": 1024
17
+ }
inference.py CHANGED
@@ -2,7 +2,7 @@
2
  import argparse,json,torch
3
  from pathlib import Path
4
  from huggingface_hub import hf_hub_download
5
- from transformers import AutoTokenizer,AutoModelForCausalLM,BitsAndBytesConfig,set_seed
6
  p=argparse.ArgumentParser()
7
  p.add_argument("prompt")
8
  p.add_argument("--mode",choices=["instruct","thinking"],default="instruct")
@@ -21,7 +21,13 @@ system=(args.system if args.system is not None else settings["system"])+("\n"+se
21
  tok=AutoTokenizer.from_pretrained(args.model)
22
  dtype=torch.bfloat16 if torch.cuda.is_bf16_supported() else torch.float16
23
  quant=BitsAndBytesConfig(load_in_4bit=True,bnb_4bit_quant_type="nf4",bnb_4bit_use_double_quant=True,bnb_4bit_compute_dtype=dtype) if args.load_in_4bit else None
24
- model=AutoModelForCausalLM.from_pretrained(args.model,torch_dtype=dtype,device_map={"":"cuda:0"},quantization_config=quant)
 
 
 
 
 
 
25
  inputs=tok.apply_chat_template([{"role":"system","content":system},{"role":"user","content":args.prompt}],tokenize=True,add_generation_prompt=True,return_dict=True,return_tensors="pt").to(model.device)
26
  with torch.inference_mode():
27
  generation={"max_new_tokens":args.max_new_tokens,"do_sample":args.sample,"pad_token_id":128004,"eos_token_id":128009}
 
2
  import argparse,json,torch
3
  from pathlib import Path
4
  from huggingface_hub import hf_hub_download
5
+ from transformers import AutoConfig,AutoTokenizer,AutoModelForCausalLM,BitsAndBytesConfig,set_seed
6
  p=argparse.ArgumentParser()
7
  p.add_argument("prompt")
8
  p.add_argument("--mode",choices=["instruct","thinking"],default="instruct")
 
21
  tok=AutoTokenizer.from_pretrained(args.model)
22
  dtype=torch.bfloat16 if torch.cuda.is_bf16_supported() else torch.float16
23
  quant=BitsAndBytesConfig(load_in_4bit=True,bnb_4bit_quant_type="nf4",bnb_4bit_use_double_quant=True,bnb_4bit_compute_dtype=dtype) if args.load_in_4bit else None
24
+ config=AutoConfig.from_pretrained(args.model)
25
+ saved_quant=getattr(config,"quantization_config",None)
26
+ if quant is None and isinstance(saved_quant,dict) and saved_quant.get("load_in_4bit"):
27
+ quant=BitsAndBytesConfig.from_dict(saved_quant)
28
+ quant.bnb_4bit_compute_dtype=dtype
29
+ config.quantization_config=quant.to_dict()
30
+ model=AutoModelForCausalLM.from_pretrained(args.model,config=config,torch_dtype=dtype,device_map={"":"cuda:0"},quantization_config=quant)
31
  inputs=tok.apply_chat_template([{"role":"system","content":system},{"role":"user","content":args.prompt}],tokenize=True,add_generation_prompt=True,return_dict=True,return_tensors="pt").to(model.device)
32
  with torch.inference_mode():
33
  generation={"max_new_tokens":args.max_new_tokens,"do_sample":args.sample,"pad_token_id":128004,"eos_token_id":128009}