Bc-AI commited on
Commit
8fda5b5
·
verified ·
1 Parent(s): 2509a4a

Publish Orion T2 Mini SFT Transformers release

Browse files
README.md CHANGED
@@ -1,278 +1,54 @@
1
  ---
2
- license: other
3
- license_name: orion-t2-research-model-use-license-1.0
4
  library_name: transformers
5
  pipeline_tag: text-generation
6
  tags:
7
  - project-prism
8
- - refract-ai-labs
9
- - smilyai
10
  - orion
11
  - orion-t2
12
- - small-language-model
13
- - custom-architecture
14
  - custom-code
15
  - causal-lm
16
  - instruction-tuned
17
  - conversational
18
- - sft
19
  base_model: Project-Prism/Orion-Flagship-Mini-Preview
20
-
21
- extra_gated_prompt: |
22
- Orion T2 Mini is an experimental research model developed by Refract AI Labs, a sub-branch of SmilyAI.
23
-
24
- Please provide the information below to request access. Your responses will be used to review and manage access to the model.
25
-
26
- Information submitted through this form may be used by Refract AI Labs to contact you regarding your access request or important model-related updates. Please do not include sensitive personal information.
27
-
28
- extra_gated_fields:
29
- Intended use: text
30
- Contact email: text
31
- Affiliation or project: text
32
- Project description: text
33
- Intended use category:
34
- type: select
35
- options:
36
- - Research
37
- - Education
38
- - Personal experimentation
39
- - Benchmarking / evaluation
40
- - Application development
41
- - Fine-tuning / model research
42
- - Commercial use
43
- - Other
44
- I agree to follow the model license and applicable usage terms: checkbox
45
- I understand that Orion T2 Mini is experimental and its outputs may be incorrect or unreliable: checkbox
46
- ---
47
-
48
- # 🔺 Orion T2 Mini
49
-
50
- > **The first major model release from Refract AI Labs.**
51
-
52
- **Orion T2 Mini** is a compact experimental language model based on Project Prism's **Orion T2 architecture**.
53
-
54
- Developed by **Refract AI Labs**, a research sub-branch of SmilyAI, Orion T2 Mini explores how far a small language model can be pushed using an unconventional architecture, sparse specialist components, persistent working state, and recurrent computation.
55
-
56
- This checkpoint is the **supervised fine-tuned assistant release** of Orion T2 Mini.
57
-
58
- ## 🚀 Release
59
-
60
- | | Orion T2 Mini |
61
- |---|---|
62
- | **Organisation** | Refract AI Labs / SmilyAI |
63
- | **Architecture** | Orion T2 |
64
- | **Model type** | Decoder-only causal language model |
65
- | **Parameters** | ~219M |
66
- | **Training stage** | Pretraining → Response-only SFT |
67
- | **SFT examples** | 700,000 |
68
- | **Primary use** | Conversational text generation |
69
- | **Framework** | Hugging Face Transformers |
70
- | **Custom code** | Required |
71
- | **Generation cache** | Currently disabled |
72
-
73
- Orion T2 Mini is the first major public model release from **Refract AI Labs** and the first assistant release representing the Orion T2 generation.
74
-
75
  ---
76
 
77
- # 🧠 Architecture
78
-
79
- Orion T2 Mini is **not a standard dense Transformer**.
80
-
81
- The architecture combines several experimental components:
82
-
83
- ### Universal Cortex
84
-
85
- A **12-stage Universal Cortex** performs the model's main sequence processing.
86
-
87
- ### Procedure Banks
88
-
89
- Shared sparse **Procedure Banks** provide specialist computational pathways that can be reused across processing stages.
90
-
91
- ### Knowledge Vault
92
-
93
- A sparse **Knowledge Vault** provides an additional mechanism for storing and retrieving learned representations.
94
 
95
- ### Working State
96
 
97
- Orion maintains an explicit **Working State** intended to provide persistent intermediate information during processing.
98
 
99
- ### Recurrent Deliberation
100
 
101
- Later processing stages can perform recurrent computation, allowing additional internal processing without simply increasing the number of unique Transformer layers.
102
-
103
- These mechanisms are experimental. Their usefulness should be determined through controlled evaluation rather than inferred from architectural complexity alone.
104
-
105
- ---
106
-
107
- # 📚 Training
108
-
109
- The released assistant checkpoint begins from the completed **Orion T2 Mini base checkpoint**.
110
-
111
- It was subsequently trained using **response-only supervised fine-tuning (SFT)** on approximately **700,000 examples**.
112
-
113
- The SFT mixture was:
114
-
115
- | Category | Share |
116
- |---|---:|
117
- | General / Conversation | 60% |
118
- | Mathematics | 20% |
119
- | Code | 20% |
120
-
121
- Only assistant responses contribute to the SFT training objective.
122
-
123
- This allows Orion to learn conversational behaviour without directly optimizing against the user and system portions of each training example.
124
-
125
- ---
126
-
127
- # 💬 Chat Format
128
-
129
- Use the bundled Hugging Face chat template.
130
-
131
- Orion was trained using the literal text role markers:
132
-
133
- ```text
134
- <|system|>
135
- <|user|>
136
- <|assistant|>
137
- ```
138
-
139
- These markers were **not added as tokenizer special tokens**. They are represented as ordinary tokenized text.
140
-
141
- ### Example
142
 
143
  ```python
144
  import torch
145
  from transformers import AutoTokenizer, AutoModelForCausalLM
146
 
147
  repo = "Project-Prism/Orion-Flagship-Mini-SFT"
148
-
149
- tokenizer = AutoTokenizer.from_pretrained(
150
- repo,
151
- trust_remote_code=True,
152
- )
153
-
154
  model = AutoModelForCausalLM.from_pretrained(
155
- repo,
156
- trust_remote_code=True,
157
- torch_dtype=torch.bfloat16,
158
- device_map="auto",
159
  )
160
-
161
  messages = [
162
- {
163
- "role": "system",
164
- "content": "You are Orion, a helpful AI assistant."
165
- },
166
- {
167
- "role": "user",
168
- "content": "Explain why the sky is blue."
169
- },
170
  ]
171
-
172
- prompt = tokenizer.apply_chat_template(
173
- messages,
174
- tokenize=False,
175
- add_generation_prompt=True,
176
- )
177
-
178
- inputs = tokenizer(
179
- prompt,
180
- return_tensors="pt",
181
- ).to(model.device)
182
-
183
  with torch.inference_mode():
184
- output = model.generate(
185
- **inputs,
186
- max_new_tokens=128,
187
- temperature=0.7,
188
- top_p=0.95,
189
- do_sample=True,
190
- use_cache=False,
191
- )
192
-
193
- new_tokens = output[
194
- 0,
195
- inputs["input_ids"].shape[1]:
196
- ]
197
-
198
- print(
199
- tokenizer.decode(
200
- new_tokens,
201
- skip_special_tokens=True,
202
- )
203
- )
204
- ```
205
-
206
- ---
207
-
208
- # ⚡ Inference Notes
209
-
210
- Orion T2 uses a custom Transformers compatibility layer and therefore requires:
211
-
212
- ```python
213
- trust_remote_code=True
214
- ```
215
-
216
- The current implementation uses:
217
-
218
- ```python
219
- use_cache=False
220
  ```
221
 
