Table of Contents
Fetching ...

KERL: Knowledge-Enhanced Personalized Recipe Recommendation using Large Language Models

Fnu Mohbat, Mohammed J Zaki

TL;DR

KERL presents a unified Knowledge Graph augmented framework that couples FoodKG with a large language model to deliver personalized recipe recommendations, accompanied by generated cooking steps and micro-nutritional profiles. It deploys three task-specific LoRA adapters on a shared Phi-3-mini backbone to enable efficient training and inference across recommendation, recipe generation, and nutrition generation, leveraging retrieval-augmented generation over KG subgraphs. The authors introduce large-scale KGQA and nutrition/recipe benchmarks derived from FoodKG and demonstrate substantial performance gains over open-source LLMs across all three tasks. The work advances practical meal planning by providing coherent, nutritionally aware recommendations and steps, with publicly available code and datasets for reproducibility and further research.

Abstract

Recent advances in large language models (LLMs) and the abundance of food data have resulted in studies to improve food understanding using LLMs. Despite several recommendation systems utilizing LLMs and Knowledge Graphs (KGs), there has been limited research on integrating food related KGs with LLMs. We introduce KERL, a unified system that leverages food KGs and LLMs to provide personalized food recommendations and generates recipes with associated micro-nutritional information. Given a natural language question, KERL extracts entities, retrieves subgraphs from the KG, which are then fed into the LLM as context to select the recipes that satisfy the constraints. Next, our system generates the cooking steps and nutritional information for each recipe. To evaluate our approach, we also develop a benchmark dataset by curating recipe related questions, combined with constraints and personal preferences. Through extensive experiments, we show that our proposed KG-augmented LLM significantly outperforms existing approaches, offering a complete and coherent solution for food recommendation, recipe generation, and nutritional analysis. Our code and benchmark datasets are publicly available at https://github.com/mohbattharani/KERL.

KERL: Knowledge-Enhanced Personalized Recipe Recommendation using Large Language Models

TL;DR

KERL presents a unified Knowledge Graph augmented framework that couples FoodKG with a large language model to deliver personalized recipe recommendations, accompanied by generated cooking steps and micro-nutritional profiles. It deploys three task-specific LoRA adapters on a shared Phi-3-mini backbone to enable efficient training and inference across recommendation, recipe generation, and nutrition generation, leveraging retrieval-augmented generation over KG subgraphs. The authors introduce large-scale KGQA and nutrition/recipe benchmarks derived from FoodKG and demonstrate substantial performance gains over open-source LLMs across all three tasks. The work advances practical meal planning by providing coherent, nutritionally aware recommendations and steps, with publicly available code and datasets for reproducibility and further research.

Abstract

Recent advances in large language models (LLMs) and the abundance of food data have resulted in studies to improve food understanding using LLMs. Despite several recommendation systems utilizing LLMs and Knowledge Graphs (KGs), there has been limited research on integrating food related KGs with LLMs. We introduce KERL, a unified system that leverages food KGs and LLMs to provide personalized food recommendations and generates recipes with associated micro-nutritional information. Given a natural language question, KERL extracts entities, retrieves subgraphs from the KG, which are then fed into the LLM as context to select the recipes that satisfy the constraints. Next, our system generates the cooking steps and nutritional information for each recipe. To evaluate our approach, we also develop a benchmark dataset by curating recipe related questions, combined with constraints and personal preferences. Through extensive experiments, we show that our proposed KG-augmented LLM significantly outperforms existing approaches, offering a complete and coherent solution for food recommendation, recipe generation, and nutritional analysis. Our code and benchmark datasets are publicly available at https://github.com/mohbattharani/KERL.

Paper Structure

This paper contains 42 sections, 11 equations, 4 figures, 14 tables.

Figures (4)

  • Figure 1: KERL Overview: Given a natural language question (with constraints), the system parses entities and generates a SPARQL query to retrieve a subgraph from the KG. The question and this subgraph as context, are given as input to the recommendation model (KERL-Recom), which generates a list of recipe names that satisfy the constraints. The KERL-Recipe and KERL-Nutri models then generate cooking steps and micro-nutrients.
  • Figure 2: KERL Multi-LoRA Setup: With the same base model, a separate LoRA adapter is trained for each task. During inference, the desired adapter is activated while base model remains the same.
  • Figure 3: F1 scores of different models across various recipe types. Our model, KERL-Recom, consistently outperforms others with a significant margin in all categories.
  • Figure 4: FoodKG Recipe sample: left panel shows a 2-hop KG subgraph for the recipe node shown on the right.