Logit Reweighting for Topic-Focused Summarization

Joschka Braun, Bálint Mucsányi, Seyed Ali BahrainianarXiv 2025 · DOI

TL;DR

Generating topic-focused summaries with small-to-medium language models is tricky; fine-tuning is expensive, and prompt engineering often degrades overall text quality. This paper introduces a lightweight, inference-time technique that directly reweights the logits of topic-relevant tokens during generation. Their "Threshold Selection" method successfully steers the model's focus toward specific topics without compromising the fluency or coherence of the summary, offering a cheap alternative to RLHF or DPO.

What Problem Does This Paper Address?

Abstractive summarization typically condenses an entire article into a general overview. However, users often want a summary tailored to a specific theme (e.g., extracting only the financial details from a general news report).

Achieving this topical focus usually requires extensive model retraining (like Direct Preference Optimization or RLHF), which is resource-intensive and requires heavily annotated data. The standard lightweight alternative—prompt engineering (e.g., "Summarize this text and focus on topic X")—frequently fails with smaller instruction-tuned models. When prompted this way, smaller models tend to awkwardly parrot the prompt's instructions or force topic words into the text unnaturally, severely degrading the overall fluency and quality of the summary. The authors aim to find a middle ground: a universally applicable, training-free method to control thematic content.

Methods

Instead of changing the prompt or the model weights, the authors intervene at inference time by manipulating the model's output logits using a custom Hugging Face LogitsProcessor. They identify topic-relevant tokens using an LDA (Latent Dirichlet Allocation) model and test three distinct ways to boost these tokens during generation:

  1. Constant Shift: Simply adds a flat constant value $c$ to the logits of all topic-relevant tokens.
  2. Factor Scaling: Multiplies the logits of topic-relevant tokens by a scaling factor $\alpha$.
  3. Threshold Selection (The Novel Standout): First, it converts logits to softmax probabilities. If a topic-relevant token's probability exceeds a predefined threshold $\theta$ (meaning the model already thinks it's a somewhat logical next word), its logit is boosted to match the maximum logit in the current distribution, plus a small bonus $\beta$.

They compare these interventions against a baseline of standard prompt engineering using greedy decoding and beam search.

Datasets

  • NEWTS: A dataset specifically designed for topical summarization, derived from the well-known CNN/DailyMail corpus. It contains 2,400 training and 600 test samples.
  • Each sample includes a source article and two reference summaries, each focused on one of the two most prominent topics in the text.
  • The dataset includes an associated LDA model with 250 distinct topics. The authors use the top 25 words from a given LDA topic (expanded with lemmas and stems) to define the "topic-relevant" vocabulary for their logit reweighting.

Key Insights and Ideas

  • Prompting hurts quality in smaller models: The baseline experiments revealed that simply prompting Gemma-2B or Llama-3-8B to focus on a topic successfully increased topic relevance, but tanked summary quality. The models became hyper-fixated on the prompt instructions, sacrificing natural phrasing.
  • Context-aware boosting is crucial: The Threshold Selection method works so well because it acts as a conditional boost. By only boosting tokens that have already crossed a probability threshold, it prevents the model from injecting topic words where they grammatically don't belong (e.g., forcing a noun where a preposition is needed).
  • The "Sign" of logits breaks Factor Scaling: The authors discovered a fascinating quirk with Factor Scaling. Some models (like Gemma) output predominantly negative logits, while others (like Llama) output positive ones. Multiplying by a factor $>1$ boosts positive logits but penalizes negative ones. This makes Factor Scaling highly unpredictable across different model architectures.
  • Beam search acts as a topical multiplier: Combining logit reweighting with beam search (4 beams) amplified the topical focus. Because beam search explores multiple paths, it naturally gravitates toward the branches heavily populated by the artificially boosted topic tokens.

Key Results

  • Threshold Selection Wins: Lowering the probability threshold steadily increased all three topicality metrics (lemmatization, tokenization, and dictionary-based scores) without any meaningful degradation in text quality (measured by ROUGE-L, BERTScore, and MAUVE).
  • Constant Shift is brittle: While Constant Shift worked, it required careful tuning. If the shift constant exceeded 10, the generated summaries devolved into pure topic-word gibberish, destroying fluency.
  • Model Scaling: Across all settings, the larger Llama-3-8B model achieved higher absolute topicality and quality scores compared to the Gemma-2B model.

Limitations and Future Work

Limitations: * The approach was only evaluated on a single news-domain dataset (NEWTS) and two relatively small models (2B and 8B parameters). * Topic definitions relied entirely on an LDA bag-of-words approach; more nuanced semantic topic representations might yield different results. * Evaluation relied strictly on automated metrics (ROUGE, BERTScore, MAUVE) without human evaluation to verify perceived fluency.

Future Work: * Dynamic Intervention: The authors suggest dynamically adjusting the intervention strength based on the part of speech. For example, turning off the logit boost when the model is about to output a function word (like "and" or "the"), and turning it up when predicting content-bearing nouns or verbs. * Activation Steering: Exploring intermediate activation steering (modifying the model's internal hidden states) as an alternative to output logit manipulation for free-form text generation.

Summary updated

Abstract

Generating abstractive summaries that adhere to a specific topic remains a significant challenge for language models. While standard approaches, such as fine-tuning, are resource-intensive, simpler methods like prompt engineering often struggle to maintain topical focus, particularly with smaller models. To address this, we propose a lightweight method that enhances topical relevance by directly reweighting the logits of topic-relevant tokens during generation. We evaluate three such reweighting techniques: Constant Shift, which adds a constant value to logits; Factor Scaling, which multiplies them by a factor; and Threshold Selection, which selectively boosts logits that exceed a probability threshold. Experiments on the NEWTS topical summarization dataset, using both Gemma-2B and Llama-3-8B models, show that these techniques effectively increase the use of topic-relevant vocabulary. Notably, the Threshold Selection method successfully improves topical focus without compromising summary quality-a trade-off often seen in other approaches. Our findings demonstrate that directly reweighting logits is a practical and resource-efficient alternative to fine-tuning, offering a promising pathway for precisely controlling the thematic content of generated text.
BibTeX
@misc{braun2025logit,
  author = {Joschka Braun and Bálint Mucsányi and Seyed Ali Bahrainian},
  title = {{Logit Reweighting for Topic-Focused Summarization}},
  year = {2025},
  eprint = {2507.05235},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.05235},
}
Figure