Scaling Product Categorization from Manual Tagging to LLM-Based Classification

getyourguide · E-commerce · 2025 · source Agentic: no · promotional bias: low · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: travel marketplace product categorization

GetYourGuide needed to classify hundreds of thousands of travel products into hundreds of multi-label categories, improving relevance and conversion beyond manual tagging, supplier rules, and vector-threshold systems.

Constraints:

Architecture

GetYourGuide uses a hybrid pipeline: OpenAI embeddings pre-rank products for each category, products are grouped into OpenAI batch jobs, GPT-4-mini evaluates one product/category pair with structured reasoning/confidence/decision fields, custom early stopping halts low-yield category processing, and Airflow-like automation handles errors and recurring updates. Offline evaluation and A/B testing validate quality and business impact.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  A["Product catalog"] --> C["Embedding pre-ranker"]
  B["Category catalog"] --> C
  C --> D["Batch job builder"]
  D --> E["LLM classifier"]
  B --> E
  E --> F["Structured output schema"]
  F --> G["Early stopping monitor"]
  G --> H["Category assignments"]
  H --> I["Offline evaluation"]
  H --> J["A/B testing"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Product catalog Travel products to be assigned to one or more categories. Embedding pre-ranker
Category catalog The set of travel categories, including existing and newly enabled niche categories. Embedding pre-ranker, LLM classifier
Embedding pre-ranker Ranks products for each category using OpenAI semantic vectors. Product catalog, Category catalog, Batch job builder
Batch job builder Groups ranked product-category pairs into OpenAI batch jobs. Embedding pre-ranker, LLM classifier
LLM classifier GPT-4-mini structured-output classifier for one product and one category. Batch job builder, Structured output schema
Structured output schema Reasoning, confidence, and decision fields that improve decision quality and debuggability. LLM classifier, Early stopping monitor
Early stopping monitor Stops processing a category when positive assignment rate falls below a threshold. Structured output schema, Category assignments
Category assignments Final product-category links used in discovery and experiments. Offline evaluation, A/B testing
Offline evaluation MCC, precision, recall, and coverage analysis over labeled category data. Category assignments
A/B testing Online business-metric evaluation of categorization changes. Category assignments

Data flow

For each category, embeddings rank products by semantic similarity; ranked product-category pairs are batched and sent to OpenAI; the LLM returns structured reasoning, confidence, and yes/no decisions; early stopping watches connection rates and stops low-yield batches; results update category assignments and flow into offline/online evaluation.

3 supporting quotes
“we start to use openi vectors to create a first fast ranking of all the products based on one category.”transcript, stated
“Then we group them in batches. We send them you use the OpenAI batch jobs”transcript, stated
“we implement a custom early stopping that would stop at certain points during the batches”transcript, stated

Why this architecture

The winning architecture reduced an enormous classification matrix by using embeddings to prioritize candidates, batch jobs to cut cost, early stopping to avoid long tails, and structured reasoning/confidence fields to improve LLM classification quality.

3 supporting quotes
“this increased a lot the quality of the results. So it was kind of like thinking mode”transcript, stated
“The problem of this approach as you can think of then we need to scale this uh 250,000 products 600 categories”transcript, stated
“if the percentage is lower than this threshold just stop and don't process the rest.”transcript, stated

Models used: OpenAI embeddings · GPT-4-mini

Scale

Alternatives considered (roads not taken)

Manual categorization

Rejected because: Manual tagging was too slow and expensive to scale.

“start with. So it was just a manual”transcript, implied

Semantic vector thresholding alone

Rejected because: Different categories needed different threshold angles and quality was insufficient for excluded categories.

“need a very small angle as a threshold”transcript, stated

One product plus all categories

Rejected because: Quality/cost tradeoffs were worse than a one-product one-category decision with a smaller model.

“one product one category using the smallest model and but good enough that we could use at that time GP for mini”transcript, stated

Patterns

rag-retrieval (candidate-generation)

Embedding similarity retrieves and prioritizes likely product-category pairs before expensive LLM classification.

“using semantic vectors. So we start to use openi vectors to create a first fast ranking”transcript, stated

structured-output-contract (output-control)

The classifier returns reasoning, confidence, and decision fields in a schema to improve quality and debugging.

“adding reason confidence in the decision part we saw that this increased a lot the quality of the results.”transcript, stated

batch-offline-processing (cost-optimization)

OpenAI batch jobs process many product-category decisions asynchronously at lower cost.

“they will process those requests in parallel and they have a 24-hour SLA for the answers.”transcript, stated

eval-driven-development (evaluation)

Offline MCC/precision/recall and online A/B metrics validated the categorization system.

“we first looked at offline evaluation and there the quality improved quite a lot.”transcript, stated

Tradeoffs

Classification unit

Chose one product and one category per LLM decision over larger multi-product/multi-category prompts.

Rationale: The small yes/no task worked well with GPT-4-mini and structured outputs.

“the task that we tried was simple yes or no decision and this we found that that model was quite good”transcript, stated

Cost control

Chose embedding pre-ranking plus early stopping over classify every product-category combination.

Rationale: The full 250k x 600 matrix would create too many API calls.

“250,000 products 600 categories so combination is a lot of API calls.”transcript, stated

Quality validation

Chose offline metrics plus A/B experiment over offline model metrics alone.

Rationale: Business impact needed conversion, quote-rate, and bounce-rate validation.

“we also introduced this LLM based system as an AB test.”transcript, stated

Gotchas (what bit them)

Structured output order affected reasoning quality.

Root cause: Putting the decision before the reason reduced the model's thinking step.

Resolution: Put reasoning before decision and include confidence in the schema.

“it's always better to put the the reason before the decision.”transcript, stated

Batch savings come with a latency SLA.

Root cause: OpenAI batch jobs are cheaper but asynchronous with a 24-hour answer window.

Resolution: Use batch for offline categorization and parallelize by category.

“this the only hard limit was as I said the 24 hours SLA from OpenAI batch jobs”transcript, stated

Long-tail niche categories make exhaustive processing wasteful.

Root cause: Some categories may have only about 100 relevant products.

Resolution: Use embedding pre-ranking and stop category batches when positive assignment rates drop below threshold.

“not process too many products for some niche category where there there could be just like I don't know 100 products.”transcript, stated

Evaluation

GetYourGuide evaluated categorization with MCC, recall, precision, category coverage, and A/B tests on conversion, quote rate, and bounce rate.

Metrics: MCC · recall · precision · category coverage · conversion rate · quote rate · bounce rate

“MCC that is Matthew's correlation coefficient it's a better F1 score that improved really noticeably”transcript, stated
“clear significant improvement of the conversion rate by plus 1.3%.”transcript, stated

Outcomes

The system is a production batch classification pipeline for marketplace categorization, not an agentic user-facing workflow.

“we were able to add 50 more of the existing 325 categories.”transcript, stated
“we enabled another team of adding 295 new categories”transcript, stated