Generating WaniKani mnemonics with GPT-4

In my last thread, I used GPT-3 to try generating WaniKani mnemonics. First, I tried using few-shot prompting with the vanilla “Davinci” model. The results were sometimes hilarious (You are the king of all fish!) but not particularly useful as mnemonics. Later in the thread I tried a different approach, fine-tuning the Curie model on 1,500 examples from WaniKani (fine tuning Davinci wasn’t available at the time). The results were much more coherent, but I felt like they often lacked a sense of logic, the storytelling flow that makes WaniKani mnemonics so memorable.

Now, of course, with the release of ChatGPT and GPT-4, we’ve got much more powerful LLMs to work with. These new models are much better at creative storytelling and following instructions in a prompt, so I was quite hopeful that few-shot prompting would work this time around.

For these examples, I used GPT-4 with the following system prompt:

You are a bot for helping users learn Japanese. Users will provide you with Kanji that they would like you to create mnemonics for, and you will respond with catchy mnemonics based on those kanji's radicals. You should weave the names of the radicals together into a memorable story that naturally leads to the meaning of the kanji. Do not use any radicals in your response that the user does not provide in their prompt. Wrap radicals in a <radical> XML tag and wrap meanings in a <kanji> tag so they can be formatted correctly.

I then provided five example prompts and mnemonics chosen randomly from WaniKani. I prompt the model with the kanji, definition, and list of radicals, and ask it to output a mnemonic. Here’s an un-curated random selection of the model’s output:

Kanji Meaning Radicals AI generated mnemonic
“Well” or “Boil” “tsunami” and “courage” If the tsunami is big enough and you have enough courage, you can catch a well and it will boil. With enough courage, anything is possible.

Imagine hanging out at the beach when a huge tsunami comes. But instead of running away, you grab your board and courageously decide you’re going to surf this wave. As you catch it, an incredible well forms around you and starts to boil. So cool!
“Green” “thread”, “wolverine”, and “water” A wolverine knits thread under a waterfall, creating a masterpiece of green color. The water from the waterfall is what gives the thread its magnificent green hue.

Picture the wolverine using his sharp claws to skillfully knit a green masterpiece, thanks to the enchanting water that adds the green color to the threads.
“Lump” “dirt” and “demon” A demon lurking underground forms a lump of dirt in the soil as it moves through the Earth. It is said that these demons dislike light, and so they form lumps in the dark dirt.

Imagine walking through a garden on a quiet night, when suddenly you stumble upon a strange lump of dirt. You remember the stories about how demons lurk in the darkness and form these lumps in the soil.
"Filial Piety “teacher” Show filial piety by honoring your teacher.

In the same way as you’d respect parents, you should also show respect to your teacher who imparts wisdom, leading you on the path to filial piety.
“Watch Over” “hand” and “eye” Use your hand to shade your eye as you watch over those around you.

Picture yourself standing on a hill, shading your eyes with your hand, as you keep a careful and loyal eye on everyone below.
“Expose” or “Dew” “rain”, “foot”, and “kiss” As the rain pours down, you see a foot sticking out from the bushes, and it looks like someone is sending a kiss! How surprising it is to see such a situation exposed! But as you look closer, you realize it’s just dew on the foot, and not a mysterious kiss at all.

It’s quite fitting, dew and exposures are often found together in poetry. Your imagination runs wild with what else might be out there in the rain.
“Indicate” or “Show” “jackhammer” Though it’s not the most subtle way to point something out, imagine using a jackhammer to indicate or show where something is.

Just imagine the noise and vibrations of a jackhammer as you desperately try to show someone where the hidden treasure is buried. This powerful and memorable image should help you recall the meaning of this kanji.
“Planting” “plow” and “drunkard” The drunkard loves to have fun in the garden with his plow and start planting flowers and veggies. This planting is done all while stumbling around and wavering because of the alcohol.

Imagine a drunkard taking up gardening as a new hobby, and with a plow in hand, he plants seeds and plants with dedication. It may be a strange sight, but the garden will have a unique touch.
“Master” or “Main” “master” There’s a master in town, and it’s one who is always in the main position of power. This master’s influence is widespread and unwavering, making them the key figure in any situation.

Picture this all-powerful master walking through town, commanding the respect and attention of everyone around them. They are undoubtedly the main character in their own story.
“Bribe” “shellfish” and “kiss” When someone offers you a precious shellfish and a sweet kiss, it might be a bribe to sway your decision.

Watch out for those shellfish and kisses! They can be tempting, but don’t let them trick you.
“Lightweight”, “Light”, or “Light Weight” “car” and “tombstone” A lightweight car for ghosts is made with tombstone material, but it still manages to be incredibly light.

Picture the ghost mobile, able to carry spirits swiftly from one place to another without making a sound because of its lightweight tombstone construction. This way, even those who’ve moved on can enjoy driving in style!
“Stretch” “bow” and “long” A long bow is the perfect tool for stretching a string across the battlefield.

When you need to work that tension out of your muscles, remember that the longest, largest bow can give you just the stretch you’re looking for.
“Repay” “alcohol”, “drop”, and “river” You repay your friend’s kindness by giving them a bottle of alcohol. As you hand it over, a drop of alcohol falls into the river below, symbolizing the gratitude and flow of your repayment toward them.

Picture the joy on your friend’s face as they receive the bottle of alcohol and the single drop symbolizing your appreciation, with the river flowing nearby, running under the bridge of friendship.
“All” “building”, “have”, and “scooter” In the building, we have a scooter that can magically carry all the people inside.

Imagine walking into a building and being amazed to see a scooter parked inside, with a sign that says it can carry all the people in the building at the very same time. It may sound impossible but that’s the magic of this particular scooter!

Well, I’ll let you judge for yourself, but personally I think these are quite good! They aren’t all perfect of course, but the nice thing is that you can literally with the click of a button generate another dozen options.

Right now, GPT-4 is a pretty expensive model so each of these examples costs about $0.03 to generate. ChatGPT (that is, gpt-3.5-turbo) is also pretty good at generating mnemoics while being a fraction of the price and not stuck behind a wait-list. The nice thing about GPT-4, aside from it being an all-around more capable model, is that it obeys the system prompt much more fervently than ChatGPT.

I came up with my system prompt pretty off-the-cuff, but I would be curious to see people try some prompt engineering to come up with something better. In particular, I would like to see if someone could come up with a prompt that stops it putting the definition in the middle of the mnemonic rather than the beginning or end.

I did all this using a Python script, but now that the chat interface is available in the OpenAI Playground, scripting shouldn’t be necessary. Anyone with an OpenAI account should be able to go in and manually create a system prompts along with some few-shot examples to play around it.

7 Likes

Honestly, these are better than 95% of official WK mnemonics.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.