Add model card (zoo's first dLLM)
Browse files
README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
tags:
|
| 4 |
+
- core-ai
|
| 5 |
+
- apple
|
| 6 |
+
- on-device
|
| 7 |
+
- diffusion-llm
|
| 8 |
+
- dllm
|
| 9 |
+
- llada
|
| 10 |
+
base_model:
|
| 11 |
+
- GSAI-ML/LLaDA-8B-Instruct
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# LLaDA-8B dLLM β Core AI (on-device diffusion LLM)
|
| 15 |
+
|
| 16 |
+
**The model zoo's first diffusion language model (dLLM) for Apple Core AI.** Most on-device LLMs
|
| 17 |
+
are autoregressive β they write one token at a time, left to right. This one is a **masked
|
| 18 |
+
diffusion** model: it starts from a canvas of `[MASK]` tokens and fills them in **in parallel**,
|
| 19 |
+
committing the most-confident positions each step until the answer resolves. A different decoding
|
| 20 |
+
paradigm, running on-device on Apple Silicon.
|
| 21 |
+
|
| 22 |
+
- **Base:** [`GSAI-ML/LLaDA-8B-Instruct`](https://huggingface.co/GSAI-ML/LLaDA-8B-Instruct) (LLaMA-dense 8B, **bidirectional**, no causal mask)
|
| 23 |
+
- **Distillation:** [`d3LLM/d3LLM_LLaDA`](https://huggingface.co/d3LLM/d3LLM_LLaDA) (hao-ai-lab / NVIDIA) β pseudo-trajectory distillation that cuts the number of denoising steps hard (β8 tokens committed per forward here)
|
| 24 |
+
- **Quantization:** int4 weight-only (per-block-32 body) + int8 head, **β4.9 GB**
|
| 25 |
+
- **Runtime:** Apple Core AI (`coreai-core`), GPU
|
| 26 |
+
|
| 27 |
+
## What it looks like
|
| 28 |
+
|
| 29 |
+
The answer doesn't stream left-to-right β the canvas *denoises*. Mid-generation you see tokens pop
|
| 30 |
+
in out of order, e.g.:
|
| 31 |
+
|
| 32 |
+
```
|
| 33 |
+
48 + β4 =β7β clipsβββ β 48 + 24 = 72 clips altogether.
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
That parallel, out-of-order fill is the signature of a masked-diffusion LM.
|
| 37 |
+
|
| 38 |
+
## How to run it
|
| 39 |
+
|
| 40 |
+
Open it in **CoreAIChatMac** (the zoo's macOS chat app) β *Download Modelsβ¦* β **LLaDA-8B
|
| 41 |
+
(diffusion)**, or point the app at a folder containing the `macos/` bundle. The host drives the
|
| 42 |
+
denoising loop over a single static, bidirectional forward (`main(input_ids[1,S]) β logits[1,S,vocab]`,
|
| 43 |
+
no KV cache).
|
| 44 |
+
|
| 45 |
+
## Bundle
|
| 46 |
+
|
| 47 |
+
- `macos/` β Core AI `.aimodel` (GPU) + `tokenizer/` + `metadata.json`
|
| 48 |
+
- `metadata.json` exposes the diffusion knobs (no recompile to retune):
|
| 49 |
+
- `seq` β canvas length (this **v1 preview** is `128` β answers up to ~80 tokens; a longer-context build is planned)
|
| 50 |
+
- `block_size` `32`, `threshold` `1.0` β the entropy threshold trades steps for speed; lower = more gradual, higher = fewer forwards (faster), too high degrades quality
|
| 51 |
+
|
| 52 |
+
## Performance (M4 Max, GPU)
|
| 53 |
+
|
| 54 |
+
| metric | value |
|
| 55 |
+
|---|---|
|
| 56 |
+
| throughput | **β38 tok/s** (threshold 1.0) |
|
| 57 |
+
| TTFT | ~0.2 s |
|
| 58 |
+
| forwards (NFE) | ~11 for an 83-token answer |
|
| 59 |
+
| size | 4.9 GB (int4 + int8 head) |
|
| 60 |
+
|
| 61 |
+
The per-step cost is a full bidirectional forward over the whole canvas (no KV cache) β the
|
| 62 |
+
distillation keeps the step count low. A delayed-KV-cache decode (process only the active region) is
|
| 63 |
+
the next speed lever.
|
| 64 |
+
|
| 65 |
+
## Roadmap
|
| 66 |
+
|
| 67 |
+
- Longer context (larger canvas) build
|
| 68 |
+
- Delayed-KV-cache decode (the d3LLM `generate_multi_block_kv_cache` lever) for higher throughput
|
| 69 |
+
- iPhone (h18p) build
|
| 70 |
+
|
| 71 |
+
## Credits & license
|
| 72 |
+
|
| 73 |
+
A community port. All credit to the upstream authors β **LLaDA** ([GSAI-ML](https://huggingface.co/GSAI-ML/LLaDA-8B-Instruct))
|
| 74 |
+
and **d3LLM** ([hao-ai-lab / NVIDIA](https://huggingface.co/d3LLM/d3LLM_LLaDA)). This bundle inherits
|
| 75 |
+
and is bound by their licenses β please review them before use. Core AI conversion only; no
|
| 76 |
+
retraining.
|
| 77 |
+
|
| 78 |
+
Part of the [Core AI model zoo](https://github.com/john-rocky/coreai-model-zoo).
|