mlboydaisuke commited on
Commit
57a2e1f
·
verified ·
1 Parent(s): 1c00f91

Add files using upload-large-folder tool

Browse files
Files changed (50) hide show
  1. LICENSE +201 -0
  2. LICENSE-NOTE.md +18 -0
  3. README.md +224 -0
  4. SHA256SUMS +93 -0
  5. UPSTREAM_README.md +266 -0
  6. config.json +79 -0
  7. coreai-kit.json +165 -0
  8. ios-h18p/wfp16-s256/metadata.json +135 -0
  9. ios-h18p/wfp16-s256/reference.json +0 -0
  10. ios-h18p/wfp16-s512/laya_ml_wfp16_s512.h18p.aimodelc/main-h18p.mlirb +0 -0
  11. ios-h18p/wfp16-s512/laya_ml_wfp16_s512.h18p.aimodelc/metadata.json +9 -0
  12. ios-h18p/wfp16-s512/metadata.json +135 -0
  13. ios-h18p/wfp16-s512/provenance/coreai-build-neural-engine-probe.log +1 -0
  14. ios-h18p/wfp16-s512/provenance/coreai-build.log +1 -0
  15. ios-h18p/wfp16-s512/reference.json +0 -0
  16. ios-h18p/wfp16-s512/tokenizer/tokenizer_config.json +22 -0
  17. ios/wfp16-s256/provenance/export-gate.json +0 -0
  18. macos/fp32-s256/laya_ml_fp32_s256.aimodel/main.hash +1 -0
  19. macos/fp32-s256/laya_ml_fp32_s256.aimodel/metadata.json +8 -0
  20. macos/fp32-s256/metadata.json +135 -0
  21. macos/fp32-s256/provenance/export-gate.json +0 -0
  22. macos/fp32-s256/provenance/export-manifest.json +196 -0
  23. macos/fp32-s256/provenance/runtime-gate.json +0 -0
  24. macos/fp32-s256/reference.json +0 -0
  25. macos/fp32-s256/tokenizer/tokenizer_config.json +22 -0
  26. macos/fp32-s512/laya_ml_fp32_s512.aimodel/main.hash +1 -0
  27. macos/fp32-s512/laya_ml_fp32_s512.aimodel/metadata.json +8 -0
  28. macos/fp32-s512/metadata.json +135 -0
  29. macos/fp32-s512/provenance/export-gate.json +0 -0
  30. macos/fp32-s512/provenance/export-manifest.json +196 -0
  31. macos/fp32-s512/provenance/runtime-gate.json +0 -0
  32. macos/fp32-s512/reference.json +0 -0
  33. macos/fp32-s512/tokenizer/tokenizer_config.json +22 -0
  34. macos/wfp16-s256/laya_ml_wfp16_s256.aimodel/main.hash +1 -0
  35. macos/wfp16-s256/laya_ml_wfp16_s256.aimodel/metadata.json +8 -0
  36. macos/wfp16-s256/metadata.json +135 -0
  37. macos/wfp16-s256/provenance/export-gate.json +0 -0
  38. macos/wfp16-s256/provenance/export-manifest.json +198 -0
  39. macos/wfp16-s256/provenance/runtime-gate.json +0 -0
  40. macos/wfp16-s256/reference.json +0 -0
  41. macos/wfp16-s256/tokenizer/tokenizer_config.json +22 -0
  42. macos/wfp16-s512/laya_ml_wfp16_s512.aimodel/main.hash +1 -0
  43. macos/wfp16-s512/laya_ml_wfp16_s512.aimodel/metadata.json +8 -0
  44. macos/wfp16-s512/metadata.json +135 -0
  45. macos/wfp16-s512/provenance/export-gate.json +0 -0
  46. macos/wfp16-s512/provenance/export-manifest.json +198 -0
  47. macos/wfp16-s512/provenance/runtime-gate.json +0 -0
  48. macos/wfp16-s512/reference.json +0 -0
  49. macos/wfp16-s512/tokenizer/tokenizer_config.json +22 -0
  50. rl_agent_config.json +26 -0
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.
LICENSE-NOTE.md ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # License and changes
2
+
3
+ Convai Innovations declares Apache-2.0 for `convaiinnovations/laya` in the upstream model card at the pinned revision
4
+ `1c5edc17a7acd8701df6fc341c0d179f1c62c982`; no standalone LICENSE or NOTICE file is listed at that revision. The unmodified upstream card
5
+ (`UPSTREAM_README.md`) and the standard Apache-2.0 text (`LICENSE`) are included.
6
+
7
+ Changes relative to the upstream `multilingual/` checkpoint:
8
+ - re-authored as a static Core AI graph from the raw weights (no transformers or laya code in the graph),
9
+ windows 256 and 512, batch 1;
10
+ - one bundle with two functions: `main` (encoder, type embedding, the two head layers and the scorer at every
11
+ position, plus the first position's hidden state) and `act` (the act head, fp32);
12
+ - `wfp16` folders store the weights in fp16 (exact: the checkpoint is stored in F16) and compute in fp32;
13
+ `fp32` folders are the reference; `ios-h18p/` holds an iPhone 17 Pro (h18p) GPU compile of the wfp16 bundle;
14
+ - `metadata.json` carries the checkpoint's temperatures (T = 1) and, beside them, the fitted calibration
15
+ published with litert-community/Laya-Multilingual-LiteRT (`laya_ml_calibration.json`);
16
+ - `tokenizer/` holds the checkpoint's `tokenizer.json` and `tokenizer_config.json`, unmodified;
17
+ `config.json` and `rl_agent_config.json` are the checkpoint's own files, unmodified.
18
+ Source: `convaiinnovations/laya@1c5edc17a7acd8701df6fc341c0d179f1c62c982`, subfolder `multilingual`.
README.md ADDED
@@ -0,0 +1,224 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: coreai
3
+ license: apache-2.0
4
+ base_model: convaiinnovations/laya
5
+ tags:
6
+ - coreai
7
+ - apple-silicon
8
+ - on-device
9
+ - modernbert
10
+ - laya
11
+ - calibrated-decisions
12
+ - text-classification
13
+ language:
14
+ - multilingual
15
+ - en
16
+ - ja
17
+ pipeline_tag: text-classification
18
+ ---
19
+
20
+ Core AI is Apple's on-device ML runtime in iOS 27 / macOS 27 and the successor to Core ML: PyTorch models are exported with Apple's `coreai-torch` (LLMs: `coreai.llm.export`) into `.aimodel` bundles that run on the GPU or the Neural Engine.
21
+
22
+ <!-- gen-cards:devicemark begin (managed by scripts/gen-cards + tools/devicemark_row.py — edit cards.json, not this block) -->
23
+ This model has no row on [DeviceMark](https://devicemark.github.io/), the on-device LLM leaderboard.
24
+ <!-- gen-cards:devicemark end -->
25
+
26
+ # laya multilingual — Core AI export
27
+
28
+ Zoo card, recipe and gate transcript: [coreai-model-zoo/models/laya-multilingual](https://github.com/john-rocky/coreai-model-zoo/blob/main/models/laya-multilingual/README.md).
29
+
30
+ A **typed decision model** that answers in one forward pass: give it a state (a message, an email, a
31
+ JSON record, a conversation) and a typed question — `choice` (pick one of named options), `score`
32
+ (an ordered scale) or `noul` (yes/no) — and it returns a probability for every option, no generation.
33
+ [`convaiinnovations/laya`](https://huggingface.co/convaiinnovations/laya), subfolder `multilingual/`
34
+ (Apache-2.0, revision `1c5edc17…`, laya 0.3.4), as a static `.aimodel` for macOS 27 and, compiled ahead
35
+ of time, for the iPhone 17 Pro (not yet run on a device). It is the catalog's first **encoder-type
36
+ decision model**: the other
37
+ decision models here are language models read out after a prefill; this one scores every option at its
38
+ own marker position in a single encoder call.
39
+
40
+ Architecture (from `model.safetensors` and `encoder/config.json`; 321,908,998 parameters, all stored in F16
41
+ but the three-value temperature buffer):
42
+ an mmBERT-base encoder — ModernBERT layout, 22 layers, hidden 768, 12 heads × 64, GLU MLP 1152 with exact
43
+ GELU, biasless attention/MLP/LayerNorm (ε 1e-5), vocabulary 256,000 — with global attention on layers
44
+ 0, 3, …, 21 and a sliding window of inclusive radius 64 elsewhere, RoPE θ 160,000 for both kinds; then a
45
+ type embedding (choice / score / noul), two pre-norm transformer layers (768, 12 heads, ReLU 3072), a scorer (LayerNorm → Linear → GELU → Linear) at every position, and a small act head.
46
+
47
+ **This is an encoder, not a generator.** One question is one forward over a right-padded window; no
48
+ KV cache, no sampling loop. It runs through raw `AIModel` calls, not the generate engine.
49
+
50
+ ## Graph contract
51
+
52
+ ```
53
+ function "main"
54
+ input "input_ids" [1, S] int32 right-padded with PAD 0
55
+ input "attention_mask" [1, S] int32 1 over real tokens, 0 over padding
56
+ input "qtype_onehot" [1, 3] fp32 choice / score / noul
57
+ output "token_logits" [1, S] fp32 the scorer at every position — read at the option markers
58
+ output "pooled_cls" [1, 768] fp32 input of "act"
59
+ function "act" fp32 in every variant
60
+ input "pooled_cls" [1, 768] fp32
61
+ input "feats" [1, 4] fp32 top1, top1 − top2, entropy / ln max(K,2), max(K,2) / 255
62
+ output "act_logits" [1, 2] fp32 class 0 = answer directly
63
+ S = 256 or 512 (export-time choice); batch = 1; one bundle holds both functions
64
+ ```
65
+
66
+ **Host recipe** — the sequence and the readout are the publisher's, unchanged:
67
+ - Build `[CLS 2] <type> question: <instructions> [SEP 1] [MASK 4] option … [MASK 4] option … [SEP 1]
68
+ <state> [SEP 1]` with laya's `build_sequence` (option text ≤ 48 tokens, head budget 256, state
69
+ right-truncated to the window; the marker positions are where the `[MASK]` ids sit). Every text piece is
70
+ tokenized without special tokens by the checkpoint's `tokenizer.json` (Gemma-style BPE, byte fallback).
71
+ - Gather `token_logits` at the markers (K logits), softmax them **raw** for the four `feats`, run `act`;
72
+ then divide the K logits by the question's temperature (bucket by type and K first, then per type) and
73
+ softmax for the answer. `metadata.json` carries the checkpoint's temperatures (T = 1) and the fitted
74
+ calibration the LiteRT port published (`temperature`, `temperature_by_options`).
75
+ - `reference.json` in every folder is the parity instrument: 201 question rows for that window with token
76
+ ids, marker positions, the publisher's answers at T = 1 and the official model's raw logits.
77
+
78
+ ## Measured
79
+
80
+ **Mac** (Apple M4 Max), macOS 27.0 build **26A428**, coreai-build 3600.83.1, the JIT `.aimodel`,
81
+ 2026-09-23. Every row: the 201 rows of its window through the whole pipeline (main → host features →
82
+ act), 3 runs per row, then 40 warm questions; the warm time is one whole question, NumPy I/O included.
83
+ The GPU rows ran alone on the GPU (the machine-wide GPU lock held, no other GPU job visible during the
84
+ run). `cpu_only` is the parity option, and its milliseconds were taken while other jobs used the machine's
85
+ CPU: reference values, not a speed claim.
86
+
87
+ | Variant | S | Compute | Argmax (choice + score) | Max \|Δp\| at T=1 | Marker max \|Δ\| | Act relative | Repeat drift | Load | Warm median |
88
+ |---|---:|---|---:|---:|---:|---:|---:|---:|---:|
89
+ | wfp16 | 256 | GPU | 81/81 | 4.47e-6 | 5.53e-5 | 2.60e-6 | 0 | 570 ms | **12.1 ms** |
90
+ | wfp16 | 512 | GPU | 81/81 | 4.59e-6 | 1.00e-4 | 3.47e-6 | 0 | 589 ms | **19.5 ms** |
91
+ | fp32 | 256 | GPU | 81/81 | 4.47e-6 | 5.53e-5 | 2.60e-6 | 0 | 853 ms | 10.4 ms |
92
+ | fp32 | 512 | GPU | 81/81 | 4.59e-6 | 1.00e-4 | 3.47e-6 | 0 | 982 ms | 17.2 ms |
93
+ | wfp16 | 256 | cpu_only | 81/81 | 9.48e-6 | 7.49e-5 | 1.85e-6 | 0 | 720 ms | 45.1 ms |
94
+ | wfp16 | 512 | cpu_only | 81/81 | 9.48e-6 | 6.68e-5 | 1.94e-6 | 0 | 600 ms | 86.2 ms |
95
+ | fp32 | 256 | cpu_only | 81/81 | 9.48e-6 | 7.49e-5 | 1.85e-6 | 0 | 762 ms | 63.0 ms |
96
+ | fp32 | 512 | cpu_only | 81/81 | 9.48e-6 | 6.68e-5 | 1.94e-6 | 0 | 720 ms | 84.2 ms |
97
+
98
+ On the CPU, wfp16 and fp32 return bit-identical marker and act logits on all 402 rows: wfp16 stores the
99
+ weights in fp16 — exact, the checkpoint is F16 — and computes in fp32. On this Mac's GPU both stay within
100
+ 1e-4 of the CPU run as well. **Use the GPU, and request it explicitly**: with the Neural Engine preference
101
+ the Mac returned the GPU's results bit for bit for fp32, but for wfp16 it returned different results that
102
+ changed from run to run (next section). **iPhone: not measured** — the `ios-h18p/` and `ios/` folders have
103
+ not run on a device yet.
104
+
105
+ The publisher's own model on the SemIf `authored144` fixture (144 three-option evidence / rule /
106
+ candidate questions it was not trained for), as `laya.load(...).predict` answers them: mean family
107
+ balanced accuracy **0.6114**, accuracy 0.5903 (the same at T = 1 and with the fitted calibration, and at
108
+ both windows). That is the reference a port's decisions are compared with, not a claim about the port.
109
+
110
+ ## Numerics gate
111
+
112
+ The oracle is the publisher's package itself (`laya.load(<pinned snapshot>, subfolder="multilingual")`,
113
+ transformers 5.17.0, CPU fp32): it reproduces the frozen fixture of the LiteRT port exactly (token ids
114
+ 402/402; batched answers and logits bit-identical), and each row alone, right-padded to its window, is the
115
+ tensor reference. Bars, at every stage: argmax identical on every choice and score row, max |Δp| ≤ 1e-3 at
116
+ T = 1 over the options, |Δ act probability| ≤ 1e-3; marker logits ≤ 1e-3 and act logits ≤ 1e-4 relative
117
+ to the official batch-1 run; repeat drift ≤ 1e-6 on CPU; a wrong-pairing control (every row judged
118
+ against another same-shape row's outputs) must fail — it does, on 162–166 of 200 pairs.
119
+
120
+ - **Authoring** (`gate_laya_authoring.py`): the 201 rows of each window, plus every hidden state of 14
121
+ rows (embeddings, 22 layers, final norm, after the type embedding, both head layers) against the
122
+ official model — absolute max |err| ≤ 1e-4 on the embeddings and layers 0–9, relative max |err| / max
123
+ |ref| ≤ 2e-4 on layer 10 through the head (measured: 5.0e-5 absolute, 5.7e-5 relative at S=256, 7.8e-6
124
+ at S=512). Five mutations must be caught and are, by the layer, tensor and answer gates: a local radius
125
+ of 63 (layer 1, 1.24 / 0.84 at S=256 / 512), all-global, all-local, ignoring padding, and dropping the
126
+ type embedding (after the type embedding, 6.6e-2 relative). A pad-isolation check replaces every pad id
127
+ with a random token: real positions stay bit-identical.
128
+ - **Export**: the torch-exported, decomposed `main` and `act` pass the same 201-row gate before conversion.
129
+ - **Runtime**: the tables above.
130
+
131
+ [`gate-laya-multilingual.json`](https://github.com/john-rocky/coreai-model-zoo/blob/main/models/laya-multilingual/gate-laya-multilingual.json) in the zoo repository is the transcript: every stage's summary with the sha256
132
+ of the full record it came from; the records keep each row's raw marker and act logits, unrounded.
133
+
134
+ ## Neural Engine and fp16
135
+
136
+ The checkpoint is F16, so fp16 **storage** is exact. fp16 **compute** is not good enough here. The recipe
137
+ that runs everything in fp16 except the RoPE application and the attention softmax misses the answer bar
138
+ everywhere it was measured — torch max |Δp| 3.4e-3 / 5.0e-3 (S=256 / 512); Mac CPU 4.38e-2 with one choice
139
+ flipped (80/81); Mac GPU 5.84e-3; Mac Neural Engine 1.85e-2 with one choice flipped (both windows) — and keeping
140
+ the residual stream and LayerNorm in fp32 as well still leaves 4.9e-3 in torch (S=256).
141
+
142
+ Placement follows the compute precision here. Compiled for the iPhone 17 Pro with `--preferred-compute
143
+ neural-engine`, the fp16 recipe gets 47 Neural Engine regions; wfp16, which computes in fp32, gets a single
144
+ region of 5.7 KB of IR and everything else stays in the GPU package. On the Mac, the Neural Engine
145
+ preference gave these results:
146
+
147
+ | Variant | S | Argmax | Max \|Δp\| | Marker max \|Δ\| | Repeat drift | Load | Warm median | Reading |
148
+ |---|---:|---:|---:|---:|---:|---:|---:|---|
149
+ | fp32 | 256 / 512 | 81/81 | 4.47e-6 / 4.59e-6 | 5.53e-5 / 1.00e-4 | 0 | 986 / 1,026 ms | 10.5 / 20.4 ms | identical to the GPU run on every row: it ran on the GPU |
150
+ | wfp16 | 256 | 81/81, 81/81 | 0.290, 0.164 | 0.82, 1.66 | **90, 90** | 1,186 ms | 12.7 ms | two runs, different answers each time: a defect of this specialization, do not use |
151
+ | wfp16 | 512 | 81/81, **80/81** | 0.343, 0.238 | 7.76, 11.4 | **202, 212** | 1,188 ms | 20.1 ms | the same, and the second run flipped a choice |
152
+ | fp16 recipe | 256 | 80/81 | 1.85e-2 | 0.211 | 0 | 5,919 ms | 42.9 ms | deterministic, but outside the bar |
153
+ | fp16 recipe | 512 | 80/81 | 1.85e-2 | 0.681 | 0 | 5 ms (cached) | 67.7 ms | the same |
154
+
155
+ `coreai.runtime` reports no placement, so the reading column is inferred from the numbers. The iPhone
156
+ folder is therefore the GPU compile, named for what it is (`ios-h18p/`); the neural-engine compile's
157
+ region count is recorded in its manifest.
158
+
159
+ ## ⬇️ Bundle
160
+
161
+ This repository holds one folder per variant, each
162
+ self-contained: the bundle, `tokenizer/` (the checkpoint's files, unmodified), `metadata.json` (the
163
+ decision contract), `reference.json` and `provenance/` (export manifest with per-file sha256, the export
164
+ and runtime gate records).
165
+
166
+ | Folder | Platform | Format | Bundle | Bytes |
167
+ |---|---|---|---|---:|
168
+ | `macos/wfp16-s256/` | macOS 27 | JIT `.aimodel` | `laya_ml_wfp16_s256.aimodel` | 644,855,189 |
169
+ | `macos/wfp16-s512/` | macOS 27 | JIT `.aimodel` | `laya_ml_wfp16_s512.aimodel` | 645,772,737 |
170
+ | `macos/fp32-s256/` | macOS 27 (reference) | JIT `.aimodel` | `laya_ml_fp32_s256.aimodel` | 1,288,156,432 |
171
+ | `macos/fp32-s512/` | macOS 27 (reference) | JIT `.aimodel` | `laya_ml_fp32_s512.aimodel` | 1,289,073,976 |
172
+ | `ios/wfp16-s256/` | iOS 27 (portable JIT) | JIT `.aimodel` | `laya_ml_wfp16_s256.aimodel` | 644,855,189 |
173
+ | `ios/wfp16-s512/` | iOS 27 (portable JIT) | JIT `.aimodel` | `laya_ml_wfp16_s512.aimodel` | 645,772,737 |
174
+ | `ios-h18p/wfp16-s256/` | iOS 27, **h18p only** | AOT `.aimodelc` | `laya_ml_wfp16_s256.h18p.aimodelc` | 645,117,160 |
175
+ | `ios-h18p/wfp16-s512/` | iOS 27, **h18p only** | AOT `.aimodelc` | `laya_ml_wfp16_s512.h18p.aimodelc` | 646,034,970 |
176
+
177
+ The `ios-h18p/` bundles are compiled for one device architecture (`h18p`, the iPhone 17 Pro) with
178
+ `xcrun coreai-build compile --platform iOS --min-deployment-version 27.0 --preferred-compute gpu
179
+ --architecture h18p` (coreai-build 3600.83.1). **Never load an iOS bundle on a Mac.**
180
+
181
+ Convert yourself: [`conversion/laya/`](https://github.com/john-rocky/coreai-model-zoo/blob/main/conversion/laya/README.md) — staged scripts, and
182
+ [`recipe.toml`](https://github.com/john-rocky/coreai-model-zoo/blob/main/models/laya-multilingual/recipe.toml) names the commands.
183
+
184
+ ## CoreAIKit (Swift)
185
+
186
+ Catalog id `laya-multilingual` (active once the kit's encoder backend is merged). `TypedDecisions` loads
187
+ the bundle as an encoder backend — the same `decide` / `prefill` calls as the kit's language-model
188
+ decision models — and runs it on the GPU; a Neural Engine preference is refused at load.
189
+
190
+ Measured through the kit on the same Mac (M4 Max, macOS 27.0 26A428, the wfp16 bundles above, GPU lock
191
+ held, 2026-09-23):
192
+
193
+ - Parity on the 201 rows of each window: token ids and marker positions 201/201, argmax 81/81, max |Δp|
194
+ 5e-6 on the GPU and 9e-6 with `cpuOnly`.
195
+ - `decide-cli bench` (a 109-token state, 8 questions, warm): **11.5 ms** per decision at S=256 when the
196
+ state is tokenized once and shared, 12.1 ms when every decision tokenizes its row; 18.9 / 19.4 ms at S=512.
197
+ - Load 1.06–1.16 s, of which the tokenizer (the 256,000-entry `tokenizer.json`) takes about 1.0 s and
198
+ 145–162 MB; the whole process is 474–498 MB after the first decision.
199
+ - SemIf authored144 at the kit's default temperature (the fitted calibration): argmax 144/144 with the
200
+ publisher's model at the same temperature, max |Δp| 2.9e-6; mean family balanced accuracy 0.6114,
201
+ accuracy 0.5903.
202
+ - With a Neural Engine preference (measured before it was refused): 168–183 of 201 rows within the 1e-3
203
+ bar over four runs, max |Δp| 0.61.
204
+
205
+ [`measurements-coreai-kit.json`](https://github.com/john-rocky/coreai-model-zoo/blob/main/models/laya-multilingual/measurements-coreai-kit.json) holds these numbers and the records they came from.
206
+
207
+ ## The port in one lesson: a massive activation moves the layer bar
208
+
209
+ From layer 11 the encoder parks a value of about 14,000 on a few dimensions of the first token. One
210
+ fp32 step there is about 0.001, so the publisher's own two attention paths (SDPA, which the package uses,
211
+ and eager) already disagree by up to 0.048 on those layers while their marker logits agree to 3.5e-5. The
212
+ publisher's own eager path does not meet a per-layer bar of 1e-4 above layer 10, so it cannot be the bar
213
+ for a reimplementation there; the gate keeps 1e-4 where it still separates a correct graph from a wrong
214
+ one (the embeddings and layers 0–9, where a window of 63 instead of 64 shows up at 0.8–1.2) and switches
215
+ to a relative bar of twice the official spread above. In the fp16 recipe the largest relative error sits
216
+ at the final norm (0.13 at S=256 in torch), the state that normalizes those large values.
217
+
218
+ ## License and limits
219
+
220
+ Apache-2.0 at the pinned upstream revision. Not tested: any iPhone (the device gate is pending), other
221
+ Macs or OS builds, dynamic or batched shapes, windows other than 256 and 512, more than 20 options, the
222
+ fitted calibration's quality at S = 512, languages beyond the fixture's English, Japanese and mixed rows,
223
+ sustained thermals. The act probability is saturated at 1.0 on every fixture row, in the publisher's
224
+ model as here: it is carried through the graph, not evidence of when to escalate.
SHA256SUMS ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 LICENSE
2
+ eef8e7fc73729b2f89adba740e2f4cfb07ffc5ec1d5d8a51bed29030ddd62ba7 LICENSE-NOTE.md
3
+ 7eece5cd17b9747c692534ebbfeda534e73729f42c5390d3ec7c36c0973997e7 README.md
4
+ 33911629d87484754bb755d2118a38626264a9b63bc33ee30131d7564f5560ee UPSTREAM_README.md
5
+ 83f6916d13ef0f556ac461f28308dc2bffa7ebeadee8ec9e2db5812020ea5bb4 config.json
6
+ ab1e98be944bca6417e8d5e4d9edd6faf44f20cb75d6ca5c891b3e3d682b74a1 coreai-kit.json
7
+ 14981993ab712dfcde5a694b41ff15383d58fe4500be96b10677384084ab44ae ios/wfp16-s256/laya_ml_wfp16_s256.aimodel/main.hash
8
+ ea3dd8178f562ffd1ac63ac5861a5cb6f26be522d73d8f93f4424c99a960772c ios/wfp16-s256/laya_ml_wfp16_s256.aimodel/main.mlirb
9
+ 0fa042a4284052e4a3eae22a8a077653469e8ef89c09f095665971447e0b1383 ios/wfp16-s256/laya_ml_wfp16_s256.aimodel/metadata.json
10
+ 26c00b87bccfab5f949d3c55837dc23709a8a0911b0706c3afa181958e985b7e ios/wfp16-s256/metadata.json
11
+ 442cd98bc7a4b33b005c3b1f12f4378757c913c4a03442d225f7761b20a1ad54 ios/wfp16-s256/provenance/export-gate.json
12
+ 5f160116bdd9392bbac125ee1676e056c01de03227d3650eb610c5dca1317c32 ios/wfp16-s256/provenance/export-manifest.json
13
+ 13742b1599338c35fb717d8d1d84748cb0912b466e542194a9c20f190b4cc897 ios/wfp16-s256/reference.json
14
+ 609d8f4c067cd3950f88594c5a802616cea245823836ef5848ee4fc40aab5b6f ios/wfp16-s256/tokenizer/tokenizer.json
15
+ 6c6b2d8e3c84ce0e671c129cd6b374b235d6f9863042a5836358d00a89bbb5a1 ios/wfp16-s256/tokenizer/tokenizer_config.json
16
+ b48956aff570cdd07f363dd243d965818879011dfd94cb187b414a1d35067aaf ios/wfp16-s512/laya_ml_wfp16_s512.aimodel/main.hash
17
+ 3dd13911fa46cb7794f9b5527e63665817d1e757309c4cd92bf7397cf2617a06 ios/wfp16-s512/laya_ml_wfp16_s512.aimodel/main.mlirb
18
+ 845279c73db455938feced18892a13eda5528cda50d2968f83affa1ac5301f30 ios/wfp16-s512/laya_ml_wfp16_s512.aimodel/metadata.json
19
+ 39838a0ef8606f56bceca30fbad4ccc36dc1bead2d1e22b07537d6a2954708f9 ios/wfp16-s512/metadata.json
20
+ 74142ff3af1d5cedf610426af6cd267cf541bae94abd3f3911e3dd6e0c787552 ios/wfp16-s512/provenance/export-gate.json
21
+ 3536f972387e44957dd2efe26a04214665d90d365486442bcb5c949aee374098 ios/wfp16-s512/provenance/export-manifest.json
22
+ b4e1ac0de94d27799a73d1ae518a91132887e9b75ccef2595a0e70249d0cb027 ios/wfp16-s512/reference.json
23
+ 609d8f4c067cd3950f88594c5a802616cea245823836ef5848ee4fc40aab5b6f ios/wfp16-s512/tokenizer/tokenizer.json
24
+ 6c6b2d8e3c84ce0e671c129cd6b374b235d6f9863042a5836358d00a89bbb5a1 ios/wfp16-s512/tokenizer/tokenizer_config.json
25
+ 98ebf41ebe53fefa90c3b39d9bbfb28de3894b134d89383dd4b8d97c92e42161 ios-h18p/wfp16-s256/laya_ml_wfp16_s256.h18p.aimodelc/main-h18p-delegates/MPSGraph/mpsExecutable.mpsgraphpackage/manifest.plist
26
+ 897d657b0ba4530726881c0974dc4239edbf3c80e729629e1bfb0770f31ebe48 ios-h18p/wfp16-s256/laya_ml_wfp16_s256.h18p.aimodelc/main-h18p-delegates/MPSGraph/mpsExecutable.mpsgraphpackage/resources.bin
27
+ 032210b57457a71500c30f0fdf568f41a28e5d8c7f5fd16c9bbc3e688bcdd729 ios-h18p/wfp16-s256/laya_ml_wfp16_s256.h18p.aimodelc/main-h18p-delegates/MPSGraph/mpsExecutable.mpsgraphpackage/specialized_model_0.mpsgraph
28
+ ed684679b8a173b91913cf6cbd5400d1ec726d4a094d53846c8cf1e960b37e92 ios-h18p/wfp16-s256/laya_ml_wfp16_s256.h18p.aimodelc/main-h18p.mlirb
29
+ 2298517d0a8a8a11c564ba6332c394dde8a52b00e2d22ef23e386d3509ed479d ios-h18p/wfp16-s256/laya_ml_wfp16_s256.h18p.aimodelc/main.hash
30
+ 11da4b3598874b815c584f4020a3970d0719f3e8bd4524f2b6d2feb7392ae5ed ios-h18p/wfp16-s256/laya_ml_wfp16_s256.h18p.aimodelc/metadata.json
31
+ a15df006d0cabddb6d7361c0c7dbff9a53b71b771c3653ef4ed015d9ec983cef ios-h18p/wfp16-s256/laya_ml_wfp16_s256.h18p.aimodelc/stats.json
32
+ 98351f6aee4e6549521fecd159d4f065249010c25440cef93cf0d5b12017da3e ios-h18p/wfp16-s256/metadata.json
33
+ f0fcb225c7fa9c4cf6ca40c13d8eb1262c75ef33322404fe046f11719473b4e5 ios-h18p/wfp16-s256/provenance/aot-manifest.json
34
+ 3713944e1df4970f2386a0f6cf6407eef85732fd93a7b386cc83220b53444701 ios-h18p/wfp16-s256/provenance/coreai-build-neural-engine-probe.log
35
+ 3713944e1df4970f2386a0f6cf6407eef85732fd93a7b386cc83220b53444701 ios-h18p/wfp16-s256/provenance/coreai-build.log
36
+ 13742b1599338c35fb717d8d1d84748cb0912b466e542194a9c20f190b4cc897 ios-h18p/wfp16-s256/reference.json
37
+ 609d8f4c067cd3950f88594c5a802616cea245823836ef5848ee4fc40aab5b6f ios-h18p/wfp16-s256/tokenizer/tokenizer.json
38
+ 6c6b2d8e3c84ce0e671c129cd6b374b235d6f9863042a5836358d00a89bbb5a1 ios-h18p/wfp16-s256/tokenizer/tokenizer_config.json
39
+ 034683ea6a20d6ded3a4b143154034bc5940a4acd657eb6dee52cc8fb0342733 ios-h18p/wfp16-s512/laya_ml_wfp16_s512.h18p.aimodelc/main-h18p-delegates/MPSGraph/mpsExecutable.mpsgraphpackage/manifest.plist
40
+ c70fd2a75bf014b4890170a085a2ee8b42ea51e9ab13552a274372eccac652c0 ios-h18p/wfp16-s512/laya_ml_wfp16_s512.h18p.aimodelc/main-h18p-delegates/MPSGraph/mpsExecutable.mpsgraphpackage/resources.bin
41
+ e7040847a40a39ad8ea614ebe5d7ba41260d51e8df2005d5c544741a34da1f2f ios-h18p/wfp16-s512/laya_ml_wfp16_s512.h18p.aimodelc/main-h18p-delegates/MPSGraph/mpsExecutable.mpsgraphpackage/specialized_model_0.mpsgraph
42
+ 52dac2fc261da834b8a2f83abca38b89175ccbff94d16001d5d28eb78cd3434c ios-h18p/wfp16-s512/laya_ml_wfp16_s512.h18p.aimodelc/main-h18p.mlirb
43
+ 659f4f04f21a2e7a6bed36a9e030a58ae65aecbd07ccafcb7804ee3f997d51a5 ios-h18p/wfp16-s512/laya_ml_wfp16_s512.h18p.aimodelc/main.hash
44
+ 83dbdf54e8e6f50de80807ad40dedba335bbd175df0f73e78ad0e5df9595d504 ios-h18p/wfp16-s512/laya_ml_wfp16_s512.h18p.aimodelc/metadata.json
45
+ 346917cdff1b82b90f5e33afe7fbe5db6f42716e150b73d51a5d622e0bfba107 ios-h18p/wfp16-s512/laya_ml_wfp16_s512.h18p.aimodelc/stats.json
46
+ 790d4605bf68af99810d5d103a89ab24a4be33862906bfe419c98f317bbb2525 ios-h18p/wfp16-s512/metadata.json
47
+ 42b33221ef5ec07470798299bb9e8c303946973141ebbe443ada4fc27a9426f2 ios-h18p/wfp16-s512/provenance/aot-manifest.json
48
+ 3713944e1df4970f2386a0f6cf6407eef85732fd93a7b386cc83220b53444701 ios-h18p/wfp16-s512/provenance/coreai-build-neural-engine-probe.log
49
+ 3713944e1df4970f2386a0f6cf6407eef85732fd93a7b386cc83220b53444701 ios-h18p/wfp16-s512/provenance/coreai-build.log
50
+ b4e1ac0de94d27799a73d1ae518a91132887e9b75ccef2595a0e70249d0cb027 ios-h18p/wfp16-s512/reference.json
51
+ 609d8f4c067cd3950f88594c5a802616cea245823836ef5848ee4fc40aab5b6f ios-h18p/wfp16-s512/tokenizer/tokenizer.json
52
+ 6c6b2d8e3c84ce0e671c129cd6b374b235d6f9863042a5836358d00a89bbb5a1 ios-h18p/wfp16-s512/tokenizer/tokenizer_config.json
53
+ 6dcc306b68fd7e53d35a9bbece24456e277ed0f7e6d233e64dbcbe036b573424 macos/fp32-s256/laya_ml_fp32_s256.aimodel/main.hash
54
+ 0b8933cd04e18fb1ee13d65afb4657556d8116fc0b2a7476993ab0121970148b macos/fp32-s256/laya_ml_fp32_s256.aimodel/main.mlirb
55
+ 8f86c49628c15b65f7b5a8202238e023d1f2d94f360088dc51934f7225edbc76 macos/fp32-s256/laya_ml_fp32_s256.aimodel/metadata.json
56
+ 25749bfc3089b9063cb819ded7aa113f29542e53a7683c8b35437371e34134c6 macos/fp32-s256/metadata.json
57
+ 730b14edc719409135cd4b019593afda5e6f0465e49b18ae9da5f9533c2b9fec macos/fp32-s256/provenance/export-gate.json
58
+ c056ac7ed99ea390c7414393c05b8abd974156f4b2cedd125506f8d637026065 macos/fp32-s256/provenance/export-manifest.json
59
+ 67371d1811e9be7e95d57e76f4bbe1d3880694e5b29773c504d1adaef6662de4 macos/fp32-s256/provenance/runtime-gate.json
60
+ 13742b1599338c35fb717d8d1d84748cb0912b466e542194a9c20f190b4cc897 macos/fp32-s256/reference.json
61
+ 609d8f4c067cd3950f88594c5a802616cea245823836ef5848ee4fc40aab5b6f macos/fp32-s256/tokenizer/tokenizer.json
62
+ 6c6b2d8e3c84ce0e671c129cd6b374b235d6f9863042a5836358d00a89bbb5a1 macos/fp32-s256/tokenizer/tokenizer_config.json
63
+ 3a8161c3c9ef90c7d791c318b55843b537cc2c704e802e8e9e497de91f46d64a macos/fp32-s512/laya_ml_fp32_s512.aimodel/main.hash
64
+ 0d624464a36edfb141f2992a28670fb393039c47acf8a180aa2478ddfc3eed15 macos/fp32-s512/laya_ml_fp32_s512.aimodel/main.mlirb
65
+ 049d6c2993afd781ab484b60e12405e39216211a57880af0f7182b64a1c48156 macos/fp32-s512/laya_ml_fp32_s512.aimodel/metadata.json
66
+ 19c5847a6f014e0dbe434cfde76f01949591ba478d240de528e6d19afa592fce macos/fp32-s512/metadata.json
67
+ 186f01358be35a2b3cb72b0321e9456c93c73065b38a0dd052c04b729bacc382 macos/fp32-s512/provenance/export-gate.json
68
+ 683b8e65aef01c12756556c6d46cf87dc984a1907bf2a492b47a0d4a00aaf5cb macos/fp32-s512/provenance/export-manifest.json
69
+ 89a55ee09c8a8c9fed89419f4302c3b885d57a66c58b6512dee768cd1cc4b259 macos/fp32-s512/provenance/runtime-gate.json
70
+ b4e1ac0de94d27799a73d1ae518a91132887e9b75ccef2595a0e70249d0cb027 macos/fp32-s512/reference.json
71
+ 609d8f4c067cd3950f88594c5a802616cea245823836ef5848ee4fc40aab5b6f macos/fp32-s512/tokenizer/tokenizer.json
72
+ 6c6b2d8e3c84ce0e671c129cd6b374b235d6f9863042a5836358d00a89bbb5a1 macos/fp32-s512/tokenizer/tokenizer_config.json
73
+ 14981993ab712dfcde5a694b41ff15383d58fe4500be96b10677384084ab44ae macos/wfp16-s256/laya_ml_wfp16_s256.aimodel/main.hash
74
+ ea3dd8178f562ffd1ac63ac5861a5cb6f26be522d73d8f93f4424c99a960772c macos/wfp16-s256/laya_ml_wfp16_s256.aimodel/main.mlirb
75
+ 0fa042a4284052e4a3eae22a8a077653469e8ef89c09f095665971447e0b1383 macos/wfp16-s256/laya_ml_wfp16_s256.aimodel/metadata.json
76
+ 26c00b87bccfab5f949d3c55837dc23709a8a0911b0706c3afa181958e985b7e macos/wfp16-s256/metadata.json
77
+ 442cd98bc7a4b33b005c3b1f12f4378757c913c4a03442d225f7761b20a1ad54 macos/wfp16-s256/provenance/export-gate.json
78
+ ae7a58df3e1b273bbe99936fd9f96301b88985d69ce4eda193001ebc19e44547 macos/wfp16-s256/provenance/export-manifest.json
79
+ 35c106008a7bc13f5d7052f1c86d5301897893cadac1c253b72bc8e6aaf58bca macos/wfp16-s256/provenance/runtime-gate.json
80
+ 13742b1599338c35fb717d8d1d84748cb0912b466e542194a9c20f190b4cc897 macos/wfp16-s256/reference.json
81
+ 609d8f4c067cd3950f88594c5a802616cea245823836ef5848ee4fc40aab5b6f macos/wfp16-s256/tokenizer/tokenizer.json
82
+ 6c6b2d8e3c84ce0e671c129cd6b374b235d6f9863042a5836358d00a89bbb5a1 macos/wfp16-s256/tokenizer/tokenizer_config.json
83
+ b48956aff570cdd07f363dd243d965818879011dfd94cb187b414a1d35067aaf macos/wfp16-s512/laya_ml_wfp16_s512.aimodel/main.hash
84
+ 3dd13911fa46cb7794f9b5527e63665817d1e757309c4cd92bf7397cf2617a06 macos/wfp16-s512/laya_ml_wfp16_s512.aimodel/main.mlirb
85
+ 845279c73db455938feced18892a13eda5528cda50d2968f83affa1ac5301f30 macos/wfp16-s512/laya_ml_wfp16_s512.aimodel/metadata.json
86
+ 39838a0ef8606f56bceca30fbad4ccc36dc1bead2d1e22b07537d6a2954708f9 macos/wfp16-s512/metadata.json
87
+ 74142ff3af1d5cedf610426af6cd267cf541bae94abd3f3911e3dd6e0c787552 macos/wfp16-s512/provenance/export-gate.json
88
+ 264333163ad46c2e1dd5d76d3c2f020fbd0968c7bc83397a916d22c7176bd10b macos/wfp16-s512/provenance/export-manifest.json
89
+ 3f64c8bcd0881cd9d54ad5ba69310e94ba511ef5fa657f6bdfe2d61c0ea2425f macos/wfp16-s512/provenance/runtime-gate.json
90
+ b4e1ac0de94d27799a73d1ae518a91132887e9b75ccef2595a0e70249d0cb027 macos/wfp16-s512/reference.json
91
+ 609d8f4c067cd3950f88594c5a802616cea245823836ef5848ee4fc40aab5b6f macos/wfp16-s512/tokenizer/tokenizer.json
92
+ 6c6b2d8e3c84ce0e671c129cd6b374b235d6f9863042a5836358d00a89bbb5a1 macos/wfp16-s512/tokenizer/tokenizer_config.json
93
+ 25061739243b617ad88d1219ba6f8a9c86c5881ca28df024fa2d9b3b2fcc30c6 rl_agent_config.json
UPSTREAM_README.md ADDED
@@ -0,0 +1,266 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: transformers
4
+ pipeline_tag: text-classification
5
+ tags: [laya, system-one, calibrated-decisions, rlcd, classification, routing, scoring, guardrails, moderation, reinforcement-learning, commercial-use]
6
+ ---
7
+
8
+ # Laya
9
+
10
+ **Multilingual, non-autoregressive System 1 decision model.** Give it a **state** (text, email, ticket, or JSON) and **typed questions**; it returns typed answers with mathematically calibrated probabilities in a single forward pass (~33 ms) across 100+ languages. Trained with reinforcement learning against strictly proper scoring rules (**RLCD**), so reporting honest probabilities is the only way to maximise reward. It never generates text, so there is nothing to parse and nothing to hallucinate.
11
+
12
+ <p align="center">
13
+ <img src="https://raw.githubusercontent.com/NandhaKishorM/laya/main/assets/laya_vs_jev_full.png" alt="Laya versus TypeSafe Jev: accuracy, every application workflow, all 51 languages, speed, calibration and routing cost" width="100%" />
14
+ </p>
15
+
16
+ **This repo holds all three checkpoints** and is the hub for the family. The English checkpoint is at the repo root; the other two are bundled subfolders, and only the one you request is downloaded:
17
+
18
+ | Checkpoint | Backbone Encoder | Params | Context | Best at |
19
+ |---|---|---|---|---|
20
+ | **`convaiinnovations/laya`** (this repo root) | ModernBERT-large | 421M | 512 | English text, guardrails, email triage |
21
+ | [`convaiinnovations/laya-multilingual`](https://huggingface.co/convaiinnovations/laya-multilingual) | mmBERT-base | 322M | 1024 (up to 8k) | 100+ languages, ~2.2x faster |
22
+ | [`convaiinnovations/laya-typed-decisions`](https://huggingface.co/convaiinnovations/laya-typed-decisions) | ModernBERT-large | 421M | 1024 | the four typed-decisions workflows (0.766 acc) |
23
+
24
+ ---
25
+
26
+ ## Quickstart: Route Mode (Recommended)
27
+
28
+ Laya's built-in **`Router`** is the recommended way to use Laya in production. It evaluates any state in any language, automatically detects scripts and languages in sub-milliseconds, and dispatches to the optimal checkpoint in a single forward pass.
29
+
30
+ ```bash
31
+ pip install laya
32
+ ```
33
+
34
+ ```python
35
+ import laya
36
+ from laya import Router
37
+
38
+ # Preload checkpoints into memory for instant sub-35ms routing
39
+ router = Router(preload=True)
40
+
41
+ state = {
42
+ "from": "user@acme.com",
43
+ "subject": "Duplicate charge on invoice #4411",
44
+ "body": "Hi, we were billed twice for March. Please refund the duplicate today or we will cancel our plan."
45
+ }
46
+
47
+ questions = {
48
+ "department": {
49
+ "type": "choice",
50
+ "instructions": "Which department should handle this request?",
51
+ "criteria": {
52
+ "billing": "invoices, payments, refunds",
53
+ "technical": "bugs, outages, system errors",
54
+ "sales": "pricing, new contracts",
55
+ "other": "everything else"
56
+ }
57
+ },
58
+ "urgency": {
59
+ "type": "score",
60
+ "instructions": "How urgent is this request?",
61
+ "criteria": ["not urgent", "soon", "critical deadline or blocking issue"]
62
+ },
63
+ "churn_risk": {
64
+ "type": "noul",
65
+ "instructions": "Does the user threaten to cancel or leave?"
66
+ },
67
+ "refund_requested": {
68
+ "type": "noul",
69
+ "instructions": "Does the user explicitly request a refund?"
70
+ }
71
+ }
72
+
73
+ # 1. English state -> automatically routed to ModernBERT-large (39.5 ms)
74
+ res_en = router.predict(state, questions)
75
+ print("Department :", res_en["answers"]["department"]["choice"]) # -> billing (confidence: 0.94)
76
+ print("Routing :", res_en["routing"]["model"]) # -> english
77
+
78
+ # 2. Hindi state -> automatically routed to mmBERT-base (100+ languages, 32.8 ms)
79
+ res_hi = router.predict({"body": "मुझसे दो बार शुल्क लिया गया, कृपया पैसे वापस करें।"}, questions)
80
+ print("Department :", res_hi["answers"]["department"]["choice"]) # -> billing (confidence: 0.86)
81
+ print("Routing :", res_hi["routing"]["model"]) # -> multilingual
82
+
83
+ # 3. Explicit override when you already know the checkpoint
84
+ res_td = router.predict(state, questions, model="typed-decisions")
85
+ ```
86
+
87
+ Every result carries full routing metadata explaining why the choice was made:
88
+
89
+ ```python
90
+ res_hi["routing"]
91
+ # {
92
+ # 'model': 'multilingual',
93
+ # 'repo': 'convaiinnovations/laya/multilingual',
94
+ # 'reason': 'non-Latin script (devanagari, 100% of letters); the English checkpoint cannot read it'
95
+ # }
96
+ ```
97
+
98
+ ### Why Route: The Evidence
99
+
100
+ On a shared benchmark (17,416 questions, one T4 GPU, identical questions per model):
101
+
102
+ | Benchmark / Task | English (`laya`) | Multilingual (`laya-multilingual`) | `Router` (Routed) |
103
+ |---|---|---|---|
104
+ | MASSIVE intent, English | **0.783** | 0.657 | **0.783** |
105
+ | MASSIVE intent, 13 other languages | 0.306 | **0.451** | **0.451** |
106
+ | XNLI, English | **0.860** | 0.843 | **0.860** |
107
+ | XNLI, 14 other languages | 0.521 | **0.731** | **0.731** |
108
+ | Languages usable (>3x random) | 23 / 51 | 45 / 51 | **45 / 51** |
109
+ | Latency, 1 question (T4 GPU) | 39.5 ms | **32.8 ms** | **32.8 ms** |
110
+ | Latency, 10 questions batched | 158.6 ms | **72.3 ms** | **72.3 ms** |
111
+
112
+ The English checkpoint collapses on non-Latin scripts (Khmer scores **0.000 accuracy at 0.952 confidence**). Because the model stays confident while being wrong, confidence gating cannot save you. `Router` detects the script in <0.5 ms pure Python before the forward pass.
113
+
114
+ ### Production Preload & Memory
115
+
116
+ A cold checkpoint build costs seconds; language detection costs microseconds. At the default `max_loaded=1`, traffic that alternates languages rebuilds a model on *every* request (measured at a 7.4 s median reload on CPU and 10.3 s on T4).
117
+
118
+ For a server or a demo, preload:
119
+
120
+ ```python
121
+ # Every checkpoint resident in memory; language flips cost detection only (<1 ms)
122
+ router = Router(preload=True)
123
+ router = Router(preload=True, device="cuda")
124
+
125
+ # Or preload only the specific checkpoints you serve:
126
+ router.preload(["english", "multilingual"])
127
+
128
+ # If your app already built an agent, attach it to avoid duplicate VRAM:
129
+ router.attach("english", existing_agent)
130
+
131
+ # Manage resident memory (default keeps 1 hot, LRU eviction)
132
+ router = Router(max_loaded=2) # keep two hot
133
+ router.unload() # free memory
134
+ ```
135
+
136
+ | Deployment Mode | Per-Request Latency | Model Reloads |
137
+ |---|---|---|
138
+ | `Router()` (lazy, `max_loaded=1`) | 7 to 10 s on every language switch | 1 per switch |
139
+ | `Router(preload=True)` | **32.8 ms (GPU) / 193–464 ms (CPU)** | **none** |
140
+
141
+ ---
142
+
143
+ ## Single-Model Mode (Direct SDK)
144
+
145
+ If you only need a single checkpoint for a dedicated pipeline:
146
+
147
+ ```python
148
+ import laya
149
+
150
+ # 1. Load from the repo root or subfolders (downloads only the requested weights)
151
+ agent = laya.load("convaiinnovations/laya") # English root (~808 MB)
152
+ agent_ml = laya.load("convaiinnovations/laya", subfolder="multilingual") # 100+ languages (~647 MB)
153
+ agent_td = laya.load("convaiinnovations/laya", subfolder="typed-decisions")
154
+
155
+ # 2. Run all questions in ONE single forward pass (~35 ms on GPU)
156
+ result = agent.predict(state, questions)
157
+ answers = result["answers"]
158
+
159
+ print("Department :", answers["department"]["choice"]) # -> billing (confidence: 0.94)
160
+ print("Urgency :", answers["urgency"]["score"]) # -> 1.84 / 2.0
161
+ print("Churn Risk :", answers["churn_risk"]["noul"]) # -> 0.892 (89.2% probability)
162
+ ```
163
+
164
+ > **If `laya.load()` hangs:** `transformers` probes for TensorFlow at import, and when TF is
165
+ > installed its abseil runtime can deadlock model construction. Run with `USE_TF=0`.
166
+
167
+ ---
168
+
169
+ ## Architecture
170
+
171
+ - **Backbone:** ModernBERT-large (395M, bidirectional, fully fine-tuned) + a decision head trained from scratch: 2 transformer layers, an option-marker scorer, and an act/escalate head. 421M total. (Multilingual uses mmBERT-base, 22 layers, 256k vocab, 322M total).
172
+ - **Option markers:** Every option is scored at its own `[MASK]` token, then softmaxed over that question's options. The answer space is defined at request time, so new schemas need no retraining.
173
+ - **Budget:** 512 tokens per question for English (`head_max_len = 192`); 1024 tokens for multilingual (`head_max_len = 256`).
174
+ - **Batching:** Every question in a call is answered in one single forward pass.
175
+
176
+ ---
177
+
178
+ ## Training
179
+
180
+ **RLCD (Reinforcement Learning for Calibrated Decisions).** The policy reports a distribution; exploration adds zero-mean Gaussian noise to the logits; the reward is a strictly proper scoring rule (log + spherical, plus ranked probability score for ordinal questions). Expected reward is maximised only by reporting honest probabilities. Updates are REINFORCE with a group-mean baseline (GRPO-style). Multi-turn conversations use TD(λ=1.0) over prefix slices.
181
+
182
+ ---
183
+
184
+ ## Benchmarks
185
+
186
+ Measured on a Tesla T4; every checkpoint answered byte-identical questions in the same run.
187
+
188
+ ### Speed
189
+
190
+ | questions per call | `laya` | `laya-multilingual` |
191
+ |---|---|---|
192
+ | 1 | 39.5 ms | **32.8 ms** |
193
+ | 5 | 84.5 ms | **40.1 ms** |
194
+ | 10 | 158.6 ms (15.9 ms/q) | **72.3 ms (7.2 ms/q)** |
195
+ | 50 | 771 ms | **337 ms (6.8 ms/q)** |
196
+
197
+ 103–332 questions/sec batched on a single T4. For reference, TypeSafe Jev has been independently measured at 236–276 ms p50 ([AbdelStark](https://github.com/AbdelStark/jev-benchmarks), [nibzard](https://github.com/nibzard/decision-model-benchmark)), so Laya answers a single question roughly **6–8× faster**.
198
+
199
+ ### Laya (with routing) vs TypeSafe Jev
200
+
201
+ Every Laya figure is what `Router().predict(...)` returns — the checkpoint the router selects for that input. Jev figures are **third-party published, never measured here** (no TypeSafe API access); sample sizes and prompts differ.
202
+
203
+ | Benchmark / Metric | TypeSafe Jev 1.13.0 | Laya (routed) | Comparison |
204
+ |---|---|---|---|
205
+ | typed-decisions, 2,000 decisions | 0.727 | **0.766** | +0.039 (beats 0.735 teacher ceiling) |
206
+ | AG News, 4 labels | 0.910 | **0.950** | +0.040 |
207
+ | DAIR Emotion, 6 labels | 0.480 | **0.595** | +0.115 |
208
+ | Banking77 (72 vs 77 labels) | **0.870** | 0.425 | Jev leads on >20 options |
209
+ | ECE *(lower better)* | 0.246 | **0.081** | 3× better (post-temperature) |
210
+ | p50 latency, 1 question | 236–276 ms | **32.8 ms** | 7.8× faster |
211
+ | Languages usable (>3x random) | *no published benchmark* | **45 of 51** | Global language coverage |
212
+ | Weights | closed API | **Apache 2.0** | Open weights, on-premise capable |
213
+ | Cost | $0.042 / 1M tokens | **$0 self-hosted** | 100% free |
214
+
215
+ On DAIR Emotion, Jev assigned zero probability to the true label on 16% of examples.
216
+
217
+ #### Where Jev leads
218
+
219
+ * **High-cardinality label spaces (>20 options at default settings):** On Banking77, Jev scores 0.870 (on 72 labels) while Laya scores 0.425 (on 77 labels at default 256-token head budget). Options share a fixed `head_max_len` budget (192 tokens on English, 256 on multilingual), so 77 options receive only ~3 to 4 tokens per label, causing text to become indistinguishable. Jev supports up to 255 options out-of-the-box. While `laya-multilingual` supports 1,024 context (and up to 8,192 in the encoder) and you can raise `agent.cfg["head_max_len"] = 512` at runtime, Jev is currently better suited for 50+ options in a single prompt without tuning.
220
+ * **Soft distribution matching:** On typed-decisions, while Laya achieves higher argmax accuracy (0.766 vs 0.727), Jev achieves higher soft accuracy (0.580 vs 0.471) against the teacher's full probability distributions.
221
+ * **Out-of-the-box raw calibration:** Before temperature scaling, the base checkpoint has higher raw ECE (0.213 vs 0.144). Laya achieves its 0.081 ECE after domain temperature fitting.
222
+
223
+ Full report: [BENCHMARKS.md](https://github.com/NandhaKishorM/laya/blob/main/BENCHMARKS.md).
224
+
225
+ ### typed-decisions, measured on all three checkpoints
226
+
227
+ 400 cases, 2,000 decisions, four workflows — measured here.
228
+
229
+ | model | accuracy | soft acc | Brier | ECE | score MAE |
230
+ |---|---|---|---|---|---|
231
+ | **`laya-typed-decisions`** | **0.766** | 0.471 | **0.062** | 0.213 | **0.242** |
232
+ | `laya` | 0.362 | 0.332 | 0.316 | 0.175 | 0.694 |
233
+ | `laya-multilingual` | 0.342 | 0.326 | 0.439 | 0.285 | 0.687 |
234
+ | *Jev 1.13.0 (published)* | *0.727* | *0.580* | *0.148* | *0.144* | *0.391* |
235
+ | *teacher self-agreement ceiling* | *0.735* | | | | |
236
+ | *per-question majority class* | *0.461* | | | | |
237
+
238
+ The fine-tuned checkpoint clears the teacher ceiling and wins all four workflows: invoice processing 0.804, security incidents 0.766, customer service 0.764, agent-trace observability 0.730. By primitive: `noul` 0.857, `choice` 0.733, `score` 0.723.
239
+
240
+ The base checkpoints sit below the majority-class baseline here — the capability on this benchmark comes from fine-tuning, which is what the [fine-tuning notebook](https://github.com/NandhaKishorM/laya/blob/main/notebooks/laya_finetune_typed_decisions_2xT4_kaggle.ipynb) is for.
241
+
242
+ ---
243
+
244
+ ## Honest Limits
245
+
246
+ - **Base checkpoints are near chance on typed-decisions zero-shot** — 0.362 here and 0.352 for multilingual, against a 0.318 random and 0.461 majority-class baseline. The 0.766 belongs to the checkpoint fine-tuned on that benchmark's own training split. Laya is a fast base to specialise, not a zero-shot decision engine.
247
+ - **High-cardinality choice questions and token budgets:** Sequences split into an option prompt budget (`head_max_len`) and the remaining document/state budget (`max_len - head_max_len`):
248
+ * `laya` (English) defaults to 512 context (`head_max_len = 192`, ~320 tokens for state).
249
+ * `laya-multilingual` and `laya-typed-decisions` default to 1,024 context (`head_max_len = 256`, ~768 tokens for state; mmBERT-base encoder supports up to 8,192 with RoPE).
250
+ At default settings, a 77-option question like Banking77 allocates only `(256 - 16) // 77` ≈ 3–4 tokens per label, causing accuracy to fall off sharply (0.425 vs Jev's 0.870). If evaluating 50+ options in a single question:
251
+ 1. Raise `agent.cfg["head_max_len"] = 512` and `agent.cfg["max_len"] = 1024` (or up to 2048 / 4096 / 8192) so every option has enough tokens to remain distinct.
252
+ 2. Or split large option sets into a two-step coarse-to-fine hierarchical choice.
253
+ - **Ordinal `score` questions are the weakest primitive** (SST-5 0.372).
254
+ - **Ships over-confident:** Refitting one temperature per (question type, option count) moves mean ECE **0.466 → 0.081** (`laya`) and **0.314 → 0.106** (`laya-multilingual`). Do this on your own data before trusting the probabilities.
255
+ - **English only on root:** Use `laya-multilingual` for anything outside English.
256
+
257
+ ---
258
+
259
+ ## Links
260
+
261
+ - **GitHub:** https://github.com/NandhaKishorM/laya
262
+ - **PyPI:** https://pypi.org/project/laya/
263
+ - **Live Demo:** https://huggingface.co/spaces/convaiinnovations/laya-demo
264
+ - **Write-up:** [Read on Dev.to](https://dev.to/nandakishor_m_6cc0adfde9f/i-built-non-autoregressive-decision-models-a-year-ago-then-a-frontier-lab-called-it-a-18me)
265
+
266
+ Apache 2.0 · Convai Innovations
config.json ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "ModernBertForMaskedLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 2,
8
+ "classifier_activation": "gelu",
9
+ "classifier_bias": false,
10
+ "classifier_dropout": 0.0,
11
+ "classifier_pooling": "mean",
12
+ "cls_token_id": 1,
13
+ "decoder_bias": true,
14
+ "deterministic_flash_attn": false,
15
+ "dtype": "float32",
16
+ "embedding_dropout": 0.0,
17
+ "eos_token_id": 1,
18
+ "global_attn_every_n_layers": 3,
19
+ "gradient_checkpointing": false,
20
+ "hidden_activation": "gelu",
21
+ "hidden_size": 768,
22
+ "initializer_cutoff_factor": 2.0,
23
+ "initializer_range": 0.02,
24
+ "intermediate_size": 1152,
25
+ "layer_norm_eps": 1e-05,
26
+ "layer_types": [
27
+ "full_attention",
28
+ "sliding_attention",
29
+ "sliding_attention",
30
+ "full_attention",
31
+ "sliding_attention",
32
+ "sliding_attention",
33
+ "full_attention",
34
+ "sliding_attention",
35
+ "sliding_attention",
36
+ "full_attention",
37
+ "sliding_attention",
38
+ "sliding_attention",
39
+ "full_attention",
40
+ "sliding_attention",
41
+ "sliding_attention",
42
+ "full_attention",
43
+ "sliding_attention",
44
+ "sliding_attention",
45
+ "full_attention",
46
+ "sliding_attention",
47
+ "sliding_attention",
48
+ "full_attention"
49
+ ],
50
+ "local_attention": 128,
51
+ "mask_token_id": 4,
52
+ "max_position_embeddings": 8192,
53
+ "mlp_bias": false,
54
+ "mlp_dropout": 0.0,
55
+ "model_type": "modernbert",
56
+ "norm_bias": false,
57
+ "norm_eps": 1e-05,
58
+ "num_attention_heads": 12,
59
+ "num_hidden_layers": 22,
60
+ "pad_token_id": 0,
61
+ "position_embedding_type": "sans_pos",
62
+ "repad_logits_with_grad": false,
63
+ "rope_parameters": {
64
+ "full_attention": {
65
+ "rope_theta": 160000,
66
+ "rope_type": "default"
67
+ },
68
+ "sliding_attention": {
69
+ "rope_theta": 160000,
70
+ "rope_type": "default"
71
+ }
72
+ },
73
+ "sep_token_id": 1,
74
+ "sparse_pred_ignore_index": -100,
75
+ "sparse_prediction": false,
76
+ "tie_word_embeddings": true,
77
+ "transformers_version": "5.0.0",
78
+ "vocab_size": 256000
79
+ }
coreai-kit.json ADDED
@@ -0,0 +1,165 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "kind": "decision",
3
+ "format": "encoder",
4
+ "model": "convaiinnovations/laya",
5
+ "subfolder": "multilingual",
6
+ "revision": "1c5edc17a7acd8701df6fc341c0d179f1c62c982",
7
+ "variants": {
8
+ "macos": {
9
+ "path": "macos/wfp16-s256",
10
+ "sizeMB": 681,
11
+ "format": "aimodel"
12
+ },
13
+ "macos-s512": {
14
+ "path": "macos/wfp16-s512",
15
+ "sizeMB": 682,
16
+ "format": "aimodel"
17
+ },
18
+ "ios": {
19
+ "path": "ios/wfp16-s256",
20
+ "sizeMB": 680,
21
+ "format": "aimodel",
22
+ "minOS": "27.0"
23
+ },
24
+ "ios-s512": {
25
+ "path": "ios/wfp16-s512",
26
+ "sizeMB": 681,
27
+ "format": "aimodel",
28
+ "minOS": "27.0"
29
+ },
30
+ "ios-h18p": {
31
+ "path": "ios-h18p/wfp16-s256",
32
+ "sizeMB": 680,
33
+ "format": "aimodelc",
34
+ "minOS": "27.0",
35
+ "architecture": "h18p"
36
+ },
37
+ "ios-h18p-s512": {
38
+ "path": "ios-h18p/wfp16-s512",
39
+ "sizeMB": 681,
40
+ "format": "aimodelc",
41
+ "minOS": "27.0",
42
+ "architecture": "h18p"
43
+ },
44
+ "macos-fp32": {
45
+ "path": "macos/fp32-s256",
46
+ "sizeMB": 1324,
47
+ "format": "aimodel",
48
+ "reference": true
49
+ },
50
+ "macos-fp32-s512": {
51
+ "path": "macos/fp32-s512",
52
+ "sizeMB": 1325,
53
+ "format": "aimodel",
54
+ "reference": true
55
+ }
56
+ },
57
+ "host": {
58
+ "layout": "laya",
59
+ "tokenizer": "tokenizer/tokenizer.json",
60
+ "cls_id": 2,
61
+ "sep_id": 1,
62
+ "pad_id": 0,
63
+ "mask_id": 4,
64
+ "head_max_len": 256,
65
+ "option_text_tokens": 48,
66
+ "source_max_len": 1024,
67
+ "sequence": "[CLS] <type> question: <instructions> [SEP] ([MASK] <option text, <=48 tokens>)... [SEP] <state, right-truncated> [SEP]",
68
+ "readout": "token_logits at the marker positions; softmax of the raw logits -> the four act features -> act; answer = softmax(logits / T), T by bucket (type:K) first, then by type",
69
+ "temperatures": "metadata.json decision block: source_temperature [1,1,1] and the fitted calibration",
70
+ "compute_units": "gpu (a Neural Engine preference is refused: its answers fall outside the bar and vary run to run)"
71
+ },
72
+ "graph": {
73
+ "functions": {
74
+ "main": {
75
+ "inputs": {
76
+ "input_ids": {
77
+ "dtype": "int32",
78
+ "shape": [
79
+ 1,
80
+ 256
81
+ ],
82
+ "padding": "right, PAD 0"
83
+ },
84
+ "attention_mask": {
85
+ "dtype": "int32",
86
+ "shape": [
87
+ 1,
88
+ 256
89
+ ],
90
+ "values": "1 real token, 0 padding"
91
+ },
92
+ "qtype_onehot": {
93
+ "dtype": "float32",
94
+ "shape": [
95
+ 1,
96
+ 3
97
+ ],
98
+ "order": [
99
+ "choice",
100
+ "score",
101
+ "noul"
102
+ ]
103
+ }
104
+ },
105
+ "outputs": {
106
+ "token_logits": {
107
+ "dtype": "float32",
108
+ "shape": [
109
+ 1,
110
+ 256
111
+ ],
112
+ "read": "at the option marker positions"
113
+ },
114
+ "pooled_cls": {
115
+ "dtype": "float32",
116
+ "shape": [
117
+ 1,
118
+ 768
119
+ ],
120
+ "read": "input of the act function"
121
+ }
122
+ }
123
+ },
124
+ "act": {
125
+ "inputs": {
126
+ "pooled_cls": {
127
+ "dtype": "float32",
128
+ "shape": [
129
+ 1,
130
+ 768
131
+ ]
132
+ },
133
+ "feats": {
134
+ "dtype": "float32",
135
+ "shape": [
136
+ 1,
137
+ 4
138
+ ],
139
+ "order": [
140
+ "top1",
141
+ "top1_minus_top2",
142
+ "entropy_over_ln_max_k_2",
143
+ "max_k_2_over_255"
144
+ ],
145
+ "from": "softmax of the RAW marker logits (no temperature)"
146
+ }
147
+ },
148
+ "outputs": {
149
+ "act_logits": {
150
+ "dtype": "float32",
151
+ "shape": [
152
+ 1,
153
+ 2
154
+ ],
155
+ "class_0": "direct answer"
156
+ }
157
+ }
158
+ }
159
+ },
160
+ "windows": [
161
+ 256,
162
+ 512
163
+ ]
164
+ }
165
+ }
ios-h18p/wfp16-s256/metadata.json ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata_version": "0.2",
3
+ "kind": "encoder",
4
+ "decision": {
5
+ "head": "encoder",
6
+ "layout": "laya",
7
+ "window": 256,
8
+ "head_max_len": 256,
9
+ "source_max_len": 1024,
10
+ "option_text_tokens": 48,
11
+ "cls_token_id": 2,
12
+ "sep_token_id": 1,
13
+ "pad_token_id": 0,
14
+ "mask_token_id": 4,
15
+ "functions": {
16
+ "main": "main",
17
+ "act": "act"
18
+ },
19
+ "inputs": {
20
+ "input_ids": {
21
+ "dtype": "int32",
22
+ "shape": [
23
+ 1,
24
+ 256
25
+ ],
26
+ "padding": "right, PAD 0"
27
+ },
28
+ "attention_mask": {
29
+ "dtype": "int32",
30
+ "shape": [
31
+ 1,
32
+ 256
33
+ ],
34
+ "values": "1 real token, 0 padding"
35
+ },
36
+ "qtype_onehot": {
37
+ "dtype": "float32",
38
+ "shape": [
39
+ 1,
40
+ 3
41
+ ],
42
+ "order": [
43
+ "choice",
44
+ "score",
45
+ "noul"
46
+ ]
47
+ }
48
+ },
49
+ "outputs": {
50
+ "token_logits": {
51
+ "dtype": "float32",
52
+ "shape": [
53
+ 1,
54
+ 256
55
+ ],
56
+ "read": "at the option marker positions"
57
+ },
58
+ "pooled_cls": {
59
+ "dtype": "float32",
60
+ "shape": [
61
+ 1,
62
+ 768
63
+ ],
64
+ "read": "input of the act function"
65
+ }
66
+ },
67
+ "act": {
68
+ "inputs": {
69
+ "pooled_cls": {
70
+ "dtype": "float32",
71
+ "shape": [
72
+ 1,
73
+ 768
74
+ ]
75
+ },
76
+ "feats": {
77
+ "dtype": "float32",
78
+ "shape": [
79
+ 1,
80
+ 4
81
+ ],
82
+ "order": [
83
+ "top1",
84
+ "top1_minus_top2",
85
+ "entropy_over_ln_max_k_2",
86
+ "max_k_2_over_255"
87
+ ],
88
+ "from": "softmax of the RAW marker logits (no temperature)"
89
+ }
90
+ },
91
+ "outputs": {
92
+ "act_logits": {
93
+ "dtype": "float32",
94
+ "shape": [
95
+ 1,
96
+ 2
97
+ ],
98
+ "class_0": "direct answer"
99
+ }
100
+ }
101
+ },
102
+ "source_temperature": [
103
+ 1.0,
104
+ 1.0,
105
+ 1.0
106
+ ],
107
+ "temperature": [
108
+ 2.042901414492613,
109
+ 3.684653192472766,
110
+ 3.629100511692587
111
+ ],
112
+ "temperature_by_options": {
113
+ "choice:2": 1.397546128996061,
114
+ "choice:3-5": 1.3591985667953796,
115
+ "choice:6-10": 1.0,
116
+ "choice:11+": 2.445877143176841,
117
+ "score:3-5": 3.684653192472766,
118
+ "noul:2": 3.629100511692587
119
+ },
120
+ "calibration_provenance": "litert-community/Laya-Multilingual-LiteRT laya_ml_calibration.json (4415 examples, six balanced fits; choice:6-10 fixed at T=1)"
121
+ },
122
+ "source": {
123
+ "hf_model_id": "convaiinnovations/laya",
124
+ "hf_revision": "1c5edc17a7acd8701df6fc341c0d179f1c62c982",
125
+ "subfolder": "multilingual"
126
+ },
127
+ "assets": {
128
+ "main": "laya_ml_wfp16_s256.h18p.aimodelc"
129
+ },
130
+ "language": {
131
+ "tokenizer": "convaiinnovations/laya/multilingual/tokenizer",
132
+ "vocab_size": 256000,
133
+ "max_context_length": 256
134
+ }
135
+ }
ios-h18p/wfp16-s256/reference.json ADDED
The diff for this file is too large to render. See raw diff
 
ios-h18p/wfp16-s512/laya_ml_wfp16_s512.h18p.aimodelc/main-h18p.mlirb ADDED
Binary file (2.18 kB). View file
 
ios-h18p/wfp16-s512/laya_ml_wfp16_s512.h18p.aimodelc/metadata.json ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "producer" : "coreai-build-3600.83.1",
3
+ "sourceHash" : "3DD13911FA46CB7794F9B5527E63665817D1E757309C4CD92BF7397CF2617A06",
4
+ "description" : "laya multilingual decision encoder (mmBERT-base + typed head); wfp16; S=512; functions main + act; source convaiinnovations\/laya@1c5edc17a7acd8701df6fc341c0d179f1c62c982\/multilingual",
5
+ "author" : "mlboydaisuke (coreai-model-zoo); weights Convai Innovations (laya)",
6
+ "assetVersion" : "2.0",
7
+ "creationDate" : "20260923T053629Z",
8
+ "license" : "Apache-2.0"
9
+ }
ios-h18p/wfp16-s512/metadata.json ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata_version": "0.2",
3
+ "kind": "encoder",
4
+ "decision": {
5
+ "head": "encoder",
6
+ "layout": "laya",
7
+ "window": 512,
8
+ "head_max_len": 256,
9
+ "source_max_len": 1024,
10
+ "option_text_tokens": 48,
11
+ "cls_token_id": 2,
12
+ "sep_token_id": 1,
13
+ "pad_token_id": 0,
14
+ "mask_token_id": 4,
15
+ "functions": {
16
+ "main": "main",
17
+ "act": "act"
18
+ },
19
+ "inputs": {
20
+ "input_ids": {
21
+ "dtype": "int32",
22
+ "shape": [
23
+ 1,
24
+ 512
25
+ ],
26
+ "padding": "right, PAD 0"
27
+ },
28
+ "attention_mask": {
29
+ "dtype": "int32",
30
+ "shape": [
31
+ 1,
32
+ 512
33
+ ],
34
+ "values": "1 real token, 0 padding"
35
+ },
36
+ "qtype_onehot": {
37
+ "dtype": "float32",
38
+ "shape": [
39
+ 1,
40
+ 3
41
+ ],
42
+ "order": [
43
+ "choice",
44
+ "score",
45
+ "noul"
46
+ ]
47
+ }
48
+ },
49
+ "outputs": {
50
+ "token_logits": {
51
+ "dtype": "float32",
52
+ "shape": [
53
+ 1,
54
+ 512
55
+ ],
56
+ "read": "at the option marker positions"
57
+ },
58
+ "pooled_cls": {
59
+ "dtype": "float32",
60
+ "shape": [
61
+ 1,
62
+ 768
63
+ ],
64
+ "read": "input of the act function"
65
+ }
66
+ },
67
+ "act": {
68
+ "inputs": {
69
+ "pooled_cls": {
70
+ "dtype": "float32",
71
+ "shape": [
72
+ 1,
73
+ 768
74
+ ]
75
+ },
76
+ "feats": {
77
+ "dtype": "float32",
78
+ "shape": [
79
+ 1,
80
+ 4
81
+ ],
82
+ "order": [
83
+ "top1",
84
+ "top1_minus_top2",
85
+ "entropy_over_ln_max_k_2",
86
+ "max_k_2_over_255"
87
+ ],
88
+ "from": "softmax of the RAW marker logits (no temperature)"
89
+ }
90
+ },
91
+ "outputs": {
92
+ "act_logits": {
93
+ "dtype": "float32",
94
+ "shape": [
95
+ 1,
96
+ 2
97
+ ],
98
+ "class_0": "direct answer"
99
+ }
100
+ }
101
+ },
102
+ "source_temperature": [
103
+ 1.0,
104
+ 1.0,
105
+ 1.0
106
+ ],
107
+ "temperature": [
108
+ 2.042901414492613,
109
+ 3.684653192472766,
110
+ 3.629100511692587
111
+ ],
112
+ "temperature_by_options": {
113
+ "choice:2": 1.397546128996061,
114
+ "choice:3-5": 1.3591985667953796,
115
+ "choice:6-10": 1.0,
116
+ "choice:11+": 2.445877143176841,
117
+ "score:3-5": 3.684653192472766,
118
+ "noul:2": 3.629100511692587
119
+ },
120
+ "calibration_provenance": "litert-community/Laya-Multilingual-LiteRT laya_ml_calibration.json (4415 examples, six balanced fits; choice:6-10 fixed at T=1)"
121
+ },
122
+ "source": {
123
+ "hf_model_id": "convaiinnovations/laya",
124
+ "hf_revision": "1c5edc17a7acd8701df6fc341c0d179f1c62c982",
125
+ "subfolder": "multilingual"
126
+ },
127
+ "assets": {
128
+ "main": "laya_ml_wfp16_s512.h18p.aimodelc"
129
+ },
130
+ "language": {
131
+ "tokenizer": "convaiinnovations/laya/multilingual/tokenizer",
132
+ "vocab_size": 256000,
133
+ "max_context_length": 512
134
+ }
135
+ }
ios-h18p/wfp16-s512/provenance/coreai-build-neural-engine-probe.log ADDED
@@ -0,0 +1 @@
 
 
1
+ Compiling h18p: 1 of 1
ios-h18p/wfp16-s512/provenance/coreai-build.log ADDED
@@ -0,0 +1 @@
 
 
1
+ Compiling h18p: 1 of 1
ios-h18p/wfp16-s512/reference.json ADDED
The diff for this file is too large to render. See raw diff
 
ios-h18p/wfp16-s512/tokenizer/tokenizer_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<bos>",
3
+ "clean_up_tokenization_spaces": false,
4
+ "cls_token": "<bos>",
5
+ "eos_token": "<eos>",
6
+ "extra_special_tokens": {
7
+ "extra_0": "<start_of_turn>",
8
+ "extra_1": "<end_of_turn>"
9
+ },
10
+ "mask_token": "<mask>",
11
+ "model_input_names": [
12
+ "input_ids",
13
+ "attention_mask"
14
+ ],
15
+ "model_max_length": 8192,
16
+ "pad_token": "<pad>",
17
+ "padding_side": "right",
18
+ "sep_token": "<eos>",
19
+ "spaces_between_special_tokens": false,
20
+ "tokenizer_class": "PreTrainedTokenizerFast",
21
+ "unk_token": "<unk>"
22
+ }
ios/wfp16-s256/provenance/export-gate.json ADDED
The diff for this file is too large to render. See raw diff
 
macos/fp32-s256/laya_ml_fp32_s256.aimodel/main.hash ADDED
@@ -0,0 +1 @@
 
 
1
+ �3�Ᏹ��Z�FWUm�� *tv�:�p�
macos/fp32-s256/laya_ml_fp32_s256.aimodel/metadata.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "assetVersion" : "2.0",
3
+ "license" : "Apache-2.0",
4
+ "creationDate" : "20260923T053120Z",
5
+ "description" : "laya multilingual decision encoder (mmBERT-base + typed head); fp32; S=256; functions main + act; source convaiinnovations\/laya@1c5edc17a7acd8701df6fc341c0d179f1c62c982\/multilingual",
6
+ "author" : "mlboydaisuke (coreai-model-zoo); weights Convai Innovations (laya)",
7
+ "producer" : "coreai-core 1.0.0b2"
8
+ }
macos/fp32-s256/metadata.json ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata_version": "0.2",
3
+ "kind": "encoder",
4
+ "decision": {
5
+ "head": "encoder",
6
+ "layout": "laya",
7
+ "window": 256,
8
+ "head_max_len": 256,
9
+ "source_max_len": 1024,
10
+ "option_text_tokens": 48,
11
+ "cls_token_id": 2,
12
+ "sep_token_id": 1,
13
+ "pad_token_id": 0,
14
+ "mask_token_id": 4,
15
+ "functions": {
16
+ "main": "main",
17
+ "act": "act"
18
+ },
19
+ "inputs": {
20
+ "input_ids": {
21
+ "dtype": "int32",
22
+ "shape": [
23
+ 1,
24
+ 256
25
+ ],
26
+ "padding": "right, PAD 0"
27
+ },
28
+ "attention_mask": {
29
+ "dtype": "int32",
30
+ "shape": [
31
+ 1,
32
+ 256
33
+ ],
34
+ "values": "1 real token, 0 padding"
35
+ },
36
+ "qtype_onehot": {
37
+ "dtype": "float32",
38
+ "shape": [
39
+ 1,
40
+ 3
41
+ ],
42
+ "order": [
43
+ "choice",
44
+ "score",
45
+ "noul"
46
+ ]
47
+ }
48
+ },
49
+ "outputs": {
50
+ "token_logits": {
51
+ "dtype": "float32",
52
+ "shape": [
53
+ 1,
54
+ 256
55
+ ],
56
+ "read": "at the option marker positions"
57
+ },
58
+ "pooled_cls": {
59
+ "dtype": "float32",
60
+ "shape": [
61
+ 1,
62
+ 768
63
+ ],
64
+ "read": "input of the act function"
65
+ }
66
+ },
67
+ "act": {
68
+ "inputs": {
69
+ "pooled_cls": {
70
+ "dtype": "float32",
71
+ "shape": [
72
+ 1,
73
+ 768
74
+ ]
75
+ },
76
+ "feats": {
77
+ "dtype": "float32",
78
+ "shape": [
79
+ 1,
80
+ 4
81
+ ],
82
+ "order": [
83
+ "top1",
84
+ "top1_minus_top2",
85
+ "entropy_over_ln_max_k_2",
86
+ "max_k_2_over_255"
87
+ ],
88
+ "from": "softmax of the RAW marker logits (no temperature)"
89
+ }
90
+ },
91
+ "outputs": {
92
+ "act_logits": {
93
+ "dtype": "float32",
94
+ "shape": [
95
+ 1,
96
+ 2
97
+ ],
98
+ "class_0": "direct answer"
99
+ }
100
+ }
101
+ },
102
+ "source_temperature": [
103
+ 1.0,
104
+ 1.0,
105
+ 1.0
106
+ ],
107
+ "temperature": [
108
+ 2.042901414492613,
109
+ 3.684653192472766,
110
+ 3.629100511692587
111
+ ],
112
+ "temperature_by_options": {
113
+ "choice:2": 1.397546128996061,
114
+ "choice:3-5": 1.3591985667953796,
115
+ "choice:6-10": 1.0,
116
+ "choice:11+": 2.445877143176841,
117
+ "score:3-5": 3.684653192472766,
118
+ "noul:2": 3.629100511692587
119
+ },
120
+ "calibration_provenance": "litert-community/Laya-Multilingual-LiteRT laya_ml_calibration.json (4415 examples, six balanced fits; choice:6-10 fixed at T=1)"
121
+ },
122
+ "source": {
123
+ "hf_model_id": "convaiinnovations/laya",
124
+ "hf_revision": "1c5edc17a7acd8701df6fc341c0d179f1c62c982",
125
+ "subfolder": "multilingual"
126
+ },
127
+ "assets": {
128
+ "main": "laya_ml_fp32_s256.aimodel"
129
+ },
130
+ "language": {
131
+ "tokenizer": "convaiinnovations/laya/multilingual/tokenizer",
132
+ "vocab_size": 256000,
133
+ "max_context_length": 256
134
+ }
135
+ }
macos/fp32-s256/provenance/export-gate.json ADDED
The diff for this file is too large to render. See raw diff
 
macos/fp32-s256/provenance/export-manifest.json ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "status": "PASS",
3
+ "measure_only": false,
4
+ "model": "convaiinnovations/laya",
5
+ "model_sha": "1c5edc17a7acd8701df6fc341c0d179f1c62c982",
6
+ "subfolder": "multilingual",
7
+ "bundle": "laya_ml_fp32_s256.aimodel",
8
+ "intended_runtime": "macos",
9
+ "format": "JIT .aimodel (portable; multifunction main + act)",
10
+ "aot": false,
11
+ "precision": "fp32",
12
+ "fp32_islands": [
13
+ "all"
14
+ ],
15
+ "act_precision": "fp32",
16
+ "window": 256,
17
+ "inputs": {
18
+ "input_ids": {
19
+ "dtype": "int32",
20
+ "shape": [
21
+ 1,
22
+ 256
23
+ ],
24
+ "padding": "right, PAD 0"
25
+ },
26
+ "attention_mask": {
27
+ "dtype": "int32",
28
+ "shape": [
29
+ 1,
30
+ 256
31
+ ],
32
+ "values": "1 real token, 0 padding"
33
+ },
34
+ "qtype_onehot": {
35
+ "dtype": "float32",
36
+ "shape": [
37
+ 1,
38
+ 3
39
+ ],
40
+ "order": [
41
+ "choice",
42
+ "score",
43
+ "noul"
44
+ ]
45
+ }
46
+ },
47
+ "outputs": {
48
+ "token_logits": {
49
+ "dtype": "float32",
50
+ "shape": [
51
+ 1,
52
+ 256
53
+ ],
54
+ "read": "at the option marker positions"
55
+ },
56
+ "pooled_cls": {
57
+ "dtype": "float32",
58
+ "shape": [
59
+ 1,
60
+ 768
61
+ ],
62
+ "read": "input of the act function"
63
+ }
64
+ },
65
+ "act": {
66
+ "inputs": {
67
+ "pooled_cls": {
68
+ "dtype": "float32",
69
+ "shape": [
70
+ 1,
71
+ 768
72
+ ]
73
+ },
74
+ "feats": {
75
+ "dtype": "float32",
76
+ "shape": [
77
+ 1,
78
+ 4
79
+ ],
80
+ "order": [
81
+ "top1",
82
+ "top1_minus_top2",
83
+ "entropy_over_ln_max_k_2",
84
+ "max_k_2_over_255"
85
+ ],
86
+ "from": "softmax of the RAW marker logits (no temperature)"
87
+ }
88
+ },
89
+ "outputs": {
90
+ "act_logits": {
91
+ "dtype": "float32",
92
+ "shape": [
93
+ 1,
94
+ 2
95
+ ],
96
+ "class_0": "direct answer"
97
+ }
98
+ }
99
+ },
100
+ "files": [
101
+ {
102
+ "path": "main.hash",
103
+ "bytes": 32,
104
+ "sha256": "6dcc306b68fd7e53d35a9bbece24456e277ed0f7e6d233e64dbcbe036b573424"
105
+ },
106
+ {
107
+ "path": "main.mlirb",
108
+ "bytes": 1288155979,
109
+ "sha256": "0b8933cd04e18fb1ee13d65afb4657556d8116fc0b2a7476993ab0121970148b"
110
+ },
111
+ {
112
+ "path": "metadata.json",
113
+ "bytes": 421,
114
+ "sha256": "8f86c49628c15b65f7b5a8202238e023d1f2d94f360088dc51934f7225edbc76"
115
+ }
116
+ ],
117
+ "op_counts": {
118
+ "builtin.module": 1,
119
+ "coreai.cast": 1,
120
+ "coreai.concat": 45,
121
+ "coreai.constant": 205,
122
+ "coreai.decomposable.broadcasting_add": 132,
123
+ "coreai.decomposable.broadcasting_batch_matmul": 149,
124
+ "coreai.decomposable.broadcasting_mul": 182,
125
+ "coreai.decomposable.broadcasting_sub": 2,
126
+ "coreai.gather_nd": 1,
127
+ "coreai.gelu": 24,
128
+ "coreai.graph": 3,
129
+ "coreai.invoke": 50,
130
+ "coreai.output": 3,
131
+ "coreai.reduce_mean": 2,
132
+ "coreai.relu": 2,
133
+ "coreai.reshape": 123,
134
+ "coreai.rsqrt": 1,
135
+ "coreai.slice": 73,
136
+ "coreai.softmax": 24,
137
+ "coreai.split": 66,
138
+ "coreai.transpose": 217
139
+ },
140
+ "seconds": {
141
+ "torch_export": 2.820340709062293,
142
+ "convert_total": 1.4655615420779213,
143
+ "optimize": 0.027386375004425645,
144
+ "save": 0.7952649999642745,
145
+ "total": 23.542196666938253
146
+ },
147
+ "torch_export_gate": {
148
+ "status": "PASS",
149
+ "record": "provenance/export-gate.json",
150
+ "argmax_identical": 81,
151
+ "choice_score_rows": 81,
152
+ "max_probability_error": 9.506940841674805e-06,
153
+ "max_act_probability_error": 0.0,
154
+ "max_marker_abs_error": 5.7220458984375e-05,
155
+ "max_act_relative_error": 5.601309665091384e-06,
156
+ "tensor_status": "PASS"
157
+ },
158
+ "authoring_records": [
159
+ "/Users/majimadaisuke/code/coreai/laya-multilingual/results/authoring_fp32_s256.json"
160
+ ],
161
+ "runtime_gate": "NOT RUN — gate_laya_runtime.py <this folder> --compute cpu_only|gpu|neural_engine",
162
+ "environment": {
163
+ "date": "2026-09-23T14:31:21+09:00",
164
+ "machine": "Apple M4 Max",
165
+ "macos_version": "27.0",
166
+ "macos_build": "26A428",
167
+ "coreai_build": "coreai-build 3600.83.1",
168
+ "python": "3.11.13",
169
+ "packages": {
170
+ "torch": "2.9.0",
171
+ "coreai-torch": "0.4.1",
172
+ "coreai-core": "1.0.0b2",
173
+ "numpy": "2.3.5",
174
+ "safetensors": "0.7.0"
175
+ },
176
+ "argv": [
177
+ "conversion/laya/export_laya.py",
178
+ "--window",
179
+ "256",
180
+ "--dtype",
181
+ "fp32",
182
+ "--target",
183
+ "macos",
184
+ "--overwrite"
185
+ ]
186
+ },
187
+ "input_hashes": {
188
+ "/Users/majimadaisuke/code/coreai/laya-multilingual/results/authoring_fp32_s256.json": "4cf069ca9b7a81a4840ec8de6b0b8199fd32a61a5219619f854f37dad027a7fc",
189
+ "/Users/majimadaisuke/code/coreai/laya-multilingual/oracle/outputs_s256.npz": "208e3cddf263dbbc57bfaa278ef3213e81082de7a7cfa9b7b3001e9b862a12cf",
190
+ "/Users/majimadaisuke/code/coreai/coreai-models-community-laya-wt/conversion/laya/export_laya.py": "599ecf18a0c941f39347e9506afc5ad78e38aef257f17958e21dcbe057204b87",
191
+ "/Users/majimadaisuke/code/coreai/coreai-models-community-laya-wt/conversion/laya/_laya_model.py": "8b8825a3aa60f3e06d55f7542e814cb279df394d42e5becabdaec267ffcdb18c",
192
+ "/Users/majimadaisuke/code/coreai/coreai-models-community-laya-wt/conversion/laya/_laya_host.py": "c6a7240b27ae5af081daaba86a39486e70dcaa6db8e29f2845291ef94b7b8c80",
193
+ "/Users/majimadaisuke/code/coreai/coreai-models-community-laya-wt/conversion/laya/_gate_metrics.py": "d80a0d4ad9656d1c49cac10ac1f5f5f5332f90d6cfe6853581eda6ad1c5328ff"
194
+ },
195
+ "bytes": 1288156432
196
+ }
macos/fp32-s256/provenance/runtime-gate.json ADDED
The diff for this file is too large to render. See raw diff
 
macos/fp32-s256/reference.json ADDED
The diff for this file is too large to render. See raw diff
 
macos/fp32-s256/tokenizer/tokenizer_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<bos>",
3
+ "clean_up_tokenization_spaces": false,
4
+ "cls_token": "<bos>",
5
+ "eos_token": "<eos>",
6
+ "extra_special_tokens": {
7
+ "extra_0": "<start_of_turn>",
8
+ "extra_1": "<end_of_turn>"
9
+ },
10
+ "mask_token": "<mask>",
11
+ "model_input_names": [
12
+ "input_ids",
13
+ "attention_mask"
14
+ ],
15
+ "model_max_length": 8192,
16
+ "pad_token": "<pad>",
17
+ "padding_side": "right",
18
+ "sep_token": "<eos>",
19
+ "spaces_between_special_tokens": false,
20
+ "tokenizer_class": "PreTrainedTokenizerFast",
21
+ "unk_token": "<unk>"
22
+ }
macos/fp32-s512/laya_ml_fp32_s512.aimodel/main.hash ADDED
@@ -0,0 +1 @@
 
 
1
+
macos/fp32-s512/laya_ml_fp32_s512.aimodel/metadata.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "assetVersion" : "2.0",
3
+ "author" : "mlboydaisuke (coreai-model-zoo); weights Convai Innovations (laya)",
4
+ "producer" : "coreai-core 1.0.0b2",
5
+ "license" : "Apache-2.0",
6
+ "creationDate" : "20260923T053231Z",
7
+ "description" : "laya multilingual decision encoder (mmBERT-base + typed head); fp32; S=512; functions main + act; source convaiinnovations\/laya@1c5edc17a7acd8701df6fc341c0d179f1c62c982\/multilingual"
8
+ }
macos/fp32-s512/metadata.json ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata_version": "0.2",
3
+ "kind": "encoder",
4
+ "decision": {
5
+ "head": "encoder",
6
+ "layout": "laya",
7
+ "window": 512,
8
+ "head_max_len": 256,
9
+ "source_max_len": 1024,
10
+ "option_text_tokens": 48,
11
+ "cls_token_id": 2,
12
+ "sep_token_id": 1,
13
+ "pad_token_id": 0,
14
+ "mask_token_id": 4,
15
+ "functions": {
16
+ "main": "main",
17
+ "act": "act"
18
+ },
19
+ "inputs": {
20
+ "input_ids": {
21
+ "dtype": "int32",
22
+ "shape": [
23
+ 1,
24
+ 512
25
+ ],
26
+ "padding": "right, PAD 0"
27
+ },
28
+ "attention_mask": {
29
+ "dtype": "int32",
30
+ "shape": [
31
+ 1,
32
+ 512
33
+ ],
34
+ "values": "1 real token, 0 padding"
35
+ },
36
+ "qtype_onehot": {
37
+ "dtype": "float32",
38
+ "shape": [
39
+ 1,
40
+ 3
41
+ ],
42
+ "order": [
43
+ "choice",
44
+ "score",
45
+ "noul"
46
+ ]
47
+ }
48
+ },
49
+ "outputs": {
50
+ "token_logits": {
51
+ "dtype": "float32",
52
+ "shape": [
53
+ 1,
54
+ 512
55
+ ],
56
+ "read": "at the option marker positions"
57
+ },
58
+ "pooled_cls": {
59
+ "dtype": "float32",
60
+ "shape": [
61
+ 1,
62
+ 768
63
+ ],
64
+ "read": "input of the act function"
65
+ }
66
+ },
67
+ "act": {
68
+ "inputs": {
69
+ "pooled_cls": {
70
+ "dtype": "float32",
71
+ "shape": [
72
+ 1,
73
+ 768
74
+ ]
75
+ },
76
+ "feats": {
77
+ "dtype": "float32",
78
+ "shape": [
79
+ 1,
80
+ 4
81
+ ],
82
+ "order": [
83
+ "top1",
84
+ "top1_minus_top2",
85
+ "entropy_over_ln_max_k_2",
86
+ "max_k_2_over_255"
87
+ ],
88
+ "from": "softmax of the RAW marker logits (no temperature)"
89
+ }
90
+ },
91
+ "outputs": {
92
+ "act_logits": {
93
+ "dtype": "float32",
94
+ "shape": [
95
+ 1,
96
+ 2
97
+ ],
98
+ "class_0": "direct answer"
99
+ }
100
+ }
101
+ },
102
+ "source_temperature": [
103
+ 1.0,
104
+ 1.0,
105
+ 1.0
106
+ ],
107
+ "temperature": [
108
+ 2.042901414492613,
109
+ 3.684653192472766,
110
+ 3.629100511692587
111
+ ],
112
+ "temperature_by_options": {
113
+ "choice:2": 1.397546128996061,
114
+ "choice:3-5": 1.3591985667953796,
115
+ "choice:6-10": 1.0,
116
+ "choice:11+": 2.445877143176841,
117
+ "score:3-5": 3.684653192472766,
118
+ "noul:2": 3.629100511692587
119
+ },
120
+ "calibration_provenance": "litert-community/Laya-Multilingual-LiteRT laya_ml_calibration.json (4415 examples, six balanced fits; choice:6-10 fixed at T=1)"
121
+ },
122
+ "source": {
123
+ "hf_model_id": "convaiinnovations/laya",
124
+ "hf_revision": "1c5edc17a7acd8701df6fc341c0d179f1c62c982",
125
+ "subfolder": "multilingual"
126
+ },
127
+ "assets": {
128
+ "main": "laya_ml_fp32_s512.aimodel"
129
+ },
130
+ "language": {
131
+ "tokenizer": "convaiinnovations/laya/multilingual/tokenizer",
132
+ "vocab_size": 256000,
133
+ "max_context_length": 512
134
+ }
135
+ }
macos/fp32-s512/provenance/export-gate.json ADDED
The diff for this file is too large to render. See raw diff
 
macos/fp32-s512/provenance/export-manifest.json ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "status": "PASS",
3
+ "measure_only": false,
4
+ "model": "convaiinnovations/laya",
5
+ "model_sha": "1c5edc17a7acd8701df6fc341c0d179f1c62c982",
6
+ "subfolder": "multilingual",
7
+ "bundle": "laya_ml_fp32_s512.aimodel",
8
+ "intended_runtime": "macos",
9
+ "format": "JIT .aimodel (portable; multifunction main + act)",
10
+ "aot": false,
11
+ "precision": "fp32",
12
+ "fp32_islands": [
13
+ "all"
14
+ ],
15
+ "act_precision": "fp32",
16
+ "window": 512,
17
+ "inputs": {
18
+ "input_ids": {
19
+ "dtype": "int32",
20
+ "shape": [
21
+ 1,
22
+ 512
23
+ ],
24
+ "padding": "right, PAD 0"
25
+ },
26
+ "attention_mask": {
27
+ "dtype": "int32",
28
+ "shape": [
29
+ 1,
30
+ 512
31
+ ],
32
+ "values": "1 real token, 0 padding"
33
+ },
34
+ "qtype_onehot": {
35
+ "dtype": "float32",
36
+ "shape": [
37
+ 1,
38
+ 3
39
+ ],
40
+ "order": [
41
+ "choice",
42
+ "score",
43
+ "noul"
44
+ ]
45
+ }
46
+ },
47
+ "outputs": {
48
+ "token_logits": {
49
+ "dtype": "float32",
50
+ "shape": [
51
+ 1,
52
+ 512
53
+ ],
54
+ "read": "at the option marker positions"
55
+ },
56
+ "pooled_cls": {
57
+ "dtype": "float32",
58
+ "shape": [
59
+ 1,
60
+ 768
61
+ ],
62
+ "read": "input of the act function"
63
+ }
64
+ },
65
+ "act": {
66
+ "inputs": {
67
+ "pooled_cls": {
68
+ "dtype": "float32",
69
+ "shape": [
70
+ 1,
71
+ 768
72
+ ]
73
+ },
74
+ "feats": {
75
+ "dtype": "float32",
76
+ "shape": [
77
+ 1,
78
+ 4
79
+ ],
80
+ "order": [
81
+ "top1",
82
+ "top1_minus_top2",
83
+ "entropy_over_ln_max_k_2",
84
+ "max_k_2_over_255"
85
+ ],
86
+ "from": "softmax of the RAW marker logits (no temperature)"
87
+ }
88
+ },
89
+ "outputs": {
90
+ "act_logits": {
91
+ "dtype": "float32",
92
+ "shape": [
93
+ 1,
94
+ 2
95
+ ],
96
+ "class_0": "direct answer"
97
+ }
98
+ }
99
+ },
100
+ "files": [
101
+ {
102
+ "path": "main.hash",
103
+ "bytes": 32,
104
+ "sha256": "3a8161c3c9ef90c7d791c318b55843b537cc2c704e802e8e9e497de91f46d64a"
105
+ },
106
+ {
107
+ "path": "main.mlirb",
108
+ "bytes": 1289073523,
109
+ "sha256": "0d624464a36edfb141f2992a28670fb393039c47acf8a180aa2478ddfc3eed15"
110
+ },
111
+ {
112
+ "path": "metadata.json",
113
+ "bytes": 421,
114
+ "sha256": "049d6c2993afd781ab484b60e12405e39216211a57880af0f7182b64a1c48156"
115
+ }
116
+ ],
117
+ "op_counts": {
118
+ "builtin.module": 1,
119
+ "coreai.cast": 1,
120
+ "coreai.concat": 45,
121
+ "coreai.constant": 205,
122
+ "coreai.decomposable.broadcasting_add": 132,
123
+ "coreai.decomposable.broadcasting_batch_matmul": 149,
124
+ "coreai.decomposable.broadcasting_mul": 182,
125
+ "coreai.decomposable.broadcasting_sub": 2,
126
+ "coreai.gather_nd": 1,
127
+ "coreai.gelu": 24,
128
+ "coreai.graph": 3,
129
+ "coreai.invoke": 50,
130
+ "coreai.output": 3,
131
+ "coreai.reduce_mean": 2,
132
+ "coreai.relu": 2,
133
+ "coreai.reshape": 123,
134
+ "coreai.rsqrt": 1,
135
+ "coreai.slice": 73,
136
+ "coreai.softmax": 24,
137
+ "coreai.split": 66,
138
+ "coreai.transpose": 217
139
+ },
140
+ "seconds": {
141
+ "torch_export": 2.7350043340120465,
142
+ "convert_total": 1.2815615829313174,
143
+ "optimize": 0.022742250002920628,
144
+ "save": 0.697535999934189,
145
+ "total": 34.18819129106123
146
+ },
147
+ "torch_export_gate": {
148
+ "status": "PASS",
149
+ "record": "provenance/export-gate.json",
150
+ "argmax_identical": 81,
151
+ "choice_score_rows": 81,
152
+ "max_probability_error": 9.506940841674805e-06,
153
+ "max_act_probability_error": 0.0,
154
+ "max_marker_abs_error": 6.771087646484375e-05,
155
+ "max_act_relative_error": 5.601309665091384e-06,
156
+ "tensor_status": "PASS"
157
+ },
158
+ "authoring_records": [
159
+ "/Users/majimadaisuke/code/coreai/laya-multilingual/results/authoring_fp32_s512.json"
160
+ ],
161
+ "runtime_gate": "NOT RUN — gate_laya_runtime.py <this folder> --compute cpu_only|gpu|neural_engine",
162
+ "environment": {
163
+ "date": "2026-09-23T14:32:32+09:00",
164
+ "machine": "Apple M4 Max",
165
+ "macos_version": "27.0",
166
+ "macos_build": "26A428",
167
+ "coreai_build": "coreai-build 3600.83.1",
168
+ "python": "3.11.13",
169
+ "packages": {
170
+ "torch": "2.9.0",
171
+ "coreai-torch": "0.4.1",
172
+ "coreai-core": "1.0.0b2",
173
+ "numpy": "2.3.5",
174
+ "safetensors": "0.7.0"
175
+ },
176
+ "argv": [
177
+ "conversion/laya/export_laya.py",
178
+ "--window",
179
+ "512",
180
+ "--dtype",
181
+ "fp32",
182
+ "--target",
183
+ "macos",
184
+ "--overwrite"
185
+ ]
186
+ },
187
+ "input_hashes": {
188
+ "/Users/majimadaisuke/code/coreai/laya-multilingual/results/authoring_fp32_s512.json": "22df54fd540cfdf6e3755772663592664306c15059b43bdf2887491a43a82341",
189
+ "/Users/majimadaisuke/code/coreai/laya-multilingual/oracle/outputs_s512.npz": "89c40615a9c9ce114f7777f444f3f53b61587847e99875a91c7a7b97032ab159",
190
+ "/Users/majimadaisuke/code/coreai/coreai-models-community-laya-wt/conversion/laya/export_laya.py": "599ecf18a0c941f39347e9506afc5ad78e38aef257f17958e21dcbe057204b87",
191
+ "/Users/majimadaisuke/code/coreai/coreai-models-community-laya-wt/conversion/laya/_laya_model.py": "8b8825a3aa60f3e06d55f7542e814cb279df394d42e5becabdaec267ffcdb18c",
192
+ "/Users/majimadaisuke/code/coreai/coreai-models-community-laya-wt/conversion/laya/_laya_host.py": "c6a7240b27ae5af081daaba86a39486e70dcaa6db8e29f2845291ef94b7b8c80",
193
+ "/Users/majimadaisuke/code/coreai/coreai-models-community-laya-wt/conversion/laya/_gate_metrics.py": "d80a0d4ad9656d1c49cac10ac1f5f5f5332f90d6cfe6853581eda6ad1c5328ff"
194
+ },
195
+ "bytes": 1289073976
196
+ }
macos/fp32-s512/provenance/runtime-gate.json ADDED
The diff for this file is too large to render. See raw diff
 
macos/fp32-s512/reference.json ADDED
The diff for this file is too large to render. See raw diff
 
macos/fp32-s512/tokenizer/tokenizer_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<bos>",
3
+ "clean_up_tokenization_spaces": false,
4
+ "cls_token": "<bos>",
5
+ "eos_token": "<eos>",
6
+ "extra_special_tokens": {
7
+ "extra_0": "<start_of_turn>",
8
+ "extra_1": "<end_of_turn>"
9
+ },
10
+ "mask_token": "<mask>",
11
+ "model_input_names": [
12
+ "input_ids",
13
+ "attention_mask"
14
+ ],
15
+ "model_max_length": 8192,
16
+ "pad_token": "<pad>",
17
+ "padding_side": "right",
18
+ "sep_token": "<eos>",
19
+ "spaces_between_special_tokens": false,
20
+ "tokenizer_class": "PreTrainedTokenizerFast",
21
+ "unk_token": "<unk>"
22
+ }
macos/wfp16-s256/laya_ml_wfp16_s256.aimodel/main.hash ADDED
@@ -0,0 +1 @@
 
 
1
+ �=��V/��:ņ\��k�"�=���BL��`w,
macos/wfp16-s256/laya_ml_wfp16_s256.aimodel/metadata.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "description" : "laya multilingual decision encoder (mmBERT-base + typed head); wfp16; S=256; functions main + act; source convaiinnovations\/laya@1c5edc17a7acd8701df6fc341c0d179f1c62c982\/multilingual",
3
+ "producer" : "coreai-core 1.0.0b2",
4
+ "assetVersion" : "2.0",
5
+ "creationDate" : "20260923T052856Z",
6
+ "author" : "mlboydaisuke (coreai-model-zoo); weights Convai Innovations (laya)",
7
+ "license" : "Apache-2.0"
8
+ }
macos/wfp16-s256/metadata.json ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata_version": "0.2",
3
+ "kind": "encoder",
4
+ "decision": {
5
+ "head": "encoder",
6
+ "layout": "laya",
7
+ "window": 256,
8
+ "head_max_len": 256,
9
+ "source_max_len": 1024,
10
+ "option_text_tokens": 48,
11
+ "cls_token_id": 2,
12
+ "sep_token_id": 1,
13
+ "pad_token_id": 0,
14
+ "mask_token_id": 4,
15
+ "functions": {
16
+ "main": "main",
17
+ "act": "act"
18
+ },
19
+ "inputs": {
20
+ "input_ids": {
21
+ "dtype": "int32",
22
+ "shape": [
23
+ 1,
24
+ 256
25
+ ],
26
+ "padding": "right, PAD 0"
27
+ },
28
+ "attention_mask": {
29
+ "dtype": "int32",
30
+ "shape": [
31
+ 1,
32
+ 256
33
+ ],
34
+ "values": "1 real token, 0 padding"
35
+ },
36
+ "qtype_onehot": {
37
+ "dtype": "float32",
38
+ "shape": [
39
+ 1,
40
+ 3
41
+ ],
42
+ "order": [
43
+ "choice",
44
+ "score",
45
+ "noul"
46
+ ]
47
+ }
48
+ },
49
+ "outputs": {
50
+ "token_logits": {
51
+ "dtype": "float32",
52
+ "shape": [
53
+ 1,
54
+ 256
55
+ ],
56
+ "read": "at the option marker positions"
57
+ },
58
+ "pooled_cls": {
59
+ "dtype": "float32",
60
+ "shape": [
61
+ 1,
62
+ 768
63
+ ],
64
+ "read": "input of the act function"
65
+ }
66
+ },
67
+ "act": {
68
+ "inputs": {
69
+ "pooled_cls": {
70
+ "dtype": "float32",
71
+ "shape": [
72
+ 1,
73
+ 768
74
+ ]
75
+ },
76
+ "feats": {
77
+ "dtype": "float32",
78
+ "shape": [
79
+ 1,
80
+ 4
81
+ ],
82
+ "order": [
83
+ "top1",
84
+ "top1_minus_top2",
85
+ "entropy_over_ln_max_k_2",
86
+ "max_k_2_over_255"
87
+ ],
88
+ "from": "softmax of the RAW marker logits (no temperature)"
89
+ }
90
+ },
91
+ "outputs": {
92
+ "act_logits": {
93
+ "dtype": "float32",
94
+ "shape": [
95
+ 1,
96
+ 2
97
+ ],
98
+ "class_0": "direct answer"
99
+ }
100
+ }
101
+ },
102
+ "source_temperature": [
103
+ 1.0,
104
+ 1.0,
105
+ 1.0
106
+ ],
107
+ "temperature": [
108
+ 2.042901414492613,
109
+ 3.684653192472766,
110
+ 3.629100511692587
111
+ ],
112
+ "temperature_by_options": {
113
+ "choice:2": 1.397546128996061,
114
+ "choice:3-5": 1.3591985667953796,
115
+ "choice:6-10": 1.0,
116
+ "choice:11+": 2.445877143176841,
117
+ "score:3-5": 3.684653192472766,
118
+ "noul:2": 3.629100511692587
119
+ },
120
+ "calibration_provenance": "litert-community/Laya-Multilingual-LiteRT laya_ml_calibration.json (4415 examples, six balanced fits; choice:6-10 fixed at T=1)"
121
+ },
122
+ "source": {
123
+ "hf_model_id": "convaiinnovations/laya",
124
+ "hf_revision": "1c5edc17a7acd8701df6fc341c0d179f1c62c982",
125
+ "subfolder": "multilingual"
126
+ },
127
+ "assets": {
128
+ "main": "laya_ml_wfp16_s256.aimodel"
129
+ },
130
+ "language": {
131
+ "tokenizer": "convaiinnovations/laya/multilingual/tokenizer",
132
+ "vocab_size": 256000,
133
+ "max_context_length": 256
134
+ }
135
+ }
macos/wfp16-s256/provenance/export-gate.json ADDED
The diff for this file is too large to render. See raw diff
 
