Knowledge Base · Learning paths
From BERT and GPT to Jev: Understanding the Evolution and Divergence of Large Language Model Architectures
This article traces the development of large language models from the 2017 Transformer to the two major paths of BERT and GPT, culminating in Jev released by TypeSafe AI in 2026. Jev specializes in three types of constrained problems—multiple choice, scoring, and judgment—delivering direct probability outputs in under 100 milliseconds, marking a new direction for discriminative large language models.
Translated from Chinese by AI. Spotted an issue? Use the feedback button.
🔗 Original article: https://mp.weixin.qq.com/s/AciT5C6ypT35F...
Tencent Programmer · WeChat Official Account · Tencent Technical Engineering · 2026-10-19 17:36
📌 This article is a repost. Copyright belongs to the original author. Please refer to the original article linked above for the authoritative version.
Author: leonjia
In September 2026, TypeSafe AI released Jev. Unlike typical language models, Jev does not generate text. Instead, it answers three types of constrained questions about a given input: selecting one of several options, assigning a rating on a scale, or determining whether a statement is true. It directly returns the probabilities of the possible answers. While typical language models take seconds to minutes to produce a response, Jev completes a batch of judgments on the order of hundreds of milliseconds.
To explain how Jev relates to mainstream large language models (LLMs), we need to return to the Transformer architecture itself. From the original architecture in 2017, through the two mainstream approaches represented by BERT and GPT, to today's frontier models such as DeepSeek and Qwen, the ways models read inputs and produce outputs have undergone several changes. These are also the two areas in which Jev differs. At the end of the article, we also compare it with the open-source Laya, which produces outputs in a similar way to Jev but uses a different underlying network.
01 2017: Transformers and Machine Translation
The paper that introduced the Transformer, Attention Is All You Need, focused on machine translation, so the original architecture had two parts: an Encoder that reads a sentence in the source language and outputs a set of context vectors, and a Decoder that reads those vectors through cross-attention while generating the target-language sentence word by word. The Encoder runs only once on the source sentence, while the Decoder runs once for every word it generates. Each generated word is fed back into the input to generate the next one.
The two-part framework itself was not this paper's contribution; seq2seq models in the RNN era already used the same structure. Its contribution was to replace recurrence entirely with attention. Recurrent networks read words one at a time, with each step receiving its state from the previous step: the nth word must wait until the preceding n−1 words have been processed. Attention, by contrast, directly examines other words in the sentence when processing each word, combining their information with weights based on relevance. All positions can be computed simultaneously. An attention layer followed by a feed-forward layer forms a basic unit; stacking dozens of these units produces a Transformer. Parallel computation makes it possible to fully utilize GPUs, providing the engineering foundation for models to later scale to hundreds of billions of parameters.
The difference between the Encoder and Decoder also lies in attention: when the Encoder reads a source sentence, each position can see the entire sentence, so its attention is bidirectional. During generation, each position in the Decoder can see only itself and the previously generated words, so its attention is causal. (The attention visibility diagram in the next section illustrates this distinction using a concrete sentence.) The units a model actually processes are tokens produced by a tokenizer. In Chinese, a token roughly corresponds to anything from a single character to a word; in English, it roughly corresponds to a word or part of one.
02 2018–2020: Three Approaches Diverge
Around 2018, researchers discovered that the Transformer's two components could be separated and used independently, with each suited to different pretraining tasks. This gave rise to three approaches. Their layer structures are almost identical, with just two substantive differences: attention visibility, meaning whether a model can see subsequent text when reading its input, and the pretraining task, meaning whether training involves filling in blanks or continuing text. These two factors determine which tasks a model is suited to.
The Encoder-only approach, pioneered by BERT (October 2018), retains only the reading half. Its pretraining task is to fill in blanks: some words in a sentence are randomly masked, and the model reconstructs them using the surrounding context. The Encoder-Decoder approach, represented by T5 (October 2019), retains both halves. Its pretraining task masks a span of text and has the Decoder reconstruct it, making it suitable for tasks with well-defined input and output formats, such as translation and summarization. The Decoder-only approach, pioneered by GPT-1 (June 2018), retains only the writing half. Its pretraining task is simply text continuation: given the preceding text, predict the next word. It is worth clarifying a potentially confusing name here: the Decoder in a Decoder-only model no longer includes cross-attention, because there is no Encoder output to read. Structurally, it is equivalent to an Encoder with a causal mask; the name “Decoder” persists purely for historical reasons.
Encoder-only models have dropped out of the race for general-purpose capabilities, but their single forward pass and millisecond-level latency keep them widely used in high-throughput discriminative tasks such as retrieval, recommendation, and content moderation. ModernBERT, released in 2024, is one example. These models follow a “pretraining plus fine-tuning” workflow: a pretrained BERT can only fill in blanks. To make it perform a specific classification task, a classification head must be attached to its output, and the entire network must be fine-tuned on labeled data for that task. The fine-tuned model reads the input once and directly outputs probabilities for each class. However, it can perform only that one task, and its set of classes is fixed during training. Switching to another task requires new labeling and another round of fine-tuning.
03 Decoder-only Becomes the Mainstream
The Inference Process: Prefill and Decode
For a decoder-only model, “understanding the input” and “generating the output” do not involve two separate networks. Instead, they are two stages of inference performed by the same network with the same parameters.
The first stage is called prefill: the entire prompt is fed into the network at once, all tokens are processed in parallel, and the key and value vectors at each layer are stored in a cache—the KV cache—for subsequent tokens to attend to. This stage is compute-intensive and corresponds to the time to first token experienced by the user.
The second stage is called decode: the network generates tokens one at a time using the KV cache, appending each new token’s keys and values to the cache. This stage is sequential and memory-intensive: every step requires reading all the weights and the entire cache. It determines the generation speed experienced by the user.
The output still “reads the input” in a decoder-only architecture, but through ordinary self-attention rather than cross-attention: each token in the response belongs to the same sequence as the prompt and can directly attend to the keys and values at every prompt position. The trade-off is that attention within the prompt is unidirectional. After passing through dozens of stacked layers, however, the final positions in the prompt have already aggregated information from the preceding text, so this restriction has not proved to be a major weakness in practice.
Why It Became the Mainstream
-
Denser training signals. A text-continuation task provides a prediction problem at every position in a sentence: each word is a target to be predicted from the preceding text. A fill-in-the-blank task provides prediction problems only at the few masked positions. Given the same batch of text, the former supplies far more training signal.
-
A unified task format. Dialogue, code completion, chain-of-thought reasoning, and tool use can all be framed as “continuing to generate within the same sequence,” without redefining input and output boundaries for each type of task. The in-context learning capability demonstrated by GPT-3 (2020, 175B)—performing a new task with just a few examples in the prompt—is a direct result of this unified approach.
-
Reusable KV caches. Causal masking ensures that the keys and values of previously processed tokens are unaffected by subsequent content, so multi-turn conversations and AI agent loops only need to append new entries. Bidirectional encoders lack this property and must recompute whenever new input is added.
A systematic comparison by Wang et al. in 2022 yielded an empirical conclusion: when training consists solely of large-scale unsupervised pretraining, without targeted fine-tuning, decoder-only models with a text-continuation objective achieve the strongest zero-shot generalization. The advantages of bidirectional attention paired with a fill-in-the-blank objective emerge only after multitask fine-tuning. The industry’s investment has happened to favor the former.
04 2022–2025: Post-Training and Reasoning Models
ChatGPT is a conversational product released by OpenAI in November 2022. Its initial underlying model was GPT-3.5, followed by updates through GPT-4, GPT-4o, the o-series, and the current GPT-5.x. OpenAI stopped disclosing architectural details starting with GPT-4, but these are all autoregressive, decoder-only models that generate one token at a time. ChatGPT’s conversational abilities come not from architectural changes, but from several rounds of post-training after pretraining. Reasoning models introduced from 2024 onward, such as OpenAI o1 and DeepSeek-R1, likewise retain the same architecture, instead using reinforcement learning to make the model generate an extended reasoning process before answering.
RLHF works as follows: humans rank multiple model responses, a reward model is trained to approximate those human preferences, and reinforcement learning then shifts the model’s outputs toward higher rewards. This aligns the model’s response style with annotators’ preferences, but also introduces two documented side effects. The first is poorer calibration: OpenAI presented a comparison in its GPT-4 technical report showing that the pretrained model’s confidence largely matched its actual accuracy—among questions for which it claimed 80% confidence, it answered roughly 80% correctly. After post-training, this alignment deteriorated noticeably. The second is overconfidence, because annotators tend to favor answers expressed with certainty.
A reasoning model’s reasoning process is still autoregressive, token-by-token generation; it is simply not shown to the user. It improves the model’s performance on verifiable tasks such as mathematics and coding, at the cost of increasing the latency of a single response from seconds to minutes.
05 2026: How Frontier Models Relate to the Main Trajectory of Development
Two open-source models from 2026—DeepSeek-V4.1-Flash, released in September, and Qwen3.8-27B, open-sourced in August—illustrate how frontier models relate to the main architectural lineage described above. Both remain autoregressive Transformers that generate one token at a time; the two-stage prefill and decode process and the post-training pipeline still apply unchanged. Architectural innovations in recent years have not altered this underlying framework. Instead, they have focused on its internal components, with broadly the same goal: reducing computation and GPU memory usage while maintaining equivalent capabilities.
The changes are concentrated in two areas. The first is replacing feed-forward networks with MoE (Mixture of Experts): each layer’s feed-forward network is split into hundreds of subnetworks, only a handful of which are activated for each token, decoupling the total parameter count from per-token computation. DeepSeek-V4.1-Flash, with 552B total parameters and 16B activated per token, falls into this category; Qwen3.8-27B, by contrast, is a dense model with all 27B parameters activated. The second is KV cache compression: in long-context and AI agent scenarios, the cache can consume more memory than the weights themselves, and developers have taken different approaches to addressing this. DeepSeek combines compression into low-dimensional latent vectors with sparse selection. In V4.1-Flash, it also uses the first 20 layers as a causal encoder and derives the keys and values for the last 20 layers through projections of that encoder’s representations, so prefill only needs to run half the network. Starting with Qwen3-Next, Qwen replaces three out of every four layers with linear attention (Gated DeltaNet), substituting a fixed-size state for the per-token cache.
The term “encoder-decoder” in V4.1-Flash means something different from the two-part, translation-oriented architecture in Section 01: its encoder still uses a causal mask, and the overall model remains a standard autoregressive language model. The difference is simply that its decoder layers no longer compute global keys and values themselves. To determine which architectural lineage a model belongs to, look not at its name but at two things: whether its attention uses a causal mask, and whether its output is produced through token-by-token generation. DeepSeek and Qwen are identical to GPT-3 on both counts; Jev differs on the second.
06 Jev
Why Build a Different Kind of Model?
TypeSafe AI released Jev on September 15, 2026. Its founder, Diogo Almeida, is a coauthor of the InstructGPT paper and previously led post-training at OpenAI. The opening sentence of the launch post identifies the problem they set out to address: “Models have been superhuman at chat for years, so where is all the automation?” Their explanation is that models trained with RLHF are designed from the outset to assist humans: the reward model fits human raters’ preferences, and the model learns to make answers look correct rather than to make its probabilities reflect actual accuracy. If a model can complete a task 95% of the time but cannot identify the remaining 5%, it cannot be used for unattended automation. TypeSafe positions its method, RLCD (Reinforcement Learning for Calibrated Decisions), alongside RLHF and RLVR as a third post-training paradigm: the first two optimize for human preferences and verifiable rewards, respectively, while RLCD optimizes for calibrated decisions. The resulting model “does not generate text; it returns decisions and probabilities.” The name “System One” comes from Kahneman’s distinction between fast and slow thinking: LLMs are classified as the slow System Two, while Jev is positioned as the fast System One.
State and Questions
Each request supplies a state (the material to be evaluated, which can be a string, JSON object, or array), along with any number of questions. Questions are restricted to three primitives:
| Primitive | Question Type | Returns | Example |
|---|---|---|---|
| Choice | Select one of up to 255 options | A probability for each option, plus a confidence score | Which team should handle this support ticket? |
| Score | Rate on an ordered scale of 2–10 levels | A probability-weighted score | How dissatisfied is the customer? |
| Noul | Determine whether a statement is true | A probability between 0 and 1 | Is this message urgent? |
One example in the documentation asks three questions about the same customer support message at once. The response contains a probability distribution for each question, rather than text.
// Request
{
"state": "Hi, I've been trying to connect my Stripe account for 3 days
and the integration keeps failing. I'm losing sales. Please help ASAP.",
"questions": {
"department": {
"type": "choice",
"instructions": "Which team should handle this",
"criteria": { "billing": "…", "technical": "…", "sales": "…" }
},
"frustration": {
"type": "score",
"instructions": "How frustrated the customer appears",
"criteria": [ "Calm", "Frustrated but civil", "Very angry" ]
},
"is_urgent": {
"type": "noul",
"instructions": "The message conveys urgency"
}
}
}
// Response
{
"answers": {
"department": {
"choice": "technical",
"confidence": 0.78,
"probabilities": { "technical": 0.85, "billing": 0.15, "sales": 0.0 }
},
"frustration": {
"score": 1.0,
"probabilities": { "0": 0.0, "1": 1.0, "2": 0.0 }
},
"is_urgent": { "noul": 1.0 }
}
}
confidence is calculated from the shape of the probability distribution: it is 0 when the distribution is uniform and 1 when it is fully concentrated. The documentation recommends using it for routing: automate high-confidence decisions and hand low-confidence ones over to a human. Official figures: most queries take around 100 ms, and adding questions within the same request introduces almost no additional latency; input costs $0.042 per million tokens, with free output; text only, primarily English; not open source.
Breaking Down Questions
TypeSafe advocates an approach in which code controls the flow, the model is called only where commonsense judgment is needed, and every question is broken down into an atomic unit. For spam detection, for example, instead of asking “Is this spam?”, you ask six Noul questions about the same email at once: Does it request credentials? Does it claim an unexpected reward? Does it create time pressure? Is there a mismatch between the sender and the domain? Is there a link-domain mismatch? Does the link text conceal the destination? The six questions are evaluated in parallel, returning six probabilities. Code then combines them into a weighted risk score and applies a threshold.
Relationship to Language Models
Jev very likely uses a pretrained Transformer as its underlying network, which gives it the ability to understand arbitrary natural-language questions. In this respect, it shares its foundations with LLMs. The difference lies in how results are produced. Whether an LLM outputs plain text or JSON, it must go through a decoding stage, generating tokens one at a time, after which the caller parses the resulting string. Jev skips decoding after prefill and instead reads each question’s probability distribution over the available options directly from the network. This is not the same as imposing a schema on an LLM through JSON mode, structured output, or similar mechanisms: those approaches only constrain the format of the generated string, without eliminating any of the token-by-token generation process. Jev has no generation process at all. The launch article describes this distinction as “sequential sampling” versus “parallel sampling.” This is also where its “type safety” comes from: outputs are restricted to the given options, so nothing outside those options can appear.
Another point of comparison is the BERT classifier in Section 02. The two are closest in their computational pattern: both read the input once and directly output class probabilities. The difference lies in how the task is specified. For a BERT classifier, the task is encoded in its parameters during fine-tuning, with a fixed set of classes; a different judgment requires new labeling and training. With Jev, the questions and options are part of the request, specified in natural language at call time. This versatility comes from an LLM-scale backbone. BERT, with only hundreds of millions of parameters and pretraining limited to masked-token prediction, cannot understand instructions such as “Does the sender’s display name conflict with the email domain?” There is a corresponding trade-off: on fixed tasks with sufficient labeled data, a specially fine-tuned BERT is often more accurate.
Understanding Jev
The company has not disclosed the architecture, offering only brief descriptions such as “a new model architecture, a parallel sampler, and the RLCD training method.” Still, its general design can be inferred from the API’s behavior. Adding more questions to the same request barely increases latency, suggesting that the state is read only once and the questions are processed in parallel. Processing 255 options takes the same time as processing two, suggesting that there is no token-by-token decoding. Option order affects accuracy, which is consistent with the characteristics of a causal Transformer. A plausible implementation would use a pretrained causal Transformer as its backbone, perform a single prefill pass over the state, then run each question and its options through parallel forward-pass branches. Scores would be read out at the end of each option, with a softmax applied across the options for each question, and synthetic data used to train probability calibration. What the company calls a “new architecture” is more likely this combination of branching, readout heads, and training objectives than a new attention mechanism.
This gives us an overall way to characterize Jev. Rather than introducing a new Transformer structure, it productizes a long-standing hack—“ask a language model multiple-choice questions and read only the probabilities, without letting it generate”—and makes probability calibration a training objective. These happen to be two things that dialogue-oriented LLMs have long neglected. Both official and independent evaluations show that, on judgment tasks broken down into well-defined questions, its accuracy is comparable to that of frontier models with moderate reasoning budgets, while its cost and latency are roughly two orders of magnitude lower. At the same time, its probabilities can become miscalibrated in unfamiliar domains, and it cannot perform numerical calculations or multistep reasoning. It retains an LLM’s comprehension capabilities but removes generation, so it cannot write, think, or operate as an AI agent. In return, it delivers latency on the order of hundreds of milliseconds and probabilities that can be used directly in programmatic decisions.
07 A Comparison: Laya
Section 06 breaks Jev into two components: an LLM-scale backbone and an output mechanism that reads out probabilities directly in a single forward pass. On September 18, three days after Jev’s release, Nandakishor M of Convai Innovations open-sourced Laya under Apache 2.0, positioning it as a “33 ms open-source System 1 decision engine.” Its author says the idea originated in his own research in 2025, while the community generally describes it as an open-source version of Jev. Its output mechanism is similar to this article’s proposed interpretation of Jev, but its backbone is a publicly available, much smaller encoder.
Laya’s architecture can be read directly from its open-source code. Its backbone is ModernBERT-large, a bidirectional encoder with roughly 400 million parameters—a contemporary version of the encoder-only approach discussed in Section 02—with a small decision head attached. Each question is assembled into a single sequence: the question type and instructions come first, followed by the options, each preceded by a [MASK] token, with the state appended at the end. After the sequence passes through the encoder and decision head, the hidden vector at each [MASK] position is used to produce a score. Applying softmax across all options for the same question yields a probability distribution. Its three primitives are the same as Jev’s, and its training objective likewise targets probability calibration. It can read at most 512 tokens at a time, roughly the length of an email. The released version tends to assign overly high probabilities: its stated confidence exceeds its actual accuracy. The author recommends that users first calibrate it on their own data before making decisions based on these probabilities.
Laya’s approach, based on its open-source code: include the options in the input sequence and read out a score at the [MASK] position before each option. Its readout mechanism is similar to this article’s proposed interpretation of Jev, but its backbone is a 400-million-parameter bidirectional encoder.
Under the classification outlined earlier, Laya takes the BERT classifier one step further: it puts the options into the input rather than the parameters, eliminating the need to retrain for each task. This is precisely the distinction between Jev and a BERT classifier discussed in Section 06, and Laya takes the same step using a 400-million-parameter encoder. In how it produces results, it resembles this article’s proposed interpretation of Jev: a single forward pass, per-option probability readouts, and calibration as a training objective. The difference is in the backbone. Neither Jev’s parameter count nor its architecture has been disclosed; based on its zero-shot performance, this article infers that it uses an LLM-scale causal Transformer. Laya’s backbone, by contrast, is known: a 400-million-parameter bidirectional encoder pretrained only on masked-token prediction.
When the same output method is applied to a 400-million-parameter BERT model, its zero-shot performance falls far short of Jev’s, and the best results reported by the authors also come from a version fine-tuned on the evaluation set. The output method itself, however, can be implemented with an open-source encoder and a readout head, as demonstrated by Laya and several similar projects that followed. This comparison shows that the gap between Jev and these open-source implementations lies not in the readout method, but in the network beneath it: understanding arbitrary questions without task-specific training requires LLM-level comprehension. For users making a fixed set of judgments on their own data, a fine-tuned Laya is a viable open-source option; handling arbitrary questions in a zero-shot setting still requires an LLM-level underlying network.
08 The Big Picture
Returning to the opening question: from the introduction of the Transformer to today, the backbone of mainstream models has remained unchanged. ChatGPT and reasoning models changed the training methods, while DeepSeek and Qwen changed the internal components. Jev retains the reading portion of this backbone and its LLM-level comprehension, while removing the generation component. The comparison with Laya shows that removing generation is not, in itself, difficult; the real challenge remains the underlying network’s ability to understand. Jev is not a replacement for LLMs, but another way of using the same underlying network for a different class of tasks. Whether it is suitable depends on whether the task calls for open-ended text generation or a decision among a finite set of options.