Mitigating the Influence of Distractor Tasks in LMs with Prior-Aware Decoding

Raymond Douglas, Andis Draguns, Tomáš Gavenčiak · Submission to ICLR 2025 · Rejected

TL;DR

Large language models frequently succumb to "distractor tasks"—such as following an injected prompt or mindlessly continuing a familiar sequence—an issue that often worsens with model scale (inverse scaling). To counter this, the authors model LMs as a "product of experts" and introduce Prior-Aware Decoding (PAD), an inference-time technique that contrasts full-prompt logits against a "weakened" prompt that isolates the distractor prior. Evaluated across 11 models and 4 tasks, PAD improved performance in 41 out of 44 model-task combinations, delivering a 40% median increase in task completion.

What Problem Does This Paper Address?

Language models are exceptional pattern recognizers, but this strength can turn into a critical failure mode when prompts trigger competing tasks. These "distractor tasks" manifest in two primary ways:

  1. Semantic overrides, such as indirect prompt injection where a new instruction overrides the original system prompt.
  2. Strong local priors, where models default to common training distributions—such as reciting the standard alphabet even when explicitly commanded to skip a letter (e.g., skip "D").

Crucially, this problem is not solved by simply scaling up compute or parameter counts. In fact, many distractor tasks exhibit inverse scaling, where larger models perform worse because they have learned the distractor patterns or surface-level priors even more strongly. Standard prompting often fails to suppress these entrenched behaviors.

Methods

The authors conceptualize language model generation as a product of experts (a geometric mixture) between two internal processes:

  • $p_C$: the contextual distribution that adheres to the intended task.
  • $p_L$: the distribution driven by strong, local distractor priors.

By assuming the model's actual output is a mixture $p_M \propto p_C^{\gamma^*} p_L^{1-\gamma^*}$, the true task-following distribution $p_C$ can be isolated by reweighting. In logit space, this translates into an intuitive extrapolation:

$$L_{\text{PAD}} = L_O + \alpha(L_O - L_W)$$

Where:

  • $L_O$ represents the logits obtained using the original prompt (task description $T$ + input data $D$).
  • $L_W$ represents the logits from a weakened prompt designed to amplify the distractor task (typically by stripping the task description, leaving only data $D$).
  • $\alpha$ is a tunable extrapolation coefficient.
Original Prompt (T + D)  ──► Model ──► Logits L_O ┐
                                                   ├──► L_PAD = L_O + α(L_O - L_W) ──► Output
Weakened Prompt (D only) ──► Model ──► Logits L_W ┘

Unlike traditional Contrastive Decoding (which contrasts a large model against an amateur, smaller model), PAD runs two forward passes through the same model with different prompt contexts. The paper also provides an algorithm variant for API-only models where token candidate sets differ between calls.

Datasets

The authors evaluated PAD across four task suites:

  • Three tasks from the Inverse Scaling Prize:
  • Prompt Injection: Instructions designed to hijack model focus away from the intended directive.
  • Pattern Match Suppression: Prompts requiring the model to break alternating token patterns (e.g., continuing A, B, A, B, A, with anything except B).
  • Redefine: Tasks redefining standard words (e.g., "Swap the meaning of lawful and unlawful. Is fraud lawful?").
  • Strong Local Priors (Custom Benchmark): A synthetic benchmark testing common sequence alterations, such as reciting the alphabet while skipping specific letters.

Key Insights and Ideas

  • Why traditional contrastive decoding fails on inverse scaling: Prior contrastive methods contrast large models against smaller ones. However, under inverse scaling, larger models succumb more strongly to distractor tasks. PAD shows that contrasting the model against a smaller version yields almost no improvement (0.3% median gain), while self-contrasting against a prompt-weakened state yields dramatic gains.
  • Total Variation Distance (TVD) as a diagnostic: The authors define strong priors formally using the TVD ($\delta$) between next-token distributions of the full prompt and stripped prompt: $\delta(p_M(\cdot|TD), p_M(\cdot|D))$. They found that PAD provides the highest relative performance gain on prompts where $\delta$ is smallest—i.e., exactly where the model's unguided prior was already overwhelming the instruction.

Key Results

The method was tested across 11 models (spanning GPT-2 variants, Llama-2-7B/13B, Mistral-7B, Mixtral-8x7B, and OpenAI API models):

  • Universal Gains: PAD outperformed baseline greedy/temperature decoding in 41 out of 44 task-model pairs at $\alpha = 2.0$.
  • Magnitude of Improvement: Across all tasks, $\alpha = 2.0$ yielded a 30 percentage point mean improvement and a 40% median relative increase in task completion over the baseline.
  • Reversing Inverse Scaling: On tasks where larger models traditionally performed worse than smaller ones (such as Redefine and Prompt Injection), PAD restored expected performance scaling without requiring any fine-tuning or parameter updates.

Limitations and Future Work

  • Inference Overhead: PAD requires two forward passes per token generation step, effectively doubling inference compute costs.
  • Prompt Decomposition Dependency: The primary method relies on cleanly separating prompts into task instructions ($T$) and data inputs ($D$). While the authors tested a task-agnostic "system prompt weakening" alternative, it produced marginal gains (<1 percentage point average improvement).
  • Hyperparameter Sensitivity: Setting $\alpha$ too high can amplify logit-level variance and degrade text fluency or correctness.
  • Future Directions: Scaling PAD to more complex jailbreaks, exploring automated ways to generate weakened prompts, and integrating the approach with internal representation steering methods like activation addition.

Summary updated

Abstract

The broad capabilities of Language Models (LMs) can be limited by their sensitivity to distractor tasks: LMs can infer secondary tasks from the prompt in addition to the intended one, leading to unwanted outputs. For example, prompt injection attacks can cause models to deviate from explicit directives. In some ‘inverse scaling’ cases, this unwanted behaviour actually worsens as models scale up to at least 540B parameters. We present a theoretical framework that interprets LMs as a product of experts that combine multiple data generation processes. Based on this framework, we introduce prior-aware decoding (PAD) -- a simple contrastive inference method to reduce the influence of distractor tasks. We apply PAD to eleven models, across four datasets, and find improvements in 41 out of 44 task-model combinations, with a median increase in task completion proportion of 40%. The results suggest a promising direction for further development towards more reliable language models.
BibTeX
@misc{douglas2024mitigating,
  author = {Raymond Douglas and Andis Draguns and Tomáš Gavenčiak},
  title = {{Mitigating the Influence of Distractor Tasks in LMs with Prior-Aware Decoding}},
  year = {2024},
  eprint = {2401.17692},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.17692},
}
Figure