mlboydaisuke commited on
Commit
9f89d30
Β·
verified Β·
1 Parent(s): 5a6d84a

Update card: blockwise int4 + GSM8K parity table

Browse files
Files changed (1) hide show
  1. README.md +22 -29
README.md CHANGED
@@ -14,7 +14,7 @@ pipeline_tag: text-generation
14
  library_name: litert-lm
15
  ---
16
 
17
- # Falcon3-3B-Instruct β€” LiteRT-LM (mixed int4)
18
 
19
  [tiiuae/Falcon3-3B-Instruct](https://huggingface.co/tiiuae/Falcon3-3B-Instruct)
20
  converted to the **LiteRT-LM** (`.litertlm`) format for on-device inference with
@@ -25,12 +25,12 @@ Text-only conversion (the Falcon3 decoder; no vision/audio towers).
25
 
26
  | | |
27
  |---|---|
28
- | **File** | `model.litertlm` (~1.7 GB) |
29
- | **Quantization** | mixed int4 β€” weights INT4 (channelwise, symmetric), embeddings INT8 |
30
  | **Compute** | integer |
 
31
  | **Base model** | tiiuae/Falcon3-3B-Instruct |
32
- | **Decode speed** | ~144 tok/s (Apple Silicon, LiteRT-LM) Β· ~33 tok/s cold on iPhone 17 Pro GPU |
33
- | **Context** | 32K |
34
 
35
  ## Usage
36
 
@@ -48,38 +48,31 @@ The `.litertlm` bundle carries the tokenizer and the prompt template (Falcon3's
48
  native `<|user|>` / `<|assistant|>` format, stop token `<|endoftext|>`), so no
49
  separate tokenizer files are needed.
50
 
51
- ## Quality
52
 
53
- Scored with an 8-question local quality gate (correctness + degeneracy, the same
54
- checks as the iOS LLM benchmark), each asked separately on Apple Silicon:
 
55
 
56
- | Check | Result |
57
  |---|---|
58
- | 17 + 25 = 42 | βœ… |
59
- | capital of Japan = Tokyo | βœ… |
60
- | opposite of "hot" = cold | βœ… |
61
- | days in a week = 7 | βœ… |
62
- | "thank you" in French = merci | βœ… |
63
- | 8 Γ— 7 = 56 | βœ… |
64
- | larger of 0.9 / 0.11 | βœ… |
65
- | "roses are red, violets are…" = blue | βœ… |
66
 
67
- **8 / 8 correct, non-degenerate**, and it terminates cleanly at `<|endoftext|>`.
68
- This is a direct-answering instruct model (no `<think>` block). As expected for a
69
- 3B model at int4, long free-form explanations can show occasional minor artifacts
70
- (a stray word or brief language mix); short-form answers and reasoning are clean.
71
-
72
- ## On-device
73
-
74
- Validated on **iPhone 17 Pro** via the LiteRT-LM Swift sample app: loads in ~5 s,
75
- generates coherent text, ~33 tok/s decode (cold) on the GPU backend.
76
 
77
  ## Conversion
78
 
79
  Converted with [`litert-torch`](https://github.com/google-ai-edge/litert) using a
80
- mixed-int4 recipe (INT4 weights channelwise + INT8 embeddings) and Falcon3's
81
- native chat template. Falcon3-3B is a standard `LlamaForCausalLM` architecture, so
82
- it rides the existing converter and runtime with no custom code.
 
 
83
 
84
  ## License
85
 
 
14
  library_name: litert-lm
15
  ---
16
 
17
+ # Falcon3-3B-Instruct β€” LiteRT-LM (blockwise int4)
18
 
19
  [tiiuae/Falcon3-3B-Instruct](https://huggingface.co/tiiuae/Falcon3-3B-Instruct)
20
  converted to the **LiteRT-LM** (`.litertlm`) format for on-device inference with
 
25
 
26
  | | |
27
  |---|---|
28
+ | **File** | `model.litertlm` (~1.86 GB) |
29
+ | **Quantization** | int4 weights β€” **blockwise (block 32)**, symmetric; embeddings INT8 |
30
  | **Compute** | integer |
31
+ | **Context (KV cache)** | 4096 |
32
  | **Base model** | tiiuae/Falcon3-3B-Instruct |
33
+ | **Decode speed** | ~101 tok/s (Apple Silicon, CPU, LiteRT-LM, greedy) |
 
34
 
35
  ## Usage
36
 
 
48
  native `<|user|>` / `<|assistant|>` format, stop token `<|endoftext|>`), so no
49
  separate tokenizer files are needed.
50
 
51
+ ## Quality β€” GSM8K parity
52
 
53
+ Measured on GSM8K (n=100, greedy, 0-shot chain-of-thought asking for `#### <n>`,
54
+ identical prompt and answer-extraction for every row). The 4-bit MLX build is the
55
+ known-good 4-bit control:
56
 
57
+ | Configuration | GSM8K |
58
  |---|---|
59
+ | bf16 (reference) | 75% |
60
+ | MLX 4-bit (control) | 76% |
61
+ | **This model β€” LiteRT int4** | **79%** |
 
 
 
 
 
62
 
63
+ LiteRT int4 is fully at parity β€” it matches or slightly exceeds both the 4-bit
64
+ control and bf16 here (the small spread is sampling noise at n=100). This is a
65
+ direct-answering instruct model (no `<think>` block) and terminates cleanly at
66
+ `<|endoftext|>`.
 
 
 
 
 
67
 
68
  ## Conversion
69
 
70
  Converted with [`litert-torch`](https://github.com/google-ai-edge/litert) using a
71
+ **blockwise int4** recipe (INT4 weights, block size 32, symmetric) with embeddings
72
+ kept at INT8, KV cache 4096, and Falcon3's native chat template. Falcon3-3B is a
73
+ standard `LlamaForCausalLM` architecture, so it rides the existing converter and
74
+ runtime with no custom code. Blockwise (not channelwise) int4 is what preserves
75
+ reasoning accuracy.
76
 
77
  ## License
78