Mo Kordzanganeh, Danial Keshvary, and Nariman Arian
Solofied Limited

arXiv | solofied.com

Abstract

Latent diffusion models are the state-of-the-art for synthetic image generation. To align these models with human preferences, training the models using reinforcement learning on human feedback is crucial. Black et. al 2024 [1] introduced denoising diffusion policy optimisation (DDPO), which accounts for the iterative denoising nature of the generation by modelling it as a Markov chain with a final reward. As the reward is a single value that determines the model's performance on the entire image, the model has to navigate a very sparse reward landscape and so requires a large sample count. In this work, we extend the DDPO by presenting the Pixel-wise Policy Optimisation (PXPO) algorithm, which can take feedback for each pixel, providing a more nuanced reward to the model.
PXPO Pipeline

Results

We performed three sets of experiments to determine how well PXPO works:

  1. Preference-based manual human feedback on a single image
  2. Segmentation feedback from an AI model
  3. Colour-channel feedback

Experiment 1: Pixel-wise Human Feedback

In this experiment, Stable Diffusion v1.4 [2] was prompted to generate a nature landscape. Then a human subject was asked to fill in the areas they liked with the colour green (corresponding to a feedback of +2 for each pixel filled) and areas they disliked with red (which was -2). The user decided that they liked the lake and disliked the trees, and filled up the first image accordingly. The model was updated using PXPO based on this single-image feedback, and the process was repeated 15 times, and with each iteration the model improved itself. At the end of this process, the resultant image had significantly more water and fewer trees. The experiment was repeated from scratch, this time the user provided the opposite feedback. This was to ensure the model actually followed instructions. The result, similarly was a significant adaptation of the image to the user's preferences.
pixel-wise human feedback
RLHF Animation - Trees Decrease Lake Increases RLHF Animation - Trees Increase Lake Decreases

Experiment 2: Segmentation Feedback

The human user was replaced with an AI segmentation model (SegFormer clothes [3]) that could detect various categories of human clothes and body parts. The synthesier was prompted to generate portrait of a man on the beach. The SegFormer had to find the person's hair and provide negative feedback in the areas where hair existed. After 160 reward queries, the synthesiser had learned to reduce the possibility of any hair being detected by the SegFormer.
Segmentation Experiment

Experiment 3: Colour-channel Feedback

This time, the aim was provide an algorithmic feedback. The model was prompted to generate a red taxi in traffic, and as feedback, each pixel with the colour blue in it was penalised proportionally to the amount of blue present in the image. The model managed to dramatically reduce the colour blue from the images after 1024 reward queries.

Colour-channel experiment

References


[1] K. Black, M. Janner, Y. Du, I. Kostrikov, and S. Levine, "Training diffusion models with reinforcement learning" (2024), arXiv:2305.13301 [cs.LG].

[2] R. Rombach, A. Blattmann, D. Lorenz, P. Esser, and B. Ommer, "High-resolution image synthesis with latent diffusion models," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (2022) pp. 10684–10695.

[3] M. Dziemian, "mattmdjaga/segformer b2 clothes - hugging face," https://huggingface.co/mattmdjaga/segformer_b2_clothes (2023).