Articles · 2026 · Reading: 15 min, plus 2 in closed details.
Article · explainer · Ahead of AI (magazine.sebastianraschka.com) · updated 2 October 2026

Language Models for Text Classification: From Bag-of-Words to Jev

Sebastian Raschka · published 29 September 2026

In one line: A free long explainer (about 36 minutes, 39 figures, linked code) that follows text classification on IMDb reviews from bag-of-words logistic regression (89.9%) through LSTMs, CNNs and fine-tuned transformers to TypeSafe's Jev decision model, which scored 96.47% on the 25,000 test reviews with no IMDb training for $0.65 in one run by the author; it sketches a Jev-like API on any transformer and relates Jev's unpublished training method to RLCR, a published reward for calibrated confidence.

96.47% IMDb, untrained
Jev's Choice API on the 25,000 test reviews, no IMDb training, 22 minutes and $0.6492; Noul gave 96.20%
one run each by the author; IMDb may be in Jev's training data · in the article: Section 3.3
89.9% bag-of-words
the logistic regression baseline he still starts with; an LSTM from scratch got 85.66%, pretrained ULMFiT 95.4%
from his notebooks; three different test sets across the ladder · in the article: Section 1.1
0.37 to 0.03 ECE
RLCR against plain RLVR on HotpotQA (Qwen2.5-7B) at 62.1% against 63.0% accuracy
the RLCR paper's Table 1(a), checked · in the article: Section 5.2

How far to trust it: A clear, correct history and an honest hands-on test of Jev; read the IMDb numbers as single runs on three different test sets of a benchmark Jev may have seen. The Jev-like design and the guess of a small ModernBERT-like model are not how Jev works: earlier measurements show it reads its options together and has frontier-scale knowledge, and the benchmark the article cites found Jev badly calibrated on one of three datasets. The evidence, judged.

Updated: the first archived copy (29 September 11:07 UTC, 17 minutes after publication) has no Section 5.3 and no updates; by 20:18 UTC the author had added Section 5.3 (answering a reader's question) and Updates 1 and 2; by 2 October, the 1961 naive Bayes reference, a missing symbol in the RLCR reward and the note that calibration worsened one of nine datasets, each prompted by a reader comment.

The idea in one sentence: every text classifier from word counts to fine-tuned transformers had to be trained on its task; Jev's novelty is breadth, one hosted model that reads the label descriptions in each request and returns a probability per label with no training, which Raschka shows end to end on IMDb movie reviews.

What this page is for. The concepts have owners: Classical ML, Sequence models, Families and objectives, calibration on Probability for ML, and Jev as a product on Other notable providers. This page keeps what the article adds (one task through every generation, a measured Jev run, a Jev-like recipe, RLCR) and checks it against Jev's documentation and the measurements made around it.

You need: logistic regression (Classical ML, section 1); encoders against decoders (Families and objectives, sections 1 and 4); calibration and temperature scaling (Probability for ML, section 8); RLVR's binary reward (RL for LLMs, section 5).

New terms: bag-of-words (word counts over a fixed vocabulary, order lost); classification head (a small layer mapping one hidden state to class scores, in place of the output layer); decision model (TypeSafe's "System One model": text and typed questions in, a probability per allowed answer out, no text generated); Choice, Noul, Score (Jev's question types: one of N options, a yes probability, an ordered rating); RLCR (RL with calibration rewards); independence of irrelevant alternatives (adding an option cannot change the odds between two others).

One task through every generation: the untrained decision model lands on top, on test sets that are not all the same
● trained on IMDb○ no IMDb trainingofficial 25,000 test10,000 of a reshufflehalf of a shufflenot stated
IMDb accuracy from the article's text (exact values from its code's README where it rounds), with each test set read from the linked notebooks. Official 25,000 test reviews: LSTM 85.66%, ULMFiT 95.4%, Jev Choice 96.47% and Noul 96.20%. 10,000 from a reshuffle of all 50,000: text CNN 90.07%, GPT-2 124M 91.88%, ModernBERT large 95.07%. Half of a shuffled 50,000: bag-of-words logistic regression 89.9%. Not stated: Laya 92.33%, Contrastive Language Models 82.90%. Single runs; the binomial standard error (0.1 to 0.3 points) is smaller than what the split and tuning change.

1. Before transformers: count the words, or read them in order

Section 1

Bag-of-words with logistic regression scored 89.9%, and the author still starts every text problem with it. Each vocabulary word gets one position holding its count, so any text becomes a fixed vector and a linear model learns which words push towards which label; word order is lost (the dog bites the man and its reverse are one vector). He calls it logistic regression remains my go-to baseline, the instinct a later test of Jev took up (responses). A Hacker News commenter named the step the article skips: averaged word vectors, as in fastText.

