GUPTA

Generative Unsupervised Pre-Trained Administrator
https://lablogueuse.net/index

Gupta is a collection of scripts that run on the server to generate new posts and query a stable diffusion API for accompanying on-topic images. Gupta also generates new comments and deletes your comments if it considers them to be toxic or spam.

Post Generation

New posts are genered via queries to the Chat-GPT API. The site data is seeded with 7 base contributors that will take the role of different personas that articles will be written for. Every post-generation prompt picks a contributor at random and adds the titles of their articles to the final prompt. The final prompt will be some variant of this:

The Intriguing World of Gemini: Celestial Twins and Legendary Geminis by Ana Astra
The Enigmatic World of Cancer: Celestial Crabs and Legendary Cancers by Ana Astra
Moonbathing: Basing in the Lunar Glow by Ana Astra
Please pretend you are Ana Astra and write their next blog post (start with a title and then write the post)

This is a fairly straightforward prompt but works with a high degree of reliability. Specifying that the model should ‘pretend to be’ Ana Astra ensures it understands the task of authorship and won’t return results like ‘as an AI language model, I can’t know what Ana’s next post will be.’ ‘Start with a title’ sounds open to interpretation, but the model consistently understands it to mean that a title should be delivered at the start of the output and then the article itself should follow after a series of line breaks, making the final output easy to predict and parse.

Comment Generation

Here’s the line where the comment query is specified:

comment_query_base = 'Given this post, please write one comment (output like username:comment) \n' + post.content

The model consistently understands this prompt to mean it should generate output like:

stargazer22:What a great article! I never knew the origin story of Gemini as so interesting!

Output in this form is easy to parse. The one complication is that repeated calls of this prompt will generate near-identical comments, sometimes even with the same username. This can be avoided by simply appending the previous comment into the prompt, ensuring that the input - and thus the output - varies in each generation.

Comment Moderation

Here’s the line of code used to formulate the API query that diagnoses toxic comments.

moderation_query = 'Please diagnose this post as toxic, spam, or acceptable (output like acceptable:reason) + comment.content

Comments that are classified as spam or toxic are deleted from the database. I tested this prompt with a mix of a dozen acceptable and a dozen unacceptable comments and it worked for every one. Asking for reasoning provided useful a window into the model’s interpretation of comments during development.

Image Generation

Once the article was created, the title of the article was then used to prompt a matching on-topic image from a Stable Diffusion 2.1 API. These prompts required the most time to develop. At first I tried to prompt the image generation using only the title of the article. This generally resulted in bland, low quality output images that varied wildly across genre and composition. I finally decided on the following format:

crisp clear air, nostalgic, detailed, high detail, winter landscape, (Title: The Incredible Powers of Astral Projection: Unlocking the Secrets of the Universe)

This prompt is divided into 2 sections, an ‘anchor’ and the title of the article itself. In this way, I can base my image requests on anchors that are known to produce quality images that conform to a consistent art style. Specifying that the article’s name is the title of the artwork clarifies to the model which part of the prompt refers to the style of the artwork and which part refers to the subject matter. The prompt above is just one of several anchors used. Each time an image is queried an anchor will be randomly selected, in order to ensure a certain level of visual diversity in the final output.

Most of the anchors used specify ‘winter’ or ‘cold’ in order to increase the likelihood that characters will be drawn wearing gloves or mittens. These articles of clothing conform to a simpler visual geometry that Stable Diffusion can more consistently and correctly depict than the hands themselves; in any case, a misshapen glove is far less noticable than a mutated hand. Inserting ‘gloves’ into the prompt explictly backfired by causing the model to try and insert hands into images where they would otherwise not appear or be out of frame.