vivianamarquez commited on
Commit
6c3c2fe
·
verified ·
1 Parent(s): 3a4385d

Update LFM2.5-VL-3B-DSpark model card

Browse files

Update model details, performance results, inference instructions, and model card formatting.

Files changed (1) hide show
  1. README.md +62 -63
README.md CHANGED
@@ -22,107 +22,90 @@ tags:
22
  <div style="display: flex; justify-content: center; gap: 0.5em; margin-bottom: 1em;">
23
  <a href="https://playground.liquid.ai/"><strong>Try LFM</strong></a> •
24
  <a href="https://docs.liquid.ai/lfm/getting-started/welcome"><strong>Docs</strong></a> •
25
- <a href="https://leap.liquid.ai/"><strong>LEAP</strong></a> •
26
  <a href="https://discord.com/invite/liquid-ai"><strong>Discord</strong></a>
27
  </div>
28
  </div>
29
 
30
  # LFM2.5-VL-3B-DSpark
31
 
32
- **LFM2.5-VL-3B-DSpark** is an experimental speculative-decoding draft model that brings DSpark to
33
- vision-language models. It allows [`LiquidAI/LFM2.5-VL-3B`](https://huggingface.co/LiquidAI/LFM2.5-VL-3B)
34
- to decode substantially faster without changing its output, for a minimal increase in memory footprint.
35
 
36
- To our knowledge, this is the first publicly available DFlash/DSpark-style block speculation model for
37
- vision-language models — speculative decoding has so far been almost exclusively a text-model story.
38
 
39
- From the drafter's perspective the input modality is irrelevant: by the time tokens reach the hidden
40
- layers, text and image patches alike are just tensors. Because DSpark taps the target's hidden states
41
- rather than modifying its architecture, exactly the same drafting algorithm applies to a VLM as to a
42
- text LFM.
43
 
44
- <!-- TODO: link the vision DSpark blog post once it is published (www.liquid.ai/blog/<slug>) -->
45
- Find more information about LFM2.5-DSpark in our [blog post](https://www.liquid.ai/blog/lfm2.5-dspark).
46
 
47
  ## 🗒️ Model Details
48
 
49
  LFM2.5-VL-3B-DSpark is a DSpark speculative-decoding draft model with the following features:
50
 
51
  - **Target model**: [`LiquidAI/LFM2.5-VL-3B`](https://huggingface.co/LiquidAI/LFM2.5-VL-3B)
52
- - **Draft parameters**: **280M** (BF16)
53
  - **Backbone**: 4 full attention layers, `hidden_size=2048`, `intermediate_size=6144` with SiLU/SwiGLU, GQA with `num_attention_heads=32` / `num_key_value_heads=8`, `head_dim=64`
54
  - **Extra heads**: Markov head (rank 256) + confidence head
55
- - **Block size**: 9
56
- - **Target taps**: hidden states from layers `[2, 9, 17, 21, 27]` of the 30-layer target
57
  - **Vocabulary**: 128,000
58
 
59
- <!-- TODO: memory-footprint overhead (% increase over the deployed target) — blog draft still has this as XXX -->
 
60
 
61
  This drafter pairs with:
62
 
63
- | Drafter | Target |
64
- |---|---|
65
- | [LFM2.5-VL-3B-DSpark](https://huggingface.co/LiquidAI/LFM2.5-VL-3B-DSpark) | [LFM2.5-VL-3B](https://huggingface.co/LiquidAI/LFM2.5-VL-3B) |
66
  | [LFM2.5-VL-3B-DSpark-GGUF](https://huggingface.co/LiquidAI/LFM2.5-VL-3B-DSpark-GGUF) | [LFM2.5-VL-3B-GGUF](https://huggingface.co/LiquidAI/LFM2.5-VL-3B-GGUF) |
67
 
68
- ### Training
69
-
70
- The drafter follows the recipe from the text DSpark release: a simplified attention-only draft model,
71
- with layer count and block size selected by ablation. There are no established data mixtures for
72
- training multimodal drafters, so the corpus was constructed from ablations — SFT data spanning common
73
- vision-language tasks, weighted toward expected workloads, with 5% text. Training ran for 10 epochs,
74
- and the published checkpoint is the epoch with the highest acceptance rate. All ablations and training
75
- runs were executed exclusively on AMD hardware using Liquid AI's training framework.
76
-
77
  ## 📊 Performance
78
 
79
- ### Quality parity
80
 
81
- Speculative decoding is **exact**: the target verifies every proposed token, so the generated text is
82
- what the target would have produced on its own. Under greedy decoding a draft token is accepted only
83
- if it matches the target's own choice, and on rejection the target's token takes its place. Benchmark
84
- accuracy is therefore unchanged — you get the speedup, not a different model.
85
 
86
  See [`LiquidAI/LFM2.5-VL-3B`](https://huggingface.co/LiquidAI/LFM2.5-VL-3B) for quality benchmarks.
87
 
88
- ### Acceptance and speedup
89
 
90
- Following [MMSpec](https://arxiv.org/abs/2603.14989), speedups are measured on diverse vision-language
91
- tasks. All numbers use 16-bit precision for both the vision encoder and the language backbone;
92
- acceleration of quantized models is outside the scope of this release.
93
 
94
- | Benchmark | Hardware | Runtime | Accepted tokens / step | Throughput | Speedup |
95
- |---|---|---|---:|---|---:|
96
- | MMSpec (testmini) | Apple M4 Max | llama.cpp | 4.04 | 62 → 140.8 tok/s | **2.27×** |
97
 
98
- <!-- TODO: full per-benchmark acceptance + speedup tables for H100 (SGLang) and Apple M4 Max (Metal/MLX).
99
- The blog draft still has these figures as TBD. The 2.6B-DSpark card carries two tables here:
100
- (1) mean accepted tokens per decoding step by benchmark, and (2) acceptance / H100 speedup /
101
- M4 Max speedup. Populate both before publishing. -->
 
 
 
 
102
 
103
- <!-- TODO: interactivity (throughput vs. concurrency on 1×H100, SGLang) — figure still TBD in the blog draft. -->
104
 
105
- > [!NOTE]
106
- > On Apple silicon the drafter is run at block size 8 rather than 9.
107
 
108
- ## 🏃 Inference
 
 
 
 
 
 
 
109
 
110
- LFM2.5-VL-3B-DSpark ships with day-one support across the inference ecosystem.
111
 
112
- | Name | Description | Docs |
113
- |------|-------------|------|
114
- | [SGLang](https://github.com/sgl-project/sglang) | High-throughput production deployments with GPU. | <!-- TODO: docs.liquid.ai link for DSpark VL on SGLang --> — |
115
- | [llama.cpp](https://github.com/ggml-org/llama.cpp) | Cross-platform inference with CPU offloading. Use the [GGUF repo](https://huggingface.co/LiquidAI/LFM2.5-VL-3B-DSpark-GGUF). | <!-- TODO: docs.liquid.ai link --> — |
116
- | [MLX](https://github.com/ml-explore/mlx) | Apple's machine learning framework optimized for Apple Silicon. | <!-- TODO: confirm MLX-VLM support path and add docs link; no MLX repo published yet --> — |
117
 
118
- ### How to run (SGLang)
 
 
119
 
120
- Requires a build of SGLang with DSpark support for LFM2 targets
121
- ([PR #31041](https://github.com/sgl-project/sglang/pull/31041)), plus the VL-serving prerequisite
122
- (`Lfm2VlForConditionalGeneration` capture-hook delegation).
123
- <!-- TODO: confirm which SGLang release/PR carries the VL capture-hook delegation and link it. -->
124
 
125
- Launch the target with the draft attached:
 
 
126
 
127
  ```bash
128
  python -m sglang.launch_server \
@@ -134,8 +117,24 @@ python -m sglang.launch_server \
134
  --disable-radix-cache --mem-fraction-static 0.8 --port 30000
135
  ```
136
 
137
- Then query the OpenAI-compatible endpoint at `http://localhost:30000/v1`. The baseline is the same
138
- command without the `--speculative-*` flags.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
 
140
  ## 📬 Contact
141
 
@@ -162,4 +161,4 @@ command without the `--speculative-*` flags.
162
  year = {2026},
163
  note = {www.liquid.ai/blog/lfm2-5-vl-dspark},
164
  }
165
- ```
 
22
  <div style="display: flex; justify-content: center; gap: 0.5em; margin-bottom: 1em;">
23
  <a href="https://playground.liquid.ai/"><strong>Try LFM</strong></a> •
24
  <a href="https://docs.liquid.ai/lfm/getting-started/welcome"><strong>Docs</strong></a> •
 
25
  <a href="https://discord.com/invite/liquid-ai"><strong>Discord</strong></a>
26
  </div>
27
  </div>
28
 
29
  # LFM2.5-VL-3B-DSpark
30
 
31
+ **LFM2.5-VL-3B-DSpark** is an experimental speculative-decoding draft model that adapts DSpark for the LFM2.5 vision-language architecture. It allows LFM2.5-VL-3B to run faster without degrading quality.
 
 
32
 
33
+ To our knowledge, this is the first publicly available DFlash/DSpark-style block speculation model for vision-language models. Until now, speculative decoding work has focused almost entirely on text-only models.
 
34
 
35
+ This is a drafter for [`LiquidAI/LFM2.5-VL-3B`](https://huggingface.co/LiquidAI/LFM2.5-VL-3B). In SGLang on a single H100, decoding runs up to 2.58× faster. On Apple silicon, it reaches up to 3.13× with MLX-VLM on an M5 Max and up to 2.14× with llama.cpp on an M3 Ultra.
 
 
 
36
 
37
+ Find more information about LFM2.5-VL-3B-DSpark in our [blog post](https://www.liquid.ai/blog/lfm2-5-vl-dspark).
 
38
 
39
  ## 🗒️ Model Details
40
 
41
  LFM2.5-VL-3B-DSpark is a DSpark speculative-decoding draft model with the following features:
42
 
43
  - **Target model**: [`LiquidAI/LFM2.5-VL-3B`](https://huggingface.co/LiquidAI/LFM2.5-VL-3B)
44
+ - **Draft parameters**: **279.5M** (BF16)
45
  - **Backbone**: 4 full attention layers, `hidden_size=2048`, `intermediate_size=6144` with SiLU/SwiGLU, GQA with `num_attention_heads=32` / `num_key_value_heads=8`, `head_dim=64`
46
  - **Extra heads**: Markov head (rank 256) + confidence head
47
+ - **Block size**: 9 during training; 8 or 9 at inference, depending on hardware
 
48
  - **Vocabulary**: 128,000
49
 
50
+ > [!NOTE]
51
+ > On Apple silicon the drafter is run at block size 8 rather than 9.
52
 
53
  This drafter pairs with:
54
 
55
+ | Drafter | Target |
56
+ | ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------- |
57
+ | [LFM2.5-VL-3B-DSpark](https://huggingface.co/LiquidAI/LFM2.5-VL-3B-DSpark) | [LFM2.5-VL-3B](https://huggingface.co/LiquidAI/LFM2.5-VL-3B) |
58
  | [LFM2.5-VL-3B-DSpark-GGUF](https://huggingface.co/LiquidAI/LFM2.5-VL-3B-DSpark-GGUF) | [LFM2.5-VL-3B-GGUF](https://huggingface.co/LiquidAI/LFM2.5-VL-3B-GGUF) |
59
 
 
 
 
 
 
 
 
 
 
60
  ## 📊 Performance
61
 
62
+ ### Benchmarks
63
 
64
+ Speculative decoding is **exact under greedy decoding**: the target verifies every proposed token, so the generated text is what the target would have produced on its own. Under matched sampling settings at non-zero temperatures, speculative decoding preserves the target model's output distribution. You get the speedup, not a different model.
 
 
 
65
 
66
  See [`LiquidAI/LFM2.5-VL-3B`](https://huggingface.co/LiquidAI/LFM2.5-VL-3B) for quality benchmarks.
67
 
68
+ ### Draft acceptance
69
 
70
+ This table reports the mean number of draft tokens accepted per target verification pass at batch size 1 and temperature 0. Higher acceptance generally enables greater acceleration, but the measured speedup also depends on hardware and runtime overhead.
 
 
71
 
72
+ Following [MMSpec](https://arxiv.org/abs/2603.14989), the evaluation covers General VQA, Text VQA, Image Captioning, Chart VQA, Complex Reasoning, and Multi-turn Conversation.
 
 
73
 
74
+ | Benchmark | 1×H100 (SGLang, block 9) | Apple M5 Max (MLX-VLM, block 8) | Apple M3 Ultra (llama.cpp, block 8) |
75
+ | ---------- | ------------------------ | ------------------------------- | ----------------------------------- |
76
+ | MMMU-Pro | 4.00 | 4.07 | 4.19 |
77
+ | Multi-turn | 3.34 | 3.24 | 3.31 |
78
+ | COCO | 4.38 | 4.21 | 4.50 |
79
+ | CharXiv | 4.01 | 4.34 | 4.04 |
80
+ | TextVQA | 3.68 | 4.08 | 3.58 |
81
+ | GQA | 3.97 | 3.77 | 3.93 |
82
 
83
+ ### Measured inference speedup
84
 
85
+ This table reports the resulting runtime performance relative to the same target model without DSpark. Each cell is formatted as **decode / end-to-end**.
 
86
 
87
+ | Dataset | 1×H100 (SGLang) | Apple M5 Max (MLX-VLM) | Apple M3 Ultra (llama.cpp) |
88
+ | ---------- | ---------------- | ---------------------- | -------------------------- |
89
+ | MMMU-Pro | 2.08× / 1.94× | 2.93× / 2.62× | 2.03× / 1.74× |
90
+ | Multi-turn | 2.00× / 1.79× | 2.30× / 1.91× | 1.57× / 1.37× |
91
+ | COCO | 2.55× / 2.23× | 3.13× / 2.59× | 2.14× / 1.77× |
92
+ | CharXiv | 2.36× / 1.96× | 2.94× / 1.71× | 1.87× / 1.56× |
93
+ | TextVQA | 2.17× / 1.65× | 2.69× / 1.56× | 1.64× / 1.33× |
94
+ | GQA | 2.35× / 1.74× | 2.67× / 1.93× | 1.77× / 1.30× |
95
 
96
+ All measurements use 16-bit processing for both the vision encoder and language backbone. The H100 results use SGLang on one H100 80GB in BF16 at batch size 1, temperature 0, and block size 9. The Apple results use FP16 weights at batch size 1, temperature 0, block size 8, and up to 2,048 output tokens. Measurements were collected with [Pipette](https://pipette.liquid.ai/).
97
 
98
+ ### Interactivity
 
 
 
 
99
 
100
+ On a single H100, DSpark maintains a throughput advantage across all measured concurrency levels. The advantage narrows as concurrency increases and decoding becomes more compute-bound.
101
+
102
+ ## 🏃 Inference
103
 
104
+ LFM2.5-VL-3B-DSpark is supported by SGLang for NVIDIA GPUs and MLX-VLM for Apple silicon. For llama.cpp, use the [GGUF checkpoint](https://huggingface.co/LiquidAI/LFM2.5-VL-3B-DSpark-GGUF).
 
 
 
105
 
106
+ ### SGLang
107
+
108
+ Requires [SGLang v0.5.19 or newer](https://github.com/sgl-project/sglang/releases/tag/v0.5.19). Launch the target with the draft attached:
109
 
110
  ```bash
111
  python -m sglang.launch_server \
 
117
  --disable-radix-cache --mem-fraction-static 0.8 --port 30000
118
  ```
119
 
120
+ Then query the OpenAI-compatible endpoint at `http://localhost:30000/v1`. The baseline is the same command without the `--speculative-*` flags.
121
+
122
+ ### MLX-VLM
123
+
124
+ On Apple silicon, use [MLX-VLM](https://github.com/Blaizzy/mlx-vlm) v0.7.2 or newer. The drafter is detected automatically when passed with `--draft-model`:
125
+
126
+ ```bash
127
+ python -m mlx_vlm.generate \
128
+ --model LiquidAI/LFM2.5-VL-3B \
129
+ --draft-model LiquidAI/LFM2.5-VL-3B-DSpark \
130
+ --draft-block-size 8 \
131
+ --image /path/to/image.jpg \
132
+ --prompt "Describe this image." \
133
+ --max-tokens 256 \
134
+ --temperature 0
135
+ ```
136
+
137
+ DSpark decoding in MLX-VLM currently uses greedy sampling, so set `--temperature 0`.
138
 
139
  ## 📬 Contact
140
 
 
161
  year = {2026},
162
  note = {www.liquid.ai/blog/lfm2-5-vl-dspark},
163
  }
164
+ ```