222
- As a result, generation currently **recomputes the prefix for every generated token**.
223
-
224
- This can make inference substantially slower than similarly sized conventional Transformer models using an optimized KV cache.
225
-
226
- The current implementation should therefore be considered a **research implementation rather than a fully optimized inference runtime**.
227
-
228
- ---
229
-
230
- # 📊 Evaluation
231
-
232
- Orion T2 Mini is intended to be evaluated across:
233
-
234
- - General language understanding
235
- - Instruction following
236
- - Reasoning
237
- - Mathematics
238
- - Coding
239
- - Long-context behaviour
240
- - Knowledge
241
- - Small-language-model benchmarks
242
-
243
- Leaderboard and benchmark results should use clearly documented evaluation configurations wherever possible.
244
-
245
- Results from different prompting formats, quantization levels, context lengths, evaluation harnesses, or few-shot settings should not automatically be treated as directly comparable.
246
-
247
- ---
248
-
249
- # ⚠️ Experimental Status
250
-
251
- **Orion T2 Mini is an experimental research model.**
252
-
253
- The architecture intentionally differs from a conventional Transformer, but architectural novelty alone does not establish improved capability or efficiency.
254
-
255
- Claims about the benefits of the Universal Cortex, Procedure Banks, Knowledge Vault, Working State, or recurrent deliberation should be tested through matched evaluations and ablations.
256
-
257
- The model may:
258
-
259
- - Hallucinate incorrect information
260
- - Produce incorrect mathematical reasoning
261
- - Generate broken or insecure code
262
- - Misunderstand instructions
263
- - Produce unexpected outputs
264
- - Inherit biases or undesirable behaviours from its training data
265
-
266
- Outputs should not be treated as inherently factual or reliable.
267
-
268
- ---
269
-
270
- # 🔬 Project Prism
271
 
272
- Orion is developed as part of **Project Prism**, an experimental model-development effort exploring alternative architectures and training approaches for compact language models.
273
 
274
- **Orion T2 Mini** represents the first major release of the T2 generation from **Refract AI Labs**.
275
 
276
- ### 🔺 Orion T2
277
 
278
- **Small model. Experimental architecture. Built to find out what actually works.**
 
1
  ---
 
 
2
  library_name: transformers
3
  pipeline_tag: text-generation
4
  tags:
5
  - project-prism
 
 
6
  - orion
7
  - orion-t2
 
 
8
  - custom-code
9
  - causal-lm
10
  - instruction-tuned
11
  - conversational
 
12
  base_model: Project-Prism/Orion-Flagship-Mini-Preview
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  ---
14
 
15
+ # 🔺 Orion T2 Mini SFT
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
+ **Orion T2 Mini SFT** is the supervised-fine-tuned assistant variant of Project Prism's experimental Orion T2 architecture.
18
 
19
+ It starts from the completed Orion T2 Mini base checkpoint and was then trained with response-only SFT on 700,000 examples: 60% general/conversation, 20% math, and 20% code.
20
 
21
+ ## Chat format
22
 
23
+ Use the bundled Hugging Face chat template. The model was trained with literal text role markers `<|system|>`, `<|user|>`, and `<|assistant|>`. Those markers were **not** added as new tokenizer special tokens.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
  ```python
26
  import torch
27
  from transformers import AutoTokenizer, AutoModelForCausalLM
28
 
29
  repo = "Project-Prism/Orion-Flagship-Mini-SFT"
30
+ tokenizer = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
 
 
 
 
 
31
  model = AutoModelForCausalLM.from_pretrained(
32
+ repo, trust_remote_code=True, torch_dtype=torch.bfloat16, device_map="auto"
 
 
 
33
  )
 
34
  messages = [
35
+ {"role": "system", "content": "You are Orion, a helpful AI assistant."},
36
+ {"role": "user", "content": "Explain why the sky is blue."},
 
 
 
 
 
 
37
  ]
38
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
39
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
 
 
 
 
 
 
 
 
 
 
40
  with torch.inference_mode():
41
+ output = model.generate(**inputs, max_new_tokens=128, temperature=0.7, top_p=0.95, do_sample=True, use_cache=False)
42
+ new_tokens = output[0, inputs["input_ids"].shape[1]:]
43
+ print(tokenizer.decode(new_tokens, skip_special_tokens=True))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  ```
45
 
46
+ ## Architecture
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
 
48
+ Orion T2 Mini has approximately 219M total parameters and combines a 12-stage Universal Cortex, shared sparse Procedure Banks, a sparse Knowledge Vault, explicit Working State, and recurrent late-stage deliberation.
49
 
50
+ The current Transformers compatibility layer uses `use_cache=False`, so generation recomputes the prefix each token.
51
 
52
+ ## Status
53
 
54
+ Experimental Project Prism research model. Architecture claims should be judged with matched evaluations rather than assumed from the design alone.
config.json CHANGED
@@ -27,7 +27,7 @@
27
  "rope_theta": 10000.0,
