EAGLE-3 draft for salamandra-7b-instruct-2606
This is a small draft model that makes salamandra-7b-instruct-2606 generate faster with speculative decoding. The draft guesses the next tokens and Salamandra checks them, so the output is the same as running Salamandra alone, just faster.
I trained it on Salamandra's own answers in Spanish, Catalan, Basque and Galician, because that's what I wanted to speed up.
How to use it
Tested with vLLM 0.33.0 on one H100 80GB. Target and draft together fit on a single 40GB+ GPU.
Option 1: serve the draft directly. vLLM reads the target model from the draft's config and downloads both:
vllm serve gabmerlo/salamandra-7b-eagle3-alia
Option 2: serve Salamandra and add the draft explicitly. Same result, more control:
vllm serve BSC-LT/salamandra-7b-instruct-2606 \
--speculative-config '{"method": "eagle3", "model": "gabmerlo/salamandra-7b-eagle3-alia", "num_speculative_tokens": 3}'
Then call it like any OpenAI-compatible server:
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "<served model name>", "messages": [{"role": "user", "content": "Explica qué es la fotosíntesis."}], "temperature": 0}'
Check that it's working: vLLM logs speculative decoding metrics (acceptance rate / mean acceptance length). You should see roughly 2.4–2.6 accepted tokens per step on es/ca/eu/gl. Close to 1 means the draft isn't helping (e.g. English prompts, which it wasn't trained on).
Notes
- Output is identical to Salamandra alone. Speculative decoding doesn't change what the model generates.
- Trained only on Spanish, Catalan, Basque and Galician. Expect less speedup in other languages.
- The speedup shrinks at high concurrency, when the GPU is already busy.
How I trained it
- Data: gabmerlo/salamandra-7b-instruct-2606-onpolicy-alia, 19,010 conversations that Salamandra answered itself (on-policy), from ALIA-2606-SFT prompts.
- Trained with vllm-project/speculators (0.10.0a58) in online mode: vLLM 0.33.0 serving Salamandra and giving the hidden states while the draft trains, both on the same H100 80GB.
- 3 epochs, sequences up to 4000 tokens, draft vocabulary of the 32000 most frequent tokens in my data. Each epoch took around 23 minutes.
The file is big (2.9GB) because it carries a copy of Salamandra's embedding table, which has 256k tokens. That part is frozen and doesn't slow anything down.
Results
On my validation split after the last epoch, the draft got the 1st token right 66% of the time, the first 2 tokens 44% and all 3 tokens 30%.
Speedup on 20 test prompts per language that were never used in training (H100, vLLM 0.33.0, temperature 0, up to 512 new tokens), compared with Salamandra alone:
- 1 request at a time: Spanish 1.92x, Catalan 2.13x, Basque 2.01x, Galician 2.03x (around 2x on average, from ~170 to ~344 tokens/s)
- 8 requests in parallel: Spanish 1.81x, Catalan 1.99x, Basque 2.19x, Galician 2.13x
All 80 answers came out identical to running Salamandra alone. Acceptance length was 2.36 to 2.60 tokens per step.
Graphs, notebooks and the comparison with the 2B GPTQ drafts: https://github.com/gabmerlo/salamandra-eagle3
License
Apache 2.0, same as Salamandra. The training data is CC BY 4.0 and comes from BSC-LT's ALIA-2606-SFT.