alfred361 commited on
Commit
17f4526
Β·
verified Β·
1 Parent(s): 9d310e2

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +37 -25
README.md CHANGED
@@ -1,25 +1,37 @@
1
- # Laya, packaged for the browser
2
-
3
- Every build this project serves, in one place, so a demo does not depend on four separate repositories staying where they are. Each folder is self-contained: the graphs, the tokenizer that produced their token ids, and the config carrying the sequence limits and temperatures.
4
-
5
- All are Apache-2.0, as upstream. Credits are per variant below; none of the base models are ours.
6
-
7
- | folder | what it is |
8
- | --- | --- |
9
- | `english-q8/v1/` | Laya English base (ModernBERT-large, 421M). Weight-only int8: weights are compressed, activations stay fp32. 100% argmax agreement with fp32, worst probability shift 0.016. 512-token context, temperatures fitted. Refuses a batch greater than 1. |
10
- | `typed-decisions-q8/v1/` | Laya fine-tuned on typed decisions (ModernBERT-large, 421M). Scores 0.766 on that benchmark where the general checkpoints score 0.362 and 0.342 and the majority-class baseline is 0.461. Weight-only int8, exported here: 100% argmax agreement with fp32, worst shift 0.0091. English only. Refuses a batch. |
11
- | `multilingual-int8/v1/` | Laya multilingual (mmBERT-base, 322M), dynamic int8. The fastest of the four and the least faithful: activation scales are derived per tensor at run time, which measured 93.8% argmax agreement with this repository's own fp32 export and a worst shift of 16.9 points. It accepts a batch and answers differently when it does, by up to 21 points. 1024-token context, no fitted temperatures. |
12
- | `multilingual-fp16/v1/` | Laya multilingual (mmBERT-base, 322M), half precision. No quantization loss at all, and the only one of the four that batches correctly β€” eight questions batched moved probabilities by at most 0.05 of a point. Needs WebGPU: on a CPU without native fp16 the runtime emulates it in software at seconds per sequence. 1024-token context, no fitted temperatures. |
13
-
14
- ## Credits
15
-
16
- - **english-q8** β€” Quantization and browser runtime by [nvkudva](https://huggingface.co/nvkudva/laya-web-q8).
17
- - **typed-decisions-q8** β€” Exported from [convaiinnovations/laya-typed-decisions](https://huggingface.co/convaiinnovations/laya-typed-decisions) with the pipeline from [nvkudva/laya-web](https://github.com/nvkudva/laya-web).
18
- - **multilingual-int8** β€” CPU-optimized export by [soyelmismo](https://huggingface.co/soyelmismo/laya-multilingual-onnx).
19
- - **multilingual-fp16** β€” fp16 ONNX export by [mizchi](https://huggingface.co/mizchi/laya-multilingual-onnx).
20
-
21
- Base models: [convaiinnovations/laya](https://huggingface.co/convaiinnovations/laya) and its family, by Nandakishor M / Convai Innovations.
22
-
23
- ## The `v1` segment
24
-
25
- Browsers cache by URL. Re-quantizing publishes to `v2` rather than overwriting `v1`, or a returning visitor keeps weights the app no longer believes it is running.
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Laya, packaged for the browser
2
+
3
+ Every build [laya.voronkov.club](https://laya.voronkov.club) has served, in one place, so a demo does not depend on several separate repositories staying where they are. Each folder is self-contained: the graphs, the tokenizer that produced their token ids, and the config carrying the sequence limits and temperatures.
4
+
5
+ All Apache-2.0, as upstream. Credits are per variant below; the base models are not ours.
6
+
7
+ | folder | what it is |
8
+ | --- | --- |
9
+ | `multilingual-tuned-q8/v1/` | **Fine-tuned, and the one the demo serves by default.** `laya-multilingual` fine-tuned on [typed-decisions](https://huggingface.co/datasets/LocalLLaMA/typed-decisions), then exported weight-only int8. Runs on wasm, so it needs no GPU. Accepts a batch and answers the same (`EQUIVALENT`). 100% argmax agreement with the PyTorch reference; worst single probability shift 0.024. 574 MB. |
10
+ | `multilingual-tuned-fp32-batched/v1/` | The same fine-tune at full precision, re-traced so it accepts a batch. Nothing is lost to quantization: 100% argmax and a worst shift of 0.0000011. Needs WebGPU. 1.3 GB. Use it when the exact numbers matter; on every case measured it makes the same decisions as the int8 build above. |
11
+ | `multilingual-tuned-fp32/v1/` | The first full-precision export of the fine-tune, before the batched re-trace. Identical fidelity, but refuses a batch greater than 1. Kept so the difference the re-trace made is still inspectable; prefer `multilingual-tuned-fp32-batched`. |
12
+ | `multilingual-fp16/v1/` | The general multilingual checkpoint, untuned, at half precision. No quantization loss, and it batches. Scores 0.342 on typed decisions, below the 0.461 of always answering the most common option -- it is here to show what the base model does, not to be relied on. No fitted temperatures. Needs WebGPU. 647 MB. |
13
+ | `multilingual-int8/v1/` | The same untuned checkpoint in dynamic int8. The fastest build here and the least faithful: activation scales are derived per tensor at run time, which measured 93.8% argmax agreement with full precision and a worst shift of 0.169. It accepts a batch and answers differently when it does, by up to 21 points. 326 MB. |
14
+ | `english-q8/v1/` | Laya English base (ModernBERT-large, 421M), weight-only int8. 100% argmax agreement with fp32, worst shift 0.016. 512-token context. Refuses a batch. No longer served by the demo, which is multilingual only. |
15
+ | `typed-decisions-q8/v1/` | Laya fine-tuned on typed decisions (ModernBERT-large, 421M, English only). Scores 0.766, the highest here, but reads English alone. Weight-only int8 exported by us: 100% argmax, worst shift 0.009. Refuses a batch. Note that its `temperature_by_options` is inherited from the base checkpoint and overrides the temperatures fitted for it -- upstream says so too. |
16
+
17
+ ## Where the numbers come from
18
+
19
+ `argmax agreement` and `worst shift` are measured against the PyTorch model the export came from, over a fixed set of 26 questions, by `export/gate.py` in [laya-web-poc](https://github.com/alexander-voronkov/laya-web-poc). Whether a build accepts a batch is measured too, by `export/batch_probe.py`, because it is a property of the export rather than of the checkpoint: three of these refuse one outright and a fourth accepts one and silently answers differently.
20
+
21
+ The benchmark scores are accuracy on the test split of [LocalLLaMA/typed-decisions](https://huggingface.co/datasets/LocalLLaMA/typed-decisions), 400 cases and 2,000 decisions. For scale: always answering the most common option scores 0.461, the teachers who wrote the answers agree with themselves 0.735 of the time, and the fine-tune here scores 0.748.
22
+
23
+ ## Credits
24
+
25
+ - **multilingual-tuned-q8** β€” Ours: [alfred361/laya-multilingual-typed-decisions](https://huggingface.co/alfred361/laya-multilingual-typed-decisions), fine-tuned from [convaiinnovations/laya-multilingual](https://huggingface.co/convaiinnovations/laya-multilingual).
26
+ - **multilingual-tuned-fp32-batched** β€” Ours, same checkpoint.
27
+ - **multilingual-tuned-fp32** β€” Ours, same checkpoint.
28
+ - **multilingual-fp16** β€” fp16 ONNX export by [mizchi](https://huggingface.co/mizchi/laya-multilingual-onnx).
29
+ - **multilingual-int8** β€” CPU-optimized export by [soyelmismo](https://huggingface.co/soyelmismo/laya-multilingual-onnx).
30
+ - **english-q8** β€” Quantization and browser runtime by [nvkudva](https://huggingface.co/nvkudva/laya-web-q8).
31
+ - **typed-decisions-q8** β€” Exported from [convaiinnovations/laya-typed-decisions](https://huggingface.co/convaiinnovations/laya-typed-decisions) with the pipeline from [nvkudva/laya-web](https://github.com/nvkudva/laya-web).
32
+
33
+ Base models: [convaiinnovations/laya](https://huggingface.co/convaiinnovations/laya) and its family, by Nandakishor M / Convai Innovations. Benchmark by LocalLLaMA.
34
+
35
+ ## The `v1` segment
36
+
37
+ Browsers cache by URL. Re-quantizing publishes to `v2` rather than overwriting `v1`, or a returning visitor keeps weights the app no longer believes it is running.