News for hackers. Stuff that matters.
Re:Food and Generative AI by burkaman on Friday October 27, 2023 @10:50AM (#38039227)
I feel like generating recipe ideas/titles is the easy part, and advanced AI techniques are not necessary. Even the article notes that there is not really any difference between 1 round of training and 40 rounds of training with their model.

Actually generating a recipe is obviously much harder, and should be effectively impossible unless you include a humanoid robot that can cook and taste. I think the best you could do is generate a possible recipe that highlights ingredients and techniques you'll need to experiment with.

Also some of their final ideas don't really make sense:

- "Carb smart mexican beef and capsicum stuffed peppers with fries , avo and sour cream". Carb smart but it comes with fries? And "capsicum stuffed peppers" is a strange way to phrase it.

- "One - pan beef meatloaf italiano with green peas and spinach". You can cook this in one pan if you really want to but it will not be good.

- " little ears " pasta serves as balsamic tomatoes. Strange phrasing.

A do think a different model could solve these problems, but coming up with generic recipe ideas is not really a problem anyone has.

Re:Food and Generative AI by tornato7 on Friday October 27, 2023 @11:31AM (#38039835)
I get all of my recipes from GPT-4 these days. Granted, most of them are just regurgitating a common recipe, but I find that it's able to tweak recipes appropriately if I say "I'm out of X, can I use Y or Z instead?" - I've never actually had a bad recipe come of it.
Re:Food and Generative AI by scudsworth on Friday October 27, 2023 @11:41AM (#38039994)
post a picture of your dinner
Re:Food and Generative AI by gffrd on Friday October 27, 2023 @12:46PM (#38040799)
"steak frites lasagna with cream base and avocado mash tartare"
Re:Food and Generative AI by giraffe_lady on Friday October 27, 2023 @12:11PM (#38040399)
I mean if you can cook already you can do whatever you want. I could make a decent meal from a recipe in a language I don't speak just off a handful of cognates. Doesn't mean I followed the recipe in a meaningful sense.

When I've looked at gpt recipes they've had some pretty deranged proportions and you'd be in trouble following them precisely. If you just need a list of ingredients and a loose technique though eg "tofu & cashew stir fry with soy sauce and garlic" then ya sure I mean absolutely.

Re:Food and Generative AI by simonw on Friday October 27, 2023 @12:27PM (#38040583)
Yeah I've found GPT-4 to be surprisingly good at recipes. I think that's because it's effectively serving up the "average" recipe for anything you ask it for, based on everything it's scraped from the internet... which usually ends up being a good recipe.

I love being able to challenge it with "and now make it vegan" etc to see what it comes up with.

This is also another example of the thing where having a randomly unreliable teacher is actually quite useful if you're trying to learn to cook - because it forces you to question what it tells you, apply your own intuition and think carefully about what worked and what didn't.

Re:Food and Generative AI by swatcoder on Friday October 27, 2023 @12:28PM (#38040596)
If you think about how it works, it's going to have a strong representation of oft-published recipes and oft-published substitutions and will be able to mash those together into plausible original recipes that are adjacent to them. Making a satisfying meal for a few people with comparatively mainstream tastes should be pretty reliable.

But the more esoteric you go, aiming for something really novel or something unusually historic/traditional/regional, or the more technical and delicate, the more it'll turn to hallucinating naive text continuations that will lead you astray. An experienced cook will know to spot the weird stuff and revise on the fly; an inexperienced one is going to end up with some... odd dishes.

It's the same as many of us see when used for code assistance. It's great at inventing "original" boilerplate which inspiration has been exhaustively covered in source material, but gets real wacky and unreliable the more you move away from that.

Re:Food and Generative AI by kastnerkyle on Friday October 27, 2023 @11:24AM (#38039711)
There was a really nice post on doing this kind of thing with CRF back in 2015 [0]. Open source data, and code on github. Also a nice tutorial on structured prediction using CRF type models.

Would be interesting if you could prompt, LoRA distill, or use modern LLM tricks against a well-labeled and curated set, similar to how other tagging problems are handled with modern pretrained models.

[0] https://open.nytimes.com/our-tagged-ingredients-data-is-now-...

Re:Food and Generative AI by guhidalg on Friday October 27, 2023 @11:23AM (#38039694)
One problem I have is recipe clustering by ingredients. I want to minimize the different ingredients I need to buy so I can get some economies of scale while shopping. I don't know of any service that does this, I have been thinking about building it for my website but I haven't figure out what is a good UI for it.
Re:Food and Generative AI by ForestCritter on Saturday October 28, 2023 @10:17AM (#38049987)
better homes and garden cookbook with the red and white checkered cover. The basics are all there and the ingredient lookup is in the index. Say I lookup potato, all the potato recipes are in the index. It also offers substitutions. I have an older version and a newer version.
Re:Food and Generative AI by og_kalu on Friday October 27, 2023 @12:13PM (#38040426)
>Actually generating a recipe is obviously much harder, and should be effectively impossible unless you include a humanoid robot that can cook and taste.

It's not because this necessary information is already implicit in the sum of all the data it is trained on.

Re:Food and Generative AI by swatcoder on Friday October 27, 2023 @12:19PM (#38040497)
I can't imagine any cook or chef who believes that all the necessary information for all good recipes has been captured in text, let alone in the text that's been digitized and made available for training.

That's not to say that LLM's can't mash together reasonable new recipes for certain audiences, especially for variations on popular modern standards, but the idea that their working space of recipes is exhaustive across all cuisine and tastes is absurd.

Re:Food and Generative AI by og_kalu on Friday October 27, 2023 @01:26PM (#38041336)
It doesn't matter what the cook thinks.

Sequence predictors don't just grok what is explicitly stated in a dataset but also what is implied by its structure.

In a language model trained on protein sequences alone and nothing else, you will find biological structure and function emerge in the inner layers.

https://www.pnas.org/doi/full/10.1073/pnas.2016239118

Language Models are predictors. If the text you give them is the shadow in Plato's cave, they don't try to draw shadows, they try to build walls. They are trying to reverse engineer the computation that must have led to that output. They will not stop at "surface level similarity" or "plausible" by choice. They will train until they have completely succeeded or until the architecture or data fail them.

With a capable enough architecture and sufficient data, there is no recipe a predictor couldn't divine with enough training.

For the perfect predictor of recipes, Is the architecture capable enough ? Is the data sufficient (both variance and quantity) ?

I'm not sure but this is not a question a cook can answer.

The OP claimed

>Actually generating a recipe is obviously much harder, and should be effectively impossible unless you include a humanoid robot that can cook and taste.

This is just false. And you don't need the hypothetical perfect predictor (just a capable one) to see it.

Re:Food and Generative AI by thuuuomas on Friday October 27, 2023 @04:10PM (#38043293)
> It doesn't matter what the cook thinks.

This is the fantasy of GenAI boosters stated concisely - that these statistical methods present a new objectivity that avoids the shortcomings of human subjectivity. Of course, these web-scraped models are distilled subjectivity in aggregate, subjectivity at scale. ChatGPT is made of people!

Re:Food and Generative AI by burkaman on Friday October 27, 2023 @01:14PM (#38041165)
I don't agree, even a human chef with decades of experience in all the tools and ingredients they're using is not going to get every recipe right on the first try. I'm not saying an AI recipe will never be good, but it is going to make mistakes sometimes.

If you're wondering whether a task is theoretically possible for an AI, I think a good rule of thumb is to ask "could a human domain expert do this given a few days and as much research material as they need". If the task here is "develop a novel recipe without trying it", the answer is no. You can't predict the interactions of every possible combination of ingredients and processes no matter how much time and experience you have.

Re:Food and Generative AI by petra on Friday October 27, 2023 @01:51PM (#38041636)
>> You can't predict the interactions of every possible combination of ingredients and processes no matter how much time and experience you have.

That's just the thing machines do better than humans. Not sure about LLM's though.

Re:Food and Generative AI by og_kalu on Friday October 27, 2023 @02:00PM (#38041766)
You misunderstand what a language model is. What a human can or cannot do is frankly irrelevant.

A GPT (Generative pretrained Transformer) is not a simulator nor an imitator. It is a predictor.

Predictors try to reverse engineer the computation that could have led to a certain output so they don't just grok what is explicitly stated in a dataset but also what is implied by its structure.

As an example, In a language model trained on protein sequences alone and nothing else, you will find biological structure and function emerge in the inner layers.

https://www.pnas.org/doi/full/10.1073/pnas.2016239118

In fact, with a capable enough architecture and sufficient data (quantity, qualit, variance), there is nothing a predictor couldn't divine with enough training.

You assert

>Actually generating a recipe is obviously much harder, and should be effectively impossible unless you include a humanoid robot that can cook and taste.

In the pursuit of recipe prediction, a predictor will learn to internally model taste because taste is implicit in the data.

You don't need the hypothetical perfect predictor to demonstrate your assertion as false because a capable predictor already does.

>If you're wondering whether a task is theoretically possible for an AI, I think a good rule of thumb is to ask "could a human domain expert do this given a few days and as much research material as they need".

You are wrong. Train a language model on descriptions of the functions of proteins and an equivalent protein sequence and you get a language model that can predict novel functioning sequences from function descriptions alone.

https://www.nature.com/articles/s41587-022-01618-2

Not only is this not something a human expert can achieve in a couple days, It's not something a human expert can achieve at all. It is a Super-Human ability.

Re:Food and Generative AI by uoaei on Friday October 27, 2023 @02:18PM (#38041993)
I don't think the commenter's understanding of LLMs is relevant here. It's what the authors of TFA think LLMs are for and, arguably more importantly, what kinds of problems (nails) they think about when presented with the idea of applying LLMs (hammer).

It's a bit ridiculous that this is the best they can come up with, and I don't really think the idea is worth defending, especially by telling other people that they just don't get it.

Re:Food and Generative AI by og_kalu on Friday October 27, 2023 @02:29PM (#38042107)
His/Her primary assertion is that it is impossible for a LLM to generate novel recipes without physically tasting it first. His/her assertion is wrong and one easily corrected by understanding a LLM is and does.

It's not a perfect predictor so it's not impeccable for all conceivable situations but GPT-4 can already generate novel recipes that taste nice. This is not some far flung science fiction ability.

Re:Food and Generative AI by ska on Friday October 27, 2023 @02:41PM (#38042274)
This is true. On the other hand, the recipes aren't typically good, and generating novel ones isn't really what people mostly want to do... so the value seems limited.
Re:Food and Generative AI by og_kalu on Friday October 27, 2023 @03:09PM (#38042612)
That's part of it yes but people tend to forget that the road to capable prediction is not instantaneous.

It's possible the data is enough to get a good predictor but the one you tested simply wasn't good enough yet.

Re:Food and Generative AI by ska on Friday October 27, 2023 @03:10PM (#38042621)
Possibly, but the easily available data itself seems is pretty poor for systemic reasons.
Re:Food and Generative AI by ForestCritter on Saturday October 28, 2023 @10:08AM (#38049926)
Salt to taste, cook until brown, kneed until the dough is no longer sticky, everything about cooking is tasting and feeling. Moreover everybody has differences in their tastes and consistency preferences. Good recipe books teach you how to use ingredients and apply that knowledge to recipes and how to modify those recipes to your personal preferences. Sure an LLM can generate novel recipes but without the premise of taste, texture and food pairing tuned in to personal preference, the novel recipe is a crap shoot in the dark. The reality is, the more you learn to cook, the less you need recipes and a good cookbokk will teach you alot more than a pile of recipes.
Re:Food and Generative AI by burkaman on Friday October 27, 2023 @02:42PM (#38042293)
I understand what you're saying, I just think we have a fundamental disagreement over "taste is implicit in the data" that I'm not sure we can resolve here. Intuitively it makes sense to me that if you know the entire sequence of a protein's fundamental building block then you can deduce its higher-level properties, but it does not make sense that if you know a lot of high-level descriptions of an ingredient and how it tastes then you can deduce behaviors like how it will react to a certain application of heat or another ingredient.

I appreciate your links though, I think this is the first I've heard of an LLM doing something that a human can't do. I can't claim to understand a lot of the first paper and I can't access the second, but assuming your descriptions are right I agree that my rule of thumb was wrong.

Re:Food and Generative AI by og_kalu on Friday October 27, 2023 @03:07PM (#38042588)
I see.

First let me explain what I mean by implicit incentive with our biology example.

You have the protein sequence, G46AKT5778FAG4

The predictor is given "G46A____"

The only way to predict this correctly consistently across multiple proteins is learn the underlying biological structure.

Now, I pulled this snippet of a recipe randomly from the web.

"Add the tomato purée and turn up the heat slightly, cooking until it has darkened, about 2-3 mins."

Block out some information.

"Add the tomato purée and turn up the heat slightly, cooking until it has ____"

The only way a predictor is getting what kind of completion to make consistently correct across multiple unseen recipes and food items is if it has some model of the visible effects of heat on food in general. The predictor will be forced learn what kind of foods darken in heated water and group them together internally so it doesn't have to memorize every single instance (more effort than simply learning it)

Now let's put back darkened and block out the time.

"Add the tomato purée and turn up the heat slightly, cooking until it has darkened, about____."

The only way a predictor is consistently correct on what time interval this should be across multiple recipes is if it has some model of the effects of heat and time on whatever it is you're cooking.

Implicit incentives are everywhere.

Re:Food and Generative AI by smith7018 on Friday October 27, 2023 @02:24PM (#38042051)
My friend has a restrictive diet for health reasons (can't eat certain greens, no gluten, etc) and decided to use ChatGPT to come up with a dessert for her dinner party. It was honestly one of the worst things I've ever tried. She verified that the recipe wasn't regurgitated from another source so it was all ChatGPT's doing.
Re:Food and Generative AI by og_kalu on Friday October 27, 2023 @02:39PM (#38042246)
That just means you used a predictor that wasn't good enough (was this at least 4 ? or 3.5 ?) not that a GPT-X would need to physically taste recipes to generate novel recipes that tasted good.

GPT-2 was mostly an incoherent babbling mess but that didn't mean a better predictor couldn't be coherent.

GPT-3 could not play chess at all but that didn't mean a better predictor couldn't play chess (3.5-turbo-instruct)

Taste is implicit in recipes so a good enough predictor has to model it somehow to succeed, no physical experimentation necessary.

Re:Food and Generative AI by ska on Friday October 27, 2023 @02:39PM (#38042237)
This isn't really surprising. The source material it's trained on isn't particularly good, and interpolating between them at all generally doesn't work well.
Re:Food and Generative AI by ForestCritter on Saturday October 28, 2023 @09:51AM (#38049787)
There are alot of bad recipes floating around out there. Recipe books are often geared to teaching you how to cook not just what to cook. There's techniques to cooking that affect how recipes come out. A good recipe book will teach you how to treat ingredients, how they interact with each other and then give you ideas on how to put them together.
Re:Food and Generative AI by nick_rocks on Friday October 27, 2023 @01:51PM (#38041643)
seems like there's a high potential for the AI to hallucinate and get confused with ingredient measurements... last I checked, LLMs struggle with numbers.