食 · 味 · 地

The hidden
geometry of flavor

What happens when you teach a machine to read 4.1 million recipes from nine languages — and ask it where miso belongs?

A question for the kitchen

What pairs with this?

It is the oldest question in any kitchen, and chefs answer it from memory, instinct, and tradition. What if a machine could answer it too — not by guessing, but by mapping the relationships between ingredients into a navigable landscape?

Ask a chef what goes with miso, and they will likely reach for mirin, dashi, or sesame oil. Ask the same chef about olive oil, and the answer becomes basil, tomato, prosciutto. This knowledge is not stored in a single recipe book. It lives in the collective memory of cuisine — embedded in millions of dishes cooked across centuries, across cultures.

Think of it like…

A library where every recipe is a sentence and every ingredient is a word. After reading enough sentences, you start to learn that "salmon" and "wasabi" often appear together, while "salmon" and "chocolate" almost never do. You build an intuition — a geometry — of which ingredients live near each other in the world of food.

That geometry is exactly what the Epicure project set out to build. The researchers aggregated 4,135,189 recipes from eleven sources across seven languages, normalized them into a clean vocabulary of 1,790 ingredients, and trained a family of models to learn — without supervision — where each ingredient should sit in a 300-dimensional space.

An ingredient is not what it is. An ingredient is what it is used with.

And once you have that map, something remarkable becomes possible: you can do arithmetic with flavor. You can take "rice," push it gently toward "South Asian," and watch the answer rotate into curry leaves, urad dal, and fenugreek seed. You can take "chicken," turn it toward "Tex-Mex," and arrive at tortillas, salsa, and Monterey Jack cheese.

Foundations

How do you turn an ingredient into a number?

Before we can navigate this map of flavor, we need to understand how it was drawn. The answer involves two very different views of what an ingredient is.

View one: ingredients as co-occurrence

The first view is purely social. Imagine you wrote down, for every recipe in our 4.1 million corpus, which ingredients appeared together. Pairs that appear together far more often than chance — like soy sauce and sesame oil — get a strong link. Pairs that almost never co-occur get nothing.

It's like…

Building a friendship network for ingredients. Two ingredients are "friends" if they're regularly seen at the same dinner parties. This network captures cultural tradition, regional cuisine, and culinary habit — but it knows nothing about why two ingredients work together chemically.

This network is captured by a measure called NPMI (Normalized Pointwise Mutual Information), a way to score how strongly two things "belong" together beyond what you'd expect by chance. Epicure's co-occurrence graph contains 203,508 such ingredient-pair edges.

View two: ingredients as chemistry

The second view is molecular. Foods share flavor compounds — the aromatic molecules that give them their character. Strawberries and pineapple share esters. Basil and tomato share certain green, herbal compounds. This is the foundation of "flavor pairing" theory.

Epicure draws on FlavorDB, a catalogue of aroma molecules. Each compound is tagged with one or more of 15 flavor families:

balsamic
citrus
earthy
fatty
floral
fruity
green
meaty
minty
nutty
spicy
vegetable
wine-like
woody
savory

Tomato carries certain "green" and "fruity" compounds. Basil carries some of the same "green" notes. So even if a recipe corpus never paired them, the chemistry would link them. Epicure encodes this with 80,019 ingredient-to-compound edges across 2,247 typed compound nodes.

View three: walking the graph

Now we have a vast graph — ingredients connected to other ingredients, and ingredients connected to compounds. How do we turn that into a vector? The trick is called Metapath2Vec. It is a kind of random tourism.

Picture this

You drop a tourist on the graph at a random ingredient. They wander — hopping from neighbor to neighbor — taking notes about who they visit and in what order. After millions of such walks, anything that gets visited together in similar contexts ends up looking similar. This is the same principle that powers word embeddings in language: you shall know a word by the company it keeps.

The trained model outputs a 300-dimensional vector for every ingredient. Two ingredients with similar vectors will tend to play similar roles in cooking. And — crucially — directions in this 300-D space correspond to meaningful concepts: a "spicy direction," a "Mediterranean direction," a "high-protein direction."

The Core Idea

One recipe, three siblings

Here is the central insight: should the model learn from recipe co-occurrence, from chemistry, or from a blend of both? Previous work fused them invisibly. Epicure makes the dial visible.

The Epicure team trained three sibling models, identical in every way except for which walks the random tourist is allowed to take. Same architecture. Same hyperparameters. Same vocabulary. Same graph. Only the walk schema differs.

Cooc

Recipe context

Walks only the ingredient-to-ingredient co-occurrence graph. Pure social network. Pure culinary tradition. Knows nothing about chemistry — only "who appears with whom."

Core

Blended

Walks the chemical compound graph and injects ingredient-to-ingredient walks ten times over. The middle path: chemistry and tradition fused into one geometry.

Chem

Chemistry

Walks only compound-mediated paths. Two ingredients become similar because they share aroma compounds — even if no recipe ever paired them.

Why this matters

The same question — "what is similar to chicken?" — has different answers depending on which sibling you ask. Cooc says "garlic, onion, black pepper" (recipe companions). Chem says "beef, pork" (chemistry peers). Core says both. The walk schema becomes a controllable design axis instead of a hidden architectural choice.

The recipe corpus

To make all this work across cultures, the team built one of the most linguistically diverse recipe datasets ever assembled:

4.14Mrecipes aggregated
11source datasets
9languages
1,790canonical ingredients

The languages span English (the dominant RecipeNLG corpus, 53.9% of recipes), Chinese (XiaChuFang, 37.4%), Russian, Vietnamese, Spanish, Turkish, Indonesian, German, and Indian-English. Non-English ingredient terms were machine-translated by Claude under deterministic decoding, then merged into a unified canonical vocabulary.

Raw ingredient strings were a mess — roughly 200,000 unique entries with brand names, preparation modifiers, and misspellings ("kraft shredded triple cheddar cheese with a touch of philadelphia" was a real entry). An LLM-assisted pipeline collapsed these into 1,790 clean ingredients, each anchored where possible to FlavorDB (for chemistry) and USDA FoodData Central (for nutrition).

The Evidence

What the geometry looks like

Once trained, the three siblings reveal strikingly different inner landscapes — and reveal that culinary culture and nutrition organize themselves automatically, without ever being told to.

The shape of the space

How "spread out" is each embedding? A metric called participation ratio measures this: it tells you, roughly, how many of the 300 dimensions are actually being used. A high number means information is distributed broadly. A low number means it's concentrated.

Isotropy: how the variance spreads

Cooc and Chem live in expansive, isotropic spaces (variance spread across ~175–183 dimensions). Core's geometry is compressed into roughly 94 dimensions — a consequence of injecting ingredient-to-ingredient walks 10× over.

Surprising finding

Core's tighter geometry is not a problem to fix — it's a feature. The concentration makes its emergent clusters tighter and its modes more coherent. The walk schema, not the data, determines the geometry's shape.

Cuisines and food groups emerge by themselves

The models were never told which ingredients belong to which cuisine. Yet when you measure how cleanly the embedding clusters by cuisine — using a metric called NMI (Normalized Mutual Information), where 0 means random and 1 means perfect — the answer is remarkable:

~0.46cuisine NMI (out of 1.0)
~0.22food-group NMI
8cuisine macro-regions found
17USDA food groups separated

Cultural tradition shapes ingredient relationships twice as cleanly as nutritional category does. Indian spices cluster together. East Asian umami ingredients cluster together. The model learned cuisine without ever being shown a cuisine label.

Linear directions you can ride

The team built 27 continuous probes (things like "how citrusy?", "how much protein?", "how minty?") and 8 cuisine probes, then asked: can a single straight line in 300-D space recover each property?

Direction quality across probe categories

Spearman ρ — how well a linear direction predicts the property. Higher is better. Chem leads on 26 of 27 continuous probes.

The pattern is consistent: Chem > Core > Cooc across every category. Chemistry-mediated walks, even though they don't directly encode cuisine or nutrition, make a broader set of culinary concepts linearly recoverable. The chemistry signal acts as a kind of geometric backbone.

Unsupervised factors: the emergent atlas

Imagine…

You take all 1,790 ingredients, throw them into a high-dimensional space, then ask: "What are the natural fault lines? If I had to describe this space with 20 independent axes, what would they be?" That's what FastICA does — it finds the most independent directions in the data.

Running this unsupervised decomposition with stability constraints (only keeping factors that show up reliably across 10 random starting points), the team found 20 stable factors per model. Each factor turned out to be a named culinary neighborhood. Within each factor, a Gaussian mixture model partitioned ingredients into tighter modes — 150 to 200 named modes per model.

Mode coherence vs. random baseline

Emergent modes are 5–6× tighter than random groupings in every model. These aren't statistical artifacts — they are real culinary regions of the space.

What kinds of modes? Things like "Sweet baking and dessert ingredients," "South Asian whole spice blends," "Mexican & Latin American pantry," "Japanese hot pot ingredients," "Chinese savory fermented and umami ingredients." These are named neighborhoods of the embedding — the geometric vocabulary that the operators in the next section will manipulate.

The Tools

Doing arithmetic with flavor

With the geometry in hand, two families of operations become possible — and both can be exposed to a chef as simple, intuitive controls.

Operator one: nearest-neighbor pairings

The simplest question: what's nearest to this ingredient? Just compute cosine similarity and rank. But notice how the three siblings disagree — each one capturing a different kind of "near":

Top-5 nearest to "chicken"

Cooc (recipe context)

garlic, onion, black pepper, turkey, carrot

Core (blended)

