Text Generation
MLX
Safetensors
English
base-model
pretrained
small-language-model
apple-silicon
from-scratch
research
Instructions to use OpenSML/OpenSML-Base-175M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use OpenSML/OpenSML-Base-175M with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("OpenSML/OpenSML-Base-175M") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use OpenSML/OpenSML-Base-175M with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "OpenSML/OpenSML-Base-175M" --prompt "Once upon a time"
- Atomic Chat
Upload complete pretrained base weights and reproducible MLX package
Browse filesSelected pretrained ancestor with tokenizer, model architecture, standalone runtime, pretraining report and loss curves, evaluation evidence, provenance and checksums.
- .gitattributes +1 -0
- CITATION.cff +9 -0
- EVALUATION_RESULTS.json +26 -0
- LICENSE +201 -0
- PACKAGING_VERIFICATION.json +22 -0
- PRETRAINING_SAMPLES.json +46 -0
- README.md +189 -0
- RUN_GUIDE.md +74 -0
- SHA256SUMS +22 -0
- SOURCE_FILES.json +49 -0
- TECHNICAL_REPORT.md +167 -0
- THIRD_PARTY_NOTICES.md +24 -0
- checkpoint_metadata.json +167 -0
- checkpoint_provenance.json +16 -0
- config.json +26 -0
- corpus.json +77 -0
- inference.py +103 -0
- model.safetensors +3 -0
- native_bundle.zip +3 -0
- pretraining-training-loss.png +3 -0
- requirements.txt +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +8 -0
- tokenizer_manifest.json +31 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
pretraining-training-loss.png filter=lfs diff=lfs merge=lfs -text
|
CITATION.cff
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
cff-version: 1.2.0
|
| 2 |
+
message: "Please cite OpenSML-Base-175M and preserve dataset/source attribution."
|
| 3 |
+
title: "OpenSML-Base-175M"
|
| 4 |
+
authors:
|
| 5 |
+
- family-names: "Zebrowski"
|
| 6 |
+
given-names: "William"
|
| 7 |
+
date-released: "2026-10-14"
|
| 8 |
+
url: "https://huggingface.co/OpenSML/OpenSML-Base-175M"
|
| 9 |
+
abstract: "A 175.6M-parameter native MLX base language model pretrained on 17.30B processed token positions, with frozen provenance and observed document validation."
|
EVALUATION_RESULTS.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model": "OpenSML-Base-175M",
|
| 3 |
+
"pretraining_step": 132005,
|
| 4 |
+
"processed_token_positions": 17300111360,
|
| 5 |
+
"weight_sha256": "5151567e266244c9e32fd6e01775192633abe227320269ecdefe28ce43e9ccc3",
|
| 6 |
+
"validation": {
|
| 7 |
+
"val_loss": 2.5563359551876785,
|
| 8 |
+
"val_ppl": 12.888506628383553,
|
| 9 |
+
"source_losses": {
|
| 10 |
+
"web": 2.941684268414974,
|
| 11 |
+
"dclm": 2.9943208396434784,
|
| 12 |
+
"wiki": 1.987750370055437,
|
| 13 |
+
"cosmopedia": 1.7873524278402328,
|
| 14 |
+
"python": 1.2724680323153734
|
| 15 |
+
},
|
| 16 |
+
"validation_fingerprint": "4ddd461c131d4d27d07bb07f5aab3fcb5a00d4b1202066e3d9b6ee6b3129087b",
|
| 17 |
+
"batches_per_source": 32,
|
| 18 |
+
"batch_size": 2,
|
| 19 |
+
"sequence_length": 2048,
|
| 20 |
+
"sources": 5,
|
| 21 |
+
"nominal_token_positions": 655360,
|
| 22 |
+
"scope": "Historical fixed document validation, mixture-weighted loss. Not a downstream benchmark or a fresh test."
|
| 23 |
+
},
|
| 24 |
+
"downstream_benchmarks": {},
|
| 25 |
+
"scope": "No JSONLite post-training or extraction metrics are attributed to these base weights."
|
| 26 |
+
}
|
LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Apache License
|
| 2 |
+
Version 2.0, January 2004
|
| 3 |
+
http://www.apache.org/licenses/
|
| 4 |
+
|
| 5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 6 |
+
|
| 7 |
+
1. Definitions.
|
| 8 |
+
|
| 9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 11 |
+
|
| 12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 13 |
+
the copyright owner that is granting the License.
|
| 14 |
+
|
| 15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 16 |
+
other entities that control, are controlled by, or are under common
|
| 17 |
+
control with that entity. For the purposes of this definition,
|
| 18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 19 |
+
direction or management of such entity, whether by contract or
|
| 20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 22 |
+
|
| 23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 24 |
+
exercising permissions granted by this License.
|
| 25 |
+
|
| 26 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 27 |
+
including but not limited to software source code, documentation
|
| 28 |
+
source, and configuration files.
|
| 29 |
+
|
| 30 |
+
"Object" form shall mean any form resulting from mechanical
|
| 31 |
+
transformation or translation of a Source form, including but
|
| 32 |
+
not limited to compiled object code, generated documentation,
|
| 33 |
+
and conversions to other media types.
|
| 34 |
+
|
| 35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 36 |
+
Object form, made available under the License, as indicated by a
|
| 37 |
+
copyright notice that is included in or attached to the work
|
| 38 |
+
(an example is provided in the Appendix below).
|
| 39 |
+
|
| 40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 41 |
+
form, that is based on (or derived from) the Work and for which the
|
| 42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 44 |
+
of this License, Derivative Works shall not include works that remain
|
| 45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 46 |
+
the Work and Derivative Works thereof.
|
| 47 |
+
|
| 48 |
+
"Contribution" shall mean any work of authorship, including
|
| 49 |
+
the original version of the Work and any modifications or additions
|
| 50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 54 |
+
means any form of electronic, verbal, or written communication sent
|
| 55 |
+
to the Licensor or its representatives, including but not limited to
|
| 56 |
+
communication on electronic mailing lists, source code control systems,
|
| 57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 59 |
+
excluding communication that is conspicuously marked or otherwise
|
| 60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 61 |
+
|
| 62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 64 |
+
subsequently incorporated within the Work.
|
| 65 |
+
|
| 66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 71 |
+
Work and such Derivative Works in Source or Object form.
|
| 72 |
+
|
| 73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 76 |
+
(except as stated in this section) patent license to make, have made,
|
| 77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 78 |
+
where such license applies only to those patent claims licensable
|
| 79 |
+
by such Contributor that are necessarily infringed by their
|
| 80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 82 |
+
institute patent litigation against any entity (including a
|
| 83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 84 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 85 |
+
or contributory patent infringement, then any patent licenses
|
| 86 |
+
granted to You under this License for that Work shall terminate
|
| 87 |
+
as of the date such litigation is filed.
|
| 88 |
+
|
| 89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 90 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 91 |
+
modifications, and in Source or Object form, provided that You
|
| 92 |
+
meet the following conditions:
|
| 93 |
+
|
| 94 |
+
(a) You must give any other recipients of the Work or
|
| 95 |
+
Derivative Works a copy of this License; and
|
| 96 |
+
|
| 97 |
+
(b) You must cause any modified files to carry prominent notices
|
| 98 |
+
stating that You changed the files; and
|
| 99 |
+
|
| 100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 101 |
+
that You distribute, all copyright, patent, trademark, and
|
| 102 |
+
attribution notices from the Source form of the Work,
|
| 103 |
+
excluding those notices that do not pertain to any part of
|
| 104 |
+
the Derivative Works; and
|
| 105 |
+
|
| 106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 107 |
+
distribution, then any Derivative Works that You distribute must
|
| 108 |
+
include a readable copy of the attribution notices contained
|
| 109 |
+
within such NOTICE file, excluding those notices that do not
|
| 110 |
+
pertain to any part of the Derivative Works, in at least one
|
| 111 |
+
of the following places: within a NOTICE text file distributed
|
| 112 |
+
as part of the Derivative Works; within the Source form or
|
| 113 |
+
documentation, if provided along with the Derivative Works; or,
|
| 114 |
+
within a display generated by the Derivative Works, if and
|
| 115 |
+
wherever such third-party notices normally appear. The contents
|
| 116 |
+
of the NOTICE file are for informational purposes only and
|
| 117 |
+
do not modify the License. You may add Your own attribution
|
| 118 |
+
notices within Derivative Works that You distribute, alongside
|
| 119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 120 |
+
that such additional attribution notices cannot be construed
|
| 121 |
+
as modifying the License.
|
| 122 |
+
|
| 123 |
+
You may add Your own copyright statement to Your modifications and
|
| 124 |
+
may provide additional or different license terms and conditions
|
| 125 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 126 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 127 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 128 |
+
the conditions stated in this License.
|
| 129 |
+
|
| 130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 132 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 133 |
+
this License, without any additional terms or conditions.
|
| 134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 135 |
+
the terms of any separate license agreement you may have executed
|
| 136 |
+
with Licensor regarding such Contributions.
|
| 137 |
+
|
| 138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 140 |
+
except as required for reasonable and customary use in describing the
|
| 141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 142 |
+
|
| 143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 144 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 147 |
+
implied, including, without limitation, any warranties or conditions
|
| 148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 150 |
+
appropriateness of using or redistributing the Work and assume any
|
| 151 |
+
risks associated with Your exercise of permissions under this License.
|
| 152 |
+
|
| 153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 154 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 155 |
+
unless required by applicable law (such as deliberate and grossly
|
| 156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 157 |
+
liable to You for damages, including any direct, indirect, special,
|
| 158 |
+
incidental, or consequential damages of any character arising as a
|
| 159 |
+
result of this License or out of the use or inability to use the
|
| 160 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 161 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 162 |
+
other commercial damages or losses), even if such Contributor
|
| 163 |
+
has been advised of the possibility of such damages.
|
| 164 |
+
|
| 165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 168 |
+
or other liability obligations and/or rights consistent with this
|
| 169 |
+
License. However, in accepting such obligations, You may act only
|
| 170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 171 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 172 |
+
defend, and hold each Contributor harmless for any liability
|
| 173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 174 |
+
of your accepting any such warranty or additional liability.
|
| 175 |
+
|
| 176 |
+
END OF TERMS AND CONDITIONS
|
| 177 |
+
|
| 178 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 179 |
+
|
| 180 |
+
To apply the Apache License to your work, attach the following
|
| 181 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 182 |
+
replaced with your own identifying information. (Don't include
|
| 183 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 184 |
+
comment syntax for the file format. We also recommend that a
|
| 185 |
+
file or class name and description of purpose be included on the
|
| 186 |
+
same "printed page" as the copyright notice for easier
|
| 187 |
+
identification within third-party archives.
|
| 188 |
+
|
| 189 |
+
Copyright [yyyy] [name of copyright owner]
|
| 190 |
+
|
| 191 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 192 |
+
you may not use this file except in compliance with the License.
|
| 193 |
+
You may obtain a copy of the License at
|
| 194 |
+
|
| 195 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 196 |
+
|
| 197 |
+
Unless required by applicable law or agreed to in writing, software
|
| 198 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 199 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 200 |
+
See the License for the specific language governing permissions and
|
| 201 |
+
limitations under the License.
|
PACKAGING_VERIFICATION.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model": "OpenSML-Base-175M",
|
| 3 |
+
"date": "2026-10-14",
|
| 4 |
+
"platform": "Apple Silicon macOS",
|
| 5 |
+
"runtime": "Python 3.11; stock MLX 0.32.3; NumPy 2.4.2; Tokenizers 0.22.2",
|
| 6 |
+
"weight_sha256": "5151567e266244c9e32fd6e01775192633abe227320269ecdefe28ce43e9ccc3",
|
| 7 |
+
"weight_bytes": 351242342,
|
| 8 |
+
"verified_weight_identity": true,
|
| 9 |
+
"frozen_tokenizer_integrity": true,
|
| 10 |
+
"source_bundle_integrity": true,
|
| 11 |
+
"parameter_count": 175611648,
|
| 12 |
+
"smoke": {
|
| 13 |
+
"command": "python inference.py --prompt \"Plants need sunlight because\" --max-tokens 24 --json",
|
| 14 |
+
"prompt_tokens": 5,
|
| 15 |
+
"output_tokens": 24,
|
| 16 |
+
"stop_reason": "token_limit",
|
| 17 |
+
"completion": " it is the source of energy for all life on Earth.\n\nThe sun is the source of energy for all life",
|
| 18 |
+
"scope": "Packaging smoke only. A plausible but repetitive continuation is not an accuracy measurement.",
|
| 19 |
+
"matches_historical_prefix": true
|
| 20 |
+
},
|
| 21 |
+
"documentation_update": "Native JSON descendant SFT-100 documented; pretrained base weights/tokenizer/runner/source bundle unchanged."
|
| 22 |
+
}
|
PRETRAINING_SAMPLES.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"kind": "qualitative-samples",
|
| 3 |
+
"prompts_sha256": "46dce284e03534aa869a713a4e749349e69d7e0f20f3fc14fb9e7fe9f9c4b94d",
|
| 4 |
+
"results": [
|
| 5 |
+
{
|
| 6 |
+
"completion": " move it to a new building.\n\nThe library was built in the late 19th century, and it was designed by the architect, Jos\u00e9 Mar\u00eda de la Torre. The library was built in the style of the Spanish Renaissance, and it was designed to be a place where people could learn about the history of the",
|
| 7 |
+
"prompt": "The library was closed for repairs, so Maya decided to",
|
| 8 |
+
"status": "generated"
|
| 9 |
+
},
|
| 10 |
+
{
|
| 11 |
+
"completion": " it is the source of energy for all life on Earth.\n\nThe sun is the source of energy for all life on Earth.\n\nThe sun is the source of energy for all life on Earth.\n\nThe sun is the source of energy for all life on Earth.\n\nThe sun is the source",
|
| 12 |
+
"prompt": "Plants need sunlight because",
|
| 13 |
+
"status": "generated"
|
| 14 |
+
},
|
| 15 |
+
{
|
| 16 |
+
"completion": " use it in a sentence.\n\nFor example, if you are learning a new word, you can use it in a sentence:\n\n\"The word 'basketball' is a great game.\"\n\n\"The word 'basketball' is a great game.\"\n\n\"The word 'b",
|
| 17 |
+
"prompt": "A useful way to remember a new word is to",
|
| 18 |
+
"status": "generated"
|
| 19 |
+
},
|
| 20 |
+
{
|
| 21 |
+
"completion": " they were greeted by a group of people who were dressed in white. The train was stopped by a police officer who was wearing a white uniform. The police officer was not wearing a uniform. The train was stopped by a police officer who was wearing a white uniform. The police officer was not wearing a uniform. The",
|
| 22 |
+
"prompt": "The train arrived late because of heavy snow. When the passengers stepped outside,",
|
| 23 |
+
"status": "generated"
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"completion": " it is the most important source of drinking water for the entire population.\n\nThe water supply of the country is very poor. The water supply is not sufficient to meet the demand of the population. The water supply is not sufficient to meet the demand of the population.\n\nThe water supply is not sufficient to meet",
|
| 27 |
+
"prompt": "Clean drinking water is important because",
|
| 28 |
+
"status": "generated"
|
| 29 |
+
},
|
| 30 |
+
{
|
| 31 |
+
"completion": "\n return len(text.split())\n\ndef count_words_with_space(text):\n \"\"\"Return the number of words with spaces.\"\"\"\n \n return len(text.split())\n\ndef count_words_with_spaces(text):\n \"\"\"",
|
| 32 |
+
"prompt": "def count_words(text):\n \"\"\"Return the number of whitespace-separated words.\"\"\"\n ",
|
| 33 |
+
"status": "generated"
|
| 34 |
+
},
|
| 35 |
+
{
|
| 36 |
+
"completion": "\n# In[ ]:\n\n\n# Create a dictionary\nd = {'name': 'John', 'age': 20, 'sex': 'male'}\nprint(d)\n\n\n# In[ ]:\n\n\n# Create a dictionary\nd = {'name': 'John', 'age",
|
| 37 |
+
"prompt": "Explain what a Python dictionary is and give a short example.\n",
|
| 38 |
+
"status": "generated"
|
| 39 |
+
}
|
| 40 |
+
],
|
| 41 |
+
"status": "complete",
|
| 42 |
+
"step": 132005,
|
| 43 |
+
"tokens": 17300111360,
|
| 44 |
+
"weight_sha256": "5151567e266244c9e32fd6e01775192633abe227320269ecdefe28ce43e9ccc3",
|
| 45 |
+
"scope": "Historical qualitative greedy samples; not correctness scores or a runtime-parity test."
|
| 46 |
+
}
|
README.md
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
pipeline_tag: text-generation
|
| 5 |
+
library_name: mlx
|
| 6 |
+
tags:
|
| 7 |
+
- base-model
|
| 8 |
+
- pretrained
|
| 9 |
+
- small-language-model
|
| 10 |
+
- apple-silicon
|
| 11 |
+
- from-scratch
|
| 12 |
+
- research
|
| 13 |
+
datasets:
|
| 14 |
+
- HuggingFaceTB/smollm-corpus
|
| 15 |
+
- HuggingFaceTB/dclm-edu
|
| 16 |
+
- HuggingFaceFW/finewiki
|
| 17 |
+
- Avelina/python-edu-cleaned
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# OpenSML-Base-175M
|
| 21 |
+
|
| 22 |
+
**Author:** William Zebrowski · **175.6M parameters** · **17.30 billion pretraining token positions**
|
| 23 |
+
|
| 24 |
+
[Run locally](RUN_GUIDE.md) · [Technical report](TECHNICAL_REPORT.md) · [Evaluation results](EVALUATION_RESULTS.json) · [Checkpoint provenance](checkpoint_provenance.json)
|
| 25 |
+
|
| 26 |
+
An English pretrained causal language model built from random initialization on
|
| 27 |
+
educational web text, Wikipedia, synthetic educational writing and Python. This
|
| 28 |
+
is the pretrained ancestor of [OpenSML-JSONLite-175M-Instruct](https://huggingface.co/OpenSML/OpenSML-JSONLite-175M).
|
| 29 |
+
It supports text completion and further fine-tuning. Its weights contain Stage A
|
| 30 |
+
pretraining and continuation only, without QA/extraction SFT or a JSON adapter.
|
| 31 |
+
|
| 32 |
+
## Download and complete text
|
| 33 |
+
|
| 34 |
+
The repository includes **`model.safetensors`**, frozen tokenizer, configuration,
|
| 35 |
+
native architecture source and a standalone completion runner. The verified
|
| 36 |
+
runtime is Apple Silicon macOS, Python 3.11 and stock MLX 0.32.3.
|
| 37 |
+
|
| 38 |
+
```bash
|
| 39 |
+
python3 -m venv .venv
|
| 40 |
+
source .venv/bin/activate
|
| 41 |
+
python -m pip install huggingface_hub
|
| 42 |
+
# Authenticate if access requires it: hf auth login
|
| 43 |
+
hf download OpenSML/OpenSML-Base-175M --local-dir ./OpenSML-Base-175M
|
| 44 |
+
cd OpenSML-Base-175M
|
| 45 |
+
python -m pip install -r requirements.txt
|
| 46 |
+
python inference.py --prompt "Plants need sunlight because" --max-tokens 64
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
The runner applies no chat template. It takes a raw prefix and prints its
|
| 50 |
+
continuation. Use `--prompt-file prompt.txt --json` for a UTF-8 prefix and a
|
| 51 |
+
machine-readable generation record. Greedy decoding is the default; optional
|
| 52 |
+
sampling uses `--temperature 0.7 --seed 42`. Prompt plus generation budget must
|
| 53 |
+
fit 2,048 tokens; overlong requests are rejected without silent truncation.
|
| 54 |
+
|
| 55 |
+
This custom architecture uses the supplied native runner, rather than
|
| 56 |
+
`transformers.AutoModel` or `mlx_lm.load`. CUDA, CPU-only, quantized and converted
|
| 57 |
+
exports have not been validated. After downloading artifacts and installing
|
| 58 |
+
dependencies, generation runs offline. The root runner defaults to the adjacent
|
| 59 |
+
weight file and verifies its SHA-256 and source bundle. The source bundle includes
|
| 60 |
+
all native tokenizer integrity companions. See [RUN_GUIDE.md](RUN_GUIDE.md).
|
| 61 |
+
|
| 62 |
+
## Model specification
|
| 63 |
+
|
| 64 |
+
| Setting | Value |
|
| 65 |
+
| --- | --- |
|
| 66 |
+
| Parameters | 175,611,648 |
|
| 67 |
+
| Transformer layers | 24 |
|
| 68 |
+
| Hidden / FFN width | 768 / 2,048 |
|
| 69 |
+
| Attention | GQA: 12 query heads / 4 KV heads; head dimension 64 |
|
| 70 |
+
| Normalization | RMSNorm and Q/K normalization |
|
| 71 |
+
| Position encoding | RoPE, base 10,000 |
|
| 72 |
+
| MLP | SwiGLU |
|
| 73 |
+
| Embeddings | Tied input/output |
|
| 74 |
+
| Linear biases | Disabled |
|
| 75 |
+
| Vocabulary | Frozen 32,000-token byte-level BPE |
|
| 76 |
+
| Context | 2,048 tokens |
|
| 77 |
+
| Published weights | BF16, unquantized safetensors |
|
| 78 |
+
|
| 79 |
+
The earlier OpenSML tokenizer is reused unchanged. OpenSML-150M weights did not
|
| 80 |
+
initialize this model. The native tokenizer's structural IDs are pad 0,
|
| 81 |
+
document-end 1, turn-start 2 and turn-end 3; the base runner uses raw text.
|
| 82 |
+
|
| 83 |
+
## Pretraining
|
| 84 |
+
|
| 85 |
+
The selected checkpoint processed **17,300,111,360 lifetime token positions**.
|
| 86 |
+
The intended sampling mixture was:
|
| 87 |
+
|
| 88 |
+
| Corpus component | Sampling weight |
|
| 89 |
+
| --- | --- |
|
| 90 |
+
| FineWeb-Edu | 50% |
|
| 91 |
+
| DCLM-Edu | 18% |
|
| 92 |
+
| English FineWiki | 13% |
|
| 93 |
+
| Cosmopedia v2 | 9% |
|
| 94 |
+
| Educational Python text mirror | 10% |
|
| 95 |
+
|
| 96 |
+
These are configured token-sampling weights, not unique-document shares. Source
|
| 97 |
+
revisions, score thresholds, filters and split policy are in `corpus.json` and
|
| 98 |
+
the report. Training uses next-token prediction on a five-Mac Apple Silicon
|
| 99 |
+
cluster with Thunderbolt/RDMA. AdamW uses betas (0.9, 0.95), epsilon 1e-8, weight
|
| 100 |
+
decay 0.1 and gradient clipping 1.0, with FP32 master weights and moments.
|
| 101 |
+
|
| 102 |
+
Nominal peak LR was 3e-4; an adaptive plateau controller caps the scheduled rate.
|
| 103 |
+
The effective cap at the selected checkpoint is **3.221225472e-5**, after nine
|
| 104 |
+
controller reductions. Validation occurs at 50M-token boundaries, with patience
|
| 105 |
+
12 evaluations, cooldown 10 and minimum delta 0.002. The original budget and
|
| 106 |
+
continuation target were higher than the selected artifact's 17.30B positions;
|
| 107 |
+
this card does not claim a completed 30B run. See the exact frozen optimizer and
|
| 108 |
+
scheduler record in `checkpoint_metadata.json`.
|
| 109 |
+
|
| 110 |
+
### Training run
|
| 111 |
+
|
| 112 |
+
The 175.6M-parameter base was trained from random initialization using next-token prediction across the educational web, Wikipedia, Cosmopedia and Python mixture. Five Apple Silicon Macs carried out distributed pretraining over Thunderbolt/RDMA. Validation was measured every 50M tokens. The curves show a steep early loss reduction followed by slower improvement; the published base was selected using held-out validation.
|
| 113 |
+
|
| 114 |
+

|
| 115 |
+
|
| 116 |
+
*Training loss and held-out validation during pretraining. Left: raw training loss and exponential moving average. Right: held-out validation loss.*
|
| 117 |
+
|
| 118 |
+
## Recorded evaluation
|
| 119 |
+
|
| 120 |
+
| Metric | Selected base |
|
| 121 |
+
| --- | --- |
|
| 122 |
+
| Fixed document-validation loss | **2.5563359552** |
|
| 123 |
+
| Perplexity | **12.8885** |
|
| 124 |
+
| FineWeb-Edu loss | 2.9417 |
|
| 125 |
+
| DCLM-Edu loss | 2.9943 |
|
| 126 |
+
| FineWiki loss | 1.9878 |
|
| 127 |
+
| Cosmopedia loss | 1.7874 |
|
| 128 |
+
| Python loss | 1.2725 |
|
| 129 |
+
|
| 130 |
+
These are historical document-prediction measurements for this exact artifact.
|
| 131 |
+
The fixed panel has 32 batches per source, batch size 2, five sources and
|
| 132 |
+
2,048-token sequences; aggregate loss follows the training mixture. The exact
|
| 133 |
+
validation fingerprint and source losses are in `EVALUATION_RESULTS.json`.
|
| 134 |
+
|
| 135 |
+
No verified downstream benchmark result for this exact weight hash was found in
|
| 136 |
+
the retained benchmark-results inventory. JSONLite extraction scores and other
|
| 137 |
+
OpenSML checkpoint ARC/IFEval scores are not attributed to this base. Historical
|
| 138 |
+
qualitative samples are in `PRETRAINING_SAMPLES.json`; they show repetition and
|
| 139 |
+
unsupported continuations as well as plausible first completions. They are not
|
| 140 |
+
factual accuracy or instruction-following benchmarks.
|
| 141 |
+
|
| 142 |
+
## Intended use and limitations
|
| 143 |
+
|
| 144 |
+
Use as a research text-completion model or a starting point for adaptation.
|
| 145 |
+
Pretraining does not establish reliable instruction following, conversation,
|
| 146 |
+
structured extraction, code execution correctness or calibrated factuality.
|
| 147 |
+
Outputs can repeat, invent facts and continue unrelated document patterns.
|
| 148 |
+
The small context and parameter budget also limit long-document work. Safety,
|
| 149 |
+
privacy, multilingual transfer and prompt-injection robustness have not been
|
| 150 |
+
comprehensively evaluated.
|
| 151 |
+
|
| 152 |
+
## Identity and reproducibility
|
| 153 |
+
|
| 154 |
+
Published `model.safetensors` has **351,242,342 bytes** and SHA-256:
|
| 155 |
+
|
| 156 |
+
`5151567e266244c9e32fd6e01775192633abe227320269ecdefe28ce43e9ccc3`
|
| 157 |
+
|
| 158 |
+
The repository name identifies the model; exact training counters and metadata
|
| 159 |
+
are kept in provenance. The tokenizer fingerprint is
|
| 160 |
+
`1194292c6d906ac19e6f01c6ad2b42825143fad426a22aa8856d903776701ecb`.
|
| 161 |
+
`SHA256SUMS` checks downloadable artifacts. The inference source bundle contains
|
| 162 |
+
model, kernels and tokenizer assets, without SFT data, optimizer states or cluster
|
| 163 |
+
credentials. Package smoke tests establish runnable native completion, not a
|
| 164 |
+
reproduction of the historical validation panel or a new blind benchmark.
|
| 165 |
+
|
| 166 |
+
## Licensing and attribution
|
| 167 |
+
|
| 168 |
+
Author-controlled source contributions use the included Apache-2.0 license.
|
| 169 |
+
The model-weight license remains unassigned; the source license does not grant
|
| 170 |
+
additional weight rights. YAML therefore omits a model-weight license identifier.
|
| 171 |
+
Training sources retain their own terms. See `THIRD_PARTY_NOTICES.md`,
|
| 172 |
+
`corpus.json`, the report and `CITATION.cff` for notices. Dataset declarations do
|
| 173 |
+
not establish blanket underlying-content redistribution clearance.
|
| 174 |
+
|
| 175 |
+
|
| 176 |
+
## Native JSON descendant update
|
| 177 |
+
|
| 178 |
+
The current [OpenSML-JSONLite-175M-Instruct](https://huggingface.co/OpenSML/OpenSML-JSONLite-175M)
|
| 179 |
+
continues this pretrained ancestor through grounded QA, exact field extraction,
|
| 180 |
+
focused extraction and a final 15,000-record native JSON SFT run (469 updates).
|
| 181 |
+
Its model generates the entire JSON object from source text and a supplied
|
| 182 |
+
schema in one request, without a fieldwise assembler, repair or constrained
|
| 183 |
+
decoding path. Native JSON held-out correctness is 1,191/1,444 (82.48%), with
|
| 184 |
+
91.31% field accuracy and 90.48% extracted-value F1; the 54-case local diagnostic
|
| 185 |
+
scores 42/54. These belong to the post-trained descendant, not this base model.
|
| 186 |
+
Scope, artifacts, source revisions and remaining errors are in the descendant's
|
| 187 |
+
[technical report](https://huggingface.co/OpenSML/OpenSML-JSONLite-175M/blob/main/TECHNICAL_REPORT.md).
|
| 188 |
+
The base weights, base tokenizer, raw-completion runner and base evaluation
|
| 189 |
+
results are unchanged.
|
RUN_GUIDE.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Run OpenSML-Base-175M
|
| 2 |
+
|
| 3 |
+
The package contains BF16 `model.safetensors`, the frozen tokenizer, configuration,
|
| 4 |
+
raw text-completion runner and native architecture/kernel source. The verified
|
| 5 |
+
platform is Apple Silicon macOS with Python 3.11 and stock MLX 0.32.3.
|
| 6 |
+
|
| 7 |
+
```bash
|
| 8 |
+
python3 -m venv .venv
|
| 9 |
+
source .venv/bin/activate
|
| 10 |
+
python -m pip install huggingface_hub
|
| 11 |
+
# Authenticate if access requires it: hf auth login
|
| 12 |
+
hf download OpenSML/OpenSML-Base-175M --local-dir ./OpenSML-Base-175M
|
| 13 |
+
cd OpenSML-Base-175M
|
| 14 |
+
python -m pip install -r requirements.txt
|
| 15 |
+
python inference.py --prompt "Plants need sunlight because" --max-tokens 64
|
| 16 |
+
```
|
| 17 |
+
|
| 18 |
+
For a file prefix and machine-readable output:
|
| 19 |
+
|
| 20 |
+
```bash
|
| 21 |
+
python inference.py --prompt-file prompt.txt --max-tokens 128 --json
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
Default decoding is greedy, temperature 0. Sampling is available via
|
| 25 |
+
`--temperature 0.7 --seed 42`; packaging checks use greedy decoding. Input is a
|
| 26 |
+
raw document prefix. No user/assistant header, chat template, JSON Schema or
|
| 27 |
+
extraction adapter is applied. The output is a continuation, not an instruction-
|
| 28 |
+
tuned assistant response.
|
| 29 |
+
|
| 30 |
+
The runner defaults to the adjacent `model.safetensors`, checks its weight hash,
|
| 31 |
+
verifies/extracts `native_bundle.zip` to a temporary directory and loads the exact
|
| 32 |
+
native model/tokenizer. Generation runs offline after download and dependency
|
| 33 |
+
installation. Prompt plus generation budget must fit 2,048 tokens; overlong
|
| 34 |
+
requests are rejected rather than truncated. Generation stops on document-end,
|
| 35 |
+
a reserved structural token, or the token limit.
|
| 36 |
+
|
| 37 |
+
Use this supplied native runner. `transformers.AutoModel` and `mlx_lm.load` are
|
| 38 |
+
not supported auto-loading paths for this custom architecture. CPU-only, CUDA,
|
| 39 |
+
quantization and framework conversions have not been validated. The root
|
| 40 |
+
`tokenizer.json` and `tokenizer_config.json` mirror the bundle's frozen files;
|
| 41 |
+
the native bundle also includes all tokenizer integrity companions.
|
| 42 |
+
|
| 43 |
+
Verify all package files on macOS:
|
| 44 |
+
|
| 45 |
+
```bash
|
| 46 |
+
shasum -a 256 -c SHA256SUMS
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
The source archive contains `pretraining/sml_v1/model.py`, tokenization/common
|
| 50 |
+
modules and the matching packed SwiGLU/CE kernels. Its full source inventory is
|
| 51 |
+
recorded in `SOURCE_FILES.json`. These can be extracted with
|
| 52 |
+
`python -m zipfile -e native_bundle.zip native_bundle` for inspection or use in a
|
| 53 |
+
custom fine-tuning implementation. This download is an inference package, not a
|
| 54 |
+
one-command reproduction of the distributed pretraining corpus/optimizer state.
|
| 55 |
+
|
| 56 |
+
Base completions can repeat, invent facts or continue with irrelevant document
|
| 57 |
+
text. The recorded document loss does not guarantee correct QA, instruction
|
| 58 |
+
following or extraction. See the model card and report for measured scope.
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
## Native JSON descendant update
|
| 62 |
+
|
| 63 |
+
The current [OpenSML-JSONLite-175M-Instruct](https://huggingface.co/OpenSML/OpenSML-JSONLite-175M)
|
| 64 |
+
continues this pretrained ancestor through grounded QA, exact field extraction,
|
| 65 |
+
focused extraction and a final 15,000-record native JSON SFT run (469 updates).
|
| 66 |
+
Its model generates the entire JSON object from source text and a supplied
|
| 67 |
+
schema in one request, without a fieldwise assembler, repair or constrained
|
| 68 |
+
decoding path. Native JSON held-out correctness is 1,191/1,444 (82.48%), with
|
| 69 |
+
91.31% field accuracy and 90.48% extracted-value F1; the 54-case local diagnostic
|
| 70 |
+
scores 42/54. These belong to the post-trained descendant, not this base model.
|
| 71 |
+
Scope, artifacts, source revisions and remaining errors are in the descendant's
|
| 72 |
+
[technical report](https://huggingface.co/OpenSML/OpenSML-JSONLite-175M/blob/main/TECHNICAL_REPORT.md).
|
| 73 |
+
The base weights, base tokenizer, raw-completion runner and base evaluation
|
| 74 |
+
results are unchanged.
|
SHA256SUMS
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
59ee3f5b0b4e357e34a390a72febcc13eac5493fb4a4c2d7ecdf6ba5be324ff2 CITATION.cff
|
| 2 |
+
9c6d4c439acf90f9187ba6cf11f070afb3ea1515d488b52c381adf9356a1d613 EVALUATION_RESULTS.json
|
| 3 |
+
c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 LICENSE
|
| 4 |
+
bdbb7150a49d2a0303709974aba2a1337077f4f855f6ea21ffa979cf3a3b66a9 PACKAGING_VERIFICATION.json
|
| 5 |
+
14819fc05509546bb8218153cf8494c6a3c4e2e4744ce504bdc21ef0d7d1ed59 PRETRAINING_SAMPLES.json
|
| 6 |
+
aa65acf8e5bd2e23b97e32a7c55ef6145dc60ecb7583908b13842a9e48d4c37c README.md
|
| 7 |
+
023cf9b387b8936ad6cf66fd3a616bd2b20af1e80442b8936a24dc8c50992791 RUN_GUIDE.md
|
| 8 |
+
c3bd058575a0313f716dabb8de8a3d7b729ff413dae5f74b06525c0737dcfac3 SOURCE_FILES.json
|
| 9 |
+
3a7021f7e242496e3121f8e4736ce56c8bd8e62d665d595191faadcb01246080 TECHNICAL_REPORT.md
|
| 10 |
+
3235c99f09bfab6e5ee95e64a382a4975978ec7f8988d33a71d4aaeb0215bf15 THIRD_PARTY_NOTICES.md
|
| 11 |
+
15a0e3b511b97503a611c0da838a7fde1c06ebed34c7103f7cda1782cc6378a4 checkpoint_metadata.json
|
| 12 |
+
22eaa19ba2346558711ff5245b4a1e581a431b7b1c5df3c2342f52407ebbc74a checkpoint_provenance.json
|
| 13 |
+
6092bad50bb78f61bf3f79c26f57c68b8cb9b47644de5290789f11fe0c66ea64 config.json
|
| 14 |
+
d31deb465fd3ba8dcd4590ecf9f01375246784df91217442ae5fcbf0f7ab252b corpus.json
|
| 15 |
+
e478df98a1ac6d0b9d090fdf5d593ad5ad651eaaf67bfff30a1fb313c926d321 inference.py
|
| 16 |
+
5151567e266244c9e32fd6e01775192633abe227320269ecdefe28ce43e9ccc3 model.safetensors
|
| 17 |
+
14f85f0ff677d35a6fb34f118f2dd21a3fdd504fff27c163860ab919b21e0e98 native_bundle.zip
|
| 18 |
+
641fe860d6fd24547fe4d15bd852190f00ddec31bd74eb7ca9eeae74031c2f0c pretraining-training-loss.png
|
| 19 |
+
cfeac63c4d14d73a7b247bf9e39fd0b4642754aa4b69e7ea6cf94e79a594e3d8 requirements.txt
|
| 20 |
+
e095f0413a11fa91fbb58f37d00e4c6bcda59beb89b28f6f680db1436a7e8891 tokenizer.json
|
| 21 |
+
619f500553367eb76f5be00a98625130ec857b9c367561334984096c029ba2a9 tokenizer_config.json
|
| 22 |
+
1194292c6d906ac19e6f01c6ad2b42825143fad426a22aa8856d903776701ecb tokenizer_manifest.json
|
SOURCE_FILES.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"native_bundle_sha256": "14f85f0ff677d35a6fb34f118f2dd21a3fdd504fff27c163860ab919b21e0e98",
|
| 3 |
+
"files": {
|
| 4 |
+
"pretraining/sml_v1/__init__.py": {
|
| 5 |
+
"bytes": 67,
|
| 6 |
+
"sha256": "7e9e02294e03e6b8a12fd202ab288f2f9b0073bb11b8cb2a5fa82211b0d1dfa4"
|
| 7 |
+
},
|
| 8 |
+
"pretraining/sml_v1/common.py": {
|
| 9 |
+
"bytes": 2553,
|
| 10 |
+
"sha256": "ec4dda551cbe45cbd30d64c7c82379a8849ce02a3ad1a597a293844b5dc86351"
|
| 11 |
+
},
|
| 12 |
+
"pretraining/sml_v1/tokenization.py": {
|
| 13 |
+
"bytes": 2797,
|
| 14 |
+
"sha256": "254e1f5d60cc4498a9f1209955752db28b91839f48d3121d674f3f5ac42e52e5"
|
| 15 |
+
},
|
| 16 |
+
"pretraining/sml_v1/model.py": {
|
| 17 |
+
"bytes": 10552,
|
| 18 |
+
"sha256": "1eee6f8afe78767ff6b9c604ccf2328c98b24bc94dbad6291a0ad699dd7345fe"
|
| 19 |
+
},
|
| 20 |
+
"pretraining/sml_v1/fast_swiglu.py": {
|
| 21 |
+
"bytes": 2328,
|
| 22 |
+
"sha256": "59d1adb31400e3c288914b4c0cc8a21681a73ca3dfa7c722ea4e13d21dc38528"
|
| 23 |
+
},
|
| 24 |
+
"pretraining/sml_v1/fast_loss.py": {
|
| 25 |
+
"bytes": 3705,
|
| 26 |
+
"sha256": "f99edeedb6cb328ef728d05643f65ea20371437f7e5806009ae3ad0885bafbf1"
|
| 27 |
+
},
|
| 28 |
+
"tokenizer/corpus.json": {
|
| 29 |
+
"bytes": 1549,
|
| 30 |
+
"sha256": "e4c47b7b6aba08f948de7c2c7cb94c58dbd09dde2ded6ac185c60856ee686d27"
|
| 31 |
+
},
|
| 32 |
+
"tokenizer/manifest.json": {
|
| 33 |
+
"bytes": 988,
|
| 34 |
+
"sha256": "1194292c6d906ac19e6f01c6ad2b42825143fad426a22aa8856d903776701ecb"
|
| 35 |
+
},
|
| 36 |
+
"tokenizer/report.json": {
|
| 37 |
+
"bytes": 889,
|
| 38 |
+
"sha256": "e871f690eabebf82da173f0e406f38b79a10cd7d2647bb3592c3fc35ae9a2f16"
|
| 39 |
+
},
|
| 40 |
+
"tokenizer/tokenizer.json": {
|
| 41 |
+
"bytes": 2288703,
|
| 42 |
+
"sha256": "e095f0413a11fa91fbb58f37d00e4c6bcda59beb89b28f6f680db1436a7e8891"
|
| 43 |
+
},
|
| 44 |
+
"tokenizer/tokenizer_config.json": {
|
| 45 |
+
"bytes": 200,
|
| 46 |
+
"sha256": "619f500553367eb76f5be00a98625130ec857b9c367561334984096c029ba2a9"
|
| 47 |
+
}
|
| 48 |
+
}
|
| 49 |
+
}
|
TECHNICAL_REPORT.md
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# OpenSML-Base-175M: pretraining technical report
|
| 2 |
+
|
| 3 |
+
**Author:** William Zebrowski · **Parameters:** 175,611,648 · **Processed token positions:** 17,300,111,360
|
| 4 |
+
|
| 5 |
+
This report describes the pretrained ancestor of OpenSML-JSONLite-175M. Its
|
| 6 |
+
weight hash is `5151567e266244c9e32fd6e01775192633abe227320269ecdefe28ce43e9ccc3`. It was trained from random initialization on the
|
| 7 |
+
Stage A corpus and continuation. No post-training stage is included in these
|
| 8 |
+
weights. Frozen checkpoint metadata is in `checkpoint_metadata.json`;
|
| 9 |
+
`checkpoint_provenance.json` pins the selected artifact.
|
| 10 |
+
|
| 11 |
+
## Architecture
|
| 12 |
+
|
| 13 |
+
The architecture has 24 transformer layers, hidden width 768, 12 query heads,
|
| 14 |
+
4 KV heads (head dimension 64), RMSNorm, Q/K normalization, RoPE base 10,000,
|
| 15 |
+
a SwiGLU FFN with width 2,048, tied embeddings, a 32,000-token vocabulary and a
|
| 16 |
+
2,048-token context. Linear layers have no biases. Compute weights are BF16;
|
| 17 |
+
pretraining used FP32 master weights/moments/gradient accumulation. The exact
|
| 18 |
+
native model and kernels are included in `native_bundle.zip` and the model
|
| 19 |
+
configuration is `config.json`.
|
| 20 |
+
|
| 21 |
+
## 4. Tokenizer and serialization
|
| 22 |
+
|
| 23 |
+
The model uses the project's frozen 32K byte-level BPE tokenizer at `reference/opensml-150m/tokenizer/bytebpe32k_v1`. The selected base reuses that tokenizer unchanged. Its own manifest has format `sml-v2-tokenizer-v1`; the format name is not a model-weight lineage claim.
|
| 24 |
+
|
| 25 |
+
| Tokenizer artifact | SHA-256 |
|
| 26 |
+
| --- | --- |
|
| 27 |
+
| Tokenizer manifest / contract fingerprint | 1194292c6d906ac19e6f01c6ad2b42825143fad426a22aa8856d903776701ecb |
|
| 28 |
+
| tokenizer.json | e095f0413a11fa91fbb58f37d00e4c6bcda59beb89b28f6f680db1436a7e8891 |
|
| 29 |
+
| tokenizer_config.json | 619f500553367eb76f5be00a98625130ec857b9c367561334984096c029ba2a9 |
|
| 30 |
+
| tokenizer corpus.json | e4c47b7b6aba08f948de7c2c7cb94c58dbd09dde2ded6ac185c60856ee686d27 |
|
| 31 |
+
|
| 32 |
+
Structural token IDs:
|
| 33 |
+
|
| 34 |
+
| ID | Token | Meaning |
|
| 35 |
+
| --- | --- | --- |
|
| 36 |
+
| 0 | `<\|pad\|>` | Padding |
|
| 37 |
+
| 1 | `<\|doc_end\|>` | Document/end-of-sequence marker |
|
| 38 |
+
| 2 | `<\|turn_start\|>` | Role/turn header |
|
| 39 |
+
| 3 | `<\|turn_end\|>` | End of a conversational-format turn |
|
| 40 |
+
|
| 41 |
+
The base completion runner uses a raw text prefix and ends on document-end or a reserved structural token. It does not construct chat turns. The reserved role/turn IDs exist in the tokenizer but do not imply instruction tuning in the base model.
|
| 42 |
+
|
| 43 |
+
Ordinary text must round-trip through the tokenizer and cannot emit reserved structural IDs. Special-token-looking content can be rejected by the tokenizer; the API does not promise unrestricted literal handling of all structural strings. Prompt/output limits are checked without truncating source text.
|
| 44 |
+
|
| 45 |
+
## 5. Pretraining corpus and curation
|
| 46 |
+
|
| 47 |
+
The selected base is the best retained checkpoint at update 132005 after **17,300,111,360 processed token positions**. The original budget was 20B; a continuation was configured toward 30B, but this inherited checkpoint is not a completed 20B or 30B artifact.
|
| 48 |
+
|
| 49 |
+
Source weights below are intended processed-token sampling weights, not measured unique-document shares. No claim of 17.3B globally unique corpus tokens is made.
|
| 50 |
+
|
| 51 |
+
| Source | Sampling weight (%) | Repository / configuration | Pinned revision | Additional selection |
|
| 52 |
+
| --- | --- | --- | --- | --- |
|
| 53 |
+
| FineWeb-Edu | 50 | HuggingFaceTB/smollm-corpus / fineweb-edu-dedup | 3ba9d605774198c5868892d7a8deda78031a781f | Deduplicated educational subset |
|
| 54 |
+
| DCLM-Edu | 18 | HuggingFaceTB/dclm-edu | dbad8ad71224482740cd9c9d353591adbf62fe04 | edu_int_score≥3 |
|
| 55 |
+
| FineWiki English | 13 | HuggingFaceFW/finewiki / en | 8bd13e72e6a002407649b3e898535f42ceb1aeb9 | English |
|
| 56 |
+
| Cosmopedia v2 | 9 | HuggingFaceTB/smollm-corpus / cosmopedia-v2 | 3ba9d605774198c5868892d7a8deda78031a781f | Format contains textbook/tutorial/blog/educational |
|
| 57 |
+
| Python text mirror | 10 | Avelina/python-edu-cleaned / default | 3fedf55e02e72dd1fd68963f991f5e91adcb0f8d | int_score≥4 |
|
| 58 |
+
|
| 59 |
+
Public source cards: [SmolLM corpus](https://huggingface.co/datasets/HuggingFaceTB/smollm-corpus/blob/3ba9d605774198c5868892d7a8deda78031a781f/README.md), [DCLM-Edu](https://huggingface.co/datasets/HuggingFaceTB/dclm-edu/blob/dbad8ad71224482740cd9c9d353591adbf62fe04/README.md), [FineWiki](https://huggingface.co/datasets/HuggingFaceFW/finewiki/blob/8bd13e72e6a002407649b3e898535f42ceb1aeb9/README.md). The Python-Edu upstream subset identifies files; this run used the configured text mirror. The mirror's pinned README could not be retrieved during report preparation, so its provenance statement here comes from the local corpus specification, not a newly completed external audit.
|
| 60 |
+
|
| 61 |
+
The exact corpus specification is [`corpus.json`](corpus.json). Training preserves source text and code indentation. NFC/whitespace normalization is used for identity hashing and partitioning, not to rewrite model input.
|
| 62 |
+
|
| 63 |
+
The content-split policy hashes identity into 10,000 buckets: 97% training, 1% validation, 1% final and 1% tokenizer development. Identity checks do not establish that a supervised benchmark article never appeared elsewhere in pretraining web data.
|
| 64 |
+
|
| 65 |
+
Recorded stream settings are a 256-document accepted-document shuffle buffer, bounded 100,000-document deduplication window, 4 prefetched batches and up to 5 retry attempts. The corpus JSON's generic 10,000 shuffle value is not the active stream override. Filtering rejects documents below 200 characters, above 200,000 UTF-8 bytes, with null characters, excess replacement characters or an excessive repeated-line pattern. Source exhaustion fails rather than silently recycling. Deduplication is bounded; it is not global semantic or fuzzy deduplication.
|
| 66 |
+
|
| 67 |
+
## 6. Pretraining execution, optimization and validation
|
| 68 |
+
|
| 69 |
+
Pretraining runs on the recorded five-Mac Apple Silicon cluster. Mac1's current local hardware was independently checked during report preparation as an Apple M5 Ultra with 96 GB unified memory. Other worker descriptions below are historical cluster records, not newly queried hardware inventories.
|
| 70 |
+
|
| 71 |
+
| Mac | Recorded chip | RAM | Microbatch | MLX cache cap |
|
| 72 |
+
| --- | --- | --- | --- | --- |
|
| 73 |
+
| 1 | M5 Ultra | 96 GB | 7 | 16 GiB |
|
| 74 |
+
| 2 | M3 Ultra | 96 GB | 3 | 16 GiB |
|
| 75 |
+
| 3 | M4 Max | 36 GB | 2 | 4 GiB |
|
| 76 |
+
| 4 | M4 Max | 36 GB | 2 | 4 GiB |
|
| 77 |
+
| 5 | M4 Max | 36 GB | 2 | 4 GiB |
|
| 78 |
+
|
| 79 |
+
The physical ring is 1→2→3→5→4→1. Four accumulation microsteps and 2,048-token sequences produce `(7+3+2+2+2)×4×2048=131072` positions/update. Unequal-rank gradients are weighted by token counts. Early batch transitions mean the lifetime token count is not simply `132005×131072`.
|
| 80 |
+
|
| 81 |
+
- First 125 updates: microbatches [4, 4, 2, 2, 2], 114,688 positions/update, 14,336,000 tokens.
|
| 82 |
+
- From 125: microbatches [6, 4, 2, 2, 2], 131,072 positions/update.
|
| 83 |
+
- From 963 / 124,174,336 tokens: [7, 3, 2, 2, 2], same global batch; per-Mac cache caps recorded.
|
| 84 |
+
- Stage A continuation starts from 113313 / 14,850,113,536 tokens, retaining weights, FP32 optimizer state, source cursors, counters and controller history.
|
| 85 |
+
- Selected base: 132005 / 17,300,111,360 tokens.
|
| 86 |
+
|
| 87 |
+
Ethernet supports SSH orchestration; the training ring uses verified Thunderbolt/RDMA links. Sequential microbatch materialization, FP32 gradient accumulation and custom Metal paths were used.
|
| 88 |
+
|
| 89 |
+
| Pretraining optimizer/schedule | Recorded setting |
|
| 90 |
+
| --- | --- |
|
| 91 |
+
| Optimizer | AdamW |
|
| 92 |
+
| Nominal peak LR | 3e-4 |
|
| 93 |
+
| Original warmup | 200M tokens, 1% of the 20B budget |
|
| 94 |
+
| Base schedule | Warmup/stable interval/cosine; continuation stretches nominal decay to 24B–30B |
|
| 95 |
+
| Adaptive controller | Factor 0.8; patience 12 evaluations; cooldown 10; minimum delta 0.002 |
|
| 96 |
+
| Controller LR floor | 3e-5 |
|
| 97 |
+
| Effective cap at selected 132005 | 3.221225472e-5 |
|
| 98 |
+
| Recorded controller reductions / evaluations | 9 / 242 |
|
| 99 |
+
| Betas | (0.9,0.95) |
|
| 100 |
+
| Epsilon | 1e-8 |
|
| 101 |
+
| Weight decay | 0.1 |
|
| 102 |
+
| Gradient clipping | 1.0 |
|
| 103 |
+
| Seed | 7337 |
|
| 104 |
+
| Loss | Next-token cross entropy; FP32 reductions |
|
| 105 |
+
|
| 106 |
+
The nominal 3e-4 schedule is not the effective late-run learning rate: the retained controller cap bounds it. The record does not justify a claim that the run trained at 3e-4 for all 17.3B positions.
|
| 107 |
+
|
| 108 |
+
Validation and qualitative samples occur at 50M-token boundaries. The fixed validation panel has 32 batches/source, batch 2, five sources, context 2,048: nominally 655,360 positions/event. Aggregate loss is source-mixture weighted. Validation fingerprint: `4ddd461c131d4d27d07bb07f5aab3fcb5a00d4b1202066e3d9b6ee6b3129087b`. Selected-base validation loss is **2.5563359551876785**, perplexity **12.8885**. This measures document prediction, not extraction or chat reliability.
|
| 109 |
+
|
| 110 |
+
Regular saves occur every 100M tokens, plus best-validation and clean-stop saves. Exact checkpoint metadata is authoritative. The initial October 2 technical report's early observations, 20B target and old schedule describe history; they are superseded here for this selected artifact. Contemporary qualitative logs often showed roughly 41k tokens/s, but no reproducible end-to-end cluster performance/energy benchmark is established by this report. The separate 42.7k profiling candidate is not claimed as the configuration that trained this checkpoint.
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
### Training run
|
| 114 |
+
|
| 115 |
+
The 175.6M-parameter base was trained from random initialization using next-token prediction across the educational web, Wikipedia, Cosmopedia and Python mixture. Five Apple Silicon Macs carried out distributed pretraining over Thunderbolt/RDMA. Validation was measured every 50M tokens. The curves show a steep early loss reduction followed by slower improvement; the published base was selected using held-out validation.
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
|
| 119 |
+
*Training loss and held-out validation during pretraining. Left: raw training loss and exponential moving average. Right: held-out validation loss.*
|
| 120 |
+
|
| 121 |
+
## Evaluation and interpretation
|
| 122 |
+
|
| 123 |
+
`EVALUATION_RESULTS.json` gives the exact selected-base loss, source losses and
|
| 124 |
+
validation identity. There is no verified full downstream benchmark result for
|
| 125 |
+
this exact weight hash in the retained benchmark-results inventory. No older
|
| 126 |
+
OpenSML-150M or post-trained descendant benchmark score is attributed here.
|
| 127 |
+
Historical qualitative generations are in `PRETRAINING_SAMPLES.json`. They show
|
| 128 |
+
both plausible first completions and repeated or unsupported continuations;
|
| 129 |
+
they are not accuracy measurements.
|
| 130 |
+
|
| 131 |
+
## Standalone package and verification
|
| 132 |
+
|
| 133 |
+
The downloadable `model.safetensors` is byte-identical to the preserved selected
|
| 134 |
+
pretrained artifact, with 351,242,342 bytes. The native runtime bundle contains
|
| 135 |
+
only model/kernel/tokenizer code and tokenizer assets; it contains no SFT data,
|
| 136 |
+
JSON adapter, optimizer or source cursor state. The root runner is tested with
|
| 137 |
+
a raw text prefix in stock MLX. Packaging verification is distinct from a
|
| 138 |
+
reproduction of the historical validation run or a new benchmark.
|
| 139 |
+
|
| 140 |
+
## Use and limitations
|
| 141 |
+
|
| 142 |
+
This model supports raw text completion and further adaptation. Instruction
|
| 143 |
+
following, conversation, text-to-JSON extraction, multilingual reliability,
|
| 144 |
+
prompt-injection robustness and general safety are not established by these
|
| 145 |
+
pretraining results. BF16 native MLX on Apple Silicon is the verified packaging
|
| 146 |
+
platform. No framework-conversion, quantized or CPU/CUDA parity claim is made.
|
| 147 |
+
|
| 148 |
+
The source code uses Apache-2.0. The model-weight license remains unassigned in
|
| 149 |
+
this prepared repository. Dataset licenses apply separately; see
|
| 150 |
+
`THIRD_PARTY_NOTICES.md`. The report does not establish blanket commercial or
|
| 151 |
+
underlying-source redistribution clearance.
|
| 152 |
+
|
| 153 |
+
|
| 154 |
+
## Native JSON descendant update
|
| 155 |
+
|
| 156 |
+
The current [OpenSML-JSONLite-175M-Instruct](https://huggingface.co/OpenSML/OpenSML-JSONLite-175M)
|
| 157 |
+
continues this pretrained ancestor through grounded QA, exact field extraction,
|
| 158 |
+
focused extraction and a final 15,000-record native JSON SFT run (469 updates).
|
| 159 |
+
Its model generates the entire JSON object from source text and a supplied
|
| 160 |
+
schema in one request, without a fieldwise assembler, repair or constrained
|
| 161 |
+
decoding path. Native JSON held-out correctness is 1,191/1,444 (82.48%), with
|
| 162 |
+
91.31% field accuracy and 90.48% extracted-value F1; the 54-case local diagnostic
|
| 163 |
+
scores 42/54. These belong to the post-trained descendant, not this base model.
|
| 164 |
+
Scope, artifacts, source revisions and remaining errors are in the descendant's
|
| 165 |
+
[technical report](https://huggingface.co/OpenSML/OpenSML-JSONLite-175M/blob/main/TECHNICAL_REPORT.md).
|
| 166 |
+
The base weights, base tokenizer, raw-completion runner and base evaluation
|
| 167 |
+
results are unchanged.
|
THIRD_PARTY_NOTICES.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Source and dataset notices
|
| 2 |
+
|
| 3 |
+
Author-controlled source contributions use the included Apache-2.0 license.
|
| 4 |
+
The model-weight license remains unassigned; this source license does not make
|
| 5 |
+
an additional weight-license grant. Installed dependencies retain their own
|
| 6 |
+
terms: MLX (MIT), NumPy (BSD-3-Clause), Tokenizers (Apache-2.0).
|
| 7 |
+
|
| 8 |
+
Pretraining corpus declarations, revisions and filters are in `corpus.json`:
|
| 9 |
+
|
| 10 |
+
| Source | Recorded source declaration |
|
| 11 |
+
| --- | --- |
|
| 12 |
+
| FineWeb-Edu through SmolLM corpus | ODC-BY; underlying content notices retained |
|
| 13 |
+
| DCLM-Edu | CC-BY-4.0 |
|
| 14 |
+
| English FineWiki | CC-BY-SA-4.0 / GFDL |
|
| 15 |
+
| Cosmopedia v2 through SmolLM corpus | ODC-BY; synthetic-data provenance retained |
|
| 16 |
+
| Python text mirror | Mirror metadata ODC-BY; original code remains subject to upstream repository licenses and The Stack v2 terms |
|
| 17 |
+
|
| 18 |
+
The pinned Python mirror card was unavailable during the preceding report audit;
|
| 19 |
+
its declaration is taken from the recorded local corpus specification, not a
|
| 20 |
+
newly completed audit of underlying content. Dataset declarations are not
|
| 21 |
+
blanket redistribution permission for all contained source documents or model
|
| 22 |
+
weights. This package redistributes no raw pretraining documents. It includes
|
| 23 |
+
own qualitative prompts/generations and aggregate historical validation results.
|
| 24 |
+
No SQuAD, Dolly or SNIPS SFT is included in this base checkpoint.
|
checkpoint_metadata.json
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"best_val_loss": 2.5563359551876785,
|
| 3 |
+
"ema": 2.4005908938776055,
|
| 4 |
+
"initialization": "normal-0.02-residual-scaled-v1",
|
| 5 |
+
"lr_scheduler": {
|
| 6 |
+
"bad_evals": 0,
|
| 7 |
+
"best": 2.5563359551876785,
|
| 8 |
+
"cap": 3.221225472000002e-05,
|
| 9 |
+
"config_fingerprint": "4f636b3a8d4804bd7b10b26b34967c380d566268898be845bf324f8df4e1459f",
|
| 10 |
+
"cooldown_remaining": 0,
|
| 11 |
+
"evaluations": 242,
|
| 12 |
+
"format": "sml-v2-plateau-v1",
|
| 13 |
+
"last_loss": 2.5563359551876785,
|
| 14 |
+
"last_step": 132005,
|
| 15 |
+
"last_tokens": 17300111360,
|
| 16 |
+
"reductions": 9
|
| 17 |
+
},
|
| 18 |
+
"recipe": {
|
| 19 |
+
"batch_rebalance_transition": {
|
| 20 |
+
"format": "sml-research-batch-rebalance-v1",
|
| 21 |
+
"parent_batches": [
|
| 22 |
+
6,
|
| 23 |
+
4,
|
| 24 |
+
2,
|
| 25 |
+
2,
|
| 26 |
+
2
|
| 27 |
+
],
|
| 28 |
+
"parent_contract": {
|
| 29 |
+
"code": "2c7e9a69271f9817017c2371ae5e874c9229da489b6c0128aadda943c109201d",
|
| 30 |
+
"data": "114cafddb71ce092c8ede1cdddcefe033f30bbab1c093b8593a9e23e36014a76",
|
| 31 |
+
"recipe": "bb8108e126d9752d656ad7f58d9b81db869e0a624341de57e8e02cbbaaf226ce",
|
| 32 |
+
"tokenizer": "1194292c6d906ac19e6f01c6ad2b42825143fad426a22aa8856d903776701ecb"
|
| 33 |
+
},
|
| 34 |
+
"parent_replica_hash": "678b8e8364d8ce87951628aa4ad68022f378c1c5c122f2e7ef7a8e5c7731dca7",
|
| 35 |
+
"parent_step": 963,
|
| 36 |
+
"start_tokens": 124174336
|
| 37 |
+
},
|
| 38 |
+
"batch_transition": {
|
| 39 |
+
"format": "sml-research-batch-transition-v1",
|
| 40 |
+
"parent_batches": [
|
| 41 |
+
4,
|
| 42 |
+
4,
|
| 43 |
+
2,
|
| 44 |
+
2,
|
| 45 |
+
2
|
| 46 |
+
],
|
| 47 |
+
"parent_contract": {
|
| 48 |
+
"code": "58f75d5d92576c268370e8f3dbb59f7cbc5ef58bcd1cf247a7cf6008c47e7e3c",
|
| 49 |
+
"data": "114cafddb71ce092c8ede1cdddcefe033f30bbab1c093b8593a9e23e36014a76",
|
| 50 |
+
"recipe": "0a2de034cbafd3bbc101d6ac151602d2ea4889b51deaf9bf9fc49e2c827a93da",
|
| 51 |
+
"tokenizer": "1194292c6d906ac19e6f01c6ad2b42825143fad426a22aa8856d903776701ecb"
|
| 52 |
+
},
|
| 53 |
+
"parent_replica_hash": "6a63305e36520f376da3db369a11350c959485ed673f410c017bd6a79190ce5f",
|
| 54 |
+
"parent_step": 125,
|
| 55 |
+
"start_tokens": 14336000
|
| 56 |
+
},
|
| 57 |
+
"batches": [
|
| 58 |
+
7,
|
| 59 |
+
3,
|
| 60 |
+
2,
|
| 61 |
+
2,
|
| 62 |
+
2
|
| 63 |
+
],
|
| 64 |
+
"betas": [
|
| 65 |
+
0.9,
|
| 66 |
+
0.95
|
| 67 |
+
],
|
| 68 |
+
"cache_gib_by_mac": [
|
| 69 |
+
16,
|
| 70 |
+
16,
|
| 71 |
+
4,
|
| 72 |
+
4,
|
| 73 |
+
4
|
| 74 |
+
],
|
| 75 |
+
"continuation": {
|
| 76 |
+
"format": "sml-v2-continuation-v1",
|
| 77 |
+
"parent_contract": {
|
| 78 |
+
"code": "db42e945868bbf75a15d49a3fd95692493d1e1262b465834779ce40ee9f0e59a",
|
| 79 |
+
"data": "114cafddb71ce092c8ede1cdddcefe033f30bbab1c093b8593a9e23e36014a76",
|
| 80 |
+
"recipe": "e530ae78f2a7d2e70c3c55b0507ce74842d936825eedd27583802cf365a2a793",
|
| 81 |
+
"tokenizer": "1194292c6d906ac19e6f01c6ad2b42825143fad426a22aa8856d903776701ecb"
|
| 82 |
+
},
|
| 83 |
+
"parent_replica_hash": "a7a6b1a5986e0b752e502b73a212a01a7c02c36d0d16b889a1ba255267eed819",
|
| 84 |
+
"parent_step": 113313,
|
| 85 |
+
"rewarm_tokens": 50000000,
|
| 86 |
+
"start_lr": 0.0003,
|
| 87 |
+
"start_tokens": 14850113536
|
| 88 |
+
},
|
| 89 |
+
"data_mode": "hf_stream",
|
| 90 |
+
"decay_start_fraction": 0.8,
|
| 91 |
+
"eps": 1e-08,
|
| 92 |
+
"eval_batch_size": 2,
|
| 93 |
+
"eval_batches_per_source": 32,
|
| 94 |
+
"eval_every_tokens": 50000000,
|
| 95 |
+
"grad_accum": 4,
|
| 96 |
+
"grad_clip": 1.0,
|
| 97 |
+
"keep_checkpoints": 3,
|
| 98 |
+
"log_every": 10,
|
| 99 |
+
"min_lr_ratio": 0.1,
|
| 100 |
+
"model": {
|
| 101 |
+
"attention_impl": "fast",
|
| 102 |
+
"bias": false,
|
| 103 |
+
"ce_impl": "metal",
|
| 104 |
+
"d_model": 768,
|
| 105 |
+
"ffn_impl": "packed-metal",
|
| 106 |
+
"loss_dtype": "float32",
|
| 107 |
+
"max_seq_len": 2048,
|
| 108 |
+
"mlp_multiple_of": 256,
|
| 109 |
+
"mlp_ratio": 4.0,
|
| 110 |
+
"n_heads": 12,
|
| 111 |
+
"n_kv_heads": 4,
|
| 112 |
+
"n_layers": 24,
|
| 113 |
+
"qk_norm": true,
|
| 114 |
+
"vocab_size": 32000
|
| 115 |
+
},
|
| 116 |
+
"name": "research-20b-python-176m-continued-to-30000000000",
|
| 117 |
+
"peak_lr": 0.0003,
|
| 118 |
+
"plateau_scheduler": {
|
| 119 |
+
"cooldown": 10,
|
| 120 |
+
"factor": 0.8,
|
| 121 |
+
"format": "sml-v2-plateau-v1",
|
| 122 |
+
"initial_lr": 0.00024,
|
| 123 |
+
"min_delta": 0.002,
|
| 124 |
+
"min_lr": 3e-05,
|
| 125 |
+
"patience": 12
|
| 126 |
+
},
|
| 127 |
+
"playground_publish_best": true,
|
| 128 |
+
"reserve_gib": 16,
|
| 129 |
+
"sample_every_tokens": 50000000,
|
| 130 |
+
"sample_prompts_file": "sample_prompts.json",
|
| 131 |
+
"save_every_tokens": 100000000,
|
| 132 |
+
"scheduler_transition": {
|
| 133 |
+
"baseline_best": 2.801170878969133,
|
| 134 |
+
"format": "sml-v2-scheduler-transition-v1",
|
| 135 |
+
"parent_contract": {
|
| 136 |
+
"code": "db42e945868bbf75a15d49a3fd95692493d1e1262b465834779ce40ee9f0e59a",
|
| 137 |
+
"data": "114cafddb71ce092c8ede1cdddcefe033f30bbab1c093b8593a9e23e36014a76",
|
| 138 |
+
"recipe": "970e96ed6919947a45d3135a5210496650e7e0f177afe311064ca0532fc9ab0e",
|
| 139 |
+
"tokenizer": "1194292c6d906ac19e6f01c6ad2b42825143fad426a22aa8856d903776701ecb"
|
| 140 |
+
},
|
| 141 |
+
"parent_replica_hash": "e7d76ee273de9c808e90454e4f2cc31228594ca68e4619b675ba0b4e6a451861",
|
| 142 |
+
"parent_step": 39896,
|
| 143 |
+
"start_tokens": 5227200512
|
| 144 |
+
},
|
| 145 |
+
"seed": 7337,
|
| 146 |
+
"stream": {
|
| 147 |
+
"dedup_window": 100000,
|
| 148 |
+
"prefetch_batches": 4,
|
| 149 |
+
"read_attempts": 5,
|
| 150 |
+
"shuffle_buffer": 256,
|
| 151 |
+
"tokenizer_corpus_policy": "reuse-frozen"
|
| 152 |
+
},
|
| 153 |
+
"target_tokens": 30000000000,
|
| 154 |
+
"warmup_fraction": 0.01,
|
| 155 |
+
"weight_decay": 0.1
|
| 156 |
+
},
|
| 157 |
+
"replica_hash": "c5b173e6cd9f07144528d9900608275c00be13c1ae0eb543503c05a6db40e8a5",
|
| 158 |
+
"step": 132005,
|
| 159 |
+
"tokens": 17300111360,
|
| 160 |
+
"v2_contract": {
|
| 161 |
+
"code": "6e444060dba8c63ba33e128a43da03df6d927d289318ec51a2c0026fb494ab9f",
|
| 162 |
+
"data": "114cafddb71ce092c8ede1cdddcefe033f30bbab1c093b8593a9e23e36014a76",
|
| 163 |
+
"recipe": "79ca696d2052326b32a71c4fc82729916312a9f97e61c358f5532131a9575d76",
|
| 164 |
+
"tokenizer": "1194292c6d906ac19e6f01c6ad2b42825143fad426a22aa8856d903776701ecb"
|
| 165 |
+
},
|
| 166 |
+
"validation_fingerprint": "4ddd461c131d4d27d07bb07f5aab3fcb5a00d4b1202066e3d9b6ee6b3129087b"
|
| 167 |
+
}
|
checkpoint_provenance.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model": "OpenSML-Base-175M",
|
| 3 |
+
"stage": "Stage A pretraining continuation",
|
| 4 |
+
"step": 132005,
|
| 5 |
+
"tokens": 17300111360,
|
| 6 |
+
"model_file": "model.safetensors",
|
| 7 |
+
"weight_bytes": 351242342,
|
| 8 |
+
"weight_sha256": "5151567e266244c9e32fd6e01775192633abe227320269ecdefe28ce43e9ccc3",
|
| 9 |
+
"original_checkpoint_metadata_sha256": "15a0e3b511b97503a611c0da838a7fde1c06ebed34c7103f7cda1782cc6378a4",
|
| 10 |
+
"tokenizer_fingerprint": "1194292c6d906ac19e6f01c6ad2b42825143fad426a22aa8856d903776701ecb",
|
| 11 |
+
"initialization": "normal-0.02-residual-scaled-v1",
|
| 12 |
+
"post_training": false,
|
| 13 |
+
"descendant": "OpenSML/OpenSML-JSONLite-175M",
|
| 14 |
+
"model_weight_license": "not yet assigned",
|
| 15 |
+
"scope": "The pretrained ancestor; no QA/extraction SFT or JSON adapter is part of these weights."
|
| 16 |
+
}
|
config.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_name": "OpenSML-Base-175M",
|
| 3 |
+
"parameters": 175611648,
|
| 4 |
+
"model": {
|
| 5 |
+
"attention_impl": "fast",
|
| 6 |
+
"bias": false,
|
| 7 |
+
"ce_impl": "metal",
|
| 8 |
+
"d_model": 768,
|
| 9 |
+
"ffn_impl": "packed-metal",
|
| 10 |
+
"loss_dtype": "float32",
|
| 11 |
+
"max_seq_len": 2048,
|
| 12 |
+
"mlp_multiple_of": 256,
|
| 13 |
+
"mlp_ratio": 4.0,
|
| 14 |
+
"n_heads": 12,
|
| 15 |
+
"n_kv_heads": 4,
|
| 16 |
+
"n_layers": 24,
|
| 17 |
+
"qk_norm": true,
|
| 18 |
+
"vocab_size": 32000,
|
| 19 |
+
"rope_base": 10000.0
|
| 20 |
+
},
|
| 21 |
+
"weight_sha256": "5151567e266244c9e32fd6e01775192633abe227320269ecdefe28ce43e9ccc3",
|
| 22 |
+
"weight_format": "BF16 safetensors",
|
| 23 |
+
"context_limit": 2048,
|
| 24 |
+
"serialization": "raw document-prefix completion",
|
| 25 |
+
"supported_runtime": "native MLX on Apple Silicon; not a Transformers or mlx-lm auto-loading export"
|
| 26 |
+
}
|
corpus.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "research-20b-educational-python-v1",
|
| 3 |
+
"seed": 7337,
|
| 4 |
+
"shuffle_buffer": 10000,
|
| 5 |
+
"min_chars": 200,
|
| 6 |
+
"max_bytes": 200000,
|
| 7 |
+
"max_rows_per_source": 50000000,
|
| 8 |
+
"split_buckets": 10000,
|
| 9 |
+
"sources": [
|
| 10 |
+
{
|
| 11 |
+
"label": "web",
|
| 12 |
+
"repo": "HuggingFaceTB/smollm-corpus",
|
| 13 |
+
"config": "fineweb-edu-dedup",
|
| 14 |
+
"revision": "3ba9d605774198c5868892d7a8deda78031a781f",
|
| 15 |
+
"split": "train",
|
| 16 |
+
"text_field": "text",
|
| 17 |
+
"weight": 50,
|
| 18 |
+
"license": "ODC-BY; preserve underlying source notices"
|
| 19 |
+
},
|
| 20 |
+
{
|
| 21 |
+
"label": "dclm",
|
| 22 |
+
"repo": "HuggingFaceTB/dclm-edu",
|
| 23 |
+
"revision": "dbad8ad71224482740cd9c9d353591adbf62fe04",
|
| 24 |
+
"split": "train",
|
| 25 |
+
"text_field": "text",
|
| 26 |
+
"weight": 18,
|
| 27 |
+
"min_score": {
|
| 28 |
+
"field": "edu_int_score",
|
| 29 |
+
"value": 3
|
| 30 |
+
},
|
| 31 |
+
"license": "CC-BY-4.0"
|
| 32 |
+
},
|
| 33 |
+
{
|
| 34 |
+
"label": "wiki",
|
| 35 |
+
"repo": "HuggingFaceFW/finewiki",
|
| 36 |
+
"config": "en",
|
| 37 |
+
"revision": "8bd13e72e6a002407649b3e898535f42ceb1aeb9",
|
| 38 |
+
"split": "train",
|
| 39 |
+
"text_field": "text",
|
| 40 |
+
"weight": 13,
|
| 41 |
+
"license": "CC-BY-SA-4.0 / GFDL"
|
| 42 |
+
},
|
| 43 |
+
{
|
| 44 |
+
"label": "cosmopedia",
|
| 45 |
+
"repo": "HuggingFaceTB/smollm-corpus",
|
| 46 |
+
"config": "cosmopedia-v2",
|
| 47 |
+
"revision": "3ba9d605774198c5868892d7a8deda78031a781f",
|
| 48 |
+
"split": "train",
|
| 49 |
+
"text_field": "text",
|
| 50 |
+
"weight": 9,
|
| 51 |
+
"format_contains": [
|
| 52 |
+
"textbook",
|
| 53 |
+
"tutorial",
|
| 54 |
+
"blog",
|
| 55 |
+
"educational"
|
| 56 |
+
],
|
| 57 |
+
"license": "ODC-BY; synthetic content; preserve provenance"
|
| 58 |
+
},
|
| 59 |
+
{
|
| 60 |
+
"label": "python",
|
| 61 |
+
"repo": "Avelina/python-edu-cleaned",
|
| 62 |
+
"config": "default",
|
| 63 |
+
"revision": "3fedf55e02e72dd1fd68963f991f5e91adcb0f8d",
|
| 64 |
+
"split": "train",
|
| 65 |
+
"text_field": "text",
|
| 66 |
+
"weight": 10,
|
| 67 |
+
"min_score": {
|
| 68 |
+
"field": "int_score",
|
| 69 |
+
"value": 4
|
| 70 |
+
},
|
| 71 |
+
"upstream_repo": "HuggingFaceTB/smollm-corpus",
|
| 72 |
+
"upstream_config": "python-edu",
|
| 73 |
+
"upstream_revision": "3ba9d605774198c5868892d7a8deda78031a781f",
|
| 74 |
+
"license": "Mirror metadata ODC-BY; original code remains subject to upstream repository licenses and The Stack v2 terms"
|
| 75 |
+
}
|
| 76 |
+
]
|
| 77 |
+
}
|
inference.py
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Offline native MLX text completion for OpenSML-Base-175M."""
|
| 3 |
+
from pathlib import Path
|
| 4 |
+
import argparse
|
| 5 |
+
import hashlib
|
| 6 |
+
import json
|
| 7 |
+
import math
|
| 8 |
+
import sys
|
| 9 |
+
import tempfile
|
| 10 |
+
import time
|
| 11 |
+
import zipfile
|
| 12 |
+
ROOT = Path(__file__).resolve().parent
|
| 13 |
+
BUNDLE_SHA256 = "14f85f0ff677d35a6fb34f118f2dd21a3fdd504fff27c163860ab919b21e0e98"
|
| 14 |
+
|
| 15 |
+
def sha256(path):
|
| 16 |
+
with Path(path).open("rb") as file:
|
| 17 |
+
return hashlib.file_digest(file, "sha256").hexdigest()
|
| 18 |
+
|
| 19 |
+
def main():
|
| 20 |
+
parser = argparse.ArgumentParser(description=__doc__)
|
| 21 |
+
inputs = parser.add_mutually_exclusive_group(required=True)
|
| 22 |
+
inputs.add_argument("--prompt", help="Raw text prefix; no chat template is applied")
|
| 23 |
+
inputs.add_argument("--prompt-file", type=Path, help="UTF-8 text prefix file")
|
| 24 |
+
parser.add_argument("--weights", type=Path, default=ROOT/"model.safetensors")
|
| 25 |
+
parser.add_argument("--max-tokens", type=int, default=128)
|
| 26 |
+
parser.add_argument("--temperature", type=float, default=0)
|
| 27 |
+
parser.add_argument("--seed", type=int, default=42)
|
| 28 |
+
parser.add_argument("--json", action="store_true", help="Print completion and generation metadata as JSON")
|
| 29 |
+
args = parser.parse_args()
|
| 30 |
+
if not 1 <= args.max_tokens <= 2047:
|
| 31 |
+
parser.error("--max-tokens must be between 1 and 2047")
|
| 32 |
+
if not math.isfinite(args.temperature) or args.temperature < 0:
|
| 33 |
+
parser.error("--temperature must be finite and nonnegative")
|
| 34 |
+
prompt = args.prompt if args.prompt is not None else args.prompt_file.read_text(encoding="utf-8")
|
| 35 |
+
config = json.loads((ROOT/"config.json").read_text())
|
| 36 |
+
if not args.weights.is_file():
|
| 37 |
+
parser.error("Missing model.safetensors; download the complete repository")
|
| 38 |
+
if sha256(args.weights) != config["weight_sha256"]:
|
| 39 |
+
parser.error("Weights do not match the published base model identity")
|
| 40 |
+
archive = ROOT/"native_bundle.zip"
|
| 41 |
+
if sha256(archive) != BUNDLE_SHA256:
|
| 42 |
+
parser.error("Native source bundle failed its integrity check")
|
| 43 |
+
with tempfile.TemporaryDirectory(prefix="opensml-base-runtime-") as directory:
|
| 44 |
+
runtime = Path(directory)
|
| 45 |
+
with zipfile.ZipFile(archive) as bundle:
|
| 46 |
+
for member in bundle.infolist():
|
| 47 |
+
p = Path(member.filename)
|
| 48 |
+
if p.is_absolute() or ".." in p.parts or (member.external_attr >> 16) & 0o170000 == 0o120000:
|
| 49 |
+
parser.error("Unsafe source-bundle entry")
|
| 50 |
+
bundle.extractall(runtime)
|
| 51 |
+
sys.path.insert(0, str(runtime/"pretraining"))
|
| 52 |
+
from sml_v1.tokenization import Tokenizer
|
| 53 |
+
from sml_v1.model import TransformerConfig, TransformerLM, count_parameters
|
| 54 |
+
import mlx.core as mx
|
| 55 |
+
from mlx.utils import tree_map
|
| 56 |
+
tokenizer = Tokenizer(runtime/"tokenizer")
|
| 57 |
+
ids = tokenizer.encode(prompt)
|
| 58 |
+
if not ids:
|
| 59 |
+
parser.error("Prompt must contain at least one token")
|
| 60 |
+
if len(ids)+args.max_tokens > config["context_limit"]:
|
| 61 |
+
parser.error("Prompt plus generation budget exceeds 2048 tokens; no truncation is performed")
|
| 62 |
+
mx.set_default_device(mx.gpu)
|
| 63 |
+
mx.set_cache_limit(4*1024**3)
|
| 64 |
+
mx.random.seed(args.seed)
|
| 65 |
+
model = TransformerLM(TransformerConfig(**config["model"]))
|
| 66 |
+
model.update(tree_map(lambda value:value.astype(mx.bfloat16),model.parameters()))
|
| 67 |
+
model.load_weights(str(args.weights))
|
| 68 |
+
mx.eval(model.parameters())
|
| 69 |
+
model.eval()
|
| 70 |
+
if count_parameters(model) != config["parameters"]:
|
| 71 |
+
raise ValueError("Unexpected parameter count")
|
| 72 |
+
inputs = mx.array([ids],dtype=mx.int32)
|
| 73 |
+
cache = None
|
| 74 |
+
generated = []
|
| 75 |
+
stop = "token_limit"
|
| 76 |
+
start = time.perf_counter()
|
| 77 |
+
try:
|
| 78 |
+
for _ in range(args.max_tokens):
|
| 79 |
+
logits, cache = model.logits(inputs, cache)
|
| 80 |
+
final = logits[0,-1]
|
| 81 |
+
if args.temperature == 0:
|
| 82 |
+
token = int(mx.argmax(final).item())
|
| 83 |
+
else:
|
| 84 |
+
token = int(mx.random.categorical(final.astype(mx.float32)/args.temperature).item())
|
| 85 |
+
if token == tokenizer.eos:
|
| 86 |
+
stop = "document_end"; break
|
| 87 |
+
if token in (0,2,3):
|
| 88 |
+
stop = "structural_token"; break
|
| 89 |
+
generated.append(token)
|
| 90 |
+
inputs = mx.array([[token]],dtype=mx.int32)
|
| 91 |
+
completion = tokenizer.decode(generated)
|
| 92 |
+
record = {"model":config["model_name"],"prompt":prompt,"completion":completion,
|
| 93 |
+
"prompt_tokens":len(ids),"output_tokens":len(generated),
|
| 94 |
+
"stop_reason":stop,"seconds":time.perf_counter()-start,
|
| 95 |
+
"protocol":{"serialization":"raw text prefix","temperature":args.temperature,
|
| 96 |
+
"seed":args.seed,"max_tokens":args.max_tokens,"context_limit":2048,
|
| 97 |
+
"truncation":False,"compute_dtype":"bfloat16"}}
|
| 98 |
+
print(json.dumps(record,indent=2,ensure_ascii=False) if args.json else completion)
|
| 99 |
+
finally:
|
| 100 |
+
mx.clear_cache()
|
| 101 |
+
|
| 102 |
+
if __name__ == "__main__":
|
| 103 |
+
main()
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5151567e266244c9e32fd6e01775192633abe227320269ecdefe28ce43e9ccc3
|
| 3 |
+
size 351242342
|
native_bundle.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:14f85f0ff677d35a6fb34f118f2dd21a3fdd504fff27c163860ab919b21e0e98
|
| 3 |
+
size 415394
|
pretraining-training-loss.png
ADDED
|
Git LFS Details
|
requirements.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
mlx==0.32.3
|
| 2 |
+
numpy==2.4.2
|
| 3 |
+
tokenizers==0.22.2
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_bos_token": false,
|
| 3 |
+
"add_eos_token": false,
|
| 4 |
+
"clean_up_tokenization_spaces": false,
|
| 5 |
+
"eos_token": "<|doc_end|>",
|
| 6 |
+
"pad_token": "<|pad|>",
|
| 7 |
+
"tokenizer_class": "PreTrainedTokenizerFast"
|
| 8 |
+
}
|
tokenizer_manifest.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"boundary_policy": "raw-text-then-one-document-EOS-v1",
|
| 3 |
+
"corpus_fingerprint": "a89f69d6f63cfa4385da233693a445404234a18194170fe1d2b4a74bf501f5d6",
|
| 4 |
+
"format": "sml-v2-tokenizer-v1",
|
| 5 |
+
"recipe": {
|
| 6 |
+
"corpus": "a89f69d6f63cfa4385da233693a445404234a18194170fe1d2b4a74bf501f5d6",
|
| 7 |
+
"min_frequency": 2,
|
| 8 |
+
"sample_manifest": "30ead6f502f11e99b479e3711a81ce7198787408d0700153615fc3255b244f46",
|
| 9 |
+
"specials": [
|
| 10 |
+
"<|pad|>",
|
| 11 |
+
"<|doc_end|>",
|
| 12 |
+
"<|turn_start|>",
|
| 13 |
+
"<|turn_end|>"
|
| 14 |
+
],
|
| 15 |
+
"tokenizers": "0.22.2",
|
| 16 |
+
"version": 1,
|
| 17 |
+
"vocab_size": 32000
|
| 18 |
+
},
|
| 19 |
+
"sha256": {
|
| 20 |
+
"corpus.json": "e4c47b7b6aba08f948de7c2c7cb94c58dbd09dde2ded6ac185c60856ee686d27",
|
| 21 |
+
"tokenizer.json": "e095f0413a11fa91fbb58f37d00e4c6bcda59beb89b28f6f680db1436a7e8891",
|
| 22 |
+
"tokenizer_config.json": "619f500553367eb76f5be00a98625130ec857b9c367561334984096c029ba2a9"
|
| 23 |
+
},
|
| 24 |
+
"special_ids": {
|
| 25 |
+
"eos": 1,
|
| 26 |
+
"pad": 0,
|
| 27 |
+
"turn_end": 3,
|
| 28 |
+
"turn_start": 2
|
| 29 |
+
},
|
| 30 |
+
"vocab_size": 32000
|
| 31 |
+
}
|