Reading in order did not help until the model was pretrained. An LSTM trained from scratch overfit: an LSTM RNN achieved only 85.66% accuracy. ULMFiT (2018) pretrained the same kind of network as a language model, fine-tuned it, and achieved an impressive 95.4% test accuracy on IMDb: on the same test set, pretraining bought 9.74 points, the lesson the rest of the article builds on and one our Sequence models page does not tell. A text CNN slides filters over windows of word vectors and max-pools over positions so any length gives a fixed vector (global max-pooling would be a better option here); such a CNN gets about 90.07% accuracy. One aside is loose: state-space models are not still has to be processed sequentially in training, where a parallel scan covers the sequence (Mamba).

2. Transformers: three ways to get one label

Section 2

An encoder reads a classification token; a decoder must read its last token. BERT-style models have a classification token at the first position that sees the whole text, so a small head on it is fine-tuned (ModernBERT gets approximately 95% accuracy). A GPT-style model gets a small head too, but under the causal mask only the last position has seen everything, so the head reads the final non-padding token's hidden state (GPT-2 124M, about 92%). An encoder-decoder can do either, or train its decoder to write the label, which the article names call this approach text-to-text classification; prompting a chat model is that without training, unnecessarily brittle and inefficient for a fixed domain. Which family wins at equal size is on Families and objectives; its newest encoder-decoder example, being DeepSeek V4.1 Flash, is not there yet.

The hero's accuracies are not one experiment. They come from three test sets (checked in the linked notebooks). Read the ladder for its two big steps, pretraining (about +5 points) and no training at all at the top, not for one-point gaps.

3. Jev: three question types, and 96.47% on IMDb without training

Section 3

Jev takes text and typed questions and returns probabilities, not text. TypeSafe launched it on 15 September 2026 with three main API types: Choice (one of N described options, a probability each and a confidence), Noul (one yes probability; several make a multi-label classifier) and Score (a level on an ordered rubric). The article's framing is the useful one, the ChatGPT moment for classification: one general model instead of a classifier per task. Prices, vendor speed claims and the decision models that followed are on Other notable providers. The confidence field is different from the probability assigned to the winning class: TypeSafe's docs define it as (pmax − 1/n) / (1 − 1/n), so a binary answer at 0.74 has confidence 0.48; calibration lives in the probabilities.

On the 25,000 test reviews Choice scored 96.47% in 22 minutes 24 seconds for $0.6492 (Noul 96.20%, $0.6345), above every trained model in the article, with no IMDb examples. The author names the catch: we don't know if the IMDb test set was in Jev's training data, and IMDb has been public since 2011. A repeat run differed slightly, and the Choice to Noul gap (67 reviews, 0.27 points) is within that noise. A fine-tuned ModernBERT matched it after 23 min to fine-tune on the training set, and can do nothing else. So the old rule (a cheap LLM for one-off decisions, fine-tune a custom classifier if we want to repeat them) gains a middle option, still beaten by a tuned specialist on a narrow high-volume task.

One comparison is attributed loosely. The article says Jev claims to be on par with GPT-5.6 Luna; TypeSafe's launch text names GPT-5.6 Terra as closest "at intelligence to Jev on average", and its workflow evaluations measure agreement with GPT-6 Astra and Fable 5.1, not correctness.

4. A Jev-like API on any backbone: one score per option

Section 4

The recipe gives the head a single output and runs it once per option. For each option the model reads the text, the instructions and that option's description; the head turns the final hidden state hi ([CLS] in an encoder, the last non-padding token in a decoder) into a score si = w·hi + b, and a softmax across the options gives the probabilities. The same w and b score every option, so options can be added or reworded without changing the model; backbone and head train together with cross-entropy. It is a cross-encoder reranker's shape (Rerankers). The author built one on ModernBERT and kept it: trivial to put a Jev-like API on a model, not to make it work on unfamiliar tasks.

