How an LLM is built

An LLM is a transformer-architecture neural network with billions of parameters. Training runs
over enormous text corpora — web pages, books, code — by autoregression: the model learns to
predict the next token from the preceding ones.

After that base training the model goes through RLHF (reinforcement learning from human feedback),
a tuning pass on human ratings that makes it useful and safe in conversation.

Input context:  "Looking for a jacket for winter walks down to -4°F,
                 budget up to $200"

Tokenization → [Looking] [for] [a] [jacket] ... → 18 tokens
The transformer processes the context; attention weighs the relationships
The answer is generated token by token: [For] [temperatures] [down] [to] [-4°F] ...

Where LLMs are used in e-commerce

AI Shopping Assistant

The main commercial application of LLMs in retail is the conversational assistant. The shopper
describes the task in free form — “a gift for my mum’s 60th, she likes gardening, budget $40–70” —
the LLM reads the intent and, using RAG to reach the current catalogue, returns specific
recommendations with an explanation.

Semantic search

Exact-match search cannot handle synonyms or typos. LLM embeddings let you find products by
semantic proximity between the query and the description — “a case that doesn’t slip” surfaces
products with a “non-slip coating” attribute, even though the words never match.

Content generation

Writing product descriptions from attributes, SEO-oriented headlines and answers to common shopper
questions — these are the operational uses of LLMs that need no complex integration.

Limits in commercial products

Risk What it looks like Mitigation
Hallucination The model invents specifications RAG — facts from the catalogue only
Stale knowledge The base model was trained on past data Current context supplied through RAG
Latency Token generation takes time Streaming responses, context caching
Cost LLM API calls cost more than ordinary queries Caching, prompt optimisation