Configuration issue with tie_word_embeddings when using trl GRPOTrainer with vLLM

#22

When loading Qwen/Qwen3-VL-8B-Instruct with vLLM, for example when using TRL’s GRPOTrainer with use_vllm=True, an error of the form AttributeError: 'Qwen3VLTextConfig' object has no attribute 'tie_word_embeddings' may occur.

This issue is caused by a mismatch in the configuration structure. In the config.json for Qwen3-VL-8B-Instruct, the field tie_word_embeddings is defined at the root level but is missing from the text_config section. In contrast, Qwen3-VL-4B-Instruct explicitly defines tie_word_embeddings inside text_config. The vLLM implementation for Qwen3-VL directly accesses text_config.tie_word_embeddings, and when this field is absent, an AttributeError is raised. This is a configuration compatibility issue rather than a problem with the model architecture or training procedure.

A straightforward and recommended fix is to add "tie_word_embeddings": false to the text_config section of config.json. This is consistent with the intended design of the 8B model, which uses untied input and output embeddings, and it does not change model behavior or performance. It only restores compatibility with vLLM.

If editing config.json is not practical, the issue can also be resolved at runtime by injecting the missing attribute after loading the model, for example by setting model.config.text_config.tie_word_embeddings to the value of the root-level tie_word_embeddings field, defaulting to false if necessary.

The tie_word_embeddings option controls whether the input token embedding matrix and the output language modeling head share the same weights. For Qwen3-VL-8B-Instruct, this option appears to be intentionally set to false. The error arises solely from the missing field in text_config, not from an incorrect configuration value.

Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment