After studying this material, students should be able to:
Recommending food ingredients is not simple math. Consider this:
Tomato + Basil = โ
Great
Tomato + Vanilla = โ Unusual
Chocolate + Chili = โ
Surprisingly Great
Good ingredient combinations depend on multiple factors simultaneously:
| Factor | Example |
|---|---|
| Taste | Sweet, sour, bitter, umami |
| Smell/Aroma | Volatile compound compatibility |
| Cuisine Style | Italian vs. Japanese traditions |
| Texture | Crunchy vs. creamy balance |
| Chef Preference | Personal creative vision |
A machine learning model for chefs must be both accurate AND explainable. A chef won't trust a "black box" that just says "add truffle" without explaining why.
The model must predict ingredient pairings that actually taste good together
The model must explain its reasoning in a way chefs can understand and trust
โ Black Box Model:
Input: Chicken โ Output: Add Lemon
(No explanation)
โ
Interpretable Model:
Input: Chicken โ Output: Add Lemon
Reason: "Lemon's citric acid brightens
fatty proteins โ used in 847 Mediterranean recipes"
A relational representation captures how things relate to each other, not just what they are individually.
Instead of storing:
Ingredient: Lemon
Properties: [yellow, citrus, sour, vitamin C]
A relational representation stores:
Lemon โ COMPLEMENTS โ Chicken (strength: 0.92)
Lemon โ CONTRASTS โ Cream (strength: 0.45)
Lemon โ BELONGS_TO โ Mediterranean cuisine (strength: 0.87)
Traditional Approach: Relational Approach:
"What IS lemon?" vs. "How does lemon RELATE
to everything else?"
Analogy: Think of it like a social network. You understand a person better by their relationships (friend of X, colleague of Y) than by their profile alone.
A memory network is a neural network architecture that has an external memory it can read from and write to โ like having a reference book while solving a problem.
MEMORY BANK:
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ KEY โ VALUE โ
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ "fatty + acid" โ โ Lemon, Vinegar, Capers โ
โ "umami base" โ โ Mushroom, Soy, Anchovy โ
โ "sweet + heat" โ โ Chili, Chocolate, Mango โ
โ "fresh herb" โ โ Basil, Mint, Cilantro โ
โโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Step 1: Query
Chef inputs: "I'm working with Salmon"
Step 2: Key Matching
System identifies Salmon's properties:
- Fatty fish โ
- Rich flavor โ
- Delicate texture โ
Step 3: Memory Lookup
Matches KEY: "fatty + acid" โ
Returns VALUE: [Lemon, Capers, Dill]
Step 4: Ranked Output with Explanation
Recommendation: Add Capers
Why: "Capers' acidity cuts through
salmon's fat โ relationship strength: 0.89"
Pre-existing structured information about food that the model can reference:
Examples of External Knowledge:
โโโ Flavor pairing databases (e.g., FlavorDB)
โโโ Chemical compound compatibility data
โโโ Traditional cuisine ingredient lists
โโโ Nutritional relationship data
โโโ Historical recipe collections
Without External Knowledge:
Model learns ONLY from training recipes
โ Limited, biased toward common combinations
With External Knowledge:
Model learns from recipes + scientific flavor data
โ Richer, more nuanced, scientifically grounded
IRRM Architecture:
[Recipe Data] โโโโโโโโโโโโโโโโโโโ
โผ
[External Knowledge Base] โโโ [Memory Network] โโโ [Recommendation]
โฒ โ
[Chef's Rules/Preferences] โโโโโโโ โ
[Explanation]
Key Benefit: When a chef asks "Why did you suggest this?" the system can point to specific entries in the knowledge base as evidence.
Learns HOW ingredients relate to each other
across multiple dimensions simultaneously
Stores and retrieves relationship patterns
in an inspectable, structured format
Grounds recommendations in verified
external food science information
Phase 1: Learn from Data
โโโ Feed model thousands of recipes
โโโ Model learns ingredient co-occurrence patterns
โโโ Relationships stored in memory network
Phase 2: Integrate Chef Rules
โโโ Chef provides scoring rules:
โ "I prefer umami-forward combinations"
โ "Avoid mixing more than 2 strong aromatics"
โโโ Rules become part of model's scoring function
Phase 3: Generate Interpretable Output
โโโ Recommendation produced
โโโ Memory keys that triggered it are logged
โโโ Explanation generated from knowledge base
Example Rule:
IF ingredient_has("citrus") AND dish_has("fish")
THEN recommend("lemon") WITH score(0.8)
Advantages:
Disadvantages:
Learned Pattern:
[fatty_protein] ร [acid_compound] โ high_compatibility
(Discovered automatically from data)
Advantages:
Disadvantages:
| Feature | Rule-Based | IRRM |
|---|---|---|
| Interpretability | High | High |
| Pattern Discovery | None | Strong |
| Customization | Manual | Semi-automatic |
| Scalability | Low | High |
| Chef Integration | Direct rules | Scoring functions |
| Novel Combinations | Limited | Strong |
Traditional Recommendation:
"Other chefs who used X also used Y"
โ Leads to COPYING existing recipes
IRRM Recommendation:
"X and Y share these relational properties..."
โ Leads to UNDERSTANDING why combinations work
โ Chef can then CREATE novel variations
1. Chef inputs base ingredients:
[Miso, Butter, Thyme]
2. IRRM analyzes relationships:
Miso โ umami, fermented, salty
Butter โ fat, rich, dairy
Thyme โ aromatic, earthy, Mediterranean
3. Memory network retrieves:
KEY: "umami + fat + herb"
VALUE: [Mushroom, Parmesan, Truffle, Walnut]
4. Output with explanation:
"Add Mushroom โ shares fermented/earthy
profile with Miso, fat-soluble aromatics
complement Butter (confidence: 0.91)"
5. Chef understands the WHY:
Can now creatively extend this logic
to invent entirely new combinations
IRRM
โ
โโโ PROBLEM SOLVED
โ โโโ Accuracy (good recommendations)
โ โโโ Interpretability (explainable recommendations)
โ
โโโ CORE MECHANISM
โ โโโ Relational Representations
โ โ โโโ How ingredients relate, not just what they are
โ โโโ Key-Value Memory Network
โ โโโ Keys = relationship patterns
โ โโโ Values = ingredient recommendations
โ
โโโ KNOWLEDGE INTEGRATION
โ โโโ External databases (flavor science)
โ โโโ Chef rules (scoring functions)
โ
โโโ OUTCOME
โโโ Interpretable recommendations
โโโ Customizable to chef preferences
โโโ Supports creative ideation
Why is interpretability especially important for professional chefs compared to casual users?
Explain the difference between representing an ingredient by its properties vs. its relationships.
Describe what the "key" and "value" represent in the memory network using a food example.
Compare one advantage and one disadvantage of IRRM over traditional rule-based systems.
How does integrating an external knowledge base improve the model's recommendations?
๐ก Core Takeaway: IRRM bridges the gap between powerful machine learning and human-understandable reasoning by storing ingredient relationships in an inspectable memory structure โ giving chefs both smart recommendations AND the ability to understand, trust, and creatively extend those suggestions.