Where Prompt Brittleness Goes When a Model Is Specialized

When a language model is fine-tuned to do one job, such as sentiment labeling, code summarization, or medical term classification, practitioners usually assume it stops caring how it is asked. Generalist models are known to be fragile. Swapping a field label from "Passage:" to "Input:", changing a separator, or adding a trailing space can move accuracy by tens of points. A specialized model, the thinking goes, has the task built into its weights and no longer needs to interpret wording. This note proposes testing that assumption directly. Our hypothesis is that specialization does not remove brittleness but relocates it. Sensitivity to the wording of the instruction falls. Sensitivity to the structural tokens of the training template (field names, delimiters, whitespace) and to the surface form of the task input itself rises, because the fine-tuned model learns to key on the exact surface it was trained on.

The question matters because specialized small models are increasingly deployed behind deterministic parsers, compilers, and tool APIs. In that setting a changed delimiter or a reworded input is a real failure, not a scoring artifact. The project has three parts. It measures brittleness separately along three axes, before and after specialization, across model scales. It traces the shift inside the model using known task-encoding attention heads. It then identifies the cheapest training change that closes each axis. A possible outcome is that cheap template augmentation suffices for some axes but not others. That would be a useful finding in itself, and the experiments are designed so it can be reached.

Core Claim

We claim that sensitivity should be split into three components rather than reported as one number.

The first is instruction sensitivity: meaning-preserving rewording of the task description. The second is format sensitivity: the descriptor, separator, and casing grammar of Quantifying Language Models' Sensitivity to Spurious Features in Prompt Design. The third is input sensitivity: meaning-preserving edits to the task input, such as synonyms, whitespace, and casing, with the label held fixed.

Our prediction is that standard fixed-template task fine-tuning shrinks the first component and enlarges the second and third relative to the prompted base model. Instruction-free specialization in the style of Jatmo shrinks the first to zero by construction, but only pushes the problem into the other two.

Three pieces of prior work motivate this prediction.

  • Learning or Self-aligning? Rethinking Instruction Fine-tuning finds that instruction fine-tuning mainly aligns output surface with existing knowledge. This suggests fine-tuning teaches surface mappings that could be tied to the training surface.
  • The spurious-features paper shows that internal representations cluster by formatting tokens. This gives a mechanism by which a model trained on one format could treat another as out-of-distribution.
  • Jatmo compiles task logic into base-model weights to defeat prompt injection. It explicitly leaves open whether doing so eliminates prompt sensitivity or merely transfers it to input phrasing. That open question is our central question.

Relation to the Closest Work

Two papers already train for prompt robustness, and the proposal must be clearly different from both.

PAFT: Prompt-Agnostic Fine-Tuning samples from a pool of 400 synthetic instructions during fine-tuning. It reports on average 7% higher accuracy on 50 unseen prompts across general benchmarks such as HellaSwag, GSM8K, and HumanEval. It varies only instruction text, works at the multi-benchmark level, and never decomposes sensitivity or examines input-side perturbations.

Towards Self-Robust LLMs: Intrinsic Prompt Noise Resistance via CoIPO aligns output distributions between clean and noisy prompts during general post-training on FLAN. It reduces the clean-to-noisy drop on Qwen2.5-7B to 0.54%. It does not evaluate structural formatting variation, and it reports that keyword and synonym substitution remains the weakest case.

Neither paper asks what narrow specialization does to sensitivity, or along which axis. We reuse both methods as treatments, not as our contribution.

We also draw on two diagnostic papers.

  • Instruction Fine-Tuning: Does Prompt Loss Matter? shows that a small nonzero loss on prompt tokens (weight around 0.24) regularizes short-completion tuning. Short completions are exactly the regime of classification-style specialization. That paper never measured robustness, so we include prompt-loss weighting as a near-free candidate fix.
  • Shared Lexical Task Representations Explain Behavioral Variability In LLMs identifies "lexical task heads": attention heads whose outputs, read through the vocabulary, spell out the task. Patching these heads recovers 10% to 90% of performance on failing prompts. That study is inference-only and uses toy lexical tasks. We supply the method for tracking these heads through fine-tuning.

Research Program

We build matched model pairs. Each pair consists of a base or instruction-tuned checkpoint before and after task specialization, at four scales from roughly 0.5B to 8B parameters. Each is specialized with LoRA and with full fine-tuning on narrow tasks drawn from two sources. The first is the 53-task Super-NaturalInstructions subset used by the formatting-sensitivity paper, where a perturbation grammar already exists. The second is the seven Jatmo tasks, which come with a teacher-distilled training pipeline.

For every model we construct three disjoint perturbation sets. Instruction rewordings come from PromptBench's attack families via the promptbench codebase. Format variants are sampled from the FormatSpread grammar. Input edits apply the same character- and word-level operators to the input field only. We human-check a sample of input edits for label preservation, mirroring PromptBench's validation, in which over 85% of its adversarial prompts were judged meaning-preserving.

We report three quantities per axis:

  • the spread between the best and worst variant,
  • the relative performance drop, and
  • the instance flip rate, meaning the fraction of items whose correctness changes across variants. This follows the prompt-multiplicity view of Rethinking Hallucinations.

