Frustratingly Simple Black-Box Adaptation of Language Models via Logit Bias

Ofek I. Cohen, Lior Shani, Aviv Rosenberg, Ankur Samanta, Tal Wagner, Yonathan EfroniarXiv 2026

Here is a blog-style summary of the paper.

Frustratingly Simple Black-Box Adaptation of Language Models via Logit Bias

TL;DR

Adapting large language models (LLMs) via black-box APIs usually requires complex prompt engineering or expensive, often inaccessible fine-tuning. This paper introduces a remarkably simple alternative: learning a single, context-independent logit-bias vector from black-box rollouts. This lightweight decoding-time intervention improves performance on reasoning tasks and controls output verbosity without modifying model weights or requiring gradient access.

What Problem Does This Paper Address?

When deploying frontier language models, organizations often need to adapt them to specific operational requirements—such as enforcing strict output formatting, shortening reasoning traces, or improving accuracy on niche, in-house data distributions.

However, in many practical settings, the model is only accessible through an inference API. This "black-box" constraint rules out standard adaptation techniques like fine-tuning or Parameter-Efficient Fine-Tuning (PEFT, like LoRA), which require direct access to model weights and gradients. While prompt optimization is a common workaround, it consumes valuable context length and can unpredictably interfere with the model's underlying instructions.

The authors ask a deceptively simple question: Can we adapt a frozen language model purely through its output channel by learning a single, static vector to bias the generation probabilities?

Methods

The paper proposes black-box logit-bias adaptation. Instead of modifying the input prompt or the model's internal weights, this method adds a fixed logit-bias vector ($\delta$) to the model's generated logits at every single decoding step before the final softmax sampling occurs.

Figure 1: Overview of logit-bias steering. The fixed logit-bias vector δ is added to the base model’s logits at every decoding step before sampling. Only δ is optimized; model weights remain unchanged.

To find the optimal bias vector without gradients, the authors leverage a KL-regularized reinforcement learning (RL) framework. They show that under an "approximate factorization" assumption—meaning the ideal token-level correction remains relatively stable across different contexts—the optimal bias can be estimated in closed form.

The optimization process works as follows:

  1. On-Policy Rollouts: Collect a dataset of completions, rewards, and token probabilities from the base model.
  2. Inverse Propensity Scoring (IPS): Use a closed-form IPS estimator to calculate the expected reward impact of promoting or suppressing individual tokens.
  3. Additive Smoothing: Apply a smoothing constant ($\alpha$) to stabilize the estimates for rare tokens and prevent mathematical errors (like log zero).

The resulting vector requires zero weight updates, zero gradient backpropagation, and can be deployed instantly using standard logit_bias parameters already exposed by major LLM hosting providers (like OpenAI, vLLM, and Azure).

Datasets

The authors evaluated their method on three challenging mathematical and reasoning benchmarks:

  • MATH: A dataset of complex high-school level competition math problems.
  • GSM8K: Grade School Math problems requiring multi-step reasoning.
  • GPQA-main: A graduate-level, Google-proof science and math question-answering benchmark.

Key Insights and Ideas

  • The Power of the Output Channel: Modifying output token distributions directly can act as a powerful "correctness prior." It bypasses the need to alter complex internal representations.
  • Steering via Formatting and Cues: A static bias vector cannot teach a model new context-dependent reasoning steps. However, it can significantly boost accuracy by steering the model toward clean formatting, structured layouts, and decisive stopping tokens, while suppressing common failure modes like rambling prose, prompt-template drifting, or repetitive lecturing.
  • Compute-Efficient Optimization: Because the IPS estimator can be computed via a single reward-weighted matrix-vector product, sweeping hyperparameters (like the regularization strength $\tau$ or smoothing factor $\alpha$) is incredibly cheap compared to iterative gradient-based training.

Key Results

The "frustratingly simple" intervention yielded consistent improvements across the board:

  • Accuracy Gains: On the MATH benchmark, applying full-vocabulary logit bias to Meta-Llama-3.1-8B-Instruct improved exact-match accuracy from 30.30% to 33.14%. On GPQA, accuracy jumped from 22.20% to 28.90%.
  • Verbosity Control: When optimized for compression (shortening outputs without losing accuracy), the learned logit bias successfully reduced average completion lengths on MATH for Gemma-2-9B-IT (from 315 to 299 tokens) and Llama-8B (from 941 to 864 tokens).
  • Parameter Efficiency: While standard fine-tuning methods like LoRA-GRPO still achieve higher absolute accuracy by altering internal reasoning capabilities, logit-bias adaptation achieves its gains using only ~128k trainable parameters (the vocabulary size) compared to the $\sim10^7$ parameters required by LoRA.

Limitations and Future Work

While highly practical, the method has clear boundaries:

  • Context Blindness: A fixed logit-bias vector applies the exact same token adjustments regardless of the history. It cannot implement conditional logic or fix specific calculation errors that depend on the prompt.
  • Over-Compression Risks: When optimizing for shorter answers, the bias can occasionally become over-aggressive, suppressing necessary mathematical derivations alongside unwanted verbosity.
  • Rare-Token Variance: The IPS estimator suffers from high variance on rare tokens that seldom appear in the training rollouts, sometimes leading to spurious token promotions.

The authors suggest that future work should focus on developing more sophisticated smoothing techniques for rare tokens, exploring lightweight context-dependent or dynamic logit biases, and evaluating the safety and fairness impacts of output-channel steering.

Summary updated

BibTeX
@misc{cohen2026frustratingly,
  author = {Ofek I. Cohen and Lior Shani and Aviv Rosenberg and Ankur Samanta and Tal Wagner and Yonathan Efroni},
  title = {{Frustratingly Simple Black-Box Adaptation of Language Models via Logit Bias}},
  year = {2026},
  eprint = {2607.22837},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2607.22837},
}
Figure