Source-linked AI summary
RecipeNet: A Hierarchical Transformer for Recipe Data
Pin-Yen Huang, Sachin Chhabra, Prasanth Sai Gouripeddi, Abhinav Kumar, Baoxin Li
TL;DR
Recipe data contains variable fields arranged in ordered procedural steps, but conventional tabular methods flatten this structure and miss hierarchical interactions and sequential dependencies. RecipeNet preserves the native hierarchy with stacked Transformer encoders, consistently outperforming existing tabular models across multiple datasets and tasks.
Problem
Variable fields and ordered steps make recipe data difficult for flat tabular methods to represent without losing structural relationships and procedural dependencies.
Method
RecipeNet hierarchically encodes fields within steps and dependencies across ordered steps using field tokenization, step-level fusion, and recipe-level sequence encoding.
Results
RecipeNet consistently achieves the best performance across all datasets and tasks, including next-step and masked-step prediction.
Takeaways & Limitations
The results support explicitly modeling recipe data’s hierarchical and sequential structure for recipe representation learning.
Abstract
from arXiv · showhide
Recipe data arises in domains such as materials synthesis, pharmaceutical formulation, and industrial manufacturing, where procedures are represented as ordered sequences of steps containing heterogeneous structured fields. Existing tabular learning methods typically flatten this structure into fixed-schema representations, limiting their ability to capture hierarchical field interactions and procedural dependencies. We propose RecipeNet, a hierarchical Transformer architecture that encodes field-level interactions within each step and sequential dependencies across steps through stacked Transformer encoders. Experiments on multiple recipe datasets and tasks demonstrate that RecipeNet consistently outperforms existing tabular models, highlighting the value of hierarchical and sequential modeling for recipe representation learning.
1 Introduction
Recipe data represents sequential procedures with heterogeneous fields organized into ordered steps across domains including manufacturing, materials synthesis, pharmaceutical formulation, and cooking. Existing tabular methods lose structural information when flattening recipes, motivating RecipeNet, which models within-step field interactions and across-step dependencies and consistently outperforms such methods across datasets and tasks.
- Recipe Data Structure: Recipe data describes sequential procedures whose heterogeneous fields are organized into ordered procedural steps across multiple application domains.Examples include industrial manufacturing, cooking, material synthesis, pharmaceutical formulation, and semiconductor manufacturing.
- Limitations of Existing Methods: Flattening and padding recipes into fixed-schema tabular representations can produce sparse inputs and lose relationships among fields and procedural steps.Existing tabular methods cannot directly handle varying field sets and numbers of procedural steps.
- Limitations of Existing Methods: Effective recipe modeling must capture intra-step field interactions, inter-step relationships, and sequential dependencies that conventional flat-feature methods generally overlook.Procedural order can influence the final outcome, whereas many tabular methods treat feature ordering as irrelevant.
- RecipeNet: RecipeNet preserves native recipe structure by encoding heterogeneous fields within each step and modeling dependencies across steps with a second Transformer encoder.Its hierarchical design accommodates variable recipe schemas while modeling local field interactions and global procedural context.
- Experimental Results: RecipeNet consistently outperforms existing tabular learning methods across multiple recipe datasets and downstream prediction tasks.The results support hierarchical recipe modeling for recipe representation learning.
2 Related Work
Prior tabular methods capture feature relationships but assume fixed schemas, whereas recipe data requires modeling variable, hierarchical fields within steps and ordered dependencies across steps. Set-based and sequential architectures address either unordered or ordered structure, but not both jointly in a unified hierarchical framework.
- Tabular learning: Fixed-schema tabular methods, including XGBoost, CatBoost, TabNet, TabTransformer, FT-Transformer, SAINT, and NODE, are not designed for recipe data’s variable schemas and procedural dependencies.Applying them often requires flattening and padding recipes into fixed-schema representations, which can obscure hierarchical and sequential structure.
- Tabular learning: Flattening and padding recipe data into fixed-schema tabular representations can obscure its inherent hierarchical and sequential structure.Recipe data contains variable schemas, hierarchical organization, and procedural dependencies that fixed-layout methods do not explicitly model.
- Set and sequential models: Set-based architectures such as Deep Sets and Set Transformer learn permutation-invariant representations, while RNNs, LSTMs, and Transformers model temporal and sequential dependencies.These approaches respectively target unordered inputs or ordered sequences.
- Set and sequential models: Recipe data combines variable heterogeneous fields within each step with an ordered sequence of procedural steps, requiring both properties to be modeled jointly.Existing methods are not specifically designed to capture both aspects within a unified hierarchical framework.
3 Method
RecipeNet preserves recipes’ native hierarchy by encoding heterogeneous fields within each step and modeling dependencies across ordered procedural steps. Its design supports variable field sets and step structures while capturing both local interactions and global procedural context.
- Architecture: RecipeNet uses field-level tokenization, step-level fusion, and recipe-level Transformer encoding to preserve recipes’ hierarchical structure.The architecture processes heterogeneous fields within steps before modeling dependencies across steps.
- Architecture: Only observed fields become tokens, allowing RecipeNet to accommodate variable field sets and procedural structures.Each step may contain a variable number of observed fields.
- Field-level tokenization: Field tokens combine value, field identity, and step-position embeddings to represent heterogeneous features without fixed feature positions.Numerical values use learned linear projections, while categorical values use embedding tables.
- Step-level fusion: A step-level Transformer aggregates observed field tokens, capturing interactions among fields that jointly determine a process step.A learnable [STEP-CLS] token summarizes the contextualized step representation.
- Recipe-level encoding: A recipe-level Transformer models long-range dependencies across procedural steps and produces the final recipe representation for downstream prediction.The representation supports task-specific classification or regression heads.
- Design properties: RecipeNet jointly captures intra-step field interactions and inter-step procedural dependencies while supporting variable fields, steps, and feature types.This combines local field interactions with global procedural context.
4 Experiments
RecipeNet is evaluated on three public recipe datasets using next-step and masked-step prediction, with balanced accuracy as the reported metric. It consistently outperforms tabular and transformer-based baselines, while ablations and efficiency analyses support the value of its hierarchical architecture.
- Experimental setup: Experiments use three public recipe datasets and evaluate next-step prediction and masked-step prediction with balanced accuracy.Next-step prediction forecasts the subsequent synthesis-step type, whereas masked-step prediction recovers a masked step from the remaining recipe information.
- Main results: RecipeNet achieves the best performance across all datasets and tasks, surpassing tree-based, neural tabular, and transformer-based models.Its gains are particularly evident for next-step prediction, and it attains near-perfect masked-step performance while exceeding XGBoost, CatBoost, and Set Transformer.
- Computational efficiency: RecipeNet reduces training time by approximately 18% versus the fastest competing transformer baseline while maintaining superior predictive performance.It has the lowest training time among transformer-based models; NODE and TabNet train faster but generally perform worse on downstream tasks.
- Ablation study: The full model performs best on both tasks, while removing the step encoder causes the largest degradation, followed by removing the recipe encoder.Removing position or field-identity embeddings also reduces performance, indicating the importance of procedural order and field-level semantics.
- Representation analysis: RecipeNet produces more compact, well-separated t-SNE embedding clusters with less inter-class overlap than baseline models.The comparison uses recipe embeddings from the Sol-gel precursor synthesis dataset, with colors denoting target classes.
5 Conclusion
RecipeNet is a hierarchical Transformer for recipe data with variable schemas and sequential procedural structure. It preserves field interactions within steps and procedural dependencies across steps, with experiments demonstrating its effectiveness across multiple datasets and downstream tasks.
- RecipeNet is a hierarchical Transformer architecture designed for recipe data with variable schemas and sequential procedural structure.
- RecipeNet preserves intra-step field interactions and inter-step procedural dependencies through hierarchical encoding.
- Experiments across multiple recipe datasets and downstream tasks demonstrate RecipeNet’s effectiveness.