OneQuery: Unified Sequence-to-Structure Generation for Multilingual E-commerce Query Understanding

Mingyu Zhang, Jiejie Qin, Jianhui Ji, Rong Xiao, Meishan Zhang, Xiaoyi ZengarXiv 2026

TL;DR

Multilingual e-commerce search usually relies on a clunky game of "telephone" across four separate models—identifying the language, fixing typos, translating, and extracting tags—where a single upstream mistake derails the entire search. OneQuery replaces this brittle pipeline with a single domain-adapted Large Language Model (LLM) that outputs all four tasks simultaneously in one structured JSON object. By using clever self-distillation to solve missing training labels and task-aware reinforcement learning to break bad habits, it beats both legacy production systems and frontier proprietary LLMs while boosting real-world conversions on AliExpress.

What Problem Does This Paper Address?

Imagine a French shopper typing "colier nepal" (misspelling collier, meaning necklace) into a global marketplace like AliExpress, where inventory is indexed mostly in English and local languages. Before the search engine can retrieve products, a Query Understanding (QU) system has to standardize this messy input.

Traditionally, industrial QU is built as a sequential assembly line of four isolated, discriminative models:

  1. Language Recognition (Is this French?)
  2. Spelling Correction (colier $\rightarrow$ collier)
  3. Query Translation (collier nepal $\rightarrow$ nepal necklace)
  4. Query Tagging / QT (Style: nepal, Product: necklace)
Figure 1: The traditional query understanding pipeline.

This modularity comes at a steep price. First, maintaining four distinct models across different engineering teams is an operational headache. Second, and more importantly, errors cascade irreversibly. Downstream modules only see the output of the step right before them, never the user's original query. Take the real-world query "escape yamaha mt 07". Because "escape" is a common English word, a traditional language detector labels the query English and skips translation—completely missing that in Spanish motorcycle slang, escape means "exhaust pipe." The user gets nonsense results.

Methods

OneQuery reframes all four subtasks into a single sequence-to-structure problem: given a raw query, a domain-pretrained e-commerce LLM (tested at 4B, 8B, and 14B scales) autoregressively generates one unified JSON object: {lang, spell, trans, qt}.

Getting an LLM to do this reliably requires overcoming two hurdles: task-specific datasets rarely have annotations for all four fields at once, and standard token-by-token training teaches models lazy surface-level shortcuts. The authors solve this with a three-stage progressive training pipeline:

Figure 2: Three-Stage Training Framework of OneQuery.
  • Stage 1: Joint Single-Task SFT. The base model is fine-tuned on existing isolated datasets using dynamic prompts that toggle an Active Subtask field. This injects foundational expertise for each individual task into one shared set of weights.
  • Stage 2: Iterative Field Completion & Joint SFT. Using the Stage 1 model as an automated annotator, the authors fill in the missing blanks across partially labeled logs, filtering for valid JSON and cross-task consistency (e.g., making sure extracted tags actually match the translation). Merging this synthetic data with human-annotated examples teaches the model to generate the complete, unified JSON in one pass.
  • Stage 3: Task-Aware RL Alignment. Using Group Relative Policy Optimization (GRPO—an efficient reinforcement learning algorithm that compares groups of sampled outputs without needing a separate, memory-heavy critic model), the model is aligned via verifiable, rule-based rewards. Crucially, the reward function is tailored per task: binary exact-match for language, translation, and tag sets, paired with a continuous Levenshtein edit-distance partial credit for spelling correction. Furthermore, rewards are weighted non-uniformly ($0.35, 0.25, 0.25, 0.15$), putting the heaviest optimization pressure on earlier fields in the JSON sequence since autoregressive generation means early tokens influence later ones.

For live deployment on AliExpress, the 14B model processes head queries offline into a cache, while a lightweight 0.3B student model distilled from the 14B outputs handles long-tail queries in real time.

Datasets

All datasets are proprietary logs sourced from AliExpress search traffic:

  • Stage 1 Data: Task-specific, partially annotated datasets for each of the four individual subtasks.
  • Stage 2 Unified Corpus: A hybrid dataset combining 3.6 million filtered synthetic pseudo-data instances (generated via Iterative Field Completion) with 310,000 fully human-labeled OneQuery examples. (31,000 human-labeled samples are later subsampled for Stage 3 RL).
  • Evaluation Benchmark ($\mathcal{D}_{\text{test}}$): A newly constructed benchmark of 19,087 real-world, multilingual, multi-category queries drawn from AliExpress logs, manually annotated and verified by domain experts across all four fields.

