Qwen 3.6 and inline comments
Posted by sarcasmguy1@reddit | LocalLLaMA | View on Reddit | 10 comments
I've been using Qwen 3.6 with the Pi harness, and so far I'm really enjoying the experience.
I've noticed Qwen is great at leaving inline comments when writing Typescript (haven't tried other languages). eg https://github.com/chrisetheridge/pi-extension-lmstudio/blob/main/src/extension/index.ts#L35
I don't see any specific instruction in Pi's system prompt that guides this behaviour, so it feels like its specific to Qwen. Does anyone have insight on how/why it does this? I'd love to encode it as a rule in AGENTS.md for other models to follow.
jwpbe@reddit
I usually let it cook and then hit it with:
"read in the skill.md and the 3 resource .md's in ../stop-slop. Once you have, grep the codebase for inline comments and remove all of them except the ones that are absolutely necessary. Our code is self documenting, so prefer to cut rather than keep. For those that survive, ensure they are written with stop-slop convention."
you can do the same for docstrings
Unlucky-Message8866@reddit
you like them? i hate them to point i wrote a lint rule to strip them, the damn models loves to spit useless comments and dividers everywhere
Hot-Employ-3399@reddit
They are so bad it starts to reason mid code like
// Wait, is it yellow? No, it's white, yellow is next cellsarcasmguy1@reddit (OP)
okay this is quite funny. i get reasoning loops but i've never hit comment loops
jacek2023@reddit
Do you edit AGENTS.md manually? I always ask agent to modify it so I assume it knows what to type 😄
Anbeeld@reddit
It does not, at least not precisely. There are very specific ways to make AGENTS.md effective that the model does not reproduce by itself, instead writing too descriptively etc. Researched this quite a bit for https://github.com/Anbeeld/AGENTS.md
sarcasmguy1@reddit (OP)
I used to get the agent to generate it for me, but I found writing it myself led to much better code and behaviour from the model. I often will ask the model for improvements to AGENTS.md based on past sessions, and then write them myself.
nickludlam@reddit
I imagine it's going to be doing that anywhere it's not obvious what's going on from the code. So in that case you linked, it's the absence of code which needs clarification. I get inline comments when using other models.
sarcasmguy1@reddit (OP)
we use openai models heavily at my workplace, and it _rarely_ adds comments like this, unless you explicitly say something like "add comments to these functions", and it often results in it writing far too much
olivia-reed2@reddit
qwen models are trained on chinese open sourced codebases where inline documentation is a strong cultural convention, so the commenting behaviour is baked into the base model weights not prompted, its like training data artifact to encode it for other models in agents.md and for typescript to be specific id prefer adding //why over //what in the inline comments