--- license: apache-2.0 language: [en, zh] base_model: Nanbeige/Nanbeige4.2-3B pipeline_tag: text-generation tags: [webgpu, browser, wgsl, quantized, nanbeige, looped-transformer] --- # Nanbeige4.2-3B · browser WebGPU artifacts [Run locally in your browser](https://huggingface.co/spaces/borkiss/nanbeige4-2-3b-browser-lab) · [Source and reproducible tooling](https://huggingface.co/spaces/borkiss/nanbeige4-2-3b-browser-lab/tree/main/source) · [Report](https://borkiss-nanbeige4-2-3b-browser-lab.static.hf.space/report.html) Custom WGSL artifacts for the original [Nanbeige4.2-3B](https://huggingface.co/Nanbeige/Nanbeige4.2-3B), source revision `3384e426066d1a49c3aea90a7190b81260a6533f`. This is an independent browser port, not an official Nanbeige release. The repository is not directly loadable by AutoModel; use the linked app or its custom runtime. | Artifact directory | Download bytes | Use | |---|---:|---| | `q4g32-e4-gram8192-emse-packed` | 2,345,711,616 | Default compact profile; calibrated Q4 linears and Q4 MSE embedding | | `q4g32-e8-gram8192-packed` | 2,600,908,800 | Calibrated Q4 linears, Q8 embedding control | | `q4g32-e8-packed` / `q4g32-e8` | 2,600,908,800 | Original round-to-nearest control, packed / individual files | The compact model was first published at revision `8d36b29983c2ad1465be29fa51ebace46b91dc62`; the calibrated Q8 embedding profile at `32adccbdde7adcab3f253678c414245a8b1072d9`. The app pins immutable revisions. Each manifest gives file SHA256 values, tensor shapes, byte offsets, scales and the complete source config. Packed bundles are at most128MiB; GPU tensor bindings fit the128MiB WebGPU baseline. The runtime shares22 physical blocks across exactly two passes, with44 independent KV slots and a final RMS normalization after each pass. It preserves48 query heads,8 KV heads and128-dimensional full RoPE. No layer pruning or reduced recurrence is used. Browser context is intentionally capped at2048 (default512) to bound memory; this is a deployment limit, not the source model's context limit. Quantization uses signed Q4 groups of32 with FP16 scales and byte-sliced nibbles. A group covariance reconstruction objective calibrates linears on8192 WikiText-2 **train** tokens, observing both recurrent visits. It is a bounded group reconstruction experiment, not full GPTQ/AWQ. Compact embedding uses per-group FP16 scale search minimizing weight MSE. Quantization and all full-weight processing ran on an RTX A6000; none ran on the development Mac. Small screening evaluation: same4096 WikiText-2 **test** token IDs,4080 scored tokens,16 independent256-token windows: | Model | Perplexity | Six-prompt mean KL vs source | First-token agreement | |---|---:|---:|---:| | Source FP32 | 41.774 | 0 | 6/6 | | Original Q4g32/Q8 embedding | 48.828 | .07496 | 6/6 | | Calibrated Q4/Q8 embedding | 45.237 | .06777 | 6/6 | | Compact calibrated Q4/Q4 embedding | 44.859 | .07180 | 6/6 | These are limited screening measurements used to choose among candidates, not a full unbiased benchmark or a claim that quantization improves the source. The separate tiny multilingual corpus slightly favors Q8 embedding. Raw losses, prompts, logits, calibration provenance, other candidate failures and scripts are in the Space's `results/` and `source/` directories. WebGPU is required. Desktop Chrome and Safari are measured on M4; physical iPhone15ProMax, Pixel10a and iPadM2 acceptance remains unverified. Device memory and browser limits can still prevent a3B-class model from loading. No inference server receives prompts. Hugging Face serves static files and weights; downloads require network access. Source model weights are Apache-2.0. Runtime source has separate MIT notices for reused kernels. Please retain the original model attribution and consult its [technical report](https://arxiv.org/abs/2607.22083).