NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Task-Specific Activation Shapes for One Shared Multi-Task Language Model

When a single language model is trained on many different NLP tasks at once, the tasks often get in each other's way. Sentiment classification, entailment, extractive question answering and biomedical named-entity tagging pull the shared weights in different directions. The usual fix is to give each task its own small set of extra weights, such as adapters or task-conditioned normalization layers. This proposal tests a much smaller intervention. Every weight matrix stays shared across tasks, and each task receives only its own shape for the non-linear function inside the feedforward layers. That shape is a learnable activation function, a curve whose form is trained by gradient descent along with the network instead of being fixed as GELU. In a 12-layer encoder this costs about 108 numbers per task.

The core question is whether the shape of the non-linearity is a meaningful place to store what differs between tasks. There is suggestive evidence that it is. Learnable rational activations in BERT deform differently depending on the downstream task format, most strongly in the top layers (Transformers with Learnable Activation Functions). That evidence comes only from separate single-task runs, where every weight is also re-tuned, so it cannot show whether the shape itself carries task information. If per-task shapes recover the accuracy lost to multi-task interference, a single backbone could serve dozens of tasks, with batches that mix tasks, while swapping only a few floating-point numbers per request. If they do not, the experiments will show whether that is because shape adds nothing beyond simple scaling and shifting.

Core Claim

We claim that, in a multi-task encoder with fully shared weights, giving each task its own rational activation coefficients per layer reduces negative transfer more than per-task affine rescaling of a fixed activation does, at comparable parameter cost. The gain should be largest on the tasks that multi-task models handle worst: token-level tagging and very small reasoning datasets. The ablation against affine rescaling decides whether the idea stands. Rational functions are known to absorb affine transformations (Rational Neural Networks have Expressivity Advantages). Some of what a per-task rational curve learns could therefore be only a per-task scale and shift, and that can be had with four numbers per layer. The claim holds only if the non-affine part of the shape matters.

Relation to Prior Work

Three papers supply the motivation and the methods. RAFT (Fang et al.) replaces GELU in BERT's feedforward layers with a rational function, a ratio of two low-degree polynomials initialized to match GELU. It adds 9 parameters per layer and reports gains that are largest in low-data settings. We reuse its parameterization and its GELU initialization. RAFT only ever trains one task per model, so it never asks whether one backbone can host several task-specific curves. Safe rational units (Molina et al.) supply the pole-free denominator $1+|Q(x)|$, which we adopt because per-task coefficients trained on tiny datasets are exactly where training instability would appear. Tang and Townsend ( Rational Neural Networks have Expressivity Advantages) prove that rational activations are more parameter-efficient than fixed smooth ones. They also show that rational activations absorb affine maps, and that normalization can interfere with them. Their results both support our hypothesis and constrain it: they are the reason the affine ablation is mandatory, and the reason we keep BERT's LayerNorm in place instead of reopening the question of normalization.

Two further papers are the closest competitors. CA-MTL (Conditionally Adaptive Multi-Task Learning) conditions attention, layer normalization and adapter bottlenecks on a task embedding using feature-wise linear modulation, a per-task scale and shift of hidden features. It handles 26 tasks with about 1.12 times the parameters of one BERT, but it keeps the activation fixed. It also reports that it still trails single-task models on token-level NER. Our proposal changes the one component CA-MTL leaves alone and removes everything else it adds. MeGan (Ji et al.) shows that steering a single sharpness scalar $\beta$ inside the Swish function of a frozen 8B model, using a hypernetwork, adapts that model across styles and tasks. This is evidence that the activation is a powerful control knob. MeGan limits itself to one scalar per layer, and we test whether full shape control adds anything beyond that scalar.

Research Program

The backbone is pretrained BERT-base. We replace GELU in every feedforward layer with a safe rational function $F_{\ell,t}(x) = P_{\ell,t}(x)/(1+|Q_{\ell,t}(x)|)$. Here $\ell$ indexes the layer, $t$ indexes the task, and $P$ and $Q$ are polynomials of degree 5 and 4 whose coefficients are initialized to fit GELU, following RAFT. All attention and feedforward weights and all normalization parameters are shared by every task. Each task has its own classification or tagging head and its own coefficient set $\{P_{\ell,t}, Q_{\ell,t}\}_{\ell=1}^{12}$.

Training proceeds in two stages. In the first stage, shared weights, heads and per-task coefficients are trained jointly on the multi-task mixture, with task sampling proportional to the square root of dataset size. We use this simpler scheme instead of CA-MTL's uncertainty sampling so that sampling is not a confound, and we apply the same scheme to every system. In the second stage, the backbone is frozen, and held-out tasks are added by training only a new head and new coefficients. This tests whether shape alone can adapt the model to a new domain.

On the analysis side, we will cluster the learned per-task curves by layer. The prediction is that tasks group by output format (token-level, span, or sentence pair) and not by domain. We will also decompose each learned curve into its best affine fit to GELU plus a residual, which measures how much of the per-task change is genuinely non-affine.

The task mixture draws on the benchmarks in the file. It includes the nine GLUE tasks (GLUE); SuperGLUE's BoolQ, CB, COPA, RTE, WiC and WSC (SuperGLUE), where CB has only 250 examples; SQuAD v1.1 for span extraction; and CoNLL 2003 NER for token tagging. NCBI Disease and MedPost, the biomedical tagging sets used in Evaluation of a Sequence Tagging Tool for Biomedical Texts, are held out for the second stage, together with CB in a variant where CB is excluded from stage one.

