Losses that Cook: Topological Optimal Transport for Structured Recipe Generation
Mattia Ottoborgo, Daniele Rege Cambrin, Paolo Garza
TL;DR
This work tackles the gap between fluent text generation and executable recipe construction by introducing a topological loss that treats ingredient lists as embedding-space point clouds and minimizes a Sinkhorn divergence between predicted and true ingredient structures. By combining this topological objective with standard cross-entropy (and Dice in some configurations), the authors demonstrate substantial improvements in recipe-specific metrics such as Ingredient Recall and Quantity Precision, as well as improved procedural coherence, without increasing model size or inference cost. Empirical results on a pasta/rice/sandwich subset of RECIPE-NLG show that the Topological loss yields the most consistent gains across factual and procedural dimensions, while a mixed Topo+Dice objective offers the best overall balance and strong human preferences (Topo+Dice preferred in 62% of cases). The approach highlights the value of geometry-aware training signals for structured generation tasks and suggests avenues to extend to broader cuisines and safety-aware validations in practical deployments.
Abstract
Cooking recipes are complex procedures that require not only a fluent and factual text, but also accurate timing, temperature, and procedural coherence, as well as the correct composition of ingredients. Standard training procedures are primarily based on cross-entropy and focus solely on fluency. Building on RECIPE-NLG, we investigate the use of several composite objectives and present a new topological loss that represents ingredient lists as point clouds in embedding space, minimizing the divergence between predicted and gold ingredients. Using both standard NLG metrics and recipe-specific metrics, we find that our loss significantly improves ingredient- and action-level metrics. Meanwhile, the Dice loss excels in time/temperature precision, and the mixed loss yields competitive trade-offs with synergistic gains in quantity and time. A human preference analysis supports our finding, showing our model is preferred in 62% of the cases.
