Using language model to generate recipe with refined content
Abstract
Embodiments relate to utilizing a language model to automatically generate a novel recipe with refined content, which can be offered to a user of an online system. The online system generates a first prompt for input into a large language model (LLM), the first prompt including a plurality of task requests for generating initial content of a recipe. The online system requests the LLM to generate, based on the first prompt input into the LLM, the initial content of the recipe. The online system generates a second prompt for input into the LLM, the second prompt including the initial content of the recipe and contextual information about the recipe. The online system requests the LLM to generate, based on the second prompt input into the LLM, refined content of the recipe. The online system stores the recipe with the refined content in a database of the online system.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 23 · Forward citations: 0.
Claims (20 — 3 Independent, 17 Dependent)
- Claim 1Independent Claim
A method, performed at a computer system comprising a processor and a computer-readable medium, comprising: generating a first prompt for a language model, the first prompt including a plurality of task requests for generating initial content for a recipe; requesting the language model to generate, based on the first prompt, the initial content for the recipe; generating a second prompt for the language model, the second prompt including the initial content for the recipe and contextual information about the recipe; requesting the language model to generate, based on the second prompt, refined content for the recipe; and storing, in a database of an online system, a version of the recipe having the refined content.
- Claim 2Depends on #1
The method of claim 1, wherein generating the first prompt for the language model comprises: generating the first prompt for the language model by including in the first prompt at least one of: a task request for generating a description of a meal associated with the recipe, a task request for generating an initial title of the recipe, a task request for generating a list of ingredients in the recipe, a task request for generating a plurality of culinary steps associated with the recipe, a task request for estimating a total number of calories associated with the recipe, a task request for estimating a time for performing one or more of the plurality of culinary steps, a task request for estimating nutritional information of the recipe, a task request for generating a list of appliances and equipment for preparing the meal, a task request for one or more recommendations for altering the recipe, a task request for generating a historical context of the recipe, a task request for generating information about a skill level requirement to prepare the meal using the recipe, or a task request for generating information about a cuisine associated with the recipe.
- Claim 3Depends on #1
The method of claim 1, further comprising: receiving a response from the language model, the response including the initial content for the recipe with a description of the recipe without the contextual information about the recipe.
- Claim 4Depends on #1
The method of claim 1, wherein generating the second prompt for the language model comprises: generating the second prompt for the language model to include the contextual information with at least one of: information about a diet associated with the recipe, information about a genre of the recipe, information about one or more ingredients of the recipe, information about a culinary technique associated with the recipe, or information about an equipment used for preparing a meal associated with the recipe.
- Claim 5Depends on #1
The method of claim 1, wherein generating the second prompt for the language model comprises: generating the second prompt for the language model to further include one or more sample recipes from the database.
- Claim 6Depends on #1
The method of claim 1, wherein generating the second prompt for the language model comprises: ranking, based on at least one of the contextual information about the recipe or an initial name of the recipe from the initial content for the recipe, a plurality of sample recipes from the database to obtain a rank for each of the plurality of sample recipes; selecting, based at least in part on the rank for each of the plurality of sample recipes, a sample recipe of the plurality of sample recipes; and generating the second prompt for the language model to further include the selected sample recipe.
- Claim 7Depends on #1
The method of claim 1, wherein generating the second prompt for the language model comprises: generating the second prompt for the language model to further include one or more questions for the language model that are related to the contextual information about the recipe.
- Claim 8Depends on #1
The method of claim 1, wherein generating the second prompt for the language model comprises: generating the second prompt for the language model to further include one or more questions for the language model related to at least one of a diet associated with the recipe, a genre of the recipe, one or more ingredients of the recipe, or a culinary technique associated with the recipe.
- Claim 9Depends on #1
The method of claim 1, wherein generating the second prompt for the language model comprises: ranking, based on at least one of the contextual information about the recipe or one or more interactions by one or more users of the online system, a plurality of questions from the database to obtain a rank for each of the plurality of questions; selecting, based at least in part on the rank for each of the plurality of questions, one or more questions of the plurality of questions; and generating the second prompt for the language model to further include the one or more selected questions.
- Claim 10Depends on #1
The method of claim 1, further comprising: causing a device associated with a user of the online system to display a user interface with the refined content of the stored version of the recipe for inclusion into a cart of the user.
- Claim 11Depends on #10
The method of claim 10, further comprising: receiving, via a network and from the device associated with the user, feedback in relation to the refined content displayed at the user interface; and initiating, based on the received feedback, update of at least one of one or more parameters of the language model, the first prompt, the second prompt, the contextual information about the recipe, or one or more parameters of a machine-learning model applied to rank components of the contextual information.
- Claim 12Independent Claim
A computer program product comprising a non-transitory computer readable storage medium having instructions encoded thereon that, when executed by a processor, cause the processor to perform steps comprising: generating a first prompt for a language model, the first prompt including a plurality of task requests for generating initial content for a recipe; requesting the language model to generate, based on the first prompt, the initial content for the recipe; generating a second prompt for the language model, the second prompt including the initial content for the recipe and contextual information about the recipe; requesting the language model to generate, based on the second prompt, refined content for the recipe; and storing, in a database of an online system, a version of the recipe having the refined content.
- Claim 13Depends on #12
The computer program product of claim 12, wherein generating the first prompt for the language model comprises: generating the first prompt for the language model by including in the first prompt at least one of: a task request for generating a description of a meal associated with the recipe, a task request for generating an initial title of the recipe, a task request for generating a list of ingredients in the recipe, a task request for generating a plurality of culinary steps associated with the recipe, a task request for estimating a total number of calories associated with the recipe, a task request for estimating a time for performing one or more of the plurality of culinary steps, a task request for estimating nutritional information of the recipe, a task request for generating a list of appliances and equipment for preparing the meal, a task request for one or more recommendations for altering the recipe, a task request for generating a historical context of the recipe, a task request for generating information about a skill level requirement to prepare the meal using the recipe, or a task request for generating information about a cuisine associated with the recipe.
- Claim 14Depends on #12
The computer program product of claim 12, wherein generating the second prompt for the language model comprises: generating the second prompt for the language model to include the contextual information with at least one of: information about a diet associated with the recipe, information about a genre of the recipe, information about one or more ingredients of the recipe, information about a culinary technique associated with the recipe, or information about an equipment used for preparing a meal associated with the recipe.
- Claim 15Depends on #12
The computer program product of claim 12, wherein generating the second prompt for the language model comprises: generating the second prompt for the language model to further include one or more sample recipes from the database.
- Claim 16Depends on #12
The computer program product of claim 12, wherein generating the second prompt for the language model comprises: ranking, based on at least one of the contextual information about the recipe or an initial name of the recipe from the initial content for the recipe, a plurality of sample recipes from the database to obtain a rank for each of the plurality of sample recipes; selecting, based at least in part on the rank for each of the plurality of sample recipes, a sample recipe of the plurality of sample recipes; and generating the second prompt for the language model to further include the selected sample recipe.
- Claim 17Depends on #12
The computer program product of claim 12, wherein generating the second prompt for the language model comprises: generating the second prompt for the language model to further include one or more questions for the language model that are related to the contextual information about the recipe.
- Claim 18Depends on #12
The computer program product of claim 12, wherein generating the second prompt for the language model comprises: ranking, based on at least one of the contextual information about the recipe or one or more interactions by one or more users of the online system, a plurality of questions from the database to obtain a rank for each of the plurality of questions; selecting, based at least in part on the rank for each of the plurality of questions, one or more questions of the plurality of questions; and generating the second prompt for the language model to further include the one or more selected questions.
- Claim 19Depends on #12
The computer program product of claim 12, wherein the instructions further cause the processor to perform steps comprising: causing a device associated with a user of the online system to display a user interface with the refined content of the stored version of the recipe for inclusion into a cart of the user.
- Claim 20Independent Claim
A computer system comprising: a processor; and a non-transitory computer-readable storage medium having instructions that, when executed by the processor, cause the computer system to perform steps comprising: generating a first prompt for a language model, the first prompt including a plurality of task requests for generating initial content for a recipe; requesting the language model to generate, based on the first prompt, the initial content for the recipe; generating a second prompt for the language model, the second prompt including the initial content for the recipe and contextual information about the recipe; requesting the language model to generate, based on the second prompt, refined content for the recipe; and storing, in a database of an online system, a version of the recipe having the refined content.
Technical Overview & Description
BACKGROUND Writing recipes from scratch traditionally requires significant time and effort. Hence, to provide a wide range of recipe options to its customers, online systems, such as online concierge systems, typically license a catalog of recipes from various providers. However, with the advancement of language models, it is now possible to generate recipes on the fly. Nevertheless, these automatically generated recipes often lack the appeal of human-written recipes, as these recipes are generated without context or validation, and they do not provide accurate tips and necessary information for successful execution. This leads to a technical problem of how to generate recipes with high-quality content at a large scale that is required by an online concierge system. SUMMARY Embodiments of the present disclosure are directed to utilizing a language model to automatically generate a novel recipe with refined (e.g., high-quality) content, which can be offered for sale to a user of an online concierge system. In accordance with one or more aspects of the disclosure, the online concierge system generates a first prompt for input into a large language model (LLM), the first prompt including a plurality of task requests for generating initial content of a recipe. The online concierge system requests the LLM to generate, based on the first prompt input into the LLM, the initial content of the recipe. The online concierge system generates a second prompt for input into the LLM, the second prompt including the initial content of the recipe and contextual information about the recipe. The online concierge system requests the LLM to generate, based on the second prompt input into the LLM, refined content of the recipe. The online concierge system stores the recipe with the refined content in a database of the online concierge system. The online concierge system causes a device of a user of the online concierge system to display a user interface with the refined content of the s
Cited By — Indexed Forward Citations (0 of 0 total)
No indexed citing patents in this generation yet. Ingest USPTO/PatentsView bulk citation tables via patents-ingest to expand the local forward citation graph.