Key Insights and Ideas

  • Shared context heals upstream mistakes: In a case study on the Spanish query "digitalizar video 8mm", OneQuery mistranslates digitalizar as "scan" instead of "digitize"—just like the baseline. Yet, in the very next JSON field, OneQuery still tags the function accurately as digitize! Because the model attends back to the original Spanish query while generating tags, a hiccup in translation no longer poisons the final semantic representation.
  • Why soft RL rewards fail in GRPO: Surprisingly, using standard evaluation metrics (like F1 or ROUGE) directly as RL rewards yielded the worst alignment results. Because GRPO normalizes rewards within a small group of 8 sampled outputs, tightly clustered continuous scores amplify sampling noise and destabilize gradients. Switching to sharp, high-contrast binary exact-match rewards (except for spelling, where valid edits vary) stabilized multi-task RL.
  • Domain post-training beats sheer scale: Prompting massive frontier models (Qwen3.8-Max and GPT-5.6 Luna) in a few-shot setup failed dramatically on Query Tagging (~20 F1 points behind OneQuery) because general LLMs don't know platform-specific tag taxonomies, and they tended to aggressively over-correct already valid queries. This also proves Stage 2's self-distillation wasn't just cheaper than prompting a giant commercial LLM—it was strictly necessary for accuracy.

Key Results

  • Offline Gains (14B Backbone vs. Production Pipeline): Language Recognition accuracy rose from 0.9514 to 0.9665; Translation ROUGE-2 jumped from 78.20 to 80.50; Spelling Correction F1 improved from 0.8568 to 0.8717; and Query Tagging F1 climbed from 0.8128 to 0.8366.
  • Scale Generalization: Repeating the exact pipeline on 4B and 8B backbones yielded ~1.5-point gains in Language Recognition, >2.2-point F1 gains in QT, and >2.3-point ROUGE-2 gains in Translation across all sizes.
  • Live Production A/B Testing: Deployed across multiple countries on AliExpress, OneQuery drove a 0.5% increase in list-to-payment conversion rate (L2P) and a 0.8-point gain in human side-by-side relevance evaluations.

Limitations and Future Work

While the authors do not include a standalone limitations section, two practical constraints surface in their experiments:

  • Capacity sensitivity in Spelling Correction: Unlike the other three tasks, smaller 4B and 8B unified backbones fell slightly short of their respective single-task pipeline baselines on Spelling Correction F1 (e.g., 0.8428 vs. 0.8365 at Stage 2, dropping below 0.8365's 8B counterpart 0.8529 vs. 0.8513), showing that memorized multilingualorthography and cautious rewriting remain sensitive to parameter count.
  • Direct serving latency: A 14B autoregressive LLM is still too slow for strict real-time e-commerce latency budgets on every search, requiring a hybrid offline-cache plus 0.3B student distillation architecture for online serving.

Summary updated

Abstract

Multilingual e-commerce search requires robust query understanding to convert cross-lingual user queries with varied linguistic patterns into standardized semantic representations that support retrieval and ranking. However, traditional Query Understanding systems suffer from error accumulation, separately optimized subtasks that ignore their mutual correlations, and high maintenance costs. To address these issues, this paper proposes OneQuery, a unified generative framework for multilingual query understanding based on domain-specific large language models in e-commerce. We reformulate four subtasks, namely Language Recognition, Spelling Correction, Translation, and Query Tagging, into a unified Sequenceto-Structure autoregressive generation process constrained by predefined schemas, and design a three-stage progressive training pipeline with multi-task reinforcement learning alignment. OneQuery demonstrates consistent gains over baselines across all tasks and remains effective across different backbone sizes, and online experiments in the AliExpress e-commerce search scenario further confirm its practical value for industrial deployment.
BibTeX
@misc{zhang2026onequery,
  author = {Mingyu Zhang and Jiejie Qin and Jianhui Ji and Rong Xiao and Meishan Zhang and Xiaoyi Zeng},
  title = {{OneQuery: Unified Sequence-to-Structure Generation for Multilingual E-commerce Query Understanding}},
  year = {2026},
  eprint = {2611.33653},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.33653},
}
Figure