Tool calling degraded with 2-bit quantization — DSM token structure frequently breaks. Is tool calling represented in the imatrix calibration dataset?
Hi, thanks for your work on these quants. I've noticed that with the 2-bit quantization, tool calling capability seems significantly degraded. The DSM token structure appears to break quite often: the model frequently produces malformed tool call outputs (broken or incomplete special token sequences), which makes function calling unreliable. My suspicion is that this may be related to the calibration data used for the importance matrix. Could you verify whether the imatrix and the reference text dataset used for calibration contain at least one example of tool calling? If the calibration data has no tool-calling samples, the special tokens and structural patterns involved in function calls may not be adequately protected during quantization, which could explain why they degrade so badly at 2 bits. If that's the case, would it be possible to add a few tool-calling examples to the calibration dataset and regenerate the imatrix? Steps to reproduce:
Load the 2-bit quant Send a request with tools defined Observe that the tool call output structure is frequently malformed
Happy to provide concrete examples of broken outputs if useful.
If that's the case, would it be possible to add a few tool-calling examples to the calibration dataset and regenerate the imatrix?
FYI: The quantization toolchain can be found here: https://github.com/antirez/ds4/tree/main/gguf-tools
Including calibration dataset, instructions how to generate one, etc: https://github.com/antirez/ds4/tree/main/gguf-tools/imatrix
Maybe you can generate what you seek on your own?
I have no real clue about these details, but I am very happy to test the results from a heavy user perspective.
Right now unfortunately the q2 file that we are using was not generated with the full imatrix dataset that is shipped with the project, which is now far better. Before updating the quants, there should be a way to quantify the amount of tool calls that are not well formatted. However something is odd here, since it is not so common to see badly formatted DSML. Do you see it as context increases? Which implementation are you exactly using (Metal, CUDA, ROCm...)? I'm asking because wrong inference graphs that contain subtle errors degradate the model in a way that also make it likely to mis-call tools. The SHA256 of the GGUF file would help as well.
mistake close the issue