macos/wfp16-s256/provenance/export-manifest.json ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "status": "PASS",
3
+ "measure_only": false,
4
+ "model": "convaiinnovations/laya",
5
+ "model_sha": "1c5edc17a7acd8701df6fc341c0d179f1c62c982",
6
+ "subfolder": "multilingual",
7
+ "bundle": "laya_ml_wfp16_s256.aimodel",
8
+ "intended_runtime": "macos",
9
+ "format": "JIT .aimodel (portable; multifunction main + act)",
10
+ "aot": false,
11
+ "precision": "wfp16",
12
+ "fp32_islands": [
13
+ "all"
14
+ ],
15
+ "act_precision": "fp32",
16
+ "window": 256,
17
+ "inputs": {
18
+ "input_ids": {
19
+ "dtype": "int32",
20
+ "shape": [
21
+ 1,
22
+ 256
23
+ ],
24
+ "padding": "right, PAD 0"
25
+ },
26
+ "attention_mask": {
27
+ "dtype": "int32",
28
+ "shape": [
29
+ 1,
30
+ 256
31
+ ],
32
+ "values": "1 real token, 0 padding"
33
+ },
34
+ "qtype_onehot": {
35
+ "dtype": "float32",
36
+ "shape": [
37
+ 1,
38
+ 3
39
+ ],
40
+ "order": [
41
+ "choice",
42
+ "score",
43
+ "noul"
44
+ ]
45
+ }
46
+ },
47
+ "outputs": {
48
+ "token_logits": {
49
+ "dtype": "float32",
50
+ "shape": [
51
+ 1,
52
+ 256
53
+ ],
54
+ "read": "at the option marker positions"
55
+ },
56
+ "pooled_cls": {
57
+ "dtype": "float32",
58
+ "shape": [
59
+ 1,
60
+ 768
61
+ ],
62
+ "read": "input of the act function"
63
+ }
64
+ },
65
+ "act": {
66
+ "inputs": {
67
+ "pooled_cls": {
68
+ "dtype": "float32",
69
+ "shape": [
70
+ 1,
71
+ 768
72
+ ]
73
+ },
74
+ "feats": {
75
+ "dtype": "float32",
76
+ "shape": [
77
+ 1,
78
+ 4
79
+ ],
80
+ "order": [
81
+ "top1",
82
+ "top1_minus_top2",
83
+ "entropy_over_ln_max_k_2",
84
+ "max_k_2_over_255"
85
+ ],
86
+ "from": "softmax of the RAW marker logits (no temperature)"
87
+ }
88
+ },
89
+ "outputs": {
90
+ "act_logits": {
91
+ "dtype": "float32",
92
+ "shape": [
93
+ 1,
94
+ 2
95
+ ],
96
+ "class_0": "direct answer"
97
+ }
98
+ }
99
+ },
100
+ "files": [
101
+ {
102
+ "path": "main.hash",
103
+ "bytes": 32,
104
+ "sha256": "14981993ab712dfcde5a694b41ff15383d58fe4500be96b10677384084ab44ae"
105
+ },
106
+ {
107
+ "path": "main.mlirb",
108
+ "bytes": 644854735,
109
+ "sha256": "ea3dd8178f562ffd1ac63ac5861a5cb6f26be522d73d8f93f4424c99a960772c"
110
+ },
111
+ {
112
+ "path": "metadata.json",
113
+ "bytes": 422,
114
+ "sha256": "0fa042a4284052e4a3eae22a8a077653469e8ef89c09f095665971447e0b1383"
115
+ }
116
+ ],
117
+ "op_counts": {
118
+ "builtin.module": 1,
119
+ "coreai.cast": 101,
120
+ "coreai.concat": 45,
121
+ "coreai.constant": 206,
122
+ "coreai.decomposable.broadcasting_add": 132,
123
+ "coreai.decomposable.broadcasting_batch_matmul": 149,
124
+ "coreai.decomposable.broadcasting_mul": 182,
125
+ "coreai.decomposable.broadcasting_sub": 2,
126
+ "coreai.gather_nd": 1,
127
+ "coreai.gelu": 24,
128
+ "coreai.graph": 3,
129
+ "coreai.invoke": 50,
130
+ "coreai.output": 3,
131
+ "coreai.reduce_mean": 2,
132
+ "coreai.relu": 2,
133
+ "coreai.reshape": 124,
134
+ "coreai.rsqrt": 1,
135
+ "coreai.slice": 73,
136
+ "coreai.softmax": 24,
137
+ "coreai.split": 66,
138
+ "coreai.transpose": 217
139
+ },
140
+ "seconds": {
141
+ "torch_export": 2.953895958024077,
142
+ "convert_total": 0.9251217909622937,
143
+ "optimize": 0.026609541033394635,
144
+ "save": 0.3654880420072004,
145
+ "total": 19.912367500015534
146
+ },
147
+ "torch_export_gate": {
148
+ "status": "PASS",
149
+ "record": "provenance/export-gate.json",
150
+ "argmax_identical": 81,
151
+ "choice_score_rows": 81,
152
+ "max_probability_error": 9.506940841674805e-06,
153
+ "max_act_probability_error": 0.0,
154
+ "max_marker_abs_error": 5.7220458984375e-05,
155
+ "max_act_relative_error": 5.601309665091384e-06,
156
+ "tensor_status": "PASS"
157
+ },
158
+ "authoring_records": [
159
+ "/Users/majimadaisuke/code/coreai/laya-multilingual/results/authoring_fp32_s256.json",
160
+ "/Users/majimadaisuke/code/coreai/laya-multilingual/results/authoring_wfp16_s256.json"
161
+ ],
162
+ "runtime_gate": "NOT RUN — gate_laya_runtime.py <this folder> --compute cpu_only|gpu|neural_engine",
163
+ "environment": {
164
+ "date": "2026-09-23T14:28:56+09:00",
165
+ "machine": "Apple M4 Max",
166
+ "macos_version": "27.0",
167
+ "macos_build": "26A428",
168
+ "coreai_build": "coreai-build 3600.83.1",
169
+ "python": "3.11.13",
170
+ "packages": {
171
+ "torch": "2.9.0",
172
+ "coreai-torch": "0.4.1",
173
+ "coreai-core": "1.0.0b2",
174
+ "numpy": "2.3.5",
175
+ "safetensors": "0.7.0"
176
+ },
177
+ "argv": [
178
+ "conversion/laya/export_laya.py",
179
+ "--window",
180
+ "256",
181
+ "--dtype",
182
+ "wfp16",
183
+ "--target",
184
+ "macos",
185
+ "--overwrite"
186
+ ]
187
+ },
188
+ "input_hashes": {
189
+ "/Users/majimadaisuke/code/coreai/laya-multilingual/results/authoring_fp32_s256.json": "4cf069ca9b7a81a4840ec8de6b0b8199fd32a61a5219619f854f37dad027a7fc",
190
+ "/Users/majimadaisuke/code/coreai/laya-multilingual/results/authoring_wfp16_s256.json": "72a3f31a980b4a4ffc0832c85410fed029083a42c24c5e72e7830de8cb573fea",
191
+ "/Users/majimadaisuke/code/coreai/laya-multilingual/oracle/outputs_s256.npz": "208e3cddf263dbbc57bfaa278ef3213e81082de7a7cfa9b7b3001e9b862a12cf",
192
+ "/Users/majimadaisuke/code/coreai/coreai-models-community-laya-wt/conversion/laya/export_laya.py": "599ecf18a0c941f39347e9506afc5ad78e38aef257f17958e21dcbe057204b87",
193
+ "/Users/majimadaisuke/code/coreai/coreai-models-community-laya-wt/conversion/laya/_laya_model.py": "8b8825a3aa60f3e06d55f7542e814cb279df394d42e5becabdaec267ffcdb18c",
194
+ "/Users/majimadaisuke/code/coreai/coreai-models-community-laya-wt/conversion/laya/_laya_host.py": "c6a7240b27ae5af081daaba86a39486e70dcaa6db8e29f2845291ef94b7b8c80",
195
+ "/Users/majimadaisuke/code/coreai/coreai-models-community-laya-wt/conversion/laya/_gate_metrics.py": "d80a0d4ad9656d1c49cac10ac1f5f5f5332f90d6cfe6853581eda6ad1c5328ff"
196
+ },
197
+ "bytes": 644855189
198
+ }
macos/wfp16-s256/provenance/runtime-gate.json ADDED
The diff for this file is too large to render. See raw diff
 
