← Latest papers
💬 NLP

Mitigating Bias in Locally Constrained Decoding via Tractable Proposals

This paper proposes a generic approach to mitigate bias in locally constrained decoding by constructing tractable, globally constrained proposals via tensorized finite automata and circuit multiplication, enabling efficient Sequential Monte Carlo sampling that converges faster to the target distribution with fewer particles across tasks like function calling and SQL generation.

Original authors: Meihua Dang, Linxin Song, Honghua Zhang, Jieyu Zhao, Guy Van den Broeck, Stefano Ermon

Published 2026-06-02
📖 5 min read🧠 Deep dive

Original authors: Meihua Dang, Linxin Song, Honghua Zhang, Jieyu Zhao, Guy Van den Broeck, Stefano Ermon

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 trying to teach a very creative but slightly chaotic storyteller (a Large Language Model) to write a story that follows a very strict rulebook, like a JSON code format or a specific SQL database query.

The problem is that the storyteller loves to wander. If you just say, "Don't break the rules," they might start a sentence that looks okay at first but becomes impossible to finish correctly by the end.

Here is how the paper solves this problem, using simple analogies:

1. The Old Way: The "Myopic" Guide (LCD)

Imagine the storyteller is walking through a maze. The old method (called Locally Constrained Decoding or LCD) acts like a guide who only looks at the very next step.

  • How it works: If the next step looks like it might hit a wall, the guide blocks it.
  • The Flaw: The guide is "myopic" (short-sighted). They might let the storyteller take a path that looks safe for the next step but leads to a dead end three steps later. The storyteller keeps walking, thinking they are fine, only to realize at the very end that they can't finish the story within the word limit. They have to start over or produce a broken story.

2. The New Way: The "Global Map" (GCD)

The authors propose a new method called Globally Constrained Decoding (GCD).

  • The Analogy: Instead of just looking at the next step, this guide has a complete map of the entire maze and knows exactly how many steps are left to reach the exit.
  • How it works: Before the storyteller takes a step, the guide checks: "If you go this way, can you actually reach the exit within the remaining steps?"
  • The Result: If the answer is "No," the guide blocks that path immediately. This guarantees that no matter what the storyteller chooses, they will always reach a valid ending. It's like having a GPS that only shows you routes that are guaranteed to get you to your destination on time.

3. The "Smart" Map: Adding Probability (P-GCD)

The "Global Map" (GCD) is great at avoiding dead ends, but it treats all valid paths as equal. It doesn't know which path the storyteller prefers or which one is more likely to be a good story.

  • The Analogy: Imagine the storyteller has a favorite way of walking. The basic map just says, "This path is valid." The new Probabilistic GCD (P-GCD) says, "This path is valid, and it's also the path the storyteller is most likely to enjoy."
  • How it works: The authors combine the "Global Map" (the rules) with a "Memory Model" (a simplified version of the storyteller's brain). They multiply these two together.
  • The Result: The guide now doesn't just block bad paths; it gently nudges the storyteller toward the paths that are both valid and high-quality. This makes the storytelling process much more efficient.

4. The "Particle" Race (SMC)

To test these methods, the researchers use a technique called Sequential Monte Carlo (SMC).

  • The Analogy: Imagine you are trying to find the best route through a foggy forest. Instead of sending one person, you send out a swarm of 100 "particles" (explorers).
  • The Old Way: With the short-sighted guide, you need to send out thousands of explorers because many of them will get lost or hit dead ends before they finish.
  • The New Way: With the "Global Map" and "Smart Map," the explorers stay on the right track. You need far fewer explorers to find the perfect path because the guide is so much better at filtering out bad options early on.

5. The "Shape-Shifting" Trick (Tensorization)

One of the paper's technical breakthroughs is how they handle the "Map."

  • The Problem: Complex rules (like JSON schemas) can create maps with millions of paths. Usually, computers get overwhelmed trying to draw these maps on a standard processor.
  • The Solution: The authors turned these complex maps into mathematical blocks (tensors) that fit perfectly onto modern graphics cards (GPUs).
  • The Analogy: It's like taking a giant, messy pile of paper maps and folding them into a compact, high-speed digital chip that a supercomputer can read instantly. This allows the "Global Map" to be calculated in the blink of an eye, even for very complex rules.

Summary of Results

The paper tested this on three real-world tasks:

  1. Function Calling: Making sure AI calls computer functions with the right format (like JSON).
  2. Keyword Generation: Making sure a story includes specific words.
  3. SQL Generation: Writing database queries that are syntactically correct.

The Verdict:

  • Reliability: The new method guarantees the story ends correctly within the word limit, whereas the old method often failed at the finish line.
  • Efficiency: To get the same quality of results, the new method needed significantly fewer "explorers" (particles) than the old method.
  • Speed: While the "Smart Map" (P-GCD) takes a bit more computing power, it is still fast enough to be practical, and the "Global Map" (GCD) is almost as fast as the old method.

In short, the paper gives AI a "Global Map" and a "Smart Nudge" so it can follow strict rules without getting lost, wasting time, or producing broken code.

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 →