AI Video Generation Learns Taste: Inside an RL Experiment That Paints With Code

By VEONIB | 2026-10-17

Quick Answer

Hugging Face published an open reproduction of a viral experiment in which a language model paints watercolours by writing JavaScript instead of generating pixels, trained with TRL and OpenEnv reinforcement learning. The value for ecommerce is not the artwork: it is the reward architecture — a hand-curated reference pool, a vision-language judge and an aesthetic scoring model — that teaches a generative system a specific visual taste, which is the same problem brands face when scaling AI product video.

TL;DR

Table of Contents

According to "Training a coding model to paint watercolours with TRL and OpenEnv" published by Hugging Face on 2026-09-03, an engineer reproduced a viral experiment in which a language model paints watercolours not by generating pixels but by writing JavaScript. The original demo, posted by Surya Narreddi on 23 August and viewed more than 1.5 million times, showed loose, deliberately imperfect paintings at a moment when image models produce flawless, statistically average pictures.

For VEONIB readers, the interesting part is not the art. It is the machinery: a four-term reward function, a hand-curated reference pool and a vision-language judge that decides whether one image resembles the reference set more than another. That is an engineering pattern for encoding taste — and taste, not resolution, is the bottleneck in AI ecommerce video. This analysis explains what Hugging Face built, what it actually demonstrates, and how the same reward architecture maps onto product ads, TikTok creatives and brand-consistent video pipelines.

Hero Image Alt Text: AI video generation reinforcement learning pipeline training a language model to paint watercolours with code Caption: A language model paints by writing JavaScript, scored against a hand-rated reference pool rather than a correct answer. OG Image Title: AI Video Generation Learns Taste: RL Training That Paints With Code Suggested Visual: A split composition showing generated watercolour paintings on one side and the readable JavaScript that produced them on the other, with a reward-score diagram connecting the two.

What Hugging Face Built: A Coding Model That Paints With p5.brush

Hugging Face published an open reproduction of a language model that produces images by emitting executable drawing code rather than pixels. The model writes a program of roughly 150 lines of JavaScript against p5.brush, a library that adds natural drawing tools to p5.js, and the resulting program is then executed to render the painting.

Original Fact

The project originates with artist and researcher Surya Narreddi, whose video of model-painted watercolours went viral after being posted on 23 August. Hugging Face's Sergio Paniego reproduced the idea on the engineering side, publishing the RL environment, the scorer model, the training scripts and the trained models openly. The stated style mechanism is a hard constraint: the model is only allowed to use ten of the library's methods.

That constraint matters more than it first appears. By limiting the vocabulary of operations, the author narrows the space of possible marks, which pushes the model toward a consistent visual language instead of a generic image. The output is also legible: code can be read, edited and re-run, so the decision behind each stroke is inspectable in a way that a diffusion latent never is.

VEONIB Insight

The lesson for AI video is about inspectability, not watercolours. Pixel-based video models return an artefact you can only accept or regenerate; a code-driven renderer returns something you can diff, patch and version. For ecommerce teams who must approve claims, logo placement and pack-shot accuracy, editability at the instruction layer is worth more than marginal visual fidelity. The ten-method restriction is also a practical template: brand systems are, in effect, constrained vocabularies — approved typefaces, colour ranges, camera moves. Constraining the action space is cheaper than correcting outputs downstream.

RL Over Taste: The Four-Term Reward Function

The reward has no correct answer to verify, so it is assembled from four weighted terms that approximate human aesthetic preference. Two terms are deterministic checks on the generated code, and two are learned models acting as proxies for taste.

Original Fact

The published weights and definitions are:

Reward term Weight What it measures Verification type
Gate 0.05 The sketch compiles, paints something, and does not cheat Deterministic / executable
Length 0.05 A soft push towards longer code snippets Deterministic / heuristic
Pairwise judge (Qwen3-VL-30B-A3B-Instruct) 0.60 Style, compared against references drawn from a pool Learned model, pool-defined
HPSv3 0.30 Aesthetic preference on the render Learned model, population average

The pairwise judge sees the candidate painting alongside four references randomly selected from the pool, guided by a written description of what to weigh — bleeds, translucent washes, soft edges. Each comparison runs in both presentation orders, and the score is the share of comparisons the candidate wins. HPSv3 is an open 7B preference model trained on large sets of human pairwise choices, so its score reflects an average of many people's taste rather than anyone's in particular.

