Senath TAthukorala KCosta RRanathunga SKaur R2025-12-032025-09Senath T, Athukorala K, Costa R, Ranathunga S, Kaur R. (2025). Large language models for ingredient substitution in food recipes using supervised fine-tuning and direct preference optimization. Natural Language Processing Journal. 12.https://mro.massey.ac.nz/handle/10179/73894In 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. Although LLM results lag behind the baseline with respect to other metrics such as Hit@3 and Hit@10, we believe that this research represents a promising step towards enabling personalized and creative culinary experiences by utilizing LLM-based ingredient substitution.CC BY 4.0(c) 2025 The Author/shttps://creativecommons.org/licenses/by/4.0/Natural language processingParameter-efficient fine-tuningMulti-task learningTwo-stage fine-tuningDirect preference optimizationRecipe personalizationMistralLarge language models for ingredient substitution in food recipes using supervised fine-tuning and direct preference optimizationJournal article10.1016/j.nlp.2025.1001772949-7191journal-article100177S2949719125000536