SPADE: Spatiotemporal Preference Alignment for Local Search
With five slots and an open vocabulary of 1.48M queries, long-tail coverage, spatiotemporal fit, and keeping the list from repeating itself have to be tuned inside one pipeline; split across three teams, the fixes cancel one another out.
On this page
5 slots, but the usual pick is wrong? Say you run the homepage of a local-service app: a user opens it, has typed nothing, and you must place a few tappable search words before that first keystroke, words that decide what gets searched and which shop they land on. At first glance the safe move is to copy whatever is popular in other cities and other hours. That quietly drops two things: where this person stands right now, and the odd, specific request they might actually have. Worse, if several of the five words are near-duplicates of 'hot pot', you have thrown the slots away. A Meituan team argues in SPADE that you cannot fix long-tail demand, the current place and hour, and keeping the list from repeating itself one at a time [1].
Five slots on a homepage, and why sorting by popularity fails
Start with the scene. You run the homepage of a local-service app; a user opens it before typing a single letter, and the screen has to show a few search words they can tap, words that decide what they search and which shop they land on. The usual split is three teams owning three pieces: one mines rare but valuable demand, one writes the city and the hour into the input as plain text, one deletes duplicate phrasing at the end. Splitting the work is tidy! It is also the wrong default. All three fight over the same five slots, and pushing one tends to bend the other two out of shape. Why? Because the output is one short list, not three separate ones.
Why can't they be split? Because this is not picking from a fixed list. The paper calls the task open-set generation, which in plain words means the vocabulary holds 1.48M distinct queries and the system has to phrase something new on the spot, with no candidate pool to fall back on [1]. The inputs are thin too: one person, one GPS coordinate, one hour, and a short trail of recent searches. If the place or the hour is off, or if one word means the same as its neighbour, that slot is wasted. That is wrong. The three axes are not three independent switches; they pull on the same string of output. The Meituan team's fix, SPADE, ties how words are split, how context is written, how training scores candidates, and how the final list is picked into one pipeline, instead of four modules each checked on its own [1].
SPADE puts four fixes into one pipeline
First, the scale. The authors sample 100K users from the platform logs of one large local-service app, and both training stages share that pool; the window is 30 consecutive days, covering 2,608 cities and 1.48M distinct queries [1]. Each instance carries a user profile, a recent trail of searches and visited shops truncated to 30 items (mean length 27.7), a GPS-level coordinate, and the hour, the day of week, and a holiday flag. The split is strict and chronological: train on the 30 days, validate on the next day, test on the day after, with no test-day data used to build training pairs [1]. Stage one collects 7.79M samples, stage two 3.08M, and the whole thing lines up with K=5 display slots.
The training setup is written down too: a 6-layer decoder, hidden width 512, 8 heads, 3 epochs in stage one and 1 in stage two, on 8 data-center GPUs [1]. When scoring a candidate, the weights 0.8, 0.1, and 0.1 go to where it ranks, whether it returns usable results, and how far the nearest shop sits; the three log types, impression, click, and conversion, get weights 0.5, 1.0, and 2.0. The numbers are not small! What matters is not the knobs but that all four steps share one output list: change an early step and the later ones inherit the changed result, so gains stack up, or collide.
- OA-BPE changes how words get split. Splitting a query into small pieces is what a tokenizer does; the standard rule merges by raw frequency, so rare but valuable phrases get chopped fine and start generation at a disadvantage. OA-BPE folds click-through rate, conversion rate, and a page-view term into the merge score, so those phrases get shorter pieces. In the paper, the median piece count for tail queries drops from 7.2 to 5.9, their chance of reaching the top 10 rises from 0.312 to 0.383, and head queries barely move (4.1 to 4.0) [1].
- STAR replaces coarse labels like a city name or a time slot. Spatiotemporal encoding, in plain words, turns the exact GPS coordinate and the hour into a set of continuous numbers, then feeds them in through a gate that starts at zero and opens slowly, so the model is not shoved off course early in training [1]. Take the spatial branch away and the geographic error climbs from 1.66 km to 2.55 km.
- MARS-DPO aligns the model with real impression-click logs, which in plain words means it uses 'what was shown and then clicked' as the textbook for what to rank first. It folds rank, whether a query returns results, and distance into one score, then picks the near-miss hard cases to learn from instead of pre-collected static pairs [1].
- SDBS adds a small bonus to lower-ranked candidates at the final step so the five words do not collapse into one meaning; the top word gets no bonus at all, which keeps its quality. Decoding, in plain words, is the model spitting out a word one piece at a time while keeping a few live options; swap in standard decoding and the similarity among the five rises from 0.211 to 0.231, where higher means more repeats [1].
The offline numbers you can look up
To read the table, know what each number measures. At K=5 the paper reports HR@5, whether the true searched word appears among the top five, counted in percentage points; GeoC@5, how many kilometres from the user to the nearest shop returned by a generated word, lower is better; IDiv@5, how much the five words resemble each other, lower means they differ more; and Exec@5, a 0-to-1 score from a separate judge, Qwen3-32B, on whether a word returns suitable results [1]. MRR@5 asks where the hit ranks, and SemSim measures how close the generated phrase sits to the labelled answer. With those four in hand, you can recompute the table yourself.
| Method (Table 2) | HR@5 | GeoC@5 km | IDiv@5 | Exec@5 |
|---|---|---|---|---|
| Pop/Trend | 6.1 | 2.73 | 0.318 | 0.784 |
| SwingQ2Q | 9.7 | 2.31 | 0.279 | 0.897 |
| AIGQ (strongest generative baseline) | 12.5 | 2.78 | 0.204 | 0.934 |
| SPADE | 13.2 | 1.66 | 0.211 | 0.952 |
| SPADE vs AIGQ | +5.6% | -40.3% | +3.4% | +1.9% |
The last row is the one to stare at. SPADE moves HR@5 from 12.5 to 13.2, up 5.6%; GeoC@5 from 2.78 km to 1.66 km, down 40.3%; Exec@5 from 0.934 to 0.952, up 1.9% [1]. Only IDiv@5 goes the other way: 0.211 against 0.204, up 3.4%, which means SPADE's five words are slightly more alike than AIGQ's, slightly less varied. Do not read that backwards! The paper says why: AIGQ picks each word while looking at the ones already produced, so it de-duplicates naturally, but it leans on a ranker to judge the whole list, a noisy signal that hurts relevance; SPADE scores each word alone, more accurate per word, blind to its neighbours. Decoding is where the variety comes back: without SDBS, IDiv@5 degrades to 0.231, 13.2% worse than AIGQ, and with it, back to 0.211 [1].
Slices show where the method earns its keep. The paper splits traffic four ways [1]:
- Cold-start users, fewer than 5 interactions: HR@5 goes 9.2 to 10.1, up 9.8%, and GeoC@5 3.41 km to 1.94 km, down 43.1%.
- Long-tail intents, query frequency below 100 in the training log: HR@5 7.4 to 8.4, up 13.5%, the biggest of the four, with GeoC@5 3.58 km to 2.07 km.
- Geo-sparse regions, fewer than 10K monthly active users: GeoC@5 4.12 km to 2.13 km, down 48.3%, and HR@5 10.8 to 11.6.
- Time-sensitive traffic, weekday meal hours 11 to 13 and 17 to 20: both score high, AIGQ 16.8 and SPADE 17.9, and the GeoC@5 gap narrows to down 28.1%, because routine office-area lunch demand is coarse enough that plain location labels already work [1].
Beyond offline, the team ran a one-week live A/B test with 20% of traffic per arm. Module CTR rose 1.88%, Search Volume 0.177%, and Search DAU 0.105%, all with p below 0.05 [1]. On one inference GPU the model takes about 20 GB, serves 289 QPS, at P50 latency 36.1 ms and P95 65.4 ms, inside the platform's P95 below 100 ms limit with room to spare. The numbers are small! On a homepage entry point, though, small is the difference between shipping and not shipping.
If you ship this, check these first
- Step one, count your slots. Every offline number here lines up with K=5; move to K=3 or K=10 and the 13.2 HR@5 or the 1.66 km GeoC@5 no longer carry over [1].
- Step two, do not watch a single score. Log hits, geographic distance, how alike the five are, and whether the word returns results separately; the paper itself loses slightly to AIGQ on IDiv@5, 0.211 against 0.204, and staring only at HR@5 hides that [1].
- Step three, recompute on your hardest slice. The +13.5%, -48.3%, and +9.8% gains come from long-tail, geo-sparse, and cold-start traffic, not from an average over everyone, so do not read them as a flat lift [1].
- Step four, load-test before launch. The 20 GB, 289 QPS, and 65.4 ms P95 were measured on one inference card; your hardware and your peak differ, so verify the P95 below 100 ms line yourself [1].
None of these four needs a retrain; they are log checks. Put your own coordinates, hours, and repeat rates on the table first, then decide whether the generating half is worth touching. Reverse that order and the expensive step gets wasted.
Where this method breaks down, and my judgment
Put the limits first. The paper lists three: the reward that judges whether a query returns results leans on batch inference from Qwen3.5-122B-A10B, which the authors say a smaller distilled model could replace; OA-BPE weights are not one-and-done, they need recomputing as the query mix shifts; and STAR encodes a single GPS coordinate, not a whole trajectory [1]. A wider limit sits in where the data came from: 100K users, 30 days, 2,608 cities, all one platform. The live A/B ran one week at 20% per arm, and the paper gives no number for whether the lift survives a season change or shows up in whether users keep coming back. Do not copy it over. The cases it does not cover deserve names too: a product with no GPS-level coordinates, a fixed candidate pool, or far more than five homepage slots simply does not fit [1].
State the boundary in one line: the result only holds when a product has GPS-level coordinates, impression-click logs, and about five homepage slots; it breaks down, or at least these gains no longer hold, on a fixed candidate pool, a product with no coordinates, or a bid to predict whether users keep coming back [1]. The line worth screenshotting: handing long-tail demand, place-and-hour, and repeat-avoidance to three separate teams is exactly the default this experiment wants to overturn.
