Domain Adaptation of Foundation LLMs for e-Commerce
Christian Herold, Michael Kozielski, Tala Bazazo, Pavel Petrushkov, Patrycja Cieplicka, Dominika Basaj, Yannick Versley, Seyyed Hadi Hashemi, Shahram Khadivi
TL;DR
This work addresses adapting foundation LLMs to the e-commerce domain through large-scale continued pretraining of Llama-3.1 models (8B and 70B) on a 1 trillion-token, mixed-domain corpus with a strong emphasis on e-commerce data. It systematically analyzes hyperparameters (learning rate, data weighting, context size) and demonstrates that careful CPT can preserve general-domain abilities while significantly boosting e-commerce performance, including multilingual benchmarks where gains reach roughly 25%–30%. A model-merging approach is introduced to precisely balance general and domain-specific capabilities without heavy computation. The results offer a scalable blueprint for industry-focused adaptation of open-domain LLMs to domain-specific needs, with practical implications for e-commerce applications such as product listings and pricing tasks.
Abstract
We present the e-Llama models: 8 billion and 70 billion parameter large language models that are adapted towards the e-commerce domain. These models are meant as foundation models with deep knowledge about e-commerce, that form a base for instruction- and fine-tuning. The e-Llama models are obtained by continuously pretraining the Llama 3.1 base models on 1 trillion tokens of domain-specific data. We discuss our approach and motivate our choice of hyperparameters with a series of ablation studies. To quantify how well the models have been adapted to the e-commerce domain, we define and implement a set of multilingual, e-commerce specific evaluation tasks. We show that, when carefully choosing the training setup, the Llama 3.1 models can be adapted towards the new domain without sacrificing significant performance on general domain tasks. We also explore the possibility of merging the adapted model and the base model for a better control of the performance trade-off between domains.
