Training a coding model to paint watercolours with TRL and OpenEnv

AI-generated summary of reporting by Huggingface Blog. Read the original for the full story.

Why it matters

It shows RL can train small open models toward subjective aesthetic taste using a hand-curated dataset, with every artifact published for reproduction.

Read this as

A Hugging Face engineer reproduced an artist's viral project in which a language model writes JavaScript code that paints watercolour-style flowers, then taught a small AI model to do it better using reinforcement learning, a method where the AI improves by trial and error against a score. The 'score' here was human taste: 178 hand-rated AI paintings judged by two preference models. All code, data and trained models are freely published.

Hugging Face open-sourced a complete training pipeline, RL environment, reference dataset, scripts and models, that taught Qwen3.5-35B-A3B to paint watercolours matching one person's curated taste. The practical value is the reusable recipe: GRPO over taste-based rewards, a p5.brush-based environment, and the debugging lessons (LoRA configuration, TRL fixes) that cost the author weeks. Competitors closed-source would charge; this is free end-to-end.

GRPO training with TRL teaches Qwen3.5-35B-A3B (LoRA, all-linear, bf16) to write ~150-line p5.js sketches rendered in headless Chromium. The reward combines HPSv3 scores and a pairwise judge against a 178-image hand-rated pool. Four TRL GRPOTrainer fixes and all-linear LoRA targeting (dense assumptions missed MoE projections) unlocked learning; three reward mixes all learned, with judge-weighted runs noisier. Steps took 15–18 minutes; runs stopped at 110 of 200 steps with reward still climbing.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

Hugging Face TRL OpenEnv Qwen3.5-35B-A3B HPSv3 p5.brush iNaturalist

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading

Edge AI in wonderland

Edge AI lets devices stay intelligent offline, enabling real-time translation and voice synthesis on phones and embedded boards without cloud dependence.