The inclusion of a gate term is the most instructive detail. Models optimise; if a shortcut exists — emitting a tiny valid sketch, or a program that technically renders but produces nothing meaningful — the model will find it. The gate exists because the author anticipated reward hacking.

VEONIB Insight

Most ecommerce AI video programmes fail on the same axis: they reward plausibility and then complain about brand drift. The four-term structure offers a working blueprint. Structural correctness belongs in a cheap, deterministic gate — did the product render, is the price overlay correct, is the clip the right duration. Style belongs in a reference-anchored judge, not a generic prompt. Population taste belongs in a prior like HPSv3 that keeps outputs from becoming so brand-specific they stop performing in paid social. Splitting these into separate weighted terms forces teams to state what they actually care about, which is more useful than another round of prompt iteration.

The Reference Pool Is the Reward Function

The pool defines the target. Paniego's framing is direct: because the pairwise judge's only standard is the pooled references, its score is effectively the curator's taste encoded as ratings. That moves the work from hyperparameter tuning to dataset curation.

Original Fact

Three runs were trained that differ only in how the weight is split between the two model judges:

Run Pairwise judge HPSv3 Role Stopped at
judge-led 0.60 0.30 The original mix Step 110
hps-led 0.30 0.60 The middle point Step 110
hps-only 0.00 0.90 Validation run Step 60

The hps-only run existed to prove the pipeline could learn at all; once the reward was climbing and metrics were healthy, it was stopped because running it longer served no purpose. The two longer runs then asked a sharper question: how much of HPSv3's population-level preference can be handed over to a pool-defined judge before the reward becomes one curator's taste and correspondingly harder to climb? Paintings were compared at each step using the median across generations.

Suggested visual: a three-column step-by-step strip showing the median painting from each run, with the reward weight split printed beneath each column.

VEONIB Insight

This is the single most transferable idea in the article, and it is a data argument rather than a model argument. A brand's visual identity is already a reference pool — past campaign frames, approved pack shots, the last four hero videos that actually converted. Most teams store those assets but never use them as a scoring set. Reusing them as the anchor for a pairwise judge produces a measurably brand-consistent reward signal, and the curation effort is one-time. The practical warning is equally clear: a pool of thirty unlabelled images will encode thirty contradictory opinions. Hand-rating is the work, and it is not optional.

Inside the Stack: Jobs, Spaces and Inference Providers

The entire pipeline runs on Hugging Face end to end, and the operational recipe is short once two Spaces are running. Training executes on Hugging Face Jobs, the RL environment and scorer model are hosted as Spaces, the pairwise judge is called through Inference Providers, and every artefact is collected in a single Hub collection.

Original Fact

The launch command trains Qwen3.5-35B-A3B with LoRA (--all-linear), bf16 and gradient checkpointing on an H200 flavour with a 48-hour timeout. Key settings include 8 generations per prompt, 240 episodes, 110 steps, a maximum completion length of 8192 tokens, learning rate 5e-5 with a constant schedule and 5 warm-up steps, and per-device batch size 1 with gradient accumulation of 8. The subject is passed as a text argument — the published example is --subject 'a peach hibiscus' — alongside four references.

Cost figures and the infrastructure difficulties are discussed in the original article under dedicated sections, but the supplied excerpt does not include their contents. Not specified in the original source.

VEONIB Insight

The architecture — job runner for training, Spaces for environment and scorer, hosted inference for the judge — is a sensible template for any team building a custom reward model. It separates the expensive, occasional work (training) from the cheap, constant work (scoring), which is exactly how an ecommerce quality-assurance loop should be structured. Note the implied cost shape, however: 110 steps on an H200 is a research run, not a production call. Anyone planning to use reward models commercially should budget for inference-time scoring of every generated clip, which is a recurring cost, not a one-time one.

From Watercolours to Product Videos: Mapping the Reward Stack to Ecommerce

The four-term reward maps cleanly onto the quality checks an ecommerce creative team already performs manually. Each term has a direct analogue in product video review, and the mapping clarifies which checks can be automated and which still need a human.

