Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Medium Engineering 13 min read Case study mediumAdept

How we think about text classification in the LLM era

Medium replaced its aging NSFW story classifier with a prompt-based LLM classifier that runs inside Snowflake Cortex SQL queries. It needs only a human-labelled evaluation set, oversampled to a 50/50 split, plus curator-written guidelines. Mixtral 8x7b matched or beat the legacy model on precision and recall for about $250/month, scoring only distribution-eligible stories. The team judged LLMs a poor fit for its topic and spam models. Topic labels come free from writer tags and let that model adapt to trends, while spam is an adversarial, full-volume workload where a static model and fixed prompt fall behind and costs rise.

Related posts

  • Stop Building Models. Start Building Systems.

    Scribd Tech mediumAdept

    A repeatable human-in-the-loop pipeline let a three-person team (engineer, SME, data scientist) classify roughly 25M Slideshare slideshows and 350M Scribd documents for adult content in about two months. A cheap fast model labels the whole corpus via asynchronous batch inference with short rationales. A stronger judge model re-checks a 0.1% random sample, and SMEs review only the disagreements plus spot-check agreements in Google Sheets, with corrections ingested into Databricks as a versioned golden dataset. Practical guidance covers standardized inputs, prompt/model version tracking, validating on a 1% corpus slice beyond the curated golden set, tracking disagreement and SME correction rates, and handling failure modes such as idempotent batch retries and Sheets bottlenecks.

  • Investing in Performance: Fine-tune small models with LLM insights - a CFM case study

    Hugging Face mediumAdept

    Capital Fund Management built a financial named-entity recognition pipeline that extracts company names from Benzinga news headlines in the FNSPID dataset. Llama 3.1-70B, served on Hugging Face Inference Endpoints, pre-labels the headlines using a structured few-shot prompt and JSON-schema guided output, and humans then review those labels in Argilla. Fine-tuning compact models such as GLiNER and SpanMarker on the curated labels raises F1 to 93.4% and 90.1%. That approaches the 95% zero-shot F1 of Llama 3.1-70B at up to 80x lower inference cost. The walkthrough includes endpoint setup, prompt design, async batched requests with AsyncInferenceClient, and a comparison against weak supervision.

  • An updated Clairic and Clairic-flash are now open-weight, from the new Workers AI Superintelligence team

    Cloudflare easyNovice

    Cloudflare has released open weights for a redesigned 27B Clairic extraction model and a new 9B Clairic-flash, both hosted on Workers AI and published on Hugging Face. The new architecture replaces the preview's single forward pass with parallel slot autoregressive generation per field, plus special heads for estimates, durations, calculated dates and arithmetic. It also adds PDF input (up to four images or pages) while keeping the typed API with confidence scores and character spans. Self-reported internal evals show near-perfect field accuracy versus Liquid AI's D1.2 and ScaleDown, with p50 latencies of roughly 155–690 ms. Pricing is $0.24/M input tokens for Clairic and $0.10/M for Clairic-flash, with Clairic discounted to $0.10 until December 1, 2026.

  • Data-Centric Machine Learning: Building Shopify Inbox’s Message Classification Model

    Shopify Engineering mediumAdept

    Shopify Inbox's message classifier improved from ~70% to ~90% accuracy, and from ~35% to ~80% high-confidence coverage, by investing in better training data rather than model tweaks. The v1 prototype used Universal Sentence Encoder embeddings with UMAP/HDBSCAN clustering and semi-supervised labeling on 40,000 examples. For v2, the team fine-tuned DistilBERT on 20,000 human-labeled messages. Those labels came from a 45-topic taxonomy built with support advisors and domain experts, refined through inter-annotator agreement exercises, and scrubbed of personal information with Presidio and Faker. Model predictions were then used to surface underrepresented topics for further annotation.

  • Opinion Classification with Kili and HuggingFace AutoTrain

    Hugging Face mediumAdept

    Kili's annotation platform and Hugging Face AutoTrain combine into an active-learning pipeline that classifies about 40,000 Google Play reviews of the Medium app into Subscription, Content, Interface and User Experience, then applies sentiment analysis to the classified reviews. The walkthrough covers creating a Kili labeling project through the web UI and the Python API, uploading data in batches of at most 100, and flagging changed samples between dataset versions for re-review. It then exports the labels to CSV and trains a model with AutoTrain and a second one without it.

The quest for software engineering knowledge.

Look:
Layout: