Lightweight Decoding Strategies for Increasing Specificity

Katy Ilonka Gero, Chris Kedzie, Savvas Petridis, Lydia ChiltonarXiv 2021

TL;DR

Large language models (LLMs) often default to "safe," generic responses that lack detail. This paper introduces two lightweight, unsupervised decoding strategies—Normalized Inverse Word Frequency (NIWF) and Positive Point-wise Mutual Information (PPMI)—that reweight a model's output distribution at inference time to favor more specific terms. The result is a significant boost in output specificity with minimal impact on how much the text "makes sense," all without the need for expensive retraining or fine-tuning.

What Problem Does This Paper Address?

Standard language models are notorious for being "vague and generic." When asked to complete a sentence like "Cryptography is used by...", a model might default to high-probability but uninformative completions like "many people" or "large companies." While specific outputs (e.g., "bitcoin miners" or "privacy advocates") are often more desirable in fields like summarization or creative writing, achieving this usually requires supervised fine-tuning on massive, domain-specific datasets.

For modern practitioners, fine-tuning isn't always an option—models like GPT-3 are often too large to retrain, accessible only via API, or being used for tasks where no training data exists. The authors tackle the challenge of controlling specificity as a post-processing step, allowing researchers to "nudge" any pre-trained model toward more informative language without touching its weights.

Methods

The authors propose two unsupervised reweighting schemes that modify the log-probabilities of tokens during the decoding process.

  1. Normalized Inverse Word Frequency (NIWF): This method uses a reference corpus to identify common vs. rare words. It adds a bonus to the log-probability of rare words, effectively penalizing "fluff" words. To prevent the model from generating total gibberish, the authors use a bounded reweighting term that ensures rare words get a modest boost while common words receive almost none.
  2. Positive Point-wise Mutual Information (PPMI): This strategy is more context-aware. It measures the association between potential output tokens and a specific "context" (e.g., keywords from the prompt). By favoring tokens with high PPMI, the model generates words that are topically relevant to the prompt rather than just globally rare.

Both methods are "lightweight" because they only require a reference corpus to calculate word counts and co-occurrences, which can be done once and applied to any model that outputs a probability distribution.

Figure 1: NIWF and PPMI give more weight to more specific words like ‘Bitcoin’ and ‘software’.

Datasets

  • Reference Corpus: The authors used a corpus of Vox news articles (30 million tokens) to estimate word frequencies and PPMI associations.
  • Evaluation Task: A science writing task using five topics from Wikipedia’s list of Computer Science topics (cryptography, human-computer interaction, support vector machines, databases, and data structures).
  • Summarization Use Case: The authors applied their methods to a PEGASUS model fine-tuned on the CNN/DailyMail dataset, specifically testing it on a news article regarding the Colonial Pipeline cyber-attack.

Key Insights and Ideas

  • Unsupervised Control is Viable: You don't need to retrain a giant model to change its "personality." Simple mathematical shifts in the output distribution can effectively steer a model toward specificity.
  • The Sensibility Trade-off: In deterministic settings (like beam search), there is a classic trade-off: as specificity goes up, sensibility (how much the text makes sense) tends to go down. However, the authors found that in stochastic settings (top-k sampling), their methods actually improved sensibility slightly while significantly boosting specificity.
  • Diversity as a Byproduct: These strategies naturally combat the repetitive nature of beam search. By penalizing generic terms, the models produced much more diverse sets of n-grams.

Key Results

The authors used human annotators (PhD students in CS) to score outputs on a 0–4 scale for both sensibility and specificity.

  • Specificity Gains: In beam search, NIWF increased absolute specificity by 0.98 and PPMI by 1.12.
  • Qualitative Shift: As shown in the table below, the "original" model produces generic phrases like "the world's largest companies," while the reweighted versions produce highly specific terms like "Telegram apps" or "bitcoin wallet owners."
Table 1: Example outputs for the different conditions.
  • Summarization Control: The authors demonstrated that by picking a specific context (like "market economics"), they could force a summarization model to focus on specific aspects of a story (e.g., "supply crunch" and "oil industry executives") that the baseline model ignored.
Table 2: Results for generating summaries using specificity reweightings to encourage topical outputs. Italics indicate phrases related to the selected topic.

Limitations and Future Work

  • Sensibility in Deterministic Search: While the drop was modest, the authors acknowledge that reweighting can sometimes lead to less "true" or coherent statements in beam search.
  • Corpus Sensitivity: The effectiveness of NIWF and PPMI depends heavily on the reference corpus. If the corpus doesn't match the domain of the prompt, the reweighting might favor irrelevant "rare" words.
  • Subjectivity of Sensibility: The inter-annotator agreement for sensibility was relatively low ($\kappa = 0.35$), suggesting that defining what "makes sense" in technical writing remains a difficult human evaluation task.

Summary updated

BibTeX
@misc{gero2021lightweight,
  author = {Katy Ilonka Gero and Chris Kedzie and Savvas Petridis and Lydia Chilton},
  title = {{Lightweight Decoding Strategies for Increasing Specificity}},
  year = {2021},
  eprint = {2110.11850},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2110.11850},
}
Figure