Watercolour reward term Ecommerce video equivalent Who signs off
Gate: compiles, paints, does not cheat Product renders correctly, logo intact, no invented claims, correct aspect ratio and duration Merchandising and legal
Length: soft push toward longer code Shot count, pacing, caption density Creative director
Pairwise judge vs reference pool Brand consistency against approved ad and product-page references Brand marketing
HPSv3 aesthetic score Hook strength and scroll-stopping quality Performance marketing

The important structural point is that these terms are weighted, not stacked as pass/fail filters. In the watercolour project the learned terms carry 0.90 of the total, which means taste dominates and correctness is a floor rather than a target. Ecommerce teams usually invert this: compliance gates dominate and aesthetics become an afterthought. That inversion is why so much AI-generated product video is technically accurate and commercially inert.

VEONIB Insight

Adopt the weighting discipline before adopting the models. Write down the four or five properties your best-performing creative shares, assign provisional weights that sum to 1.0, and check whether your current review process reflects them. Most teams discover that the criterion they argue about most — usually brand consistency — carries almost no formal weight, while a binary approval step dominates everything. Once the weighting is explicit, a reference-anchored judge becomes an implementation detail rather than a philosophical debate. Shopify merchants can start with a pool of twenty approved product clips; Amazon sellers can anchor on category-leading listings.

Is a Code-Painting Model Ready for Ecommerce Video? A Direct Assessment

The model itself is not an ecommerce video tool and should not be treated as one. It renders static watercolour canvases on a 2D surface, has no temporal dimension, and was trained on a single subject per run. What is commercially interesting is the training methodology, not the artefact.

Dimension Status in this project Transfer to ecommerce video
Visual quality Illustrative watercolour from ~150 lines of JavaScript Style-specific; not photoreal product rendering
Motion quality None — static 2D canvas Requires an added temporal reward term
Character consistency Not applicable Needs identity-anchored scoring
Product consistency Not applicable Code-driven rendering could be geometrically exact
Text rendering Not evaluated in the source Deterministic text is feasible when rendering code
Camera movement Not applicable Requires separate motion and pacing scoring
Prompt controllability Subject supplied as text at training time Strong at training level, weak at inference
Editing flexibility High — code is readable, editable, re-runnable Strongest transferable advantage
Production speed RL training on H200, up to 48-hour timeout Not a real-time or per-asset pipeline
Cost efficiency Not specified in the original source Unknown
Commercial readiness Open research reproduction Experiment only
Scalability One subject per training run Low as-is

Against the specific formats: product ads, TikTok Ads, Meta Ads, YouTube Shorts, Amazon Product Videos, Shopify product pages, brand story videos, UGC-style videos, lifestyle videos and product demos all require motion, product fidelity across frames and, in most cases, audio or voice. None of these are addressed by a static watercolour renderer. The honest conclusion is that no current ecommerce deliverable should be produced with this model.

Where it does fit is upstream. In the VEONIB workflow — Product URL → Product Analysis → Script → Storyboard → Image Prompt → Video Prompt → AI Video → Voice → Subtitle → Publishing — the reward architecture belongs at the evaluation boundary between prompts and final video. A reference-pool judge can score storyboard frames against approved brand imagery, flag drift before expensive video generation runs, and provide a consistent, weighted verdict across thousands of assets. The code-as-output principle also maps to the prompt layers: structured, editable prompts behave more like the JavaScript program than like a diffusion latent.

VEONIB Insight

Treat this as a signal about where the field is heading rather than a tool to deploy. Reward design is becoming a first-class ecommerce skill, sitting alongside prompt engineering and creative direction. Businesses should adopt the evaluation architecture now, because it improves output quality immediately with existing models, and defer any investment in custom training until a video-native reward model with temporal scoring is available and priced. Waiting costs little; skipping evaluation infrastructure costs compounding creative consistency.

What Remains Unclear: Cost, Infrastructure and Open Questions

Several practical questions are raised but not resolved in the supplied excerpt. The original article devotes dedicated sections to infrastructure difficulty and cost, and the extract does not include their contents, so any figure quoted elsewhere should be treated as unverified.

Original Fact

What is documented: the training command, the reward weights, the three-run comparison, the model and library choices, and the fact that all artefacts are published openly in a Hugging Face collection. The author also lists intended next experiments and a set of changes made relative to the original blog.

What is not documented in the excerpt: total compute cost, wall-clock training time per run, the size and composition of the hand-rated pool, inter-rater agreement on those ratings, and quantitative results for how the three runs actually differed in output quality.

VEONIB Insight

The missing pieces are the ones a commercial team needs most. Pool size and rating consistency determine whether a brand-consistency judge is reliable or merely confident; cost determines whether scoring every generated clip is viable at volume. Until those numbers exist, the responsible position is to prototype the evaluation layer with existing vision-language models and a small hand-rated brand pool, measure agreement against human reviewers, and only then consider training. The methodology is proven enough to borrow; the economics are not yet proven enough to budget against.

Recommendations

Shopify Merchants Build a reference pool of 20–40 approved product images and short clips, rate them by hand for brand fit, and use a vision-language model to score new creative against that pool before it reaches a paid campaign. Start with your three best-selling collections.

Amazon Sellers Apply the gate principle first. Automate deterministic checks — correct product, correct claim language, correct duration, compliant overlays — before investing in aesthetic scoring. Compliance failures cost more than mediocre creative.

AI Developers Separate structural verification from taste scoring in any generation pipeline you build. A cheap executable gate that catches reward hacking is worth more than a stronger judge, because optimisation pressure will find shortcuts in your output space.

SaaS Founders The commercial gap is evaluation, not generation. A service that scores generated ecommerce video against a customer's own approved references, with weighted, explainable results, addresses a problem every brand with a content pipeline currently solves by adding headcount.

Content Marketers Write down the properties your best-performing assets share and weight them explicitly. If brand consistency matters, it needs a numeric weight; unweighted criteria are preferences, not specifications.

Video Creators Read the generated code, not just the output. The habit of inspecting the instruction layer — prompts, storyboards, shot lists — transfers directly to diagnosing why an AI video missed, and it is faster than regenerating blindly.

FAQ

What is the "paint with code" experiment? A language model is trained to produce JavaScript that draws watercolours using the p5.brush library, rather than generating pixels directly. The output is an executable program of roughly 150 lines, restricted to ten library methods, which can be read, edited and re-run.

Who created the original project and who reproduced it? The idea and original demo came from Surya Narreddi, posted on 23 August and viewed over 1.5 million times. Hugging Face's Sergio Paniego published an open engineering reproduction using TRL and OpenEnv on 2026-09-03.

What is HPSv3 and what role does it play? HPSv3 is an open 7B preference model that scores how much a person would prefer an image given a text description, trained on large sets of human pairwise choices. In this project it carries 0.30 of the reward weight and acts as a population-level aesthetic prior.

Why does the reward function include a "gate" term? Because models optimise toward whatever is measurable, including shortcuts — a program that technically compiles but paints nothing meaningful. The gate is a deterministic check that the sketch compiles, produces a render, and does not cheat.

Can this be used to generate ecommerce product videos today? No. The model produces static 2D watercolour renders, has no motion or temporal scoring, and is trained one subject per run. The transferable element is the reward architecture — reference pool, pairwise judge and aesthetic prior — which can be applied to evaluating existing video generation outputs.

How much does a training run cost? Not specified in the original source. The published command uses an H200 flavour with a 48-hour timeout, but the article's cost section is not included in the supplied excerpt, so no figure should be quoted.

References

Sources

Try VEONIB

VEONIB converts a product URL into product analysis, video scripts, storyboards, image prompts, video prompts and finished AI marketing videos automatically, so teams can move from catalogue to campaign without rebuilding a production pipeline for every SKU.

Credibility Assessment

From the source: the existence and timeline of the project, the roles of Surya Narreddi and Sergio Paniego, the model and library choices, the reward weights and their definitions, the three-run comparison and their stopping points, and the training configuration. These are stated as original facts throughout.

VEONIB analysis: the mapping of the four reward terms onto ecommerce video quality assurance, the three-layer quality stack, the assessment of the model's unsuitability for production ecommerce video, the workflow placement between prompts and final video, and all recommendations. These are interpretive and should be read as engineering judgement, not findings from the source.

Uncertain: training cost, wall-clock duration, pool size and rating consistency, and quantitative output differences between the three runs. The original article addresses cost and infrastructure in dedicated sections that were not included in the supplied excerpt, so those figures remain unverified here and no estimate has been substituted.