Baselines

The naive reference point is a single multi-task BERT with shared GELU and per-task heads only. It shows how much interference exists before any fix is applied. Beside it we run single-task fine-tuning of the full model on each task, which has no interference but also no sharing. The size of the gap between these two, measured per task, is the headroom our method is trying to recover.

The strongest existing method is CA-MTL ( Conditionally Adaptive Multi-Task Learning: Improving Transfer Learning in NLP Using Fewer Parameters & Less Data). It is the most direct competitor because it targets exactly this multi-task interference problem with task-conditioned modulation, and it reports beating single-task fine-tuning by 0.7 to 1.0% on average across 24 tasks with BERT-Large. It also reports beating other adapter methods by 2.8% on an 8-task GLUE model. The file gives no absolute GLUE, SQuAD or WNUT scores for CA-MTL: no reported result was found on Lacuna for CA-MTL's per-task numbers. We will therefore reimplement it on BERT-base with our task mixture and our sampling scheme, rather than compare against numbers from its paper. The same applies to RAFT: the file reports only relative gains (about +1 GLUE point with full data, +5.71 with 100 examples, and +2.05 SQuAD F1 over GELU), not absolute scores.

The fair-comparison protocol is as follows. Every system uses the same BERT-base checkpoint, the same task mixture, the same sampling scheme and the same number of training steps. Each system gets the same grid of 12 learning-rate and warmup configurations, selected on validation data. We report five seeds for tasks with fewer than 5,000 training examples. Two further systems isolate what drives any gain. The first, called shared-RAFT, trains one set of rational coefficients shared by all tasks; it separates the benefit of a better activation from the benefit of task-specific activations. The second, called per-task-affine, uses a fixed GELU with a per-task scale and shift on both its input and its output, which is 4 numbers per layer. To remove parameter count as an explanation, we also run a variant of our method that ties the denominator to its GELU fit and learns only 4 numerator coefficients per layer, matching the affine baseline exactly. We add per-task $\beta$ in a Swish activation, a MeGan-style scalar conditioned on a task identifier instead of on text.

Beating the baselines means three things. Averaged over the mixture, per-task rational must match or exceed CA-MTL while using roughly four orders of magnitude fewer task-specific backbone parameters. It must exceed per-task-affine by more than the seed standard deviation on the token-level and small-data tasks. It must also close at least half of the gap between the naive multi-task model and single-task fine-tuning on CoNLL 2003. As an external sanity anchor for that task, a BiLSTM-CRF tagger reaches 0.87 F1 in Tourille et al..

Why not just…?

Why not just use CA-MTL's feature-wise modulation and conditional layer norm? It works, and it may still win on average. Its weakness is the one its authors state: it remains behind single-task models on token-level NER. It also costs about 12% extra parameters, and the modulation is applied throughout the network. Our comparison is fair head-to-head on the same data. If CA-MTL wins on sentence-level tasks and per-task shapes win on tagging, that split result is itself informative. We will also test whether the two are complementary by running CA-MTL with per-task rational activations added.

Why not just learn a per-task scale and shift around a fixed GELU? This is the most serious threat. Rational functions are known to absorb affine maps (Tang and Townsend), so much of what the per-task curves learn could be exactly this. We do not argue around it; the parameter-matched affine ablation and the affine-plus-residual decomposition of the learned curves are built to answer it. If the affine baseline matches our method within noise, we will report that the benefit comes from per-task affine conditioning of the activation's input and output, and drop the claim that shape matters.

Why not just condition a single sharpness scalar, as MeGan does? MeGan's strong results on style and domain adaptation (Ji et al.) show that a single scalar can go a long way. Those results are on generative adaptation of an 8B model, however, not on interference among structurally different tasks in a shared encoder. Per-task $\beta$ is one of our baselines. If it matches full shapes, the simpler knob wins and the extra coefficients are unjustified.

Why not just fine-tune separately per task, or use a larger model? Separate fine-tuning removes interference but multiplies storage and serving cost by the number of tasks. It is the upper reference against which we measure how much headroom is recovered. A wider model reduces interference by adding capacity, but it leaves the question of where task identity can be stored unanswered. Theory suggests that rational units buy expressivity more cheaply than width ( Rational Neural Networks have Expressivity Advantages), but that has only been shown in vision and reinforcement learning, so we treat it as a hypothesis and not as evidence.

Decisive Checks

The first check is the matched-parameter comparison between per-task rational and per-task affine activations on CoNLL 2003, SQuAD v1.1, CB and WSC. If there is no separation there, the core claim fails. The second is the frozen-backbone transfer to NCBI Disease and MedPost: with the backbone frozen, training only a head and 108 coefficients should beat training a head alone by a clear margin, and should approach full fine-tuning of the head plus top layer. The third is the clustering analysis: if the learned curves group by output format and not by domain or dataset size, that supports the view that activation shape encodes how a task reads out representations. Finally, we will track pole proximity and seed variance on CB. Instability of the per-task coefficients on 250 examples would be a practical limit worth reporting in its own right.