---
title: "How we think about text classification in the LLM era"
description: "Medium replaced its aging NSFW story classifier with a prompt-based LLM classifier that runs inside Snowflake Cortex SQL queries."
url: "https://swe.quest/articles/how-we-think-about-text-classification-in-the-llm-era-a6b9a6bf775ffc1a"
canonical: "https://medium.engineering/how-we-think-about-text-classification-in-the-llm-era-89a185f79b68"
source: "Medium Engineering"
published: "2026-08-19"
difficulty: "medium"
kind: "Case study"
reading_minutes: 13
tags: ["llms","machine-learning","evals","cost-optimization"]
---

# How we think about text classification in the LLM era

A post on [Medium Engineering](https://swe.quest/sources/medium-eng.md), published 2026-08-19, 13 min read, Case study. Original: [https://medium.engineering/how-we-think-about-text-classification-in-the-llm-era-89a185f79b68](https://medium.engineering/how-we-think-about-text-classification-in-the-llm-era-89a185f79b68)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Machine learning](https://swe.quest/tags/machine-learning.md) (AI & ML)
- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)
- [Cost optimization](https://swe.quest/tags/cost-optimization.md) (Reliability & operations)

## Prerequisites

- binary classification metrics ([easy posts on Observability](https://swe.quest/tags/observability.md?difficulty=easy))
- SQL ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- LLM prompting basics ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))

## Keywords

Snowflake Cortex, Mixtral 8x7b, Claude Haiku, Medium, NSFW classification

## Related posts

- [Stop Building Models. Start Building Systems.](https://swe.quest/articles/stop-building-models-start-building-systems-12c2ba76d9e8ec33.md): Scribd Tech · 2026-07-11 · Medium · 8 min read · LLMs, Evaluation, Data pipelines, Machine learning
  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.
- [Investing in Performance: Fine-tune small models with LLM insights - a CFM case study](https://swe.quest/articles/investing-in-performance-fine-tune-small-models-with-llm-insights-a-cfm-case-116aeecc59f2bbd4.md): Hugging Face · 2024-12-03 · Medium · 23 min read · Model training, LLMs, Inference & serving, Cost optimization, Python
  Capital Fund Management built a financial named-entity recognition pipeline that extracts company names from Benzinga news headlines in the FNSPID dataset.
- [An updated Clairic and Clairic-flash are now open-weight, from the new Workers AI Superintelligence team](https://swe.quest/articles/an-updated-clairic-and-clairic-flash-are-now-open-weight-from-the-new-workers-663f14e1266fe2c4.md): Cloudflare · 2026-11-18 · Easy · 6 min read · LLMs, Inference & serving, Evaluation
  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.
- [Data-Centric Machine Learning: Building Shopify Inbox’s Message Classification Model](https://swe.quest/articles/data-centric-machine-learning-building-shopify-inbox-s-message-classification-89547c88c3590e73.md): Shopify Engineering · 2022-07-21 · Medium · 12 min read · Machine learning, Model training, Privacy, Communications
  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.
- [Opinion Classification with Kili and HuggingFace AutoTrain](https://swe.quest/articles/opinion-classification-with-kili-and-huggingface-autotrain-97ebbffd8c146463.md): Hugging Face · 2022-04-28 · Medium · 18 min read · Machine learning, Model training, Python
  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.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