The mechanistic part locates lexical task heads in each base model and measures their activation strength under each perturbation axis, before and after specialization. Two alternatives are distinguished. In one, specialization makes the task signal independent of these heads, so that patching them has no effect afterward. In the other, the heads become keyed to the training template, so their activation collapses under format variants and patching them restores accuracy. The second outcome would give a causal account of the predicted increase in format sensitivity.

The intervention part compares four training changes under a matched budget, each targeting the axes it plausibly covers:

  • prompt-loss weighting,
  • template augmentation with a small number $K$ of formats and wordings in the style of PAFT,
  • input-side augmentation, and
  • a paired consistency loss in the style of CoIPO, applied to task fine-tuning.

The aim is a map of which fix closes which axis, and the smallest $K$ at which augmentation saturates.

Evaluation Protocol

Flaw or Artifact? Rethinking Prompt Sensitivity in Evaluating LLMs shows that rigid parsers inflate measured sensitivity. Its example is Gemma-2.0 on ARC-Challenge, where the standard deviation across templates falls from 0.28 to 0.005 when an LLM judge replaces the parser.

We therefore score every output twice. One score uses the deployment parser (exact label, valid JSON, compilable code). The other uses a model judge of semantic correctness. We report the gap between them as its own quantity. A shift in brittleness that appears only under the parser is still a real deployment failure. Even so, we will not claim it as a change in the model's understanding of the task.

Baselines

Naive reference points. The first is the unspecialized model prompted zero-shot and one-shot with the canonical template, measured on all three axes. This establishes whether specialization helps or hurts sensitivity at all. The only published sensitivity reference for this setting is from the formatting-sensitivity paper: an average spread of about 10 accuracy points across 50+ tasks on LLaMA-2-13B, and a median spread of 6.4 points for GPT-3.5. The second naive reference is standard fixed-template supervised fine-tuning with full prompt masking. This is what practitioners actually ship.

Jatmo-style instruction elimination. This baseline from Jatmo removes the instruction axis entirely. Jatmo reports about 98% of teacher utility and under 0.5% attack success. It reports nothing on benign format or input variation, so on those axes we have no reported result found on Lacuna for Jatmo models.

PAFT-style template augmentation. This is the strongest existing competitor. It is the simplest method that could make the whole problem disappear, and its reported gain of 7% average accuracy on unseen prompts comes from PAFT. We run it with the same task data, the same optimizer steps, and the same learning-rate and LoRA-rank search as every other arm. Its template pool is drawn from a grammar disjoint from the test variants, so success cannot come from overlap with the test set.

CoIPO-style paired consistency loss. This is the strongest intrinsic-robustness method. It reports a 0.54% clean-to-noisy drop on Qwen2.5-7B and a 3.64% average gain over COIN on NoisyPromptBench, from CoIPO. Here it is adapted to the single-task setting with an identical budget.

Ablations. Prompt-loss weighting alone isolates whether merely modeling the prompt tokens confers robustness. Input-side augmentation alone isolates the input axis.

What counts as success. Any proposed combination beats the strongest baseline only if it lowers the worst-axis flip rate by at least the seed-to-seed standard deviation without losing clean accuracy. The descriptive claim succeeds only if fixed-template specialization measurably enlarges format or input sensitivity relative to the prompted base, under both scorers.

Why not just…?

Why not just augment templates during fine-tuning, as PAFT does? This is the main threat, and we treat it as a hypothesis to test rather than dismiss. PAFT varies instruction text. Augmentation over formats may also close the format axis. Nothing in PAFT's design touches the input field, and CoIPO reports that synonym substitution resists even targeted training. Our prediction is therefore that template augmentation leaves input-side flips largely intact. If augmentation with a small $K$ closes all three axes, the proposal's practical recommendation becomes "augment and stop." The decomposition and head analysis then stand as the explanation of why this works.

Why not just remove the instruction, as Jatmo does? Removing the instruction removes one axis by construction. Jatmo's own authors leave open whether the sensitivity moves to input phrasing. Our input-axis measurement on the same seven Jatmo tasks answers that question directly.

Why not just add a few demonstrations? ProSA finds that the jump from zero-shot to one-shot gives the largest robustness gain. However, On the Relation between Sensitivity and Accuracy in In-Context Learning shows that the ordering of demonstrations becomes a new source of instability. Demonstrations also add context cost that specialized deployments are meant to avoid. We include one-shot prompting of the base model as a reference arm, so its robustness per unit of inference cost is measured rather than assumed.

Why not just score with a model judge? A judge changes only how outputs are scored. A specialized model feeding a compiler or tool call fails on a malformed output regardless of how a judge would rate it. We report both scores precisely so a reader can see how much of any shift survives semantic scoring.

Decisive Checks

The descriptive claim is falsified if fixed-template specialization lowers sensitivity on all three axes relative to the prompted base, at every scale, under both scorers. The mechanistic claim is falsified if lexical-task-head activation is unchanged across format variants after fine-tuning while accuracy still drops. The practical claim, that some axis needs more than augmentation, is falsified if PAFT-style augmentation at matched budget matches the consistency loss on the input axis within seed variance. Each outcome is informative, and the project yields a usable recommendation for anyone shipping a fine-tuned small model behind a strict parser.