Square builds RoBERTa-based merchant categorization model achieving ~30% accuracy improvement
Square's merchant categorization relied heavily on self-selection during onboarding, which was highly susceptible to miscategorization. Historical ML approaches used older methods and over-indexed on self-selected data as ground truth, leading to inefficiencies and missed opportunities.
How it works
Common implementation structure
How this type of workflow is generally built, generalized across documented cases — not tied to any one vendor's stack. Click any stage to read what happens there. Specific products that implement these stages appear in “Tools commonly seen” below.
Stage 1 · Daily inference trigger
The model performs inference daily across the platform's vast seller base.
Tools used
RoBERTaDatabricksPySparkHuggingface
Outcome
The RoBERTa model achieved an absolute ~30% improvement in categorization accuracy over existing methods, with per-category accuracy gains including 13% for food_and_drink and 38% for retail, and now powers all Square business metrics requiring merchant category segmentation.
What failed first
Previous ML attempts at Square used older methods, over-indexed on self-selected onboarding data as labels, and narrowly focused on new seller onboarding without leveraging post-onboarding signals.