TL;DR
This paper explores how Large Language Models (LLMs) can help break down complex meal ingredients into their basic components for better nutritional analysis and personalized meal planning. The open-source Llama-3 (70B) model emerged as the top performer, outperforming commercial models like GPT-4o in accurately decomposing ingredients.
What Problem Does This Paper Address?
Planning healthy meals and understanding their nutritional content is challenging. Many meal plans list "compound ingredients" (like "Chicken Cacciatore") rather than their individual components (chicken breast, tomatoes, herbs, etc.). This makes it difficult to accurately assess nutritional value, identify allergens, or customize meals for individual needs. Manually breaking down these ingredients is time-consuming and prone to human error. This research aims to leverage LLMs to automate this ingredient decomposition process, improving the efficiency and accuracy of nutritional analysis and personalized meal planning.
Methods
The study employed a quantitative approach to compare the performance of three LLMs: GPT-4o, Llama-3 (70B), and Mixtral (8x7B).
- Meal Plan Generation: GPT-4o was used to generate 15 structured meal plans (breakfast, lunch, dinner) with precise portion sizes and specific quantities of ingredients, including compound ingredients.
- Compound Ingredient Decomposition: Each LLM was tasked with identifying and breaking down these compound ingredients into their basic components, including estimated quantities.
- USDA FoodData Central Mapping: The decomposed basic ingredients were then mapped to entries in the USDA FoodData Central repository using API-based search.
- Nutritional Analysis: Nutritional values were retrieved and aggregated for the decomposed ingredients.
- Evaluation: Performance was assessed through:
- Manual Review by Nutritionists: Nutritionists acted as the "ground truth" for identifying compound ingredients and assessing the realism of decomposed ingredients and quantities.
- Quantitative Metrics: Accuracy and F1-scores were calculated to measure the models' performance in identifying compound ingredients.
- Statistical Analysis: Paired t-tests and Wilcoxon signed-rank tests were used to determine the statistical significance of performance differences between models.
Datasets
- USDA FoodData Central Repository: This was used as the reference database for nutritional information and for mapping decomposed ingredients. The study utilized a subset of this data, prioritizing 'SR Legacy', 'Foundation Foods', and then 'Survey type (FNDDS)', 'Experimental Foods', and 'Branded Foods' if necessary.
- Generated Meal Plans: 15 meal plans were generated by GPT-4o for the study.
Key Insights and Ideas
- LLMs as Powerful Tools for Nutrition: The study demonstrates that LLMs, particularly advanced ones, can significantly aid in the complex task of ingredient decomposition, a crucial step for personalized nutrition.
- Open-Source Advantage: Llama-3 (70B), an open-source model, outperformed the commercial GPT-4o, suggesting that open-source LLMs are rapidly closing the gap and may offer superior performance in specific tasks.
- Decomposition Nuances: While LLMs are good at identifying compound ingredients, accurately decomposing them into precise quantities and identifying subtle components like oils and seasonings remains a challenge.
- Weight Discrepancies: Models sometimes overestimated or underestimated the weight of decomposed ingredients, highlighting the need for models to account for cooking processes like evaporation.
- Consistency in Macronutrient Estimates: Despite variations in ingredient decomposition, the LLMs showed consistent estimates for macronutrient content (protein, fat, carbohydrates, fiber), suggesting their reliability for overall nutritional profiling.
Key Results
- Overall Performance: Llama-3 (70B) achieved the highest average F1-score (0.894) and accuracy (0.893), followed by GPT-4o (F1-score: 0.842, accuracy: 0.835), and then Mixtral (8x7B) (F1-score: 0.690, accuracy: 0.666).
- Statistical Significance: Llama-3 (70B) and GPT-4o significantly outperformed Mixtral (8x7B) in both accuracy and F1-score. There were no statistically significant differences between GPT-4o and Llama-3 (70B).
- Ingredient Decomposition Accuracy: Llama-3 (70B) matched the weight of compound ingredients with their basic components exactly 87% of the time, compared to 73% for GPT-40 and 55% for Mixtral (8x7B).
- Common Issues: All models struggled with accurately identifying and integrating seasonings, oils, and sweeteners.
Limitations and Future Work
- Dataset Size: The study used a relatively small dataset of 15 meal plans due to the significant effort required for manual validation by nutritionists.
- Ingredient Identification Nuances: LLMs sometimes missed basic ingredients like oils and seasonings, and struggled with precise quantity estimation, especially for complex dishes.
- Future Work:
- Domain-Specific Data: Incorporating domain-specific reference data for seasonings and oils could improve decomposition accuracy.
- Cross-Cultural Adaptation: Testing LLMs on different cuisines is crucial, as ingredient naming and combinations vary significantly.
- Ensemble Methods: Exploring ensemble methods that combine multiple LLMs or use feedback loops could enhance decomposition accuracy.
- Broader Nutritional Analysis: Future studies could delve deeper into estimating macro- and micronutrient content, as well as dietary fiber.
- API Limitations: The study encountered API rate limits for the USDA FoodData Central, which, while managed, could impact larger-scale analyses.
Summary updated