Cost savings by using DeepSeek R1 for Product Taxonomy Classification
Problem statement
We’ve recently encountered a challenge: automating the classification of a large volume of products into a specialized taxonomy without a sufficient annotated dataset for a classification model training. Our client operates an online marketplace that aggregates goods from various sellers, with each employing different data quality standards and diverse data population methods. On average, we process around 1,000 products daily, and our database consists of over 100,000 products spanning more than 2,000 categories.
Overall solution architecture
To address our classification needs, we developed a reasoning-driven LLM agent designed to map products to the most appropriate categories based on detailed product attributes.?
Our primary steps included:
Within the pilot version and limited amount of request, we relied on GPT-4o for this task. However, after the successful pilot before the production usage where it should have replaced all manual checks, we decided to replace it with self-hosted LLM and after testing chose DeepSeek R1 Mini.
Transition to DeepSeek R1 Mini
By leveraging LangGraph, we decoupled our solution from specific model dependencies, enabling a seamless switch from GPT-4o to R1 Mini. We used Ollama's wrapper for model communication, requiring no additional modifications to our existing infrastructure.
领英推荐
Key differences
Switching to the R1 Mini introduced the need for a slightly different output pattern, as it incorporates a built-in reasoning phase not present in GPT-4o. Consequently, we adjusted our LangChain-based pipeline by adding an extra processor to align with the R1 Mini's format specifications. Beyond that minor alteration, our workflow remained largely intact, thanks to the robust abstraction layer provided by LangGraph.
Results and benefits
Conclusion
Shifting to the DeepSeek R1 Mini provided both financial relief and flexibility, all without sacrificing classification precision. The ability to effortlessly switch models – made possible by LangGraph – proved critical for maintaining a smooth operational flow. We expect this approach to remain sustainable and cost-effective as our product listings continue to expand.
#AI #DeepLearning #ProductClassification #LangGraph #CostOptimization
A lot to think about in terms of cost-efficient technologies