In this paper, we address the challenge of recipe personalization through ingredient substitution. We make use of Large Language Models (LLMs) to build an ingredient substitution system designed to predict plausible substitute ingredients within a given recipe context. Given that the use of LLMs for this task has been barely done, we carry out an extensive set of experiments to determine the best LLM, prompt, and the fine-tuning setups. We further experiment with methods such as multi-task learning, two-stage fine-tuning, and Direct Preference Optimization (DPO). The experiments are conducted using the publicly available Recipe1MSub corpus. The best results are produced by the Mistral7-Base LLM after fine-tuning and DPO. This result outperforms the strong baseline available for the same corpus with a Hit@1 score of 22.04. Thus we believe that this research represents a significant step towards enabling personalized and creative culinary experiences by utilizing LLM-based ingredient substitution.
翻译:本文针对通过成分替换实现食谱个性化这一挑战展开研究。我们利用大语言模型构建了一个成分替换系统,旨在预测给定食谱语境下合理的替代成分。鉴于大语言模型在此任务中的应用尚属罕见,我们进行了大量实验以确定最佳的大语言模型、提示词及微调设置。我们进一步尝试了多任务学习、两阶段微调及直接偏好优化等方法。所有实验均基于公开可用的Recipe1MSub语料库进行。最佳结果由经过微调与直接偏好优化处理的Mistral7-Base大语言模型取得,其Hit@1分数达到22.04,显著超越了同一语料库上的现有强基线。因此,我们相信这项研究代表了通过基于大语言模型的成分替换技术,在实现个性化与创造性烹饪体验方面迈出的重要一步。