pork, beef, chicken broth, peanut, cream of chicken soup

Chem (chemistry)

beef, pork, cream of chicken soup, buffalo wing sauce, peanut

Cooc reaches for the aromatic vegetables a chicken cooks with. Core and Chem reach for protein peers — other meats. Both answers are "right" — they answer different questions. A chef-facing tool can let the user choose: "What do I cook this with?" or "What can I substitute?"

Operator two: SLERP direction arithmetic

This is where it gets magical. Once you have meaningful directions in the embedding (a "Mediterranean direction," a "high-protein direction," a "South Asian direction"), you can rotate any ingredient toward any direction by a chosen angle.

The technique

SLERP (Spherical Linear Interpolation) rotates a starting vector toward a target direction along the surface of a sphere. At 0° you're at the original ingredient. At 60° you've traveled halfway. The angle is a continuous dial between "stay close to the seed" and "go to the target neighborhood."

Try it: rotate an ingredient toward a culinary direction

Pick a seed, pick a destination, slide the angle. Watch the top-5 nearest neighbors transform from the seed's natural pantry to the destination's specialty cupboard. (Values are illustrative reconstructions from the paper's worked examples.)

Top-5 nearest after rotation

    Notice what happens with rice + South Asian at 30°: even though "rice" by itself doesn't pull up dal varieties (its top-5 in Cooc is just carrot, okra, vegetable oil, pea, dashi), rotating toward the South Asian direction lands on curry leaf, urad dal, chana dal, fenugreek seed — a perfectly coherent South Indian pantry that emerged from arithmetic, not lookup.

    Two ingredients, one destination

    Even more striking: when you rotate chicken AND beef both toward the Mexican/Tex-Mex direction at 60°, they converge on nearly the same neighborhood (corn tortilla, salsa, Monterey Jack cheese, cotija). The angle dissolves the seed and replaces it with the target's pantry. This is what direction arithmetic gives a chef: a steerable, continuous map of culinary possibility.

    The cultural lens shifts too

    Even when you rotate the same seed toward the same intent across all three siblings, the cultural framing shifts. Rotating chocolate toward "sweet baking":

    ModelTop resultsFlavor
    Cooccocoa powder, vanilla, coffee, hazelnut, cacaoWestern confection
    Corebaking powder, chia seed, whole wheat flour, baking sodaWestern baking pantry
    Chemred bean paste, matcha powder, purple sweet potato, mochiEast Asian sweets

    Chem's chemistry-driven walks surface an East Asian dessert mode anchored by red bean paste and matcha — a destination Cooc would never reach because Western and East Asian sweet traditions rarely share recipes, yet they share aroma compounds.

    Honest reckoning

    What this map doesn't show

    Corpus imbalance

    The corpus is roughly half East Asian and a tenth Mediterranean, with single-digit shares for South Asian, Eastern European, and Latin American cuisines. The model's resolution within smaller regions is correspondingly weaker, even if the cross-region rankings remain stable.

    Chemistry coverage gaps

    Only 523 of 1,790 ingredients have direct compound connections (the "hubs"). The other 1,267 reach chemistry context only indirectly, through hub-mediated paths. Broader compound databases would shorten that chain.

    LLM in the pipeline

    The vocabulary itself was canonicalized by Claude, and cuisine tags came from LLM annotation. The embeddings themselves are LLM-free — they only see canonical tokens — but the labels that frame them carry LLM judgment.

    Key Takeaways

    What you now know

    If you could explain Epicure to a friend over coffee, here is what you would say.

    The big idea

    4.1 million recipes in nine languages can be condensed into a 300-dimensional geometric map where every ingredient has a coordinate. Distances and directions in this map encode real culinary meaning — cuisine, nutrition, flavor profile — without ever being explicitly labeled.

    The controlled dial

    Three sibling models — Cooc, Core, Chem — span a continuum from "pure recipe co-occurrence" to "pure chemistry." Making this dial explicit lets you ask different culinary questions of the same data.

    Chemistry is the geometric backbone

    Counterintuitively, chemistry-mediated training (Chem) produces the strongest linear directions for cuisine, nutrition, and sensory properties — even though it never sees those labels. Chemistry acts as a structural prior with broad reach.

    Culture beats nutrition for clustering

    Cuisine clusters in the embedding twice as cleanly as USDA food groups do. Tradition organizes ingredient relationships more sharply than nutritional category.

    Two operators on one map

    Nearest-neighbor lookups answer "what's near this?" while SLERP rotation answers "what's near this in that direction?" Both can be exposed in one chef-facing interface.

    From recommendation to navigation

    The next step in computational gastronomy isn't bigger embeddings — it's better operators on them. Epicure is an argument that food AI should give chefs steering wheels, not just suggestions.

    A 300-dimensional vector becomes useful to a chef only when it is wrapped in operators they can actually steer.