Training Qwen with RL to Paint Watercolors via Code
zsakib_ · x · 2026-08-24
Surya Narreddy demonstrated using Reinforcement Learning to fine-tune Qwen 3.5 35B to generate watercolor paintings by writing p5.js code, rather than generating images directly.
How it works:
- The model receives a prompt and writes a complete p5.brush JavaScript sketch.
- The code is rendered as a PNG in a sandboxed Puppeteer environment.
- A judge model compares the output against hand-rated reference paintings.
- The judgment is converted into a reward signal, updating the model via GRPO.
Reward Checks:
- Code compilation status.
- Code length.
- HPSv3 preference scores (model-judged preference).
- Human pairwise ratings from hand-picked sketches.
This approach makes the generated image editable code, addressing the limitation of traditional generative models where outputs cannot be directly modified.
Related event: RL-Trained Qwen Coding Model Paints Watercolors by Writing p5.js Code(11 posts)→
More from coding & agent
- DHH cracks Linux deep sleep on Zenbook A16: 0.16W overnight draw — cgarciae88 · 2026-11-30
- Sakana AI open-sources Agentic Scientist, pushing toward self-improving AI researchers — SakanaAILabs · 2026-11-30
- Blogger migrates Ghost blog to self-hosting in hours with Claude — kevinakwok · 2026-11-30
- Business-prose model open-sourced: trained on a single 96GB GPU, all quant formats in one repo — IridiumEagle · 2026-11-30
- Devs say vibe-coding workflow is draining the joy of programming — weskambale · 2026-11-30
- Slipwing: Open-Source Windows MCP Server Lets Agents Drive Chrome and Desktop Apps in the Background — Sudden_Analysis8617 · 2026-11-30