Ecom Builds a Procurement Encoder: A 14-Attribute Product Card Fits Into 1,024 Tokens
A standard catalog search returns a metal table instead of a wooden one. The dimensions match, but for a procurement officer it is a different product. An ML engineer at Ecom built his own encoder, a model that turns a product card into numbers for search, in which "79" stays attached to "Height, cm." The card includes a name, a description, and up to 14 attributes, for a total of up to 1,024 tokens (a token is a fragment of a word). For procurement, the precision of attributes matters more than overall similarity.
AI-processed from Хабр: Машинное обучение; edited by Hamidun News
A procurement officer needs a wooden table of specified dimensions, but search returns a metal one. The dimensions match, the tabletop is there, and it has four legs, so on the surface everything lines up. For procurement, though, it is a different product.
That is where the write-up on the Ecom project begins: the team needed its own product search and a RAG layer over the catalog. The team's only ML engineer took on the encoder. That is the name for a model that turns a product card into a set of numbers used to find similar items.
The main constraint in the headline is that a card made of a name, a description, and up to 14 attributes must fit into 1,024 tokens. A token here is a fragment of a word, the units the model assembles its input text from. Why read this?
Anyone who searches tables, price lists, or configs runs into the same question: how do you avoid losing the meaning of an "attribute name – value" pair?
Why procurement needs its own search
In a typical online store, an approximate match is forgiven, since the shopper will see that the table is not the right one. Procurement is stricter. Deviations are acceptable only where the requirements explicitly allow them. The system also needs a retrospective view of the market: which offers existed, when, from which suppliers, and at what price. Without that, estimating the cost of a lot, and then of the whole contract, becomes guesswork.
The author carries one example through the entire piece: a procurement officer needs three meters of copper cable, unshielded. One supplier lists length in meters, another in centimeters, and a third sells the cable by the coil. At every stage the same question comes up: on what data can we say that we have found exactly what was requested?
What the model receives as input
A card has three parts. The name defines the product type, for example "Eurobook Sofa." The description adds purpose and details, and it may be empty. The attributes pass properties as "name – value" pairs: "Height, cm" – "79", "Upholstery material" – "Rogozhka."
A number on its own means nothing. Seventy-nine of what: centimeters, millimeters, pieces? In the example, the unit is hidden in the attribute name, so both halves of the pair must reach the model. The same goes for text: "rogozhka" makes sense only next to "upholstery material." The author needed to preserve this link rather than end up with a bag of words in which every number lives on its own.
In standard data preparation, up to 14 attributes are selected, and the total card budget is capped at 1,024 tokens. Feature selection is handled in data preparation, before the model. If an attribute by which a procurement officer tells a suitable product from an unsuitable one did not make it into the input and is mentioned nowhere else, the attention mechanism will not recover it. A neural network can do a lot, but it cannot use a field that was never passed to it.
Why you can't just flatten everything into one line
Each field is tokenized separately, and the resulting sequences are then assembled into one common sequence with separators. A token receives not only its own embedding, a numerical "fingerprint" of the word fragment, but also two structural tags. The first shows where the token came from: the name, the description, an attribute name, an attribute value, or a service position. The second gives the name and value of one attribute a shared number, so the model knows which number belongs to which label.
For practitioners, there are two takeaways. First, when working with tabular and semi-structured data, simply flattening records into a string loses the relationships that were explicit in the source. Structural tags are cheap, and they preserve what would otherwise have to be inferred from context. Second, the token budget should be planned in advance. The 1,024-token ceiling limits the number of features, so the quality of field selection matters as much to the result as the size of the model.
What's next, and what isn't visible yet
The author promises a follow-up. It will cover what the two "towers" of the encoder learn from labeled data, how many cards LSH (fast preliminary candidate filtering) keeps for exact re-scoring, how the ordering of results was evaluated by several LLM judges, and how all of this becomes an estimate of lot cost. That estimate is what matters to a procurement officer far more than any architecture.
A caveat: the available part of the text contains no search quality metrics, no comparison with off-the-shelf embedding models, and no figures on training costs or the cost of running the model. It is too early to claim a win. Still, the engineering principles are already clear and apply well beyond procurement. Don't lose units of measurement. Tie attribute names to their values. Select fields before the model, rather than hoping it will work out what to ignore.
- May 2, 2026Hugging Face releases Ecom-RLVE, a training gym for online-store AI agents
- Feb 3, 2026SQL Without Analysts: How ecom.tech Got Local LLMs to Write Queries
- Apr 28, 2026ecom.tech compares evolutionary fine-tuning of Qwen3-4B with SFT and GRPO for Kotlin tests
- Jul 25, 2026ECoM Reasoning: Compressed Reasoning Speeds Up Voice Models on Spoken Math
Key Questions Answered
Why procurement needs its own search?
In a typical online store, an approximate match is forgiven, since the shopper will see that the table is not the right one. Procurement is stricter. Deviations are acceptable only where the requirements explicitly allow them. The system also needs a retrospective view of the market: which offers existed, when, from which suppliers, and at what price. Without that, estimating the cost of a lot, and then of the whole contract, becomes guesswork.
What the model receives as input?
A card has three parts. The name defines the product type, for example "Eurobook Sofa." The description adds purpose and details, and it may be empty. The attributes pass properties as "name – value" pairs: "Height, cm" – "79", "Upholstery material" – "Rogozhka." A number on its own means nothing. Seventy-nine of what: centimeters, millimeters, pieces? In the example, the unit is hidden in the attribute name, so both halves of the pair must reach the model.
Why you can't just flatten everything into one line?
Each field is tokenized separately, and the resulting sequences are then assembled into one common sequence with separators. A token receives not only its own embedding, a numerical "fingerprint" of the word fragment, but also two structural tags. The first shows where the token came from: the name, the description, an attribute name, an attribute value, or a service position. The second gives the name and value of one attribute a shared number, so the model knows which number belongs to which label.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
Waitlist: free vibecoding intensive + AI digest
Leave your email to reserve a spot in the free 2-day intensive and get the AI stories that matter.