Two consequences go unstated. It costs one forward pass per option (up to 255 at Jev's limit), which two readers raised. And it obeys the independence of irrelevant alternatives: each score ignores the others, so the odds between two options stay es1−s2 whatever is added (the figure).

Jev does not behave like that. Twelve days before the article, Archer Hume added an irrelevant fifth option to a four-way question and the log-odds between two existing options fell from +0.38 to +0.11, lower in all ten blocks; TypeSafe's own docs warn that Choice answers lean toward the first option. Jev reads a question's options together. The recipe still works for a clone; it is not a description of Jev.

Scoring each option on its own fixes the odds between two options; adding a fifth option moved Jev's
Top, the article's design with illustrative scores (bank 0.9, provider 1.4, customer 0.6, unknown 0.3; then "bad weather" −0.4): every probability shrinks (customer 0.188 to 0.176, unknown 0.139 to 0.130) but log(pcustomer/punknown) stays +0.30. Bottom, Jev 1.13.0 measured by Archer Hume (17 September 2026, ten blocks): +0.38 to +0.11, mean change −0.28 (95% interval −0.36 to −0.19); a set-dependent softmax temperature could also explain it.

5. Guessing Jev: a small encoder, synthetic data, a calibration reward

Section 5

The architecture guess is contradicted by what was known. The author guesses using something small similar to ModernBERT, to explain the low latency. TypeSafe's FAQ says "Jev is neither small nor an LLM", and Hume measured 84.6% on MMLU-Pro, which he reads as frontier-scale pretraining. Latency fits a large model too: Jev only reads, with no token-by-token decoding. On data the article is on firmer ground: 100% of our data is synthetic matches the launch post, and his anecdote (hand-labelling 300 more examples resulted in a >10-20% accuracy boost, where days of tuning gave 2 to 5) is the right lesson for a clone builder.

RLCD is unpublished, so the article explains a published cousin, RLCR, with no officially established connection between the two. RLVR rewards a right answer 1 and a wrong one 0, so guessing pays. RLCR (Damani et al., MIT, 2025) has the model state a confidence q after its answer and rewards R = c − (q − c)²: correctness minus the Brier penalty. Wrong at 0.9 earns −0.81, wrong at 0.2 earns −0.04, right at 0.9 earns 0.99. Because the Brier score is proper, honesty maximises the expected reward: a model right 70% of the time earns 0.49 by saying 0.7, 0.45 by saying 0.9 and 0.40 by saying 1.0 (the figure). With Qwen2.5-7B on HotpotQA it cut ECE from 0.37 to 0.03; on six other datasets from 0.46 to 0.21, with accuracy 53.9% to 56.2% (Table 1(a), checked). The paper's baselines are RLVR and post-hoc classifiers, not over regular RLVR with temperature scaling.

For a model that writes no text, the author drops the RL and adds a Brier term to cross-entropy: on his ModernBERT, a modest improvement over regular temperature scaling across nine datasets, worse on one (AG News, a note a reader prompted). His analogy names since Direct Policy Optimization (DPO) is a cross-entropy alternative to RLHF: it is Direct Preference Optimization (Alignment).

The RLCR reward: confident and wrong costs most, and a model right 70% of the time earns most by saying 0.7
R = c − (q − c)² against stated confidence q: right answers earn 1 − (1 − q)², wrong ones −q². Marked: the article's worked values, right at 0.9 (0.99), wrong at 0.9 (−0.81), wrong at 0.2 (−0.04). Dashed: the expected reward when right 70% of the time, 0.7 · (1 − (1 − q)²) − 0.3 · q², peaking at q = 0.7 with 0.49. Calculated, not measured.

6. Is calibration needed if you train with cross-entropy?

Section 5.3

In expectation no, in practice yes, in a section added on publication day after a reader asked. Cross-entropy is proper, so a model that reached the true probabilities would be calibrated. A real network keeps lowering its training loss by growing more confident, so networks overfit to NLL without overfitting to the 0/1 loss (Guo et al.). Hence the article's conclusion: a Brier term adds little in supervised training and matters in RL, where nothing else scores the stated probability. A reader added what it leaves out: one fitted temperature does not survive a shift in inputs, which is where an agent's decisions go.

7. Who it is for, the clones, and OpenAI's answer

Section 6

The use the article cares about is inside agent harnesses: a pre-screener for regular LLM-agent harnesses looking for prompt injection, choosing a reasoning effort or a skill, judging. One measurement cuts against the screener: one ordinary sentence inside a complaint moved 55% of Jev's routing decisions (responses), so the screen can be steered by what it screens (Guardrails; decision models as judges on LLM-as-judge).

The clones fall short on breadth, and the comparison the article cites hides a calibration failure. Contrastive Language Models scored its IMDb test accuracy is just 82.90%, Laya 92.33%, and both failed his Tetris test (a reader noted Jev's launch demos played games, so the test favours Jev's training data). For GLiNER the article says based on a benchmark, Jev is definitely stronger; that benchmark, 100 examples per dataset, also found Jev tied on emotion with far worse probabilities, ECE 0.351 against 0.117. For an article about calibrated decisions, that is the result to report. Its one reported weak spot, legal reviews in non-English languages, is a reader's anecdote.

The conclusion holds: nothing in Jev is new as an idea, its breadth is, and the bar to justify fine-tuning a specialized model is higher. The same day OpenAI announced a Jev-like Decisions API on GPT-6 Luna (Update 1).

How much of this to believe

The history and the mechanics are right wherever we checked them. The accuracies match the linked notebooks, ULMFiT's 95.4% is its paper's 4.6% error, the Jev run is internally consistent (24,117 of 25,000; 15,456,663 tokens at $0.042 per million is $0.6492; the 14-token gap per review between Choice and Noul matches the example responses), and the RLCR rewards and Table 1(a) values are exact (closed block below). The author marks his guesses and the contamination risk, and changed the post within three days in answer to four reader comments.

  • The ladder mixes three test sets and single runs: one or two points between rows say little.
  • The Jev-like design and the "small ModernBERT" guess are not Jev. Measurements published twelve days earlier show Jev reads options jointly and has frontier-scale knowledge; TypeSafe says "neither small nor an LLM". The article does not cite them.
  • Calibration is the theme and is not tested on Jev. The benchmark it links shows Jev's ECE at 0.351 on emotion, worse than the open model; a later test found Jev at 1.00 on 58% of complaints while right on 90.2% of those. Hume found ECE 0.031 on 1,200 MMLU items: calibrated on some tasks, not all.
  • Small slips: Luna where TypeSafe names Terra; "Direct Policy Optimization"; temperature scaling put in the RLCR comparison; state-space models "processed sequentially" in training.

Verdict. The best single walk from bag-of-words to decision models, with a cheap, honest test of Jev on one task. Take its history and its RLCR explanation as written, its Jev-like recipe as a way to build a clone, and "calibrated" as the vendor's word until a reliability diagram on your own task says so.

What the responses said

Hacker News: 214 points and 9 comments (read 27 November 2026; submitted 16 minutes after publication), almost all praise. The article's thread: 66 comments and replies (Substack's endpoint), four of which changed the post. The substantive ones, in date order (the first two predate the article):

  • earlier measurementJev's Architecture Unmasked
    Archer Hume, 17 September 2026

    Twelve days before the article, from about 10,000 API calls: 84.6% on MMLU-Pro (frontier-scale knowledge); an irrelevant fifth option lowered the log-odds between two others from +0.38 to +0.11 in all ten blocks, so Jev reads its options together. The article does not cite it.

  • benchmark the article citesBTZSC pilot v1: Jev against GLiNER2.5
    AbdelStark (jev-benchmarks), 17 September 2026

    Preregistered, 100 examples per dataset: Jev far more accurate on AG News (0.910 against 0.700) and Banking77 (0.870 against 0.610), tied on emotion with much worse probabilities (ECE 0.351 against 0.117). The article quotes it only as Jev being stronger.

  • reader comment, answeredIsn't cross-entropy already self-calibrating?
    a reader, Substack comments, 29 September 2026

    The author agreed it is, in expectation, cited Guo et al. on overfitting the log-likelihood, and wrote the answer into the post as Section 5.3 the same day.

  • reader commentTemperature scaling is brittle under shift
    a reader, Substack comments, 3 October 2026

    A calibration researcher: one fitted temperature breaks under covariate shift, where an agent's branches lead, and a decision model must be sharp as well as calibrated; he cited his own SDM activations (arXiv 2509.12760). No reply by 27 November.

  • reader commentsOne pass for all options, or a 255-slot head?
    two readers, Substack comments, 10 October 2026

    Section 4's design runs one forward pass per option; one reader proposed one input with a classification token per option, another a fixed 255-way head with unused slots masked. No reply by 27 November.

  • measurementTF-IDF still beats Jev in many enterprise jobs. Here is where Jev wins.
    Eugene Orlov and Olga Matveeva, 14 October 2026

    Jev against TF-IDF and a fine-tuned mmBERT on human labels: behind on complaint issues (46.6% against 61.2%); 1.00 on 581 of 1,000 complaints but right on 90.2% of those, so no threshold reached 95%; one ordinary sentence moved 55% of its decisions. Jev won on checking AI answers and on unseen languages.

Since the article (checked 27 November 2026)

Decision models became a product category within three weeks of the article: OpenAI, Cloudflare, Amazon and Microsoft shipped the same shape, three serving engines added decision endpoints, and TypeSafe raised $870M at a $7.5B valuation (2026-10-19: tech news). TypeSafe has still not published RLCD or Jev's architecture.

  • OpenAI: Decisions API guide (6 October 2026): Update 1's API reached public beta on GPT-6 Luna at $0.10 per million input tokens, output free; Cloudflare, Amazon and Microsoft shipped the same shape.
  • TypeSafe: Jev 1.14 changelog (14 October 2026): Better multilingual support (the weak spot the article reports), images in requests, a Box question type, 262k-token context.

Where it moves the knowledge base

  • Other notable providers: "everything is vendor-reported with no independent evaluation" is out of date; add the IMDb run (one run, possible contamination), Hume's measurements, the BTZSC and enterprise results, and Jev 1.14.
  • LLM-as-judge: decision-model probabilities can be rounded and piled at 0 and 1 (61% of values in one test), leaving no threshold to fit.
  • RL for LLMs: its closed RLCD block can name RLCR, R = c − (q − c)², as the published calibration reward.
  • Families and objectives: the decoder's last-token classification head; DeepSeek-V4.1-Flash as a current encoder-decoder; a hosted decision model among the choices.
  • Sequence models: ULMFiT (85.66% to 95.4% on IMDb by pretraining) in Further reading.
  • Guardrails: a decision-model injection screen was steered by one ordinary sentence (55% of decisions, one test).
The article's numbers, recomputed (depth)

Exact decimals in src/recompute.py; the test splits from the notebooks the article links (read 27 November 2026).

ClaimRecomputedResult
Jev Choice 96.47% (24,117 correct)24,117 / 25,00096.468%, so 96.47% (binomial standard error 0.12 points)
Jev Noul 96.20% (24,050 correct)24,050 / 25,00096.20%; the gap to Choice is 67 reviews, 0.27 points
$0.6492 and $0.634515,456,663 and 15,106,663 tokens × $0.042 per million$0.64918 and $0.63448; $0.026 per 1,000 reviews
Choice against Noul tokens350,000 tokens / 25,000 reviews14 per review, the gap between the examples' 342 and 328
Throughput25,000 reviews in 1,344 s18.6 reviews per second (concurrency not stated)
ULMFiT 95.4%100 − 4.6% test error95.4%; 9.74 points above the LSTM on the same official test set
Confidence 1.0 for a 1.0 / 0.0 answer(pmax − 1/n) / (1 − 1/n)1.0; a binary 0.74 gives 0.48
RLCR rewards −0.81, −0.04, 0.990 − 0.9², 0 − 0.2², 1 − 0.1²exact
Honest confidence paysp · (1 − (1 − q)²) − (1 − p) · q², at p = 0.70.49 at q = 0.7; 0.45 at 0.5 or 0.9; 0.40 at 1.0; in general p² at q = p
RLCR Table 1(a)arXiv 2507.16806HotpotQA ECE 0.37 to 0.03, accuracy 63.0% to 62.1%; out-of-distribution average ECE 0.46 to 0.21, accuracy 53.9% to 56.2%: as quoted

Test splits: the logistic regression used the second half of a shuffled 50,000 (25,000 reviews); the LSTM the official 25,000 test reviews; the CNN, GPT-2 and ModernBERT a 35,000 / 5,000 / 10,000 reshuffle of all 50,000; Jev the official test set; Laya and Contrastive Language Models not stated.

Provenance: what was read, fetched and compared

Read on 27 November 2026: the post (published 29 September 2026 10:50 UTC per its page data, about 8,200 words with code, 36 minutes at 230 words a minute, 39 numbered figures) and seven archived copies from 29 September to 14 November (Wayback), whose differences are in the card; all 66 comments and replies through Substack's comment endpoint; the Hacker News item and its comments through the API; TypeSafe's launch post with its FAQ, and its documentation pages on confidence, model jaggedness and the changelog; the RLCR paper (arXiv HTML, Table 1 and the reward's derivation); the linked notebooks (machine-learning-book chapters 8 and 15, the text CNN, the LLMs-from-scratch IMDb README and split script); the BTZSC pilot report; Archer Hume's essay; Orlov and Matveeva's essay; the abstract of the Jev survey (arXiv 2609.30216).

Not checked: numbers that appear only in the article's figures (the repeated Jev runs, the ModernBERT against Jev comparison, the Brier experiment's per-dataset values), TypeSafe's benchmark chart, and the OpenAI DevDay recap the article quotes. The article's figures are not openly licensed; the hero is redrawn from numbers in its text. Commenters are not named.