QodeAssist icon indicating copy to clipboard operation
QodeAssist copied to clipboard

qwen3

Open alexzk1 opened this issue 7 months ago • 6 comments

There is new qwen3 with weird behave. It has "thinking" mode which can be stopped by adding "/no_think" (underscore!) to the system/user prompts, which is discussed on reddit.

However, it generates output like this, on code completion mode:

class BinaryTreeIterator{
// I pressed ctrl+alt+Q here
    <think>

</think>

    // Define the necessary members for the BinaryTreeIterator class
    private:
        Node* current;
        BinaryTree* tree;

        BinaryTreeIterator(BinaryTree* tree) : current(tree->root), tree(tree) {}

        // Implement necessary methods for iteration
        Node* next() {
            if (!current) return nullptr;
            if (current->right) {
                current = current->right;
                while (current->left) {
                    current = current->left;<think>

</think>

                return current;
            }
            Node* parent = tree->findParent(current);
            while (parent && parent->right == current) {
                current = parent;
                parent = tree->findParent(parent);
            }
            if (!parent) return nullptr;
            current = parent->right;
            return current;
        }

        Node* getCurrent() const {
            return current;
        }

        void setCurrent(Node* node) {
            current = node;
        }

        bool
};

Is any way your plugin could remove that tags ? I used Qwen FIM template. P.S. I bet same will be in chat too.

Update, probably, it could be +1 template: https://huggingface.co/Qwen/Qwen3-32B They say enable_thinking=False will not do that tag and it needs different parameters like temperature too.

alexzk1 avatar May 17 '25 14:05 alexzk1

For me Qwen3 is ambiguous, in ollama it does not listen at all to what is written in the system promt, in lm studio it seems better. I can remove the thinking block, but whether it will completely solve the problem or just add - it is not clear.

Palm1r avatar May 18 '25 16:05 Palm1r

If I add /no_thinking IN CHAT as part of my message, there are no extra tags there. Not sure if you remove it already, or user's prompt does not generate it.

What I read there, it seems like their "new API". That's why they keep empty block in response, probably, it will continue to qwen 4 etc.

alexzk1 avatar May 18 '25 16:05 alexzk1

Sorry but you didn't understand me. Qwen3 model don't count system prompt for her, at all. For example as you can see, I sent no_think and ask return code as codeblock with rules, like "don't repeat current code" and model didn't do this, at all. I checked it in Ollama and LM Studio

Image

In same time other models do it fine: Image So I don't see reason to use and support Qwen3, maybe coder model will be better and with support FIM as well.

Palm1r avatar May 18 '25 17:05 Palm1r

Ok than...btw, it's on your screen too, why do we get now that ```cpp prefix? I get it with qwen 2.5 too, I don't think it was before.

alexzk1 avatar May 18 '25 17:05 alexzk1

It was, I just disabled text handler for show raw answer from model. It is controlled from here Image This answer from qwen-coder2.5 Image

Palm1r avatar May 18 '25 17:05 Palm1r

It was, I just disabled text handler for show raw answer from model. It is controlled from here

This does not work for me, I tried on/off/apply many times, i still see "```cpp". I had "qwen FIM", with "Ollama fim" it works different.

alexzk1 avatar May 23 '25 11:05 alexzk1