Language models for text classification: From bag-of-words to Jev
TL;DR Highlight
A history from bag-of-words to transformers explains why Jev is more than just a text classifier.
Who Should Read
A backend or ML engineer deciding whether to use an LLM or build a dedicated classifier for text classification.
Core Mechanics
- Jev is a classifier, but not just a classifier
- The author says GPT and open-weight LLMs can do the same classification, but Jev is faster and cheaper.
- For a narrow, well-defined problem, he expects it not to beat a special-purpose classifier.
- Its selling point is being far more general than task-specific models.
- Bag-of-words plus logistic regression is still the baseline
- It counts each vocabulary word into a fixed-size vector that classic classifiers can consume.
- It loses word order, so "the dog bites the man" and "the man bites the dog" look identical.
- On IMDb (balanced dataset) it reached 89.9% accuracy.
- The LSTM RNN actually lost on the same data
- An LSTM trained from scratch got 85.66% on IMDb, below the 89.9% of bag-of-words logistic regression.
- Its higher training accuracy indicated substantial overfitting.
- ULMFiT (2018), which pre-trains then fine-tunes, reached 95.4% test accuracy on IMDb.
- Text CNNs run in parallel and do fine
- Learned filters slide over windows of adjacent word embeddings, then global max pooling gives a length-independent vector.
- Filter computations run in parallel across positions, unlike the step-by-step RNN.
- The author's experiment got 90.07% on IMDb, with the caveat that it depends heavily on architecture.
- Encoder models reach about 95% with little effort
- Fine-tuning the 2024 ModernBERT on IMDb gave roughly 95% with minimal tuning.
- The author did little hyperparameter tuning and thinks 1-2% more is possible.
- ModernBERT is his go-to for classification tasks.
- Decoder LLMs get a classification head instead of the output layer
- He calls direct prompting brittle and inefficient when you need structured outputs in a specific domain.
- Swapping the output layer for a leaner classification head is the alternative.
- GPT-2 124M reached about 92% on IMDb.
Community Reactions
- Opinion that hype outran reality
- Some commenters said people uncritically cited AGI, system 1, and "no hallucinating" claims.
- Game demos (Doom, Minecraft) rarely explained they used game state as input, which misled people.
- Experience: Jev looked promising for email classification
- One commenter is comparing email classification strategies and says Jev looks promising.
- They wrote up the comparison at housecat.com/blog/classifying-email.
- View that this is the ChatGPT moment for classification
- Commenters said the excitement is cheap classification of many text types without fine-tuning a custom classifier per task.
- Addition: continuous bag-of-words bridges the gap
- A commenter pointed to averaging or summing word embeddings per document as a middle step.
- They said pretrained embeddings help on small datasets, and fastText works this way.
How to Apply
- Build a logistic regression baseline first
- Run TF-IDF plus logistic regression on your labeled data within 30 minutes and record accuracy.
- Use that number as the yardstick for LLM prompting or fine-tuned models.
- Shortlist ModernBERT fine-tuning for fixed-label tasks
- If your labels are fixed, compare prompt classification and ModernBERT fine-tuning on the same test set for accuracy, latency, and cost.
- Start with minimal tuning and check the default results first.
- Decide on Jev by the scope of your task
- Keep a dedicated classifier for a narrow, single, well-defined task.
- For multi-purpose classification with changing labels, add a general classification API like Jev to the candidates and measure cost and speed.
Try It
# Paste into Claude or ChatGPT (simplified version of the article's idea: choosing a classification approach)
I'm building a text classification feature. Compare the options given these conditions.
- Task: {{task description}}
- Label list: {{labels}}
- Number of labeled examples: {{count}}
- Daily request volume and latency target: {{volume and latency}}
Compare four options: (1) TF-IDF + logistic regression, (2) ModernBERT fine-tuning, (3) LLM prompt classification, (4) a general classification API.
Put expected accuracy, speed, cost, and maintenance burden when labels change in a table, and suggest the order of baselines to try first.
Next step: ask it to write scikit-learn code for option 1 matching {{my data format}}.Terminology
Related Papers
Gemini 4 Neon is the new #1 on the Models Engineering Index
Gemini 4 Neon ranks first on the Models Engineering Index with 68.0, combining multiple benchmarks.
LLMs can read and write executables byte by byte from a hex dump
Given only a hex dump and no tools, an LLM analyzed, patched and wrote working executables.
Claude was trained on protein sequences at scale
Next-amino-acid tests on obscure proteins show only the latest Claude models predict them
Remembered as Brief: Stored Preferences SilentlyRemove Decision-Critical Information
A stored 'keep it short' preference silently drops warnings; listing must-know points first restores content.
All AI-generated code should be Open Source
A blog argues AI-generated code should be open source; most HN commenters disagreed.
What thousands of conversations look like inside a language model
Mapping Qwen3-1.7B states showed Chinese sitting apart from English, while German and Croatian overlapped it.
AI, activity, and outcomes in software engineering
AI sped up writing code, but shipping speed did not rise as much, says a talk
LLMs Play Zachtronics' TIS-100
16 LLMs played TIS-100 and set 133 new Pareto frontier points across 18 puzzles