By finetuning GPT-2 to generate beer recipes, and working with the wider beer community, we can have robot beer!
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
So a good friend of mine in the BABB (Brisbane Amateur Beer Brewers), Mark had the first crack at a recipe. The recipe the AI generated was...
drumroll please...
"Pale's out, Pale's in!"
A great name if I've ever seen one. You can find this recipe here.
Let's get to the brewday photos, all courtesy of our good friend Mark!
Measuring Out the Hop Additions
Mashing In at 65 Degrees
Recirculating...
Mash Completed, letting the bag drain as it gets up to boiling for the first hop addition
First Hop Addition
Beer completed and cooled down, going into the fermenter.
We have a monthly meeting coming up in 3 weeks for BABBs, so hopefully we can bring some along if it's ready in time! Expect an update with some BJCP scoresheets!
So just a quick post to show off some of the latest results at 240,000 generations of this recipe generator. We're down to an average loss of 0.06, which the original post was at approximately 0.78 still.
Beer Name: I was walking through the park and I witnessed a squirrel orgy, his nuts were massive!
Beer Type: All Grain Recipe
Beer Style: Experimental Beer (34C)
Beer Color: 2.7 SRM
Beer Bitterness: 39.7 IBU
ABV: 8.7% ABV
Ingredients:
Add 11 lbs 0.37 oz of Pilsner (2 Row) UK grains.
Add 3 lbs 11.97 oz of Oats, Flaked grains.
Add 2 lbs 3.27 oz of Wheat Malt, Bel grains.
Add 1 lbs 1.64 oz of Cara-Pils/Dextrine grains.
Add 0.71 oz of Magnum hops as boil hops for 90 minutes.
Add 0.71 oz of Magnum hops as boil hops for 60 minutes.
Add 0.71 oz of Magnum hops as boil hops for 30 minutes.
Add 1.06 oz of Challenger hops as boil hops for 20 minutes.
Add 3.00 g of Irish Moss
Add 1.06 oz of Challenger hops as boil hops for 10 minutes.
Add 0.71 oz of Saaz hops as boil hops for 5 minutes.
Add 1.06 oz of Saaz hops as dry hops for 3 days.
Yep, that beer name is wonderful. More excitingly, that is a recipe that would work.
Now that we're down to a pretty low loss level, I can generate some text whilst giving the model a prompt.
Giving the beer name "Citra IPA" I was hoping for an all Citra hopped beer.
Beer Type: All Grain Recipe
Beer Style: American IPA (21A)
Beer Color: 8.6 SRM
Beer Bitterness: 56.5 IBU
ABV: 7.7% ABV
Ingredients:
Add 11 lbs 0.37 oz of Pale Malt, Maris Otter grains.
Add 2 lbs 3.27 oz of Munich Malt grains.
Add 8.82 oz of Caramel/Crystal Malt - 20L grains.
Add 0.99 oz of Citra hops as boil hops for 60 minutes.
Add 0.71 oz of Citra hops as boil hops for 30 minutes.
Add 1.27 of Whirlfloc Tablet
Add 0.99 oz of Citra hops as boil hops for 15 minutes.
Add 1 pkgs of Add 2.32 of Goodbelly
Add 1.40 tsp of Yeast Nutrient
Add 1.06 oz of Citra hops as dry hops for 4 days.
I repeated this another dozen or so times, and it appears thanks to GPT-2 looking back when generating it's next line of text, it knows to make it not only an IPA but a Citra-based IPA! This result is far better than I ever thought I'd get out of it!
Just to check this out a bit more, I generated one named "Big Stout" and it made an Imperial Stout.
================================================================================
Model prompt >>> Beer Name: Big Stout
======================================== SAMPLE 1 ========================================
Beer Type: All Grain Recipe
Beer Style: Imperial Stout (20C)
Beer Color: 39.3 SRM
Beer Bitterness: 58.8 IBU
ABV: 9.5% ABV
Ingredients:
Add 12.00 gal of Add 20 lbs of Pale Malt (2 Row) US grains.
Add 3 lbs of Oats, Flaked grains.
Add 1 lbs of Chocolate Malt grains.
Add 12.00 oz of Carafa III grains.
Add 12.00 oz of Caramel/Crystal Malt -120L grains.
Add 12.00 oz of Roasted Barley grains.
Add 1.00 oz of Magnum hops as boil hops for 75 minutes.
Add 1.00 oz of Magnum hops as boil hops for 30 minutes.
Add 1.00 of Whirlfloc Tablet
Add 1.00 oz of Northern Brewer hops as steeping hops for 15 minutes.
Add 2 pkgs of
We still see the hangover from the training data of "Add 2 pkgs of" where my parser didn't grab the yeast.
I'm going to send a bunch of these recipes off locally now to get some made up. I was discussing at the local homebrew group how I should do it, and some were suggesting I give the top blurb of name, style, color, bitterness and ABV and have an experienced homebrewer develop a recipe in isolation from the rest of the recipe. We'd then compare both of these recipes to see how the GPT-2 based generator works out.
So I originally posted on reddit when I had trained on my CPU at home to 1,000 iterations and it was producing some funny results. Some results looked amazing, others.. would have ended up not tasting so good. I decided I'd put the project up on paperspace and get some real GPU muscle behind it. Within 48 hours I had 114x what I'd done in 3 days on the CPU. I've now got the results from a sample every 100 iterations over 114,000 of them!
I thought it'd be fun to pick a few of the generations to see what it had learnt between the generations.
So before I get to that, how about I start with showing what the recipes being fed in look like, so we can see how quickly GPT-2 is finetuned to the recipe structure.
Amarillo Pale Ale
All Grain Recipe
American Pale Ale (10A)
8.6 SRM
48.4 IBU
4.7% ABV
Add 7 lbs of Pale Malt, Maris Otter grains.
Add 1 lbs of Munich I (Weyermann) grains.
Add 8.00 oz of Aromatic Malt (Dingemans) grains.
Add 8.00 oz of Barley, Flaked (Briess) grains.
Add 8.00 oz of Caramel Malt - 20L (Briess) grains.
Add 8.00 oz of Caramel Malt - 60L (Briess) grains.
Add 2.00 oz of Amarillo (leaf) hops as boil hops.
Add 3.00 oz of Amarillo (leaf) hops as boil hops.
Add 1.00 oz of Amarillo (leaf) hops as boil hops.
Add 1 pkgs of
Notice how the end is Add 1 pkgs of ? Looks like my parser wasn't working very well and chopped off the yeast. Nevermind that, the rest of it is in general what it looks like. I scraped from a US website so all of the grains/hops are in Imperial and there was no way I could be bothered fixing that to metric.
Sample 1 After 100 Generations
======== SAMPLE 1 ========
SC1.0)
MBC 4.0 10ml (µg)
Add 10.21g of Calcium Chloride
Add 4.04g of Stearic Acid
Add 1.91g of Chloromethocrylene
Add 7.59 g of Stearic Acid, Add 2.21g of Methylparaben
Add 8.06 g of Citric Acid, Add 1.83g of Calcium Chloride
Add 1.80 g of Stearic Acid (flaked)
Add 0.00 g of Dihydro Triticum per SDS-PAGE v1.05
Add 5.00 g of Phenols (Phthalates)
Add 0.00 g of Dithyrene (Calcium)
Add 5.00 g of Biotin (Calcium)
Add 0.00 g of Dimethyltryptamine (DMT)
Add 0.70 g of MgSO4
Add 0.50 g of Chlorphenesin E (Ci-PEGSO4)
Add 0.50 g of Chlorpyrifos (Ci-PEGSO4)
Add 0.49 g of Bromine
Add 0.49 g of Phenolic Acid
Add 0.49 g of Bromide (MgSO4)
Add 5.00 g of Flaked Glycerin (BgSO4)
Add 8.00 tsp of Camphor
Add 2.23 oz of Igloozy® T-Hexane
Add 1 cup of iced coffee
Add 1 tbsp of Extra-Crisp Lemon
Add 1.82 g of Chlorella
Add 3.16 oz of Citra (Citra)
Add 12.00 ml of Fuggles®
Add 8.00 ml of Citra Seed Extract
Add 3.00 ml of Calcium Chloride
Add 2.00 tsp of Citra Sulfate
Add 1.00 tsp of Sulfonic Acid
Add 1.00 tsp of Citra
Add Add 2.00 tsp of Almondsilicate
Add 1 tsp of Citra
Add 5.00 ml of St-Egene Products
Add 8.00 g of Carcassimic Acid
Add 20.00 ml of Maraschino Peppers
Add 4.00 oz of Citra(C) hops
Add 4.00 oz of Citra
Add 0.50 tsp of Zydeco
Add 0.50 tsp of Choline-9 (Diaminobutyric Acid) (DIMINO)
Add 0.49 tsp of Marihuana Seed Extract
Add 1.00 tsp of Zydeco (ZnD)
Add 1.00 tsp of Marihuana Leaf Extract
Add 1.00 tsp of Marihuana Leaf Extract
Add 1 oz of Citra hops
Add 0.53 tsp of Zylovol (ZnM)
Add 0.53 tsp of Marihuana Leaf Extract
Add 1 oz of Citra hops
Add 1.00 tsp of Marihuana Leaf Extract
Add 1.00 tsp of Marihuana Leaf Extract
Add 8.00 tsp of Zylovol (ZnD)
Add 10.00 g of Marihuana Leaf Extract
Add 2 oz of Citra hops
Add 5.00 oz of Citra hops
Add 6.00 oz of Citra hops (D)
Add 2.00 oz of Citra hops
Add 2.00 oz of Citra hops (P)
Add 2.00 oz of Citra hops
Add 1.00 oz of Citra hops
Add 1.00 oz of Citra hops
Add 0.50 oz of Citra hops
Add 2.00 oz of Citra hops
Add 1 oz of Citra hops
<|endoftext|>Table of Contents</|
<|endoftext|>Add 1.00 g of Citra hops
<|endoftext|>Add 1.00 g of Citra hops
Add 1.00 g of Citra hops
Add 1.00 g of Citra hops
Add 1.00 g of Citra hops
Add 1 tsp of Citra hops
Add 1.00 tsp of Citra hops
Add 2.00 tsp of Citra hops
Add 2.00 tsp of Citra hops
Add 2.00 tsp of Citra hops
Add 2.00 tsp of Citra hops
...
Read more »
Create an account to leave a comment. Already have an account? Log In.
I used all of the beersmith cloud recipes, approx. 50,000 all up.
I know little about GPT-2 and less about beer, but are chloromethocrylene, dimethyltryptamine, and chlorpyrifos common beer ingredients? Or are these just random ingredients that are being pulled in somehow?
Those are definitely random ingredients pulled from wikipedia, because I am simply finetuning GPT-2 away from producing regular text and convincing it that what I actually care about is beer recipes. So it still has all that knowledge in the back of it's head that it uses when there is some creative license (i.e. beer names, in more trained versions).
Dimethyltryptamine is DMT which would make for one hell of a psychedelic beer!
It looks like Chlorpyrifos is a pesticide.
The training is currently up to 240,000 generations now and it's just produced the weirdest named beer that it has decided is an "Experimental Beer" and that name is.... "I was walking through the park and I witnessed a squirrel orgy, his nuts were massive!"
Become a member to follow this project and never miss any updates
Hi!
I really like your project! I'm doing AI research and am a passionate home brewer. I was wondering which dataset you use to train the model. And how big is the recipe dataset?