When you train a text classifier from scratch on a few hundred examples, a classic result says you should prefer a generative model, one that learns what the text of each class looks like, over a discriminative model that learns only the boundary between classes. The generative model is more constrained, so it reaches its best accuracy with far fewer examples. A recent Transformer study complicates this. The generative advantage appears only for large 12-layer models; for small 1-layer models the plain discriminative encoder wins at every data size (Generative or Discriminative? Revisiting Text Classification in the Era of Transformers). One reading is that a generative classifier spends much of its capacity, and much of its data, modeling the input text itself. That cost buys nothing for the label and is only repaid at scale.
This note proposes that multi-task learning changes the economics of that cost. If several classification tasks draw on related text, a single shared generative model of the text can serve all of them. Each task then needs only a small label-specific part on top. The cost of modeling the inputs is paid once, from the pooled inputs of all tasks, while the cheap label part is paid per task. The core claim is testable. If amortization is the mechanism, the advantage of a shared hybrid generative-discriminative classifier over discriminative baselines should be governed by the pooled number of inputs across tasks, not by the number of labels per task. That would shift the data-size crossover between generative and discriminative models as tasks are added. If instead the advantage tracks per-task labels, or vanishes once the discriminative model gets the same pooled inputs through pretraining, the idea is wrong. Either result is informative.
Core Claim
We build one decoder-only Transformer that models text conditioned on a task tag and a label: $P_\phi(x \mid y, t)$, where $x$ is the input text, $y$ a class of task $t$, and $\phi$ the shared weights. It classifies by Bayes' rule, as in the autoregressive classifiers of the Transformer study above. The model is trained with a multi-conditional objective in the style of Multi-Conditional Learning. That paper mixes a conditional-likelihood term with a generative-likelihood term and finds the generative term regularizes better than Gaussian weight priors. Here it becomes
$$ \mathcal{L} = \sum_{t=1}^{T} \sum_{(x,y)\in D_t} \Big[\alpha_t \log P_\phi(y \mid x, t) + \beta_t \log P_\phi(x \mid y, t)\Big], $$
where $D_t$ is task $t$'s labeled set, and $P_\phi(y \mid x, t)$ is obtained by normalizing $P_\phi(x\mid y,t)P(y\mid t)$ over the task's labels.
A second idea comes from Classification with Hybrid Generative/Discriminative Models. That paper keeps the generative probabilities fixed and fits only a tiny vector of discriminative weights over length-normalized log-likelihoods, and proves that the samples needed scale logarithmically rather than with feature dimension. On top of the shared model, each task gets such a small vector: per-class offsets, a log-likelihood scale, and a length-normalization exponent. It is fitted by cross-validated conditional likelihood on that task's labels alone.
This places the four directions in clear roles. The generative-discriminative trade-off is the phenomenon being explained. The hybrid model is the mechanism. Multi-task sharing is the lever that changes the cost structure. Model complexity, meaning depth and the data-size crossover, is the axis on which the prediction is measured.
The closest prior work does not test this. The Transformer study compares pure generative and pure discriminative models on isolated tasks and never shares a generative model across tasks. Multi-Conditional Learning and the Raina hybrid are single-task and shallow. Generative Modeling for Multitask Visual Learning does couple a generator with a multi-task network and reports low-data gains. However, it uses an adversarial image generator as a source of synthetic training data, never classifies through a likelihood, and never asks how the gain scales with the number of tasks or with depth.
Research Program
The work has three parts. First, we reproduce the from-scratch two-regime result on the nine text benchmarks used by the Transformer study. Those are AG News, Emotion, SST-2, SST-5, Multiclass Sentiment, Twitter Financial News Sentiment, IMDb, and Hate Speech Offensive, at depths 1, 2, 4 and 12 and on a grid of per-task training sizes from tens of examples to the full set. This anchors everything to a known pattern.
Second, we train the shared hybrid on task groups of size $T \in \{1, 3, 6, 9\}$. For each depth and $T$, we locate the crossover $N^*$, the per-task label count at which the hybrid and the best discriminative competitor tie. Two kinds of groups are built. Related groups draw on sentiment-like data: SST-2, SST-5, IMDb, Multiclass Sentiment and Twitter Financial. Unrelated groups mix AG News, Emotion and Hate Speech. Amortization predicts large shifts in $N^*$ for related groups and small ones for unrelated groups, because a shared text model only helps if the input distributions overlap.
Third, we run a collapse analysis, which is the scientific core. We plot the hybrid's margin over the discriminative baseline against per-task labels $N$ and, separately, against pooled inputs $TN$. We also add a condition in which only the generative term $\log P_\phi(x\mid y,t)$ receives extra unlabeled in-domain text, holding per-task labels fixed. If the curves collapse onto pooled inputs, and unlabeled text alone moves the margin, the amortization account holds.
We also test what depth does. If the 1-layer failure in the Transformer study is a capacity limit, sharing should not rescue 1-layer hybrids. If it is a data limit on fitting the input distribution, pooling should rescue them.
Two engineering issues are handled explicitly rather than ignored. First, the generative term produces per-token gradients that can swamp the per-example classification gradient. This is the magnitude conflict described by RotoGrad, which rescales task losses and rotates task-specific feature subspaces. We compare plain per-token normalization against RotoGrad applied with the generative and discriminative terms treated as separate tasks. Second, Bayes-rule classification needs one forward pass per label. The labels here number at most six, but we report inference cost honestly, since latency is the main practical argument for discriminative encoders. $\alpha_t$ and $\beta_t$ are tuned per task on validation data within a fixed budget that every method also receives. We do not claim an automatic weighting rule.
Baselines
The naive reference point is a single-task discriminative encoder trained from scratch per task at the matched depth. Its weight decay, dropout and learning rate are tuned on validation data with the same number of trials as every other method. It is what a practitioner does by default, and the Transformer study found it the winner at small depth. Beating it means a higher weighted F1, averaged over five independent subsamples per data size, with non-overlapping 95% intervals.
The first strong competitor is a multi-task discriminative encoder with a shared trunk, per-task heads, and RotoGrad gradient homogenization. Comparing against it separates the benefit of sharing from the benefit of being generative.
The second, and most dangerous, is an auxiliary-loss discriminative model. It is the same multi-task encoder plus a shared language-modeling loss on all task inputs. It sees the same pooled text and spends capacity modeling it, but still classifies discriminatively. The pure gap between it and the shared hybrid isolates the key ingredient: classifying through label-conditional likelihood rather than merely training on a density loss.
The third is in-domain pretrain-then-fine-tune. We pretrain a masked language model from scratch on the pooled task inputs, plus the extra unlabeled text when that condition applies, with matched total compute. We then fine-tune discriminatively, both per task and multi-task. The Transformer study reports that pretraining dissolves the generative advantage, so this baseline directly attacks the claim.
On the strongest numbers, there is no reported result found on Lacuna for weighted F1 of the from-scratch encoder, autoregressive or masked models on these nine benchmarks; the file states only the qualitative pattern. Our reproduction therefore supplies the reference numbers, and we will release them. The nearest quantitative anchors come from older single-task settings. Multi-Conditional Learning beat maximum entropy and Naive Bayes on 15 of 20 text subsets (p = 0.001 against maximum entropy) and cut error by nearly 50% in some cases, and the Raina hybrid reached 95% accuracy at 40% coverage on an atheism versus religion.misc split of 20 Newsgroups. These show what hybrid regularization can do, but they are not comparable baselines here.
Ablations come in three forms. The first is the hybrid trained per task without sharing, which tests whether sharing matters. The second shares only an unconditional text model $P(x)$, with label-specific parts kept separate, which tests whether label conditioning must be shared too. The third drops the Raina-style per-task correction vector and drops each objective term in turn.
Why not just…?
Why not just pretrain on the pooled text and fine-tune a discriminative encoder? This is the real threat. The Transformer study already shows that pretraining erases the generative edge, so if in-domain pretraining on the same pooled inputs matches the hybrid, amortization adds nothing a standard pipeline lacks. Our hope rests on scale. Their pretraining used web-scale corpora, whereas here the pooled corpus is tens of thousands of short texts. Fine-tuning discards the label-conditional density whose constraint gives fast convergence, and sequential fine-tuning can overwrite general representations (Wang et al.). The matched-compute pretraining baseline settles this directly. If it ties or wins at every pooled size, we report that the mechanism is "more input data" rather than "generative classification."
Why not just add a language-modeling loss to a multi-task discriminative model? That gives the network the same density signal and the same sharing, and it keeps single-pass inference. The auxiliary-loss baseline is built to answer exactly this question. The prediction specific to our account is that the gap is largest at the smallest per-task label counts. There, the Raina-style argument says a classifier that reads its decision off a likelihood needs only logarithmically many labels to fit its few free parameters, whereas an auxiliary loss only shapes features for a head that still has many parameters.
Why not just tune a single-task hybrid or stronger weight decay per task? Multi-Conditional Learning already shows that a generative term beats Gaussian priors within one task. We include tuned weight decay in the naive baseline and the unshared hybrid as an ablation. Neither can show a margin that grows with the number of tasks, so if the margin does not grow with $T$, this cheaper option is enough and our central claim fails.
Why not just use shallow single-task models, since small data favors small models? Shallow models resist overfitting on limited data (Temporal Convolution Networks for Real-Time Abdominal Fetal Aorta Analysis with Ultrasound; Neural network language models for low resource languages). The 1-layer encoder is in the grid, so this alternative is evaluated at every data size rather than argued away.
Decisive Checks
Three results decide the proposal. The first concerns related task groups at depth 4 or 12. There, the crossover $N^*$ must increase monotonically with $T$, while unrelated groups show a markedly smaller shift. The second is the collapse test: the hybrid's margin must align better with pooled inputs than with per-task labels, and unlabeled in-domain text fed only to the generative term must widen it. The third is that the shared hybrid must beat both the auxiliary-loss model and matched in-domain pretraining at the smallest per-task sizes, on weighted F1 and on expected calibration error.
If the first two hold but the third fails, the contribution narrows to explaining the Transformer study's depth effect. If the 1-layer hybrid stays worse at every $T$, the depth effect is a capacity limit and not a data limit. That would also be a clean answer to the open question in the gap section.
References
- Generative or Discriminative? Revisiting Text Classification in the Era of Transformers
- Multi-Conditional Learning: Generative/Discriminative Training for Clustering and Classification
- Classification with Hybrid Generative/Discriminative Models
- Generative Modeling for Multitask Visual Learning
- RotoGrad: Gradient Homogenization in Multi-Task Learning
- Can You Tell Me How to Get Past Sesame Street? Sentence-Level Pretraining Beyond Language Modeling
- Temporal Convolution Networks for Real-Time Abdominal Fetal Aorta Analysis with Ultrasound
- Neural network language models for low resource languages