Using GPT-2 to Generate Absurd Names

On the Naming of Cats

Sunday night I was sitting at my computer,  tears welling up in my eyes under the glow of the monitor. Now I know what you are thinking – how is this different from any other Monday Eve? Well this time I was holding back laughter from discovering the amazing Cat Fanciers’ Association and their Top Cats and Kittens. Take some time to look through those, it’s an absolute goldmine of cute cats and insane names. Specifically, there are 1,002 awards that have been given from 2009 – 2019 with only a handful of repeat winners.

Why do I know exactly how many winners there have been? I thought it would make an entertaining dataset for my Computer Science class and got to work converting it to a text file. I figured there could be something useful that could be done with a list of names like “Lushell Hollywoodsunset of a Kitkat” and “Topeng I’vegotnews4you of Purrmatix”. I could never be creative enough to come up with names like that! But an AI model probably can.

The secret behind any solid AI model is a large set of data. The 1,002 names are not that many, but I figure they should be enough, especially since people have built programs to make Pokemon names with less. I do not actually know that much about programming, but I am pretty crafty at Googling so I ended up finding Janelle Shane’s page where she did something similar

I wasn’t looking to generate all new names though, I wanted them to emulate the CFA’s style. Janelle Shane did something like that as well! Specifically, she used OpenAI’s GPT-2 model so that not only was she using a dataset of cat names, she was using data pulled from across the internet on general patterns in the English language. Reading through her work eventually led me to Mac Woolf’s Python package to use GPT-2 in Colab and got to work training it on the CFA cat names.

I started with the lowest settings I could so that I could run the program quickly and make sure it works, using the 124M model and lowering the learning rate to 1e-5. Running the fine tuning program already led to some great sample results including:

  • JUN-JUICE EYE RASPBERY CAT
  • CYBERJELLICE EX LIL LO
  • JOY TOWN! CUTE SELFIE
  • JUN-JUICE IN THE HEART OF HUGUAR JOO-HAUN
  • MISS-MEEM-MEEM DUM-DAMAM
  • KANSAS CITY MACHINE GUNDAM
  • JOKIPEDES BABY PICKENS
  • JACOB HILLS TASTE BLUE BLUE TIL I FINISHED
  • KANGY-FUH!
  • BENJAMIN!
  • RUMMAR OF DOLLY-MADE-OUT-OF-PANTS
  • TIPPED BILLS THAT ARISE OF SILVER SCANDAL
  • KID SHOWMES 2012 BRONCO BALLEROK OF NU MOON

These were entertaining, but they wouldn’t quite fit in with the actual names on the list. After 1,000 steps of fine tuning, here are some of the names the model could come up with:

  • JUBILEUM BOWL OF WILLIAM LAFITH
  • CHAMY’S CALL ME, BLUE MISTER
  • CHANCERY’S QUIERE HAN SHI MAN OF CAT
  • FEMALE CARICATURE ENTHUSIAST
  • SUNNY WHISKEY BRIGHT RALTAR
  • TICKETYBOOK ULTIMA LAND EX
  • MARCUS LILY BEAT OF TOMMY LOUIS
  • CATBERY TAIL WHIMSICAL AS CAESAR
  • SUMO POSELLIUS INFINITE DREAM?
  • CHAMSEY’S TUFF TIGER

Much less entertaining, much less chaotic, but much more in line with the actual names! In fact, I would argue if I mixed up the names generated by the trained GPT-2 here with actual ones, you wouldn’t be able to tell the difference. Of the following names, “SUNCOON FAST EDDIE OF FUJICATS”, “PERSIPALS A KIND-OF-MAGIC”, “HOOBEE HELIOS OF DOLL VILLA”, “NAKELI EMMA OF WISHES” and “BENHANA HAN PENG”, only two are real but can you tell which? (It’s the first two.) I saved the results from my model here for your entertainment.

Make Your Own

If you are ok with using AI like a magic box without much insight on how it works, feel free to use the Colab I used for this experiment, but make sure to share any exciting results you get! All you need is an internet connection and a data set to train the model with, though you could also rely on the base model that can complete any text for you given a prefix text to start. It will take a couple hours the first time you try it to find some data and get it running, but once you get an idea for the workflow, you could knock out a couple experiments a day!

Probable Problems

After making my initial CFA Name Generator, I thought I would try a couple experiments with it. The first thing I did was try to make a more accurate model by upping the work on the fine tuning. I used the 355M model and set the learning rate back to the default and let it run. Seeing the first results got my hopes up: “DRAGONHILL PONYO”, “KITTIES LAND BLUE FIRE OF TEDDY-CAT”, and “VELVETKIST PACK’N HEAT OF KRIMPURRS”. But then I realized the model was horribly overfit – these were actual names from the original data! There were a few solid original names (“RUMFOLD SUNNY DELIGHT OF 5800 DREAMS”), but the list was mostly repeated from the original data. The model learned too well.

Another weakness in using GPT-2 is that it is built for text completion and crafting whole sentences and paragraphs based on what it has learned from the internet. This means it has trouble when entering the world of made-up words, like when I tried to get it to generate new Pokemon names using the current list to train it. The small data set of mostly single, short words wasn’t enough to create anything original, so the list was again repeated from already existing names. Though there were some highlights like the following:

  • Hazor
  • Mime II
  • Tropebroot
  • Celeste Grande
  • Xanthan
  • Careful
  • Neomure
  • Greteel
  • Limaher
  • Diploke
  • Gummy
  • Gotchus
  • Fighting Magma Benza
  • Phat’Loo’Roo’Gum
  • Kitty Cat
  • Scratchy
  • Calcium Pantothenate

1 thought on “Using GPT-2 to Generate Absurd Names”

  1. Pingback: Using BigQuery and GPT-2 to Generate Shower Thoughts – Mr. Marchant

Comments are closed.