Identifying and Decomposing Compound Ingredients in Meal Plans Using Large Language Models

Leon Kopitar, Leon Bedrac, Larissa J. Strath, Jiang Bian, Gregor StiglicarXiv 2024 · DOI

Abstract

Accurate nutrient profiling is essential for health management but is often hindered by the complexity of meal descriptions. Most meal plans list "compound ingredients"—dishes like "Beef Stroganoff"—which must be decomposed into basic components for precise tracking. This study evaluates the performance of three Large Language Models (LLMs)—GPT-4o, Llama-3 (70b), and Mixtral (8x7b)—in automating this decomposition process. While Llama-3 and GPT-4o demonstrate high accuracy, significant gaps remain in identifying "hidden" ingredients like oils and seasonings, highlighting the need for specialized refinements in nutritional AI.

Introduction

Nutrient profiling is a cornerstone of managing chronic diseases such as diabetes and hypertension. However, the transition from a meal description to a structured nutritional database is a significant hurdle. Meal plans typically consist of compound ingredients that require manual breakdown into basic components (e.g., flour, butter, onions) before they can be cross-referenced with databases like the USDA FoodData Central. This manual process is labor-intensive and prone to error.

This paper investigates whether LLMs can serve as "digital nutritionists" by automating the identification and decomposition of these complex dishes. By bridging the gap between natural language meal descriptions and structured data, LLMs could revolutionize personalized nutrition tracking.

Methodology

The researchers developed a systematic workflow to test the capabilities of three prominent LLMs: GPT-4o, Llama-3 (70b), and Mixtral (8x7b). The process began with the generation of 15 diverse meal plans using GPT-4o, encompassing 101 total ingredients.

Workflow for identifying and decomposing compound ingredients using LLMs and validating against the USDA database.

As shown in Figure 1, the workflow involved:

  1. Identification: Models identified compound ingredients within the generated plans.
  2. Decomposition: These ingredients were broken down into basic components.
  3. Validation: Results were cross-referenced with the USDA FoodData Central repository via API.
  4. Evaluation: Performance was measured against a "ground truth" established by professional nutritionists using metrics such as Accuracy and F1-score.

Key Results

The comparative analysis revealed distinct performance tiers among the models. Llama-3 (70b) emerged as the top performer, slightly outperforming the proprietary GPT-4o, though the difference was not statistically significant ($p > .1$).

Comparison of Accuracy and F1-score across GPT-4o, Llama-3 (70b), and Mixtral (8x7b).

As illustrated in Figure 4, Llama-3 (70b) achieved an F1-score of 0.894 and an accuracy of 0.893. GPT-4o followed with an F1-score of 0.842 and accuracy of 0.835. In contrast, Mixtral (8x7b) performed significantly worse ($p < .01$), particularly struggling with complex items like hummus.

Discussion: The "Seasoning Gap"

A critical finding of this study is the "Seasoning Gap." Despite high overall performance, all models frequently overlooked "invisible" ingredients essential for accurate nutritional profiles. While models were adept at identifying primary proteins and vegetables, they often missed cooking oils, salt, and sugar.

Interestingly, while Mixtral had the lowest overall accuracy, it was the most likely to include basic seasonings (12.9% of the time compared to GPT-4o’s 9.7%). This suggests that different training biases influence how models perceive recipe "completeness." Without accounting for these hidden fats and sodium sources, the resulting nutritional data remains insufficient for medical-grade applications.

Conclusion and Future Work

LLMs show immense promise in automating the first steps of nutritional analysis. The parity between open-weights models like Llama-3 and proprietary models like GPT-4o suggests a viable path for specialized healthcare applications.

However, to reach "medical grade" precision, future work must address the omission of essential cooking elements. Potential strategies include implementing Chain-of-Thought prompting to force models to consider cooking methods and integrating direct caloric and macronutrient estimation into the pipeline. Ultimately, these models could support users with specific medical needs where ingredient precision is a matter of safety.

Summary updated

Abstract

This study explores the effectiveness of Large Language Models in meal planning, focusing on their ability to identify and decompose compound ingredients. We evaluated three models-GPT-4o, Llama-3 (70b), and Mixtral (8x7b)-to assess their proficiency in recognizing and breaking down complex ingredient combinations. Preliminary results indicate that while Llama-3 (70b) and GPT-4o excels in accurate decomposition, all models encounter difficulties with identifying essential elements like seasonings and oils. Despite strong overall performance, variations in accuracy and completeness were observed across models. These findings underscore LLMs' potential to enhance personalized nutrition but highlight the need for further refinement in ingredient decomposition. Future research should address these limitations to improve nutritional recommendations and health outcomes.
BibTeX
@misc{kopitar2024identifying,
  author = {Leon Kopitar and Leon Bedrac and Larissa J. Strath and Jiang Bian and Gregor Stiglic},
  title = {{Identifying and Decomposing Compound Ingredients in Meal Plans Using Large Language Models}},
  year = {2024},
  eprint = {2411.05892},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.05892},
}
Figure