LIVE · Thursday 3 December

Best LLM for Custom Product Taxonomy Classification: GPT-6 Luna on a Retrieved Shortlist, Then Test

No public benchmark names a winner for classifying ecommerce products into your own taxonomy. A cheap model choosing from a retrieved shortlist is the sensible start, and the final choice comes from a test on your own labeled products.

By Thomas8 min read

For classifying products into an existing custom taxonomy, start with OpenAI's gpt-6-luna choosing from a short list of candidate categories that an embedding search retrieves. Luna accepts text and images, costs $0.10 per million input tokens, and its Decisions API returns one of the categories that you supply. No published product taxonomy classification benchmark compares Luna, GPT-6.2 Astra, Claude and specialized models on the same custom taxonomy, so nobody can name a universal winner. The model that wins on your catalog is the one that scores best on a labeled sample of your own products.

Classifying into a taxonomy is a different job from building one

Classification means that a product arrives and the system assigns it to a leaf of a taxonomy that already exists. That is different from creating a taxonomy, where a model proposes new categories, and from writing product listings, where a model generates titles and descriptions. Benchmarks for those two jobs do not measure classification, so their results do not transfer to it.

A taxonomy is ready for a model when each leaf has four things written down:

  • A stable category ID that does not change when a label is renamed, so that stored results stay valid.
  • The full path from the root, such as "Electronics > Computers > Laptops", so that the model sees the context of the leaf.
  • A definition with exclusions, which states what belongs in the category and what belongs in its closest neighbor instead.
  • A few examples of confusing products, which show how a borderline item was decided before.

The taxonomy also needs one extra outcome that is not a category: "needs review". A product with a missing description or an ambiguous intended use should land there instead of in a wrong leaf.

A large taxonomy has to be cut down to a shortlist first

A full product taxonomy is too large to give a model as a fixed list of answers. Shopify's public classification dataset contains 10,476 distinct categories. OpenAI's Structured Outputs guide caps a schema at 1,000 enum values across all enum properties. So a constrained answer field cannot hold every leaf of a taxonomy of that size.

The workable design therefore has two stages. A retriever finds the 10 to 50 categories that are closest to the product, and a second model picks one of them. A 2024 paper at an ACL workshop on customizable language processing describes this pattern for ecommerce. In its "Dual-Expert" design, a fine-tuned domain model proposes the top candidates and a general LLM compares them and chooses. Shopify's public dataset follows the same idea and ships a potential_product_categories field of candidate paths with each product.

The two stages fail in different ways, so they have to be measured separately:

  1. Shortlist recall measures how often the correct leaf appears among the retrieved candidates. If the right category is missing, no reranker can choose it.
  2. Reranker accuracy measures how often the second model picks the correct leaf when it is present in the shortlist.

A cheap way to build the first stage is to embed each category's path and definition once, and then embed each product. OpenAI's text-embedding-3-small costs $0.02 per million tokens, and OpenAI lists classification among its uses.

The model choices differ in how they return a category

Four kinds of model can fill the second stage. They differ in price, in how they return an answer and in how much control you have.

  • GPT-6 Luna through the Decisions API returns one of your supplied options with a probability for each. OpenAI describes Luna as its "most efficient model for focused, high-volume tasks". The Decisions API accepts text, images and JSON, charges only for input tokens and supports only gpt-6-luna. OpenAI says the API returns answers about 10 times faster than its Responses API. The Decisions guide does not state a maximum number of options per question.
  • A larger hosted model with structured outputs is the comparison to run on hard cases. OpenAI positions GPT-6.2 Astra as its "most capable model", at $8 per million input tokens and $40 per million output. Anthropic's Claude Haiku 5.5 is priced like Luna, at $0.10 input and $0.50 output per million tokens, and supports structured outputs through constrained decoding.
  • A fine-tuned open model is what Shopify runs at its scale. Its July 2025 engineering post reports three successive vision models: LLaVA 1.5 7B, LLaMA 3.2 11B and, at the time, Qwen2VL 7B. Shopify reports that each switch raised accuracy and cut GPU needs. Luna's model page lists fine-tuning as not supported, so Luna itself cannot be tuned.
  • A ready-made decision model is a fourth route. Parsec's TOD is released as LoRA adapters on Google's gemma-4-12B-it together with a ModernBERT retriever, so it already contains both stages. Its predict call takes a state, a list of options, a question and optional images, and it returns one probability per option. The base weights are not included, and users must accept the Gemma 4 licence. Parsec's TOD page prices hosted use at $0.30 per 1,000 decisions, or $300 for a million products. The page does not mention product classification, and Parsec reports there that the release scored below its own untrained base model on a public decision benchmark. TOD has not been tested on a product taxonomy in any published result.

Images matter for some products and not for others. Shopify's post notes that key attributes sometimes appear only in product photos, and its human annotators review images alongside text. Whether images change accuracy on a given catalog has to be measured by running the same products with and without the photo.

A valid answer is not the same as a correct answer

Structured outputs and choice APIs solve the format problem, not the accuracy problem. OpenAI's guide states that Structured Outputs constrains a completed, non-refusal response to your schema. Anthropic says that its structured outputs guarantee schema-compliant responses through constrained decoding. Both mean that the model returns a category ID from your list. Neither means that the ID is the right one.

Your application still has to check three things after every call:

  1. The returned ID exists in the current taxonomy version.
  2. The ID is a leaf and is consistent with any parent category that the product already carries.
  3. The confidence is above the threshold that you set for automatic acceptance.

That threshold has to come from labeled data. OpenAI advises in its Decisions guide that developers use "labeled examples from your application to set thresholds" and weigh the cost of false positives against false negatives. A probability of 0.9 from a model is a score, not a proof. You learn what it means for your catalog only by checking how often 0.9 answers are correct on products whose category you already know.

The right starting model depends on volume and on how hard your edge cases are

Teams with a few thousand to a few million products a month should start with an embedding shortlist and Luna through the Decisions API. It is the cheapest hosted option per call, and it returns a category with probabilities that can drive a review threshold. Run Astra or Claude on the products that Luna sends to review. A larger model is worth its price only if it clears enough of that queue.

A fine-tuned model is worth testing when volume is very large or when the taxonomy encodes business rules that prompts do not capture. Shopify reached that point at over 10 million product updates a day, when it found commercial APIs "prohibitively expensive" at its volume. Tuning should be judged on held-out products against the frozen baseline, because a tuned model does not always beat the model that it started from.

Your own benchmark should measure cost per correct product

A useful test set comes from your own catalog. Shopify's practice is a model to copy: its test labels come from human annotators who resolve ambiguities and provide gold labels. For training data, Shopify uses several LLM annotators and an LLM arbitrator that can abstain and fall back to a human.

A test set of this kind should follow five rules:

  1. Keep near-duplicate products, such as color variants of one item, in the same split, so that the test does not reward memorization.
  2. Include rare leaves, products with incomplete descriptions, products with an ambiguous intended use and products whose deciding evidence is only in the photo.
  3. Give every model the same candidate shortlist and the same category definitions.
  4. Pin the model version, and record the hardware and numeric precision for any model that you host.
  5. Run text-only and text-plus-image conditions separately.

The accuracy numbers to report are exact leaf accuracy, macro-F1 so that rare leaves count, and the share of errors that land in a sibling or parent category. The operating numbers are the share of products sent to review at your chosen error rate, latency, and cost per correctly categorized product. That last figure is the one that settles the choice. It divides the total spend, including human review, by the number of products that end up in the right leaf.

Shopify's product-catalogue dataset on Hugging Face is a public fixture for use before your own labels exist. It has 48,289 products, a 38,631 and 9,658 train and test split, an image field for each product and an Apache 2.0 licence. Its card does not describe how the labels were made, does not name the taxonomy version and does not mention how near-duplicates were handled. Results on it show how models handle Shopify's taxonomy, not yours.

At list prices, a million products a month cost $150 on Luna and $12,800 on Astra

List prices settle the cost side even before accuracy is known. Take 1 million products a month. Assume 400 tokens of product text and a shortlist of 20 candidates at 40 tokens each, plus 300 tokens of instructions, for 1,500 input tokens per product. Assume a 20-token answer for models that bill output, and no prompt caching. Image tokens are left out.

Option Monthly model cost
Embedding shortlist with text-embedding-3-small $8
GPT-6 Luna, Decisions API $150
GPT-6 Luna, structured outputs, reasoning off $160
Claude Haiku 5.5, structured outputs about $208
GPT-6.2 Astra, structured outputs $12,800

The Luna figures are 1.5 billion input tokens at $0.10 per million, plus $10 of output for the structured-output version. Luna's default reasoning effort is medium, and reasoning tokens would add to that bill. Haiku 5.5 has the same list price as Luna, but Anthropic says that its newer tokenizer produces about 30% more tokens for the same text. Astra is 1.5 billion tokens at $8 plus 20 million at $40.

Human review can cost more than the model. At a 10% review rate, 100,000 products a month go to a person. How many products a calibrated threshold sends to review has not been measured for any of these models on a custom taxonomy.

Sources

More in Models

All Models →