My output is garbled

#4
by pliskin123 - opened

I'm using the latest llama.cpp (b9893), but the output is garbled. Why is this happening? Is it a chat template issue? The startup parameters I'm using are as follows:
"%EXE_PATH%" ^
-m "%MODEL_PATH%" ^
--host 0.0.0.0 ^
--port %user_port% ^
--keep -1 ^
-np 1 ^
--mlock ^
-fa on ^
--cache-type-k %k_type% ^
--cache-type-v %v_type% ^
--temp %temperature% ^
--fit-ctx %ctx_val% --fit on -v

Unsloth AI org

as we said the GGUFs are not finalized until we announce them, there is more issues with the the inference implementation than we originally anticipated. We are trying to see if can push PRs to llama.cpp to fix the issue

We found DeepSeek-V4 issues in llama.cpp that caused gibberish after the 2nd turn. The cause was broken prompt caching. To run correctly, please use the latest llama.cpp version.
We also improved the DeepSeek-V4 chat jinja template, and tested over 4000 conversations to be equivalent with the official baseline.

Guide: https://unsloth.ai/docs/models/deepseek-v4
GGUF: https://huggingface.co/unsloth/DeepSeek-V4-Flash-GGUF

You can run DeepSeek-V4-Flash with all our fixes and Thinking toggles via Unsloth Studio:
deepseek-v4-flash in unsloth studio

llama.cpp added DeepSeek V4 support in #24162 - we noticed that when using any GGUF from any provider, multi turn conversations would not function well when compared to DS4's Hugging Face baseline. llama.cpp uses --ctx-checkpoints N which allowed it to do prefix caching to save inference costs. Instead of re-processing every prompt again on the 2nd, nth ask, we can use KV caching. However we found DS4 needed --ctx-checkpoints 0 or else you will get gibberish. Please use the latest version of llama.cpp to get fixes.

Engine Score Calculation Tool selection Parallel Tools Multi Turn tools Nested tools
Official code 15/15 3 3 3 3 3
Any provider 4/15 1 2 0 0 1
After our fix 15/15 3 2 3 3 3

Thanks guys and feel free to support our Tweet, Linkedin post or Reddit post

CC: @pliskin123 @lsm03624

shimmyshimmer changed discussion status to closed

Sign up or log in to comment