macos/wfp16-s256/reference.json ADDED
The diff for this file is too large to render. See raw diff
 
macos/wfp16-s256/tokenizer/tokenizer_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<bos>",
3
+ "clean_up_tokenization_spaces": false,
4
+ "cls_token": "<bos>",
5
+ "eos_token": "<eos>",
6
+ "extra_special_tokens": {
7
+ "extra_0": "<start_of_turn>",
8
+ "extra_1": "<end_of_turn>"
9
+ },
10
+ "mask_token": "<mask>",
11
+ "model_input_names": [
12
+ "input_ids",
13
+ "attention_mask"
14
+ ],
15
+ "model_max_length": 8192,
16
+ "pad_token": "<pad>",
17
+ "padding_side": "right",
18
+ "sep_token": "<eos>",
19
+ "spaces_between_special_tokens": false,
20
+ "tokenizer_class": "PreTrainedTokenizerFast",
21
+ "unk_token": "<unk>"
22
+ }
macos/wfp16-s512/laya_ml_wfp16_s512.aimodel/main.hash ADDED
@@ -0,0 +1 @@
 
 
1
+ =�9�F�w���R~cfX��W0�L�+�9|�az
macos/wfp16-s512/laya_ml_wfp16_s512.aimodel/metadata.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "assetVersion" : "2.0",
3
+ "description" : "laya multilingual decision encoder (mmBERT-base + typed head); wfp16; S=512; functions main + act; source convaiinnovations\/laya@1c5edc17a7acd8701df6fc341c0d179f1c62c982\/multilingual",
4
+ "producer" : "coreai-core 1.0.0b2",
5
+ "license" : "Apache-2.0",
6
+ "creationDate" : "20260923T052959Z",
7
+ "author" : "mlboydaisuke (coreai-model-zoo); weights Convai Innovations (laya)"
8
+ }
macos/wfp16-s512/metadata.json ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "metadata_version": "0.2",
3
+ "kind": "encoder",
4
+ "decision": {
5
+ "head": "encoder",
6
+ "layout": "laya",
7
+ "window": 512,
8
+ "head_max_len": 256,
9
+ "source_max_len": 1024,
10
+ "option_text_tokens": 48,
11
+ "cls_token_id": 2,
12
+ "sep_token_id": 1,
13
+ "pad_token_id": 0,
14
+ "mask_token_id": 4,
15
+ "functions": {
16
+ "main": "main",
17
+ "act": "act"
18
+ },
19
+ "inputs": {
20
+ "input_ids": {
21
+ "dtype": "int32",
22
+ "shape": [
23
+ 1,
24
+ 512
25
+ ],
26
+ "padding": "right, PAD 0"
27
+ },
28
+ "attention_mask": {
29
+ "dtype": "int32",
30
+ "shape": [
31
+ 1,
32
+ 512
33
+ ],
34
+ "values": "1 real token, 0 padding"
35
+ },
36
+ "qtype_onehot": {
37
+ "dtype": "float32",
38
+ "shape": [
39
+ 1,
40
+ 3
41
+ ],
42
+ "order": [
43
+ "choice",
44
+ "score",
45
+ "noul"
46
+ ]
47
+ }
48
+ },
49
+ "outputs": {
50
+ "token_logits": {
51
+ "dtype": "float32",
52
+ "shape": [
53
+ 1,
54
+ 512
55
+ ],
56
+ "read": "at the option marker positions"
57
+ },
58
+ "pooled_cls": {
59
+ "dtype": "float32",
60
+ "shape": [
61
+ 1,
62
+ 768
63
+ ],
64
+ "read": "input of the act function"
65
+ }
66
+ },
67
+ "act": {
68
+ "inputs": {
69
+ "pooled_cls": {
70
+ "dtype": "float32",
71
+ "shape": [
72
+ 1,
73
+ 768
74
+ ]
75
+ },
76
+ "feats": {
77
+ "dtype": "float32",
78
+ "shape": [
79
+ 1,
80
+ 4
81
+ ],
82
+ "order": [
83
+ "top1",
84
+ "top1_minus_top2",
85
+ "entropy_over_ln_max_k_2",
86
+ "max_k_2_over_255"
87
+ ],
88
+ "from": "softmax of the RAW marker logits (no temperature)"
89
+ }
90
+ },
91
+ "outputs": {
92
+ "act_logits": {
93
+ "dtype": "float32",
94
+ "shape": [
95
+ 1,
96
+ 2
97
+ ],
98
+ "class_0": "direct answer"
99
+ }
100
+ }
101
+ },
102
+ "source_temperature": [
103
+ 1.0,
104
+ 1.0,
105
+ 1.0
106
+ ],
107
+ "temperature": [
108
+ 2.042901414492613,
109
+ 3.684653192472766,
110
+ 3.629100511692587
111
+ ],
112
+ "temperature_by_options": {
113
+ "choice:2": 1.397546128996061,
114
+ "choice:3-5": 1.3591985667953796,
115
+ "choice:6-10": 1.0,
116
+ "choice:11+": 2.445877143176841,
117
+ "score:3-5": 3.684653192472766,
118
+ "noul:2": 3.629100511692587
119
+ },
120
+ "calibration_provenance": "litert-community/Laya-Multilingual-LiteRT laya_ml_calibration.json (4415 examples, six balanced fits; choice:6-10 fixed at T=1)"
121
+ },
122
+ "source": {
123
+ "hf_model_id": "convaiinnovations/laya",
124
+ "hf_revision": "1c5edc17a7acd8701df6fc341c0d179f1c62c982",
125
+ "subfolder": "multilingual"
126
+ },
127
+ "assets": {
128
+ "main": "laya_ml_wfp16_s512.aimodel"
129
+ },
130
+ "language": {
131
+ "tokenizer": "convaiinnovations/laya/multilingual/tokenizer",
132
+ "vocab_size": 256000,
133
+ "max_context_length": 512
134
+ }
135
+ }
macos/wfp16-s512/provenance/export-gate.json ADDED
The diff for this file is too large to render. See raw diff
 
