An intelligent recipe generation method based on LLM large model and intelligent cooking kitchenware
Through phased generation and dynamic adjustment of the intelligent recipe system, the problems of error transmission and insufficient personalized adaptation in existing technologies are solved, more accurate ingredient recommendations and cooking step generation are achieved, and the user experience is improved.
Patent Information
- Application Number
- CN202510867686.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-06-26
AI Technical Summary
The existing intelligent recipe generation system has the risk of error transmission, is difficult to personalize and adapt to user behavior habits, and lacks a dynamic update mechanism, resulting in the generation results being out of touch with user needs, and the ingredient replacement rules are not handled accurately enough, especially in the scenarios of new users or new dishes.
A phased generation mechanism is adopted. First, a list of main and auxiliary ingredients is generated and revised by the user. Then, the cooking steps are generated. Combining user habit files and collaborative filtering algorithms, the amount of ingredients and replacement rules are dynamically adjusted. The API of the LLM large model is used for accurate recommendations, and the system is optimized by regularly updating user habit files.
It significantly reduces the chain reaction caused by initial data errors, improves the accuracy of recommendations and interaction efficiency, reduces the burden of repeated input for users, and enhances the system's personalized adaptation capabilities.
Smart Images

Figure CN120373476B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent cooking, and in particular to an intelligent recipe generation method and intelligent cooking utensils based on an LLM large model. Background Art
[0002] Current intelligent recipe generation technology generally uses large language models (LLMs) to output complete recipe content at once, including a list of main and auxiliary ingredients and cooking steps. However, this process carries a significant risk of error propagation. Because LLMs may generate incorrect main and auxiliary ingredients (such as missing key condiments or misjudging ingredient amounts) in complex tasks due to contextual misunderstanding or training data limitations, such errors will directly affect the rationality of subsequent cooking steps. For example, the absence of "soy sauce" may make the "marinating" step in the process impossible, requiring users to backtrack and correct each step, resulting in low interaction efficiency. In addition, existing systems rely on static rules or explicit user configuration (such as a preset list of dietary restrictions) for personalized adaptation, making it difficult to dynamically capture users' implicit behavioral habits (such as a long-term preference to replace pork with beef or systematically adjust the amount of chili peppers). Furthermore, the habit update mechanism is rigid and cannot automatically iterate and optimize based on historical behavioral data, resulting in recommendation results that are out of touch with users' actual needs.
[0003] Traditional approaches to handling ingredient substitution rules rely on manually constructed rule bases or keyword matching. For example, for lactose-intolerant users, forcing them to replace milk with soy milk is crucial. However, these approaches are unable to handle semantically similar substitutions of ingredients from different categories (e.g., replacing brown sugar with honey due to functional similarity, even though the two ingredients share overlapping uses but belong to different categories). Furthermore, they lack the ability to exploit behavioral similarities between users. While some systems have incorporated collaborative filtering algorithms, these algorithms struggle to effectively derive substitution rules for new users or new dishes (due to data sparsity or cold start issues). For example, it's impossible to infer whether the same rules apply to the new dish "Shredded Pork with Green Peppers" based on a user's substitution of shredded pork in the existing recipe "Fish-Fragrant Shredded Pork." Furthermore, when a user's real-time needs (such as a temporary request for "less salt") conflict with historical preferences, most systems lack explicit prioritization logic and mechanically apply historical preferences, resulting in results that deviate from the user's current intent and reduce user experience. These shortcomings collectively limit the practicality and user engagement of intelligent recipe systems. Summary of the Invention
[0004] In view of the above problems, the present invention proposes the following technical solutions:
[0005] An intelligent recipe generation method based on the LLM large model includes the following steps:
[0006] S1: Based on the dish name, region, and personalized requirements entered by the user, a prompt word is constructed and the API of the LLM model is called to generate the original main and auxiliary ingredient list of the dish. The original main and auxiliary ingredient list is provided to the user, and after the user confirms the modification, the actual main and auxiliary ingredient list is obtained;
[0007] S2: Based on the actual list of main and auxiliary ingredients, dish name, region, and personalized requirements, the API of the LLM large model is called to generate the original cooking steps of the dish; the original cooking steps are provided to the user, and after the user's modification and confirmation, the actual cooking steps are obtained.
[0008] Preferably, in the process of generating the original main and auxiliary ingredient list of a dish, a user habit file is also called, and the user habit file includes quantity change habit, increase and decrease habit, and replacement habit; the specific calling method is:
[0009] Use quantitative habits directly as the content of prompt words to construct prompt words;
[0010] According to the weights of the main and auxiliary materials in the increase and decrease habits, when calling the API of the LLM model, the logit_bias parameter is used to control the tendency of the corresponding main and auxiliary materials to appear;
[0011] Based on the current user's replacement habits and other users' replacement habits, a collaborative filtering algorithm is used to determine whether and which replacement rule in the current user's replacement habits should be used in the prompt word of the current dish;
[0012] When the personalized requirements input by the user conflict with the replacement habits, the personalized requirements input by the user shall prevail.
[0013] Perform the following steps regularly to modify the user habit file. Initially, the user habit file is empty:
[0014] 1) Read the original main and auxiliary ingredient lists and the actual main and auxiliary ingredient lists of the n dishes that the user has recently used, and obtain the difference in the list contents of the n dishes; where n is the quantity threshold;
[0015] 2) Based on the differences in the list content, the names of the main and auxiliary materials whose dosages are adjusted by the user, as well as the mean of the corresponding adjustment ranges, are obtained to correct the quantity change habits;
[0016] 3) Based on the differences in the list content, the names of the main and auxiliary ingredients added or deleted by the user are counted. For similar main and auxiliary ingredients, they are considered to be in a replacement relationship, and the dish name and the corresponding replacement content are added to the replacement habit as a replacement rule; for different main and auxiliary ingredients, they are considered to be in an addition or subtraction habit, and the content of the addition or subtraction habit is revised.
[0017] Preferably, the method for determining whether the main and auxiliary materials belong to the same type of main and auxiliary materials is:
[0018] The names of the main and auxiliary ingredients are vectorized using a pre-trained model. Main and auxiliary ingredients with a similarity exceeding a threshold are considered to belong to the same category.
[0019] Preferably, the similarity is specifically cosine similarity.
[0020] The present invention also provides a kitchen appliance for intelligent cooking, wherein the steps for implementing intelligent cooking of the kitchen appliance are as follows:
[0021] Use the above method to obtain the actual cooking steps, and call the API of the LLM model according to the actual cooking steps and the instruction format of the kitchen utensils to generate cooking instruction steps;
[0022] Cook using the cooking instructions.
[0023] Beneficial effects: The present invention decouples the list of main and auxiliary ingredients from the cooking steps through a phased generation mechanism. The list is first generated and then the steps are generated after correction by the user, which significantly reduces the chain reaction caused by initial data errors. For example, after the user deletes "wood ear", the subsequent steps automatically avoid operations involving wood ear, avoiding the tedious process of manual modification of each item in the traditional solution; at the same time, based on the multi-dimensional dynamic modeling of user behavior data (quantitative change habits, increase and decrease weights, collaborative filtering replacement rules), the system can automatically learn user preferences, such as by analyzing the average of the most recent n usage adjustments for correction, or combining semantic vector similarity to determine whether "beef shreds replace pork shreds" is applicable across dishes, which not only reduces the burden of repeated input for users, but also improves the accuracy of recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 Flowchart of the present invention;
[0025] Figure 2 A user input interaction diagram in an embodiment of the present invention;
[0026] Figure 3 This is an interactive diagram of the main and auxiliary material lists in an embodiment of the present invention;
[0027] Figure 4 An interactive diagram of cooking steps in an embodiment of the present invention;
[0028] Figure 5 A cooking instruction step diagram in an embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to make the purposes, features, and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0030] like Figure 1 As shown, an intelligent recipe generation method based on the LLM large model includes the following steps:
[0031] S1: Based on the dish name, region, and personalized requirements entered by the user, a prompt word is constructed and the API of the LLM large model (such as DeepSeek and Tongyi Qianwen) is called to generate the original main and auxiliary ingredient list of the dish. The original main and auxiliary ingredient list is provided to the user, and after the user confirms the modification, the actual main and auxiliary ingredient list is obtained;
[0032] In the process of generating the original main and auxiliary ingredient list of a dish, the user habit file is also called. The user habit file includes quantity change habit, increase and decrease habit, and replacement habit. The specific calling method is:
[0033] Use quantitative habits directly as the content of prompt words to construct prompt words;
[0034] According to the weights of the main and auxiliary materials in the increase and decrease habits, when calling the API of the LLM model, the logit_bias parameter is used to control the tendency of the corresponding main and auxiliary materials to appear;
[0035] The logit_bias parameter here refers to a parameter in the LLM model's API that controls the probability of generating specific tokens (words). The specific parameter name may vary in different LLM models. The specific name and usage of the parameter can be found in the official LLM model documentation. DeepSeek's API parameters are compatible with OpenAI, and this parameter is named logit_bias. For example, each time a user adds or removes an ingredient (not a replacement), the weight of the ingredient decreases by one each time it is deleted, and increases by one each time it is added. For example, if the user's addition and removal habits are such that the weight of black fungus is -1 and the weight of white sugar is +4, then the logit_bias parameter will decrease the token_id of black fungus and increase the token_id of white sugar accordingly. The specific usage of the logit_bias parameter is as follows: For example, if the token_id of wood ear is 9999, where -100 is the minimum value, when calling DeepSeek, add the parameter logit_bias={"9999":-100}, then the generation probability of the word wood ear will be completely suppressed, so "wood ear" will not appear.
[0036] Based on the current user's replacement habits and other users' replacement habits, a collaborative filtering algorithm is used to determine whether and which replacement rule in the current user's replacement habits should be used in the prompt word of the current dish;
[0037] Collaborative filtering algorithms are currently available. Here's a simple example: First, all replacement rules in the current user's replacement habits are traversed. Based on the dishes used in each replacement rule, a corresponding dish vector is generated. The m users whose dish vectors for the corresponding replacement rules are most similar to the current user are found. Based on the dish vectors for the replacement rules of these m most similar users, a decision is made as to whether the current dish uses the corresponding replacement rule. For example, in the current user's replacement habits, dishes a, b, d, and e replace shredded pork with shredded beef, resulting in a dish vector (a, b, d, e) for shredded pork with shredded beef. Among other users, the dish vector for shredded pork with shredded beef for the user most similar to the current user is (a, b, c, d, e). If the current dish is c, the current dish uses the replacement rule for shredded pork with shredded beef.
[0038] When the personalized requirements input by the user conflict with the replacement habits, the personalized requirements input by the user shall prevail;
[0039] S2: Based on the actual list of main and auxiliary ingredients, dish name, region, and personalized requirements, the API of the LLM model is called to generate the original cooking steps of the dish; the original cooking steps are provided to the user, and after the user's modification and confirmation, the actual cooking steps are obtained;
[0040] Perform the following steps regularly to modify the user habit file. Initially, the user habit file is empty:
[0041] 1) Read the original main and auxiliary ingredient lists and the actual main and auxiliary ingredient lists of n dishes actually used by the user recently, and obtain the difference in the list contents of the n dishes; where n is a quantity threshold. In this embodiment, the value of n is 5;
[0042] 2) Based on the differences in the list content, the names of the main and auxiliary materials whose dosages are adjusted by the user, as well as the mean of the corresponding adjustment ranges, are obtained to correct the quantity change habits;
[0043] For example, among the original lists of main and auxiliary ingredients of the five most recent dishes actually used by the user, dried chili peppers appeared in two of them. The user increased the dosage of one of them by 5% and the dosage of the other by 15%. If dried chili peppers were not recorded in the quantitative change habit before correction, then an item "the dosage of dried chili peppers increased by 10% relative to the baseline value" would be added to the quantitative change habit. If dried chili peppers were recorded in the quantitative change habit before correction, for example, "the dosage of dried chili peppers increased by 100% relative to the baseline value", then the quantitative change habit would be corrected to "the dosage of dried chili peppers increased by 120% relative to the baseline value".
[0044] 3) Based on the differences in the list content, the names of main and auxiliary ingredients added or deleted by the user are counted. For similar main and auxiliary ingredients, it is considered a replacement relationship, and the dish name and corresponding replacement content are added as a replacement rule to the replacement habit. For different main and auxiliary ingredients, it is considered an addition or deletion habit, and the addition or deletion habit content is revised;
[0045] The method for judging whether the main and auxiliary materials belong to the same type of main and auxiliary materials is as follows:
[0046] A pre-trained model (such as Sentence-BERT) is used to vectorize the names of the main and auxiliary ingredients. Main and auxiliary ingredients with similarities exceeding a threshold are considered to belong to the same type of main and auxiliary ingredients. In this embodiment, the similarity is specifically cosine similarity.
[0047] For example, among the original main and auxiliary ingredient lists of the five most recent dishes actually used by the user, in the main and auxiliary ingredient list of one dish called Fish-flavored Shredded Pork, the user deleted shredded pork and added shredded beef; because the cosine similarity between the shredded pork and shredded beef after vectorization exceeds the threshold, it is considered to be a replacement relationship, so a replacement rule is added to the replacement habit: in the dish Fish-flavored Shredded Pork, shredded pork is replaced with shredded beef; for another example, among the original main and auxiliary ingredient lists of the five most recent dishes actually used by the user, one dish deleted black fungus and added white sugar; because the cosine similarity between the black fungus and white sugar after vectorization is lower than the threshold, it is considered to be an increase and decrease habit, and in the increase and decrease habit, the weight value of black fungus is reduced, and the weight value of white sugar is increased.
[0048] On the other hand, the present invention also provides an intelligent cooking appliance, wherein the steps for implementing the intelligent cooking are as follows:
[0049] The above method is used to obtain the actual cooking steps, and according to the actual cooking steps and the instruction format of the smart kitchen appliance, the API of the LLM large model is called to generate the cooking instruction steps;
[0050] Cook using the cooking instructions.
[0051] Here is a more specific example to illustrate:
[0052] like Figure 2 As shown, a smart cooking kitchen appliance first requires the user to input the dish name: Tianmu Lake Fish Head, region: Liyang City, Jiangsu Province, and personalized requirements: (application scenario: large banquet, cooking method: stir-fry first and then roast, operation difficulty: professional);
[0053] like Figure 3 As shown, based on the above information, a prompt word is constructed, and the API of the LLM large model (such as DeepSeek and Tongyi Qianwen) is called to generate the original main and auxiliary ingredient list of the dish. The user modifies and confirms it according to needs; in the process of generating the original main and auxiliary ingredient list of the dish, the user habit file is called;
[0054] like Figure 4 As shown, based on the actual list of main and auxiliary ingredients, DeepSeek's API is called to generate the original cooking steps of the dish; the original cooking steps are provided to the user, and after the user's modification and confirmation, the actual cooking steps are obtained;
[0055] like Figure 5 As shown, according to the actual cooking steps and the instruction format of the smart kitchen appliance, the LLM large model is called to generate cooking instruction steps;
[0056] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. An intelligent recipe generation method based on LLM large model, characterized in that: The following steps are involved: S1: Based on the dish name, region, and personalized requirements entered by the user, a prompt word is constructed and the API of the LLM model is called to generate the original main and auxiliary ingredient list of the dish. The original main and auxiliary ingredient list is provided to the user, and after the user confirms the modification, the actual main and auxiliary ingredient list is obtained; S2: Based on the actual list of main and auxiliary ingredients, dish name, region, and personalized requirements, the LLM model API is called to generate the original cooking steps of the dish. The original cooking steps are provided to the user, and after the user confirms the modification, the actual cooking steps are obtained; In the process of generating the original main and auxiliary ingredient list of a dish, the user habit file is also called. The user habit file includes quantity change habit, increase and decrease habit, and replacement habit. The specific calling method is: Use quantitative habits directly as the content of prompt words to construct prompt words; According to the weights of the main and auxiliary materials in the increase and decrease habits, when calling the API of the LLM model, the logit_bias parameter is used to control the tendency of the corresponding main and auxiliary materials to appear; Based on the current user's replacement habits and other users' replacement habits, a collaborative filtering algorithm is used to determine whether and which replacement rule in the current user's replacement habits should be used in the prompt word of the current dish; When the personalized requirements entered by the user conflict with the replacement habits, the personalized requirements entered by the user shall prevail; Perform the following steps regularly to modify the user habit file. Initially, the user habit file is empty: 1) Read the original main and auxiliary ingredient lists and the actual main and auxiliary ingredient lists of the n dishes that the user has recently used, and obtain the difference in the list contents of the n dishes; where n is the quantity threshold; 2) Based on the differences in the list content, the names of the main and auxiliary materials whose dosages are adjusted by the user, as well as the mean of the corresponding adjustment ranges, are obtained to correct the quantity change habits; 3) Based on the differences in the list content, the names of main and auxiliary ingredients added or deleted by the user are counted. For similar main and auxiliary ingredients, it is considered a replacement relationship, and the dish name and corresponding replacement content are added as a replacement rule to the replacement habit. For different main and auxiliary ingredients, it is considered an addition or deletion habit, and the addition or deletion habit content is revised; in, The method to determine whether the main and auxiliary materials belong to the same type is: The names of the main and auxiliary ingredients are vectorized using a pre-trained model. Main and auxiliary ingredients with a similarity exceeding a threshold are considered to belong to the same category.
2. The intelligent recipe generation method based on the LLM model according to claim 1 is characterized in that: The similarity is specifically cosine similarity.
3. An intelligent cooking appliance, characterized in that: The steps for implementing the intelligent cooking of the kitchenware are as follows: Obtain actual cooking steps using the method described in any one of claims 1 to 2, and call the API of the LLM large model according to the actual cooking steps and the instruction format of the kitchenware to generate cooking instruction steps; Cook using the cooking instructions.
Citation Information
Patent Citations
Intelligent cooking method based on cooking equipment, cooking system and storage medium
CN118429063A
Prompt word generation method and device, equipment, medium and program product
CN119739834A