Yahya308 commited on
Commit
89aab85
·
verified ·
1 Parent(s): 9dfcff4

Mini Intelligence v2.0.0

Browse files
Files changed (9) hide show
  1. LICENSE +176 -0
  2. NOTICE +20 -0
  3. README.md +253 -0
  4. config.json +84 -0
  5. head.safetensors +3 -0
  6. model.safetensors +3 -0
  7. router_config.json +83 -0
  8. tokenizer.json +0 -0
  9. tokenizer_config.json +14 -0
LICENSE ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
NOTICE ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Mini Intelligence v2.0.0
2
+ Copyright 2026 yahya308
3
+
4
+ This product is licensed under the Apache License, Version 2.0 (see LICENSE).
5
+
6
+ Third-party components and data
7
+
8
+ * Laya (https://huggingface.co/convaiinnovations/laya), created by Convai Innovations, licensed under
9
+ the Apache License, Version 2.0. The encoder weights in model.safetensors were fine-tuned from the
10
+ Laya encoder at revision e333cb7c823cd1787276228260f56d02fbf5180b. config.json is Laya's encoder
11
+ configuration with the architecture name changed to ModernBertModel. tokenizer.json and
12
+ tokenizer_config.json are Laya's tokenizer files, unchanged.
13
+
14
+ * Laya's encoder is based on ModernBERT-large (https://huggingface.co/answerdotai/ModernBERT-large),
15
+ created by Answer.AI and LightOn, licensed under the Apache License, Version 2.0.
16
+
17
+ * The training queries and the per-model outcome labels come from LLMRouterBench
18
+ (https://github.com/ynulihao/LLMRouterBench; Li et al., "LLMRouterBench: A Massive Benchmark and
19
+ Unified Framework for LLM Routing", arXiv:2601.07206). No benchmark questions, candidate model
20
+ outputs or outcome labels are redistributed with this model.
README.md ADDED
@@ -0,0 +1,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: convaiinnovations/laya
4
+ base_model_relation: finetune
5
+ language:
6
+ - en
7
+ library_name: transformers
8
+ pipeline_tag: text-classification
9
+ inference: false
10
+ tags:
11
+ - llm-routing
12
+ - model-routing
13
+ - router
14
+ - modernbert
15
+ - multi-label-classification
16
+ ---
17
+
18
+ # Mini Intelligence v2
19
+
20
+ Mini Intelligence is a small query router. Given an English query, it estimates, for each of 20 open language models of roughly 7–9B parameters, the probability that the model answers the query correctly. It selects the model with the highest estimate and returns all 20 scores. The caller can then send the query to the selected model.
21
+
22
+ Version 2.0.0 is a full fine-tune of the English [Laya](https://huggingface.co/convaiinnovations/laya) encoder (ModernBERT-large: 28 layers, about 395M parameters) with a 20-output prediction head. It was trained on outcomes recorded by [LLMRouterBench](https://github.com/ynulihao/LLMRouterBench), as part of a master's thesis on LLM routing.
23
+
24
+ - **This repository:** the fine-tuned encoder as a standard transformers ModernBERT checkpoint, the prediction head, the tokenizer and the router configuration.
25
+ - **Code, command-line tool and verification tools:** [github.com/yahya308/Mini-Intelligence](https://github.com/yahya308/Mini-Intelligence) (tag `v2.0.0`).
26
+
27
+ ## Usage
28
+
29
+ ### With the Mini Intelligence package
30
+
31
+ ```shell
32
+ git clone --branch v2.0.0 https://github.com/yahya308/Mini-Intelligence.git
33
+ cd Mini-Intelligence
34
+ python -m pip install .
35
+ mini-intelligence "Write a Python function that merges two sorted lists."
36
+ ```
37
+
38
+ ```python
39
+ from mini_intelligence import MiniIntelligence
40
+
41
+ router = MiniIntelligence() # downloads this repository at the commit pinned by the package
42
+ decision = router.route("Write a Python function that merges two sorted lists.")
43
+ print(decision["selected_model"], decision["probabilities"][decision["selected_model"]])
44
+ ```
45
+
46
+ The package checks the SHA-256 of every downloaded file before loading. It runs in float32 on CPU or CUDA by default. On a CUDA GPU, bfloat16 autocast is available with `precision="bfloat16"`.
47
+
48
+ ### With transformers only
49
+
50
+ The encoder is a standard `ModernBertModel`. This snippet reproduces the package's probabilities exactly:
51
+
52
+ ```python
53
+ import json
54
+
55
+ import torch
56
+ from huggingface_hub import snapshot_download
57
+ from safetensors.torch import load_file
58
+ from torch import nn
59
+ from transformers import AutoTokenizer, ModernBertModel
60
+
61
+ path = snapshot_download("Yahya308/Mini-Intelligence", revision="v2.0.0")
62
+ config = json.load(open(f"{path}/router_config.json", encoding="utf-8"))
63
+ tokenizer = AutoTokenizer.from_pretrained(path)
64
+ encoder = ModernBertModel.from_pretrained(path, dtype=torch.float32, attn_implementation="sdpa").eval()
65
+ head = nn.Sequential(nn.LayerNorm(1024), nn.Linear(1024, 128), nn.GELU(), nn.Dropout(0.1), nn.Linear(128, 20))
66
+ head.load_state_dict({k.removeprefix("layers."): v for k, v in load_file(f"{path}/head.safetensors").items()})
67
+ head.eval()
68
+
69
+ query = "Write a Python function that merges two sorted lists."
70
+ ids = tokenizer(query.replace(tokenizer.mask_token, " "), add_special_tokens=False)["input_ids"]
71
+ if len(ids) > 423:
72
+ ids = ids[:211] + ids[-212:]
73
+ ids = torch.tensor([[tokenizer.cls_token_id, *ids, tokenizer.sep_token_id]])
74
+ with torch.inference_mode():
75
+ cls = encoder(input_ids=ids, attention_mask=torch.ones_like(ids)).last_hidden_state[:, 0]
76
+ probs = head(cls).sigmoid()[0]
77
+ print(config["models"][int(probs.argmax())], float(probs.max()))
78
+ ```
79
+
80
+ The snippet was tested with transformers 5.17.0, the version the package pins.
81
+
82
+ ## What changed from v1
83
+
84
+ | | v1.0.0 | v2.0.0 |
85
+ |---|---|---|
86
+ | Adaptation | Rank-8 LoRA on one matrix (the output projection of the final encoder layer's MLP); rest of the encoder frozen | Full fine-tune of every encoder parameter, embeddings included |
87
+ | Learned parameters | 165,012 | 394,917,524 (encoder 394,781,696; head 135,828) |
88
+ | Released weights | Adapter and head only; base Laya weights downloaded at load time | Complete encoder (standard ModernBERT checkpoint) and head, on this page |
89
+ | Runtime dependency | `laya` package | transformers only |
90
+ | Default inference precision | bfloat16 encoder on GPU | float32 on CPU or GPU (bfloat16 optional) |
91
+ | Mean over the 5 official splits, Sample-Avg / Dataset-Avg | 70.10% / 71.35% | 70.78% / 72.40% |
92
+ | ARC-Challenge (held out, released checkpoint) | 93.69% | 94.03% |
93
+
94
+ The input (423-token head and tail view), representation (CLS), head architecture, candidate pool and selection policies are unchanged. v1 remains available at the [`v1.0.0` tag](https://github.com/yahya308/Mini-Intelligence/tree/v1.0.0) of the GitHub repository.
95
+
96
+ ## Model details
97
+
98
+ - **Base model:** `convaiinnovations/laya`, revision `e333cb7c823cd1787276228260f56d02fbf5180b` (English; ModernBERT-large encoder).
99
+ - **Input:** the query text only. The tokenizer's mask token is replaced by a space. The encoder reads `[CLS]`, up to 423 query tokens and `[SEP]`. Longer queries are represented by their first 211 and last 212 tokens.
100
+ - **Representation:** the CLS vector after the encoder's final normalization.
101
+ - **Prediction head:** LayerNorm, a 128-unit linear layer, GELU, dropout 0.1 and a 20-unit linear layer, followed by a sigmoid. There is one output per candidate.
102
+ - **Selection policies:**
103
+ - `raw` (default): select the candidate with the highest predicted success.
104
+ - `gated`: select the fallback model, Qwen3-8B, unless the top candidate's predicted success exceeds Qwen3-8B's by at least a margin chosen on validation data. For this checkpoint, the chosen margin is 0.0, so the gated policy never falls back and gives the same choices as `raw`. It is kept for compatibility with v1.
105
+
106
+ ### Files
107
+
108
+ | File | Content | SHA-256 |
109
+ |---|---|---|
110
+ | `config.json` | ModernBERT configuration (Laya's encoder configuration) | `1fb7072c9ede80879dd68e8457faf69b1989909d3ce6e902db0873d7b02234ac` |
111
+ | `model.safetensors` | Fine-tuned encoder, float32 (1.58 GB) | `7e29152f140bc4dadaf78152bc99210bda242a91a4ae66723aebe797a245b41e` |
112
+ | `head.safetensors` | Prediction head, float32 | `cf24e4e656b54404f06c72513eb2e03ca1929fe55f58965e397286fe2b495155` |
113
+ | `tokenizer.json`, `tokenizer_config.json` | Laya's tokenizer, unchanged | `6c8aaa9a…`, `50044de6…` |
114
+ | `router_config.json` | Candidate order, input view, policy, training summary, file checksums | |
115
+
116
+ The encoder and head tensors are an exact split of the training checkpoint (`49acc7067cad04b3ecf944ede735080082bc7fc598970226d1cdc674d7ad7f37`), with no conversion: every tensor is bit-identical.
117
+
118
+ ### Candidates (output order)
119
+
120
+ 1. DeepHermes-3-Llama-3-8B-Preview
121
+ 2. DeepSeek-R1-0528-Qwen3-8B
122
+ 3. DeepSeek-R1-Distill-Qwen-7B
123
+ 4. Fin-R1
124
+ 5. GLM-Z1-9B-0414
125
+ 6. Intern-S1-mini
126
+ 7. Llama-3.1-8B-Instruct
127
+ 8. Llama-3.1-8B-UltraMedical
128
+ 9. Llama-3.1-Nemotron-Nano-8B-v1
129
+ 10. MiMo-7B-RL-0530
130
+ 11. MiniCPM4.1-8B
131
+ 12. NVIDIA-Nemotron-Nano-9B-v2
132
+ 13. OpenThinker3-7B
133
+ 14. Qwen2.5-Coder-7B-Instruct
134
+ 15. Qwen3-8B (fallback model of the gated policy)
135
+ 16. cogito-v1-preview-llama-8B
136
+ 17. gemma-2-9b-it
137
+ 18. glm-4-9b-chat
138
+ 19. granite-3.3-8b-instruct
139
+ 20. internlm3-8b-instruct
140
+
141
+ ## Training
142
+
143
+ - **Data:** queries from the 15 datasets of LLMRouterBench's 20-model setting. They cover mathematics, code generation, logical and general reasoning, knowledge and domain question answering (including medicine and finance), and emotion recognition in dialogue.
144
+ - **Targets:** LLMRouterBench records, for each query, whether each of the 20 candidates answered it correctly. These 20 binary outcomes are the multi-label targets. The loss is binary cross-entropy.
145
+ - **Released checkpoint:** trained on all 11,481 queries of the 15 datasets, split by prompt text into 9,759 fitting and 1,722 validation queries. ARC-Challenge was not used for training or for any selection.
146
+ - **Optimization:**
147
+ - Every encoder parameter and the head are trained.
148
+ - AdamW (betas 0.9 and 0.999, epsilon 1e-8), weight decay 0.01. The encoder's LayerNorm weights are not decayed.
149
+ - Learning rate 5e-5 for the encoder and 1e-3 for the head. The encoder rate was chosen from {1e-5, 2e-5, 5e-5} on the validation part of one official split.
150
+ - Linear warm-up over the first 6% of steps, then linear decay to zero. Gradient clipping at 1.0.
151
+ - Batches of 16 queries of similar length.
152
+ - Up to 5 epochs, with early stopping after 2 epochs without improvement. The epoch with the lowest validation loss is kept; for this checkpoint, epoch 3.
153
+ - **Precision:** float32 weights with bfloat16 autocast. The final encoder layer's MLP runs in float32.
154
+ - **Hardware:** one NVIDIA L40S GPU, about 12.5 minutes of training for this checkpoint.
155
+ - **Gated policy:** the fallback model is the best single candidate on the fitting queries (Qwen3-8B). The margin was chosen from {always fall back, 0.2, 0.1, 0.05, 0.025, 0.01, 0.0} by routed accuracy on the validation queries.
156
+
157
+ ## Evaluation
158
+
159
+ ### Official LLMRouterBench protocol (the training recipe)
160
+
161
+ The recipe was evaluated with LLMRouterBench's official protocol: the `split_by_dataset_then_prompt` split, 70% training and 30% test within each dataset, 5 seeds (42, 999, 2024, 2025 and 3407), the 20-model pool and the 15 datasets. For each split, a separate model was trained with the same recipe on that split's training part. These numbers therefore describe the recipe, not the exact checkpoint on this page.
162
+
163
+ The metrics measure how often the selected model's recorded answer was correct:
164
+
165
+ - **Sample-Avg:** accuracy over all test queries.
166
+ - **Dataset-Avg:** the mean of the 15 per-dataset accuracies.
167
+
168
+ Mean ± standard deviation over the 5 splits:
169
+
170
+ | Method | Sample-Avg | Dataset-Avg |
171
+ |---|---:|---:|
172
+ | Mini Intelligence v2, raw (this recipe) | 70.78 ± 0.58% | 72.40 ± 1.06% |
173
+ | Mini Intelligence v2, gated | 70.40 ± 0.83% | 72.08 ± 0.93% |
174
+ | Mini Intelligence v1, raw | 70.10 ± 0.92% | 71.35 ± 1.11% |
175
+ | Best single model (Qwen3-8B) | 66.72 ± 0.87% | 68.01 ± 1.08% |
176
+
177
+ - **Compared with v1:** +0.68 points Sample-Avg and +1.05 points Dataset-Avg on average. In paired bootstrap tests per split (2,000 resamples, 95% intervals), the Sample-Avg gain was above zero in 3 of the 5 splits. The Dataset-Avg gain was not distinguishable from zero in any split. v1 and v2 were trained and evaluated on different GPUs.
178
+ - **Gated policy:** on these splits, the validation-chosen margin was 0.0 in three splits. Gating did not improve accuracy.
179
+
180
+ For context only, the LLMRouterBench paper ([arXiv:2601.07206](https://arxiv.org/abs/2601.07206), Table 11; same 20 candidates, 15 datasets, 70/30 splits and five seeds as our evaluation) reports these Dataset-Avg values for published routers:
181
+
182
+ | Router (published numbers) | Dataset-Avg |
183
+ |---|---:|
184
+ | Avengers | 71.94% |
185
+ | MODEL-SAT | 71.88% |
186
+ | EmbedLLM | 71.24% |
187
+ | GraphRouter | 70.29% |
188
+ | RouterDC | 61.33% |
189
+
190
+ We did not re-run these routers. The paper marks the values of MODEL-SAT, EmbedLLM, GraphRouter and RouterDC as peak scores on the test set, and gives no intervals. Our numbers come from different hardware and runs, so we make no claim of a significant difference: v2 is on par with the strongest published routers.
191
+
192
+ ### Held-out ARC-Challenge (this exact checkpoint)
193
+
194
+ ARC-Challenge was never used for training or selection. On its 1,172 queries:
195
+
196
+ | Method | Accuracy |
197
+ |---|---:|
198
+ | Mini Intelligence v2 (raw = gated) | 94.03% |
199
+ | Best single model (Qwen3-8B) | 93.77% |
200
+ | Mini Intelligence v1 (raw) | 93.69% |
201
+
202
+ - The difference from the best single model (+0.26 points, 95% paired bootstrap interval −0.77 to +1.28) is not significant. ARC-Challenge is near the ceiling for this pool: the best possible choice per query would reach 97.44%.
203
+ - **Probability quality:** averaged over the 20 candidates, the Brier score is 0.139 and the log loss 0.445. Over the five official test splits, the means were 0.194 and 0.564; v1 had 0.198 and 0.575. A constant prediction of 0.5 gives 0.25 and 0.693.
204
+
205
+ ### Reproducibility
206
+
207
+ The training run stored its ARC-Challenge probabilities (NVIDIA L40S, bfloat16 autocast). The released files were checked against them:
208
+
209
+ - **Same machine.** The package and the original training code, both in float32 on an NVIDIA RTX 4070 Laptop GPU, gave the same probabilities to within 1.2e-7 for all 1,172 queries, with identical choices.
210
+ - **Against the training run.**
211
+ - Float32 on the RTX 4070 differs from the stored bfloat16 probabilities by at most 0.042 (mean 0.0013).
212
+ - 1,168 of 1,172 choices are identical (99.66%). The 4 different choices are near ties (the top two stored probabilities differ by less than 0.001), and in each case both models had the same recorded outcome.
213
+ - Routed accuracy is the same: 94.03%.
214
+ - **CPU versus GPU.** Float32 on CPU and on the GPU differ by at most 2e-5, with identical choices.
215
+
216
+ `tools/verify_release.py` in the GitHub repository repeats this check on your machine. It compares against reference probabilities keyed by a SHA-256 hash of each prompt. You need the ARC-Challenge prompts from LLMRouterBench; they are not distributed.
217
+
218
+ ## Limitations
219
+
220
+ - **Measured on benchmark task types only.** Routing quality was measured on LLMRouterBench queries.
221
+ - **Unfamiliar task types.** On queries unlike the training tasks, the router can over-rely on patterns learned from similar-looking training tasks. It can then route poorly, for example by sending a whole family of queries to one model that is weak on them. Evaluate it on your own data, and compare it with simply using the best single model, before relying on it.
222
+ - **Fixed pool.** It only routes among these 20 specific models, as run by LLMRouterBench. It cannot score other models, other versions of these models or a different candidate set.
223
+ - **Estimates, not guarantees.** The probabilities are estimates of benchmark correctness learned from about 11,500 queries. They are not calibrated confidences.
224
+ - **English only.** Long queries are seen only through their first 211 and last 212 tokens.
225
+ - **No cost or latency.** Cost, latency, answer length and user preferences are not modeled.
226
+ - **Numerical precision.** Running in bfloat16 instead of float32 changes the probabilities by up to about 0.04. It can flip choices between near-tied candidates.
227
+
228
+ ## Training data, licenses and attribution
229
+
230
+ - **Training labels:** the training queries and per-model outcomes come from LLMRouterBench (Li et al., 2026). No benchmark questions, model outputs or outcome labels are redistributed here or in the GitHub repository.
231
+ - **Base model:** [Laya](https://huggingface.co/convaiinnovations/laya) by Convai Innovations, Apache License 2.0. Laya is built on ModernBERT-large (Answer.AI and LightOn, Apache License 2.0). The tokenizer files are Laya's, unchanged, from revision `e333cb7`.
232
+ - **License:** Apache License 2.0 (see `LICENSE`). Attribution is in `NOTICE`.
233
+
234
+ ## Citation
235
+
236
+ ```bibtex
237
+ @software{mini_intelligence_2026,
238
+ author = {yahya308},
239
+ title = {Mini Intelligence: a fine-tuned Laya router that predicts success across 20 language models},
240
+ version = {2.0.0},
241
+ year = {2026},
242
+ url = {https://github.com/yahya308/Mini-Intelligence}
243
+ }
244
+
245
+ @article{li2026llmrouterbench,
246
+ title = {LLMRouterBench: A Massive Benchmark and Unified Framework for LLM Routing},
247
+ author = {Li, Hao and Zhang, Yiqun and Guo, Zhaoyan and Wang, Chenxu and Tang, Shengji and Zhang, Qiaosheng and Chen, Yang and Qi, Biqing and Ye, Peng and Bai, Lei and Wang, Zhen and Hu, Shuyue},
248
+ journal = {arXiv preprint arXiv:2601.07206},
249
+ year = {2026}
250
+ }
251
+ ```
252
+
253
+ Please also credit the upstream [Laya model](https://huggingface.co/convaiinnovations/laya).
config.json ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "ModernBertModel"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 50281,
8
+ "classifier_activation": "gelu",
9
+ "classifier_bias": false,
10
+ "classifier_dropout": 0.0,
11
+ "classifier_pooling": "mean",
12
+ "cls_token_id": 50281,
13
+ "decoder_bias": true,
14
+ "deterministic_flash_attn": false,
15
+ "dtype": "float32",
16
+ "embedding_dropout": 0.0,
17
+ "eos_token_id": 50282,
18
+ "global_attn_every_n_layers": 3,
19
+ "gradient_checkpointing": false,
20
+ "hidden_activation": "gelu",
21
+ "hidden_size": 1024,
22
+ "initializer_cutoff_factor": 2.0,
23
+ "initializer_range": 0.02,
24
+ "intermediate_size": 2624,
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
+ "sliding_attention",
50
+ "sliding_attention",
51
+ "full_attention",
52
+ "sliding_attention",
53
+ "sliding_attention",
54
+ "full_attention"
55
+ ],
56
+ "local_attention": 128,
57
+ "max_position_embeddings": 8192,
58
+ "mlp_bias": false,
59
+ "mlp_dropout": 0.0,
60
+ "model_type": "modernbert",
61
+ "norm_bias": false,
62
+ "norm_eps": 1e-05,
63
+ "num_attention_heads": 16,
64
+ "num_hidden_layers": 28,
65
+ "pad_token_id": 50283,
66
+ "position_embedding_type": "absolute",
67
+ "repad_logits_with_grad": false,
68
+ "rope_parameters": {
69
+ "full_attention": {
70
+ "rope_theta": 160000.0,
71
+ "rope_type": "default"
72
+ },
73
+ "sliding_attention": {
74
+ "rope_theta": 10000.0,
75
+ "rope_type": "default"
76
+ }
77
+ },
78
+ "sep_token_id": 50282,
79
+ "sparse_pred_ignore_index": -100,
80
+ "sparse_prediction": false,
81
+ "tie_word_embeddings": true,
82
+ "transformers_version": "5.0.0",
83
+ "vocab_size": 50368
84
+ }
head.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cf24e4e656b54404f06c72513eb2e03ca1929fe55f58965e397286fe2b495155
3
+ size 543816
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7e29152f140bc4dadaf78152bc99210bda242a91a4ae66723aebe797a245b41e
3
+ size 1579143688
router_config.json ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "format_version": 2,
3
+ "release": "2.0.0",
4
+ "models": [
5
+ "DeepHermes-3-Llama-3-8B-Preview",
6
+ "DeepSeek-R1-0528-Qwen3-8B",
7
+ "DeepSeek-R1-Distill-Qwen-7B",
8
+ "Fin-R1",
9
+ "GLM-Z1-9B-0414",
10
+ "Intern-S1-mini",
11
+ "Llama-3.1-8B-Instruct",
12
+ "Llama-3.1-8B-UltraMedical",
13
+ "Llama-3.1-Nemotron-Nano-8B-v1",
14
+ "MiMo-7B-RL-0530",
15
+ "MiniCPM4.1-8B",
16
+ "NVIDIA-Nemotron-Nano-9B-v2",
17
+ "OpenThinker3-7B",
18
+ "Qwen2.5-Coder-7B-Instruct",
19
+ "Qwen3-8B",
20
+ "cogito-v1-preview-llama-8B",
21
+ "gemma-2-9b-it",
22
+ "glm-4-9b-chat",
23
+ "granite-3.3-8b-instruct",
24
+ "internlm3-8b-instruct"
25
+ ],
26
+ "input": {
27
+ "head_tokens": 211,
28
+ "tail_tokens": 212,
29
+ "max_content_tokens": 423,
30
+ "template": "[CLS] content [SEP]; the mask token is replaced by a space; no other special tokens"
31
+ },
32
+ "representation": "CLS vector after the encoder's final_norm",
33
+ "head": {
34
+ "layers": "LayerNorm(1024) -> Linear(1024, 128) -> GELU -> Dropout(0.1) -> Linear(128, 20)",
35
+ "width": 128,
36
+ "dropout": 0.1,
37
+ "output": "sigmoid"
38
+ },
39
+ "policy": {
40
+ "default": "raw",
41
+ "fallback_model_index": 14,
42
+ "fallback_model": "Qwen3-8B",
43
+ "fallback_margin": 0.0,
44
+ "rule": "gated: select the fallback model when p(top) - p(fallback) < fallback_margin",
45
+ "margin_grid": [
46
+ "always_fallback",
47
+ 0.2,
48
+ 0.1,
49
+ 0.05,
50
+ 0.025,
51
+ 0.01,
52
+ 0.0
53
+ ],
54
+ "margin_selection": "highest routed accuracy on the validation rows"
55
+ },
56
+ "training": {
57
+ "held_out_dataset": "arcc",
58
+ "fit_queries": 9759,
59
+ "validation_queries": 1722,
60
+ "selected_epoch": 3,
61
+ "epochs_run": 5,
62
+ "encoder_lr": 5e-05,
63
+ "head_lr": 0.001,
64
+ "weight_decay": 0.01,
65
+ "logical_batch": 16,
66
+ "max_epochs": 5,
67
+ "precision": "fp32 weights, bf16 autocast; layer-27 MLP fp32 at CLS only",
68
+ "gpu": "NVIDIA L40S",
69
+ "trainable_parameters": 394917524,
70
+ "min_validation_bce": 0.5608606582470903
71
+ },
72
+ "base_model": "convaiinnovations/laya",
73
+ "base_revision": "e333cb7c823cd1787276228260f56d02fbf5180b",
74
+ "base_sha256": "891102d372688fc2a094dac56a384bc537b87c63f21f9f3dac0be2b7cbc8d86c",
75
+ "training_checkpoint_sha256": "49acc7067cad04b3ecf944ede735080082bc7fc598970226d1cdc674d7ad7f37",
76
+ "files": {
77
+ "config.json": "1fb7072c9ede80879dd68e8457faf69b1989909d3ce6e902db0873d7b02234ac",
78
+ "model.safetensors": "7e29152f140bc4dadaf78152bc99210bda242a91a4ae66723aebe797a245b41e",
79
+ "head.safetensors": "cf24e4e656b54404f06c72513eb2e03ca1929fe55f58965e397286fe2b495155",
80
+ "tokenizer.json": "6c8aaa9a542084f2457eab775d4eeb51f92a70c0fd9de28d5edb0ddec3c08d30",
81
+ "tokenizer_config.json": "50044de60daaa73df97d262e15a40d4faf0160e7d742df64b377877a1320dd12"
82
+ }
83
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "clean_up_tokenization_spaces": true,
3
+ "cls_token": "[CLS]",
4
+ "mask_token": "[MASK]",
5
+ "model_input_names": [
6
+ "input_ids",
7
+ "attention_mask"
8
+ ],
9
+ "model_max_length": 8192,
10
+ "pad_token": "[PAD]",
11
+ "sep_token": "[SEP]",
12
+ "tokenizer_class": "PreTrainedTokenizerFast",
13
+ "unk_token": "[UNK]"
14
+ }