Don’t let a neural net mix drinks.
3 min read

Don’t let a neural net mix drinks.

Don’t let a neural net mix drinks.

So I’ve used neural networks to generate recipes in the past. They’re computer programs that can learn to imitate the data we give them, copying the way that humans drive cars, label images, or translate languages.

That is, they try to learn. They’re called “neural” because they have virtual neurons that work a little like the real neurons in our brains. Their virtual brains, however, are really tiny. Where a human has about 86 billion neurons, the neural networks we use today have hundreds to low thousands - think nematode worm or, optimistically, jellyfish. So they often struggle, and recipes, my friends, are one of those times. (you haven’t lived until you’ve seen a neural net’s attempt at “small sandwiches”)

I turned to cocktails, inspired by Beth Skwarecki’s cocktails bot (and helped immensely by the dataset she sent me).

The neural net’s first attempt was… an attempt.

morale and phop ngaba   * 1 1/2 ounces lineappl  * 1 lunces crilpe juice  * 1 teaspoon sramge juices   - add witeasples.  - fttr into a cocltail glass.   somingenalle srasge botanaine dllope llasse   * 1/2 ocaspoot cocktail  * 2 teaspogn calaare collaajlasss jocos   - fill cocktail glass.

I let it train for a little longer, and things got a little more recognizable, as it learned to kinda spell more ingredients.

luzdl snick   * 1 ounce maraschino liqueur  * 1 ounce litht pinch schnapps  * 1 ounce frondy  * splash of panch  * 1/2 ounce lime juice  * 1 ounce motbher dry vermouth  * splash of orange curacao  * 1/2 teaspoon vanill  * splash on menther  * cordigt sprig   - pour cube all ingredients into champagne glass.  - blend until brotdy frov.  * tpint spriw.

It had, however, not learned when to quit. 64-ounce (2 liter) cocktails are not unheard of at this stage.

champagc cuss   * 1 1/2 ounces vodka  * 1/2 ounce vodka  * dash curacao   - l yur cube mint schnapps  * li1 ounce creme de menthe  * 1 tcospinn all ingrediens  * 1/3 ounce cube  * 1/2 ounce creme de pance  * 1/2 ounce creme de menthe  * 1/2 ounce brandy  * chilled champagne   - pour curacao cubl frilp piwtertw phole t limgu into a pint glass.  - garnint into a blender.  - garnish with a lemon pepp spping with prech cr schnapps.  - stir.  - add surana and a champagne place drop.  - pours marine pots.  - frult maptber.  - shake.  - strain into a chill of top ipd two spoot cream liqueur and curacao and orange syice and souit gil.  - shdve drint cream, and grenadine.  - garnish with a pint gl tstin twist.  - sdake.  - strain into a blandy.  - stir.  - top with champagne.  - add brendd.  - stir.

It continued to learn on its own, all without input from me, and eventually ended up with cocktails that were almost plausible.

hot tew ball   * 3 ounces black sloe gin whipped cream  * 1 egg white  * 1 teaspoon orange shered  * 2 eggs vodka  * 1 1/2 ounces maraschino liqueur  * 4 drops pineapple   - pour vodka, lemon juice, and egg white.  - shake.  - strain into a cocktail glass.
amareta's little milk   * 2 ounces pineapple juice  * 1/2 ounce lemon juice  * 1/2 teaspoon light rum  * splash sugar   - fill a cocktail shaker with ice.  - add vodka and vodka.  - stir gently on top.  - blend until thic de cart maltinr glass.  - add soda.  - strain into a chilled martini glass.  - garnish with milk bowl.
velvet fill   * 3/4 ounce cream  * 1/2 ounce dark rum  * 1/2 ounce cream  * 1/2 teaspoon creme de cacao  * 1/2 teaspoon sugar   - fill cocktail shaker with ice.  - add gin, creme de cacao, and bitters.  - shake.  - strain into a chilled martini glass.  - garnish with an orange twist.

Some of my other training attempts, however, did not go so well. At first the cocktail titles in my training set were in all caps, which confused the heck out of the neural net because capital letters were so rare that it didn’t see enough examples of what to do with them. It struggled with the titles.

CHALE COCK MONKTINININININININININILE  * 1 1/2 ounces vodka  * 1 ounce coffee liqueur  * 1/2 ounce cointreau  * 1/2 ounce cream  * 1/2 ounce cream  * 1 teaspoon grenadine  * 1 teaspoon sugar  * 1 teaspoon sugar  * 1 teaspoon sugar  * 1 teaspoon sugar  * Dash of Angostura bitters  * Chilled champagne   - Pour vodka and cointreau into a blender.  - Blend until smooth.  - Pour into a chilled cocktail glass.
RAL CHONK    * 1 1/2 ounces vodka  * 1/2 ounce sour mix  * Chilled champagne  * Club soda   - Pour club soda, coffee liqueur, and club soda.  - Shake.  - Strain into a chilled champagne flute.  - Squeeze into chilled champagne flute.  - Stir with an orange slice.

You may also notice that the ill-fated all-caps attempt had a lot of repetition - that’s because I was using textgenrnn, which has a somewhat limited memory. It could learn to spell ingredients, but had no idea whether it had already added sugar and cream. When I switched to char-rnn for the lowercase recipes above, I could give it a memory of 50 characters, enough to cut down on repetition. The textgenrnn version, however, became strangely obsessed with creme de cacao. The less said about its cocktails, the better.

black banana     * 1 1/2 ounces gin  * 1/2 ounce dry vermouth  * 1 ounce cream  * 1 ounce creme de cacao  * 1/2 ounce creme de cacao  * 1/2 ounce rum  * 1/2 ounce lemon juice  * 1/2 ounce creme de cacao  * 1/2 ounce triple sec  * 1/2 ounce grenadine  * 1/2 ounce creme de cacao  * 1/2 ounce amaretto   - fill cocktail shaker with ice.  - add gin, vermouth, and pineapple juice.  - shake.  - strain into a collins glass.  - add coffee liqueur, creme de cacao, and cream.  - shake.  - strain into a chilled cocktail glass.  - garnish with a lemon slice.

For more neural net cocktails (including custom-generated cocktails for any name you care to provide), check out Beth’s cocktails bot!

For a few more of the cocktails I generated (including some very unfortunately-named ones), you can become an AI Weirdness supporter to get bonus content. Or become a free subscriber to get new AI Weirdness posts in your inbox!

Subscribe now