macos/wfp16-s512/provenance/export-manifest.json ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "status": "PASS",
3
+ "measure_only": false,
4
+ "model": "convaiinnovations/laya",
5
+ "model_sha": "1c5edc17a7acd8701df6fc341c0d179f1c62c982",
6
+ "subfolder": "multilingual",
7
+ "bundle": "laya_ml_wfp16_s512.aimodel",
8
+ "intended_runtime": "macos",
9
+ "format": "JIT .aimodel (portable; multifunction main + act)",
10
+ "aot": false,
11
+ "precision": "wfp16",
12
+ "fp32_islands": [
13
+ "all"
14
+ ],
15
+ "act_precision": "fp32",
16
+ "window": 512,
17
+ "inputs": {
18
+ "input_ids": {
19
+ "dtype": "int32",
20
+ "shape": [
21
+ 1,
22
+ 512
23
+ ],
24
+ "padding": "right, PAD 0"
25
+ },
26
+ "attention_mask": {
27
+ "dtype": "int32",
28
+ "shape": [
29
+ 1,
30
+ 512
31
+ ],
32
+ "values": "1 real token, 0 padding"
33
+ },
34
+ "qtype_onehot": {
35
+ "dtype": "float32",
36
+ "shape": [
37
+ 1,
38
+ 3
39
+ ],
40
+ "order": [
41
+ "choice",
42
+ "score",
43
+ "noul"
44
+ ]
45
+ }
46
+ },
47
+ "outputs": {
48
+ "token_logits": {
49
+ "dtype": "float32",
50
+ "shape": [
51
+ 1,
52
+ 512
53
+ ],
54
+ "read": "at the option marker positions"
55
+ },
56
+ "pooled_cls": {
57
+ "dtype": "float32",
58
+ "shape": [
59
+ 1,
60
+ 768
61
+ ],
62
+ "read": "input of the act function"
63
+ }
64
+ },
65
+ "act": {
66
+ "inputs": {
67
+ "pooled_cls": {
68
+ "dtype": "float32",
69
+ "shape": [
70
+ 1,
71
+ 768
72
+ ]
73
+ },
74
+ "feats": {
75
+ "dtype": "float32",
76
+ "shape": [
77
+ 1,
78
+ 4
79
+ ],
80
+ "order": [
81
+ "top1",
82
+ "top1_minus_top2",
83
+ "entropy_over_ln_max_k_2",
84
+ "max_k_2_over_255"
85
+ ],
86
+ "from": "softmax of the RAW marker logits (no temperature)"
87
+ }
88
+ },
89
+ "outputs": {
90
+ "act_logits": {
91
+ "dtype": "float32",
92
+ "shape": [
93
+ 1,
94
+ 2
95
+ ],
96
+ "class_0": "direct answer"
97
+ }
98
+ }
99
+ },
100
+ "files": [
101
+ {
102
+ "path": "main.hash",
103
+ "bytes": 32,
104
+ "sha256": "b48956aff570cdd07f363dd243d965818879011dfd94cb187b414a1d35067aaf"
105
+ },
106
+ {
107
+ "path": "main.mlirb",
108
+ "bytes": 645772283,
109
+ "sha256": "3dd13911fa46cb7794f9b5527e63665817d1e757309c4cd92bf7397cf2617a06"
110
+ },
111
+ {
112
+ "path": "metadata.json",
113
+ "bytes": 422,
114
+ "sha256": "845279c73db455938feced18892a13eda5528cda50d2968f83affa1ac5301f30"
115
+ }
116
+ ],
117
+ "op_counts": {
118
+ "builtin.module": 1,
119
+ "coreai.cast": 101,
120
+ "coreai.concat": 45,
121
+ "coreai.constant": 206,
122
+ "coreai.decomposable.broadcasting_add": 132,
123
+ "coreai.decomposable.broadcasting_batch_matmul": 149,
124
+ "coreai.decomposable.broadcasting_mul": 182,
125
+ "coreai.decomposable.broadcasting_sub": 2,
126
+ "coreai.gather_nd": 1,
127
+ "coreai.gelu": 24,
128
+ "coreai.graph": 3,
129
+ "coreai.invoke": 50,
130
+ "coreai.output": 3,
131
+ "coreai.reduce_mean": 2,
132
+ "coreai.relu": 2,
133
+ "coreai.reshape": 124,
134
+ "coreai.rsqrt": 1,
135
+ "coreai.slice": 73,
136
+ "coreai.softmax": 24,
137
+ "coreai.split": 66,
138
+ "coreai.transpose": 217
139
+ },
140
+ "seconds": {
141
+ "torch_export": 2.5944650830933824,
142
+ "convert_total": 0.9086021248949692,
143
+ "optimize": 0.02510629198513925,
144
+ "save": 0.3723792920354754,
145
+ "total": 32.12391641596332
146
+ },
147
+ "torch_export_gate": {
148
+ "status": "PASS",
149
+ "record": "provenance/export-gate.json",
150
+ "argmax_identical": 81,
151
+ "choice_score_rows": 81,
152
+ "max_probability_error": 9.506940841674805e-06,
153
+ "max_act_probability_error": 0.0,
154
+ "max_marker_abs_error": 6.771087646484375e-05,
155
+ "max_act_relative_error": 5.601309665091384e-06,
156
+ "tensor_status": "PASS"
157
+ },
158
+ "authoring_records": [
159
+ "/Users/majimadaisuke/code/coreai/laya-multilingual/results/authoring_fp32_s512.json",
160
+ "/Users/majimadaisuke/code/coreai/laya-multilingual/results/authoring_wfp16_s512.json"
161
+ ],
162
+ "runtime_gate": "NOT RUN — gate_laya_runtime.py <this folder> --compute cpu_only|gpu|neural_engine",
163
+ "environment": {
164
+ "date": "2026-09-23T14:30:00+09:00",
165
+ "machine": "Apple M4 Max",
166
+ "macos_version": "27.0",
167
+ "macos_build": "26A428",
168
+ "coreai_build": "coreai-build 3600.83.1",
169
+ "python": "3.11.13",
170
+ "packages": {
171
+ "torch": "2.9.0",
172
+ "coreai-torch": "0.4.1",
173
+ "coreai-core": "1.0.0b2",
174
+ "numpy": "2.3.5",
175
+ "safetensors": "0.7.0"
176
+ },
177
+ "argv": [
178
+ "conversion/laya/export_laya.py",
179
+ "--window",
180
+ "512",
181
+ "--dtype",
182
+ "wfp16",
183
+ "--target",
184
+ "macos",
185
+ "--overwrite"
186
+ ]
187
+ },
188
+ "input_hashes": {
189
+ "/Users/majimadaisuke/code/coreai/laya-multilingual/results/authoring_fp32_s512.json": "22df54fd540cfdf6e3755772663592664306c15059b43bdf2887491a43a82341",
190
+ "/Users/majimadaisuke/code/coreai/laya-multilingual/results/authoring_wfp16_s512.json": "22c6215db4688c0a4ae42227169acc3c277f1597cb83c2216f0764abe86f7bc0",
191
+ "/Users/majimadaisuke/code/coreai/laya-multilingual/oracle/outputs_s512.npz": "89c40615a9c9ce114f7777f444f3f53b61587847e99875a91c7a7b97032ab159",
192
+ "/Users/majimadaisuke/code/coreai/coreai-models-community-laya-wt/conversion/laya/export_laya.py": "599ecf18a0c941f39347e9506afc5ad78e38aef257f17958e21dcbe057204b87",
193
+ "/Users/majimadaisuke/code/coreai/coreai-models-community-laya-wt/conversion/laya/_laya_model.py": "8b8825a3aa60f3e06d55f7542e814cb279df394d42e5becabdaec267ffcdb18c",
194
+ "/Users/majimadaisuke/code/coreai/coreai-models-community-laya-wt/conversion/laya/_laya_host.py": "c6a7240b27ae5af081daaba86a39486e70dcaa6db8e29f2845291ef94b7b8c80",
195
+ "/Users/majimadaisuke/code/coreai/coreai-models-community-laya-wt/conversion/laya/_gate_metrics.py": "d80a0d4ad9656d1c49cac10ac1f5f5f5332f90d6cfe6853581eda6ad1c5328ff"
196
+ },
197
+ "bytes": 645772737
198
+ }
macos/wfp16-s512/provenance/runtime-gate.json ADDED
The diff for this file is too large to render. See raw diff
 
macos/wfp16-s512/reference.json ADDED
The diff for this file is too large to render. See raw diff
 
macos/wfp16-s512/tokenizer/tokenizer_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<bos>",
3
+ "clean_up_tokenization_spaces": false,
4
+ "cls_token": "<bos>",
5
+ "eos_token": "<eos>",
6
+ "extra_special_tokens": {
7
+ "extra_0": "<start_of_turn>",
8
+ "extra_1": "<end_of_turn>"
9
+ },
10
+ "mask_token": "<mask>",
11
+ "model_input_names": [
12
+ "input_ids",
13
+ "attention_mask"
14
+ ],
15
+ "model_max_length": 8192,
16
+ "pad_token": "<pad>",
17
+ "padding_side": "right",
18
+ "sep_token": "<eos>",
19
+ "spaces_between_special_tokens": false,
20
+ "tokenizer_class": "PreTrainedTokenizerFast",
21
+ "unk_token": "<unk>"
22
+ }
rl_agent_config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "encoder": "jhu-clsp/mmBERT-base",
3
+ "head_layers": 2,
4
+ "max_len": 1024,
5
+ "head_max_len": 256,
6
+ "max_prefixes": 6,
7
+ "act_costs": {
8
+ "escalate": 0.5
9
+ },
10
+ "cost_wrong_act": 3.0,
11
+ "amp_dtype": "bf16",
12
+ "model_name": "rl-agent",
13
+ "temperature": [
14
+ 1.0,
15
+ 1.0,
16
+ 1.0
17
+ ],
18
+ "temperature_by_options": {},
19
+ "training": {
20
+ "updates": 15987,
21
+ "epochs_completed": 4,
22
+ "hours": 4.97,
23
+ "world_size": 1,
24
+ "fine_tuned_from_checkpoint": false
25
+ }
26
+ }