28
  "router_aux_coef": 0.0,
29
  "router_z_coef": 0.0,
30
- "sequence_length": 1024,
31
  "shared_expert": true,
32
  "tie_word_embeddings": false,
33
  "tokenizer_name": "mistralai/Mistral-7B-v0.3",
 
27
  "rope_theta": 10000.0,
28
  "router_aux_coef": 0.0,
29
  "router_z_coef": 0.0,
30
+ "sequence_length": 32768,
31
  "shared_expert": true,
32
  "tie_word_embeddings": false,
33
  "tokenizer_name": "mistralai/Mistral-7B-v0.3",
model-00001-of-00002.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:66b888c3fec9f66c95c0e4607581047d4919732acc7b668b2ceab349b64fbf25
3
  size 534948792
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4142704bb7316be8d0ae1177556025258a297680a62464721bd2b753aa4e539a
3
  size 534948792
model-00002-of-00002.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:907793b1be290a0f8538244dde37b77f8c1831568633ce663181f16939688ce5
3
  size 341329548
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9b0a71acd70a0d3a30aaf1e02b9417c592948d5538a1ea9ba9383ebcddcbbb46
3
  size 341329548
orion_source.json CHANGED
@@ -1,9 +1,9 @@
1
  {
2
- "source_repo": "Project-Prism/Orion-Flagship-Mini-SFT",
3
- "source_checkpoint": "step-000021875-ffba08df",
4
- "source_checkpoint_path": "checkpoints/step-000021875-ffba08df",
5
- "step": 21875,
6
- "tokens": 335659047,
7
  "native_format_version": 2,
8
  "architecture": "orion_flagship_mini_t2",
9
  "transformers_custom_code": true,
 
1
  {
2
+ "source_repo": "Project-Prism/Orion-Flagship-Mini-SFT-Phase2",
3
+ "source_checkpoint": "step-000004817-5d8e15d0",
4
+ "source_checkpoint_path": "checkpoints/step-000004817-5d8e15d0",
5
+ "step": 4817,
6
+ "tokens": 66781963,
7
  "native_format_version": 2,
8
  "architecture": "orion_flagship_mini_t2",
9
  "transformers_custom_code": true,
sft_provenance.json CHANGED
@@ -9,10 +9,10 @@
9
  "system_marker": "<|system|>",
10
  "user_marker": "<|user|>"
11
  },
12
- "destination_repository": "Project-Prism/Orion-Flagship-Mini-SFT",
13
  "ignore_index": -100,
14
  "model_name": "Orion T2 Mini SFT",
15
- "native_checkpoint": "checkpoints/step-000021875-ffba08df",
16
  "objective": "response-only supervised fine-tuning",
17
  "project": "Project Prism",
18
  "prompt_tokens_masked": true,
@@ -34,9 +34,9 @@
34
  "fraction": 0.2
35
  }
36
  },
37
- "sft_step": 21875,
38
- "source_sft_repository": "Project-Prism/Orion-Flagship-Mini-SFT",
39
- "supervised_tokens": 335659047,
40
  "tokenizer": "mistralai/Mistral-7B-v0.3",
41
  "transformers_custom_code": true,
42
  "use_cache": false
 
9
  "system_marker": "<|system|>",
10
  "user_marker": "<|user|>"
11
  },
12
+ "destination_repository": "Refract-Labs/Orion-Flagship-Mini",
13
  "ignore_index": -100,
14
  "model_name": "Orion T2 Mini SFT",
15
+ "native_checkpoint": "checkpoints/step-000004817-5d8e15d0",
16
  "objective": "response-only supervised fine-tuning",
17
  "project": "Project Prism",
18
  "prompt_tokens_masked": true,
 
34
  "fraction": 0.2
35
  }
36
  },
37
+ "sft_step": 4817,
38
+ "source_sft_repository": "Project-Prism/Orion-Flagship-Mini-SFT-Phase2",
39
+ "supervised_tokens": 66781963,
40
  "tokenizer": "mistralai/Mistral-7B-v0.3",
41
  "transformers_custom_code": true,
42
  "use_cache": false