Manuscript Offprint

arXiv:2609.03967

Investigating the Ability of Large Language Models to Analyze Recipes for Diabetes

Revathy Venkataramanan, Aditya Luthra, Venkatesan Nadimuthu, Amit Sheth

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Several studies have evaluated the ability of Large Language Models (LLMs) for meal planning, yielding positive outcomes. These models can process natural language inputs and leverage learned knowledge from their pretraining to generate meal plans. In this work, we investigate the ability of LLMs to analyze the suitability of given recipes for diabetes. The primary challenge for LLMs is to retrieve relevant dietary guidelines for diabetes, decompose recipes into ingredients and cooking methods, and apply these guidelines to determine the recipe's suitability. To study these challenges, we employ three kinds of prompts namely, (i) Direct Query Prompt (ii) Context-Guided Prompt, and (iii) Exemplary Context Prompt that incorporate different levels of diabetes dietary guidelines from medical sources. We introduce a benchmark dataset curated for this investigation consisting of 7607 recipes that include 3807 recipes suitable for diabetes and 3800 recipes not suitable for diabetes. Our results demonstrate that most LLMs are cautious in predicting recipes as suitable to prevent detrimental outcomes. Further, the models that can reason using the dietary guidelines performed better in predicting the suitability of recipes for diabetes. Overall, Mistral-7B and Llama 70B showed superior performance to their counterparts.

Keywords Large Language Models · LLM Evaluation · Diabetes · Nutrition · Dietary Guidelines · Health Informatics · Prompt Engineering · Reasoning · Benchmark Dataset · Food Computing

1 Introduction

The World Health Organization estimates that 830 million people worldwide have diabetes [1], a condition manageable through dietary adjustments. Comprehensive dietary guidelines have been published by medical sources like MayoClinic and the Center for Disease Control (CDC). However, they are extensive, challenging to remember, and difficult to apply in daily meal planning. While the guidelines include examples, they are not exhaustive. For instance, vegetables and fruits are considered nutritious sources of healthy carbohydrates and rich fiber, suitable for diabetes management. However, certain fruits high in glucose should be avoided. This underscores the complexity of dietary decisions for diabetes. While AI-powered meal-tracking tools [2] have gained popularity over the years, they often lack targeted analysis for diabetes, likely due to liability concerns.

General-purpose LLMs such as ChatGPT, Bard, and Claude have become invaluable tools for the general public. They are frequently employed for everyday activities like meal planning [3], vacation itineraries [4], drafting emails, and providing educational assistance. There have been several studies that showcase the positive aspect of LLMs in meal planning [5]. At the same time, they are suggested to be augmented with the clinician's advice [6]. On the other hand, studies have also shown the limitations of using LLMs for nutrition management, specifically for diabetes [7, 8].

In this study, we aim to investigate the ability of LLMs to assess the suitability of a given recipe for diabetes. Unlike meal planning, where LLMs can take a cautious approach by recommending meals derived using a subset of diabetes guidelines that they can retrieve or remember, assessing suitability demands a thorough understanding. This process requires comprehensive knowledge of the full scope of dietary guidelines. The core challenges for the LLMs include (i) Medical Knowledge Retrieval: Searching their vast embedding space for relevant, targeted and complete dietary

PREPRINT

guidelines for diabetes. (ii) Conceptual Understanding: Interpreting diabetes dietary concepts (what constitutes healthy carbohydrate or saturated fat). (iii) Deductive Analysis: Applying general dietary rules to specific cases (e.g., “Carrot is a vegetable, vegetables are healthy carbohydrates”) to analyze suitability. For this investigation, we utilize three types of prompts incorporating different levels of diabetic dietary guidelines: (i) Direct Query Prompt (ii) Context-Guided Prompt, and (iii) Exemplary Context Prompt. We further prompt the LLMs to reason using the keywords part of dietary guidelines such as healthy carbohydrates, trans fat, and so on. Four classes of LLMs namely, Mistral, Gemma2, Llama, and ChatGPT with varying sizes were chosen for this analysis. To conduct this investigation, we introduce a recipe dataset consisting of 7607 recipes with 3807 recipes suitable for diabetes gathered from medical sources and 3800 recipes not suitable for diabetes curated using keywords on Recipe1M dataset [9].¹

References (30)