← Latest papers
📊 statistics

Top-H Decoding: Adapting the Creativity and Coherence with Bounded Entropy in Text Generation

This paper introduces Top-H decoding, a novel sampling algorithm based on an entropy-constrained mass maximization framework that effectively balances creativity and coherence in large language models, outperforming state-of-the-art methods like min-p sampling on creative writing benchmarks while maintaining robustness in factual tasks.

Original authors: Erfan Baghaei Potraghloo, Seyedarmin Azizi, Souvik Kundu, Massoud Pedram

Published 2026-05-12
📖 5 min read🧠 Deep dive

Original authors: Erfan Baghaei Potraghloo, Seyedarmin Azizi, Souvik Kundu, Massoud Pedram

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are asking a very smart, well-read robot to tell you a story. You want the story to be creative (full of surprising, wild ideas) but also coherent (making logical sense, not gibberish).

The problem is, when you tell the robot to "be creative," it often gets too excited. It starts picking words that are so unlikely that the story falls apart. This is the "Creativity vs. Coherence" struggle.

The Old Ways: The "Top-K" and "Top-P" Filters

Previously, researchers tried to fix this with simple filters:

  • Top-K: "Only pick from the top 50 most likely words." This is like a strict teacher who only lets you use a small, safe vocabulary. It's coherent, but boring.
  • Top-P (Nucleus): "Pick from the smallest group of words that adds up to 90% of the probability." This is a bit more flexible, but if the robot is unsure, it might accidentally include some very weird words just to fill the quota, ruining the story.
  • Min-P: A newer method that says, "If the robot is very confident about the best word, cut off the weird ones aggressively. If it's unsure, be more lenient." This works well, but it has a blind spot: it only looks at the single best word to decide how confident the robot is. It ignores the rest of the crowd.

The New Method: Top-H Decoding

The authors of this paper propose a new method called Top-H. Think of it as a Smart Traffic Controller for words.

Instead of just looking at the "fastest car" (the top word) to decide how much traffic to allow, Top-H looks at the entire traffic jam (the whole probability distribution).

Here is how it works, using a simple analogy:

The "Entropy" Meter (The Measure of Chaos)

Imagine the robot's brain is a room full of people shouting different words.

  • Low Entropy (Calm): Everyone is shouting the same thing, or just a few people are shouting loudly. The robot is very confident.
  • High Entropy (Chaos): Hundreds of people are shouting different things at once. The robot is confused and unsure.

Old methods (like Min-P) only check the volume of the loudest person to guess how chaotic the room is. If the loudest person is shouting loudly, Min-P assumes the room is calm and cuts off the others. But what if there are 50 other people shouting just a bit quieter? The room is actually chaotic!

Top-H measures the total noise level (entropy) of the whole room.

  • If the room is calm (low entropy), Top-H says, "Great, we know what we're doing. Let's only let the top few people speak." (High coherence).
  • If the room is chaotic (high entropy), Top-H says, "Whoa, there's a lot of uncertainty here. We need to let more people speak to keep the story interesting, but we must set a limit so it doesn't become a screaming match." (High creativity, but controlled).

The "Greedy" Algorithm

The paper proves that finding the perfect group of words to balance this is a mathematically impossible puzzle (called "NP-hard"). It's like trying to find the perfect combination of ingredients for a cake where you have a million options, but you can't test them all.

So, Top-H uses a Greedy Algorithm. Imagine you are building a tower of blocks.

  1. You start with the biggest, most stable block (the most probable word).
  2. You keep adding the next biggest block.
  3. After every block, you check: "Is the tower getting too wobbly?" (Is the entropy too high?)
  4. If the tower is still stable (within the "entropy budget"), you keep adding.
  5. The moment adding one more block would make it wobble too much, you stop.

This ensures you get the most interesting words possible without the story collapsing into nonsense.

What the Paper Found

The authors tested this "Smart Traffic Controller" against the old methods on various tasks:

  • Creative Writing: Top-H wrote stories that were significantly more creative and coherent than the others, especially when the robot was told to "be wild" (high temperature settings).
  • Reasoning Tasks: It also did better at math and logic puzzles, proving it doesn't just make things up; it stays grounded.
  • Speed: It is almost as fast as the other methods, so it doesn't slow down the robot.

The Bottom Line

Top-H is a new way for AI to choose its words. Instead of guessing based on just the "best" option, it measures the overall "confidence" of the AI. If the AI is sure, it sticks to safe words. If the AI is exploring, it allows more variety but keeps a strict leash to prevent the story from falling apart. It's like having a creative director who knows exactly when to let the actors improvise and when to stick to the script.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →