← Latest papers
🤖 machine learning

Variational Learning for Insertion-based Generation

This paper introduces the Insertion Process (IP), a variational learning framework that enables variable-length non-monotonic sequence generation by learning data-driven insertion orders through a bijective correspondence between insertion trajectories and permutations, thereby improving modeling quality and generalization in domains lacking a canonical left-to-right structure.

Original authors: Yangtian Zhang, Zhe Wang, Arthur Gretton, Rex Ying, David van Dijk, Michalis K. Titsias, Jiaxin Shi

Published 2026-06-02
📖 4 min read☕ Coffee break read

Original authors: Yangtian Zhang, Zhe Wang, Arthur Gretton, Rex Ying, David van Dijk, Michalis K. Titsias, Jiaxin Shi

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 build a complex Lego castle.

The Old Way (Autoregressive Models):
Most AI models today build like a strict construction crew that only works from left to right. They lay the first brick, then the second, then the third, and so on. If they realize halfway through that they need a tower in the middle of the wall, they can't just pop a brick in there. They have to tear everything down and start over, or awkwardly try to build the tower on top of the existing wall, which often leads to a wobbly, unstable mess. This works fine for simple sentences, but it struggles with complex structures where the "middle" depends on the "end."

The Problem with Current "Flexible" Models:
Scientists have tried to fix this with "masked diffusion" models. Think of these as a crew that starts with a pre-determined number of empty Lego slots (a fixed grid) and randomly fills them in.

  • The Flaw 1: They are stuck with a fixed number of slots. If you want a tiny house or a massive skyscraper, you have to guess the size beforehand.
  • The Flaw 2: They don't really care when they fill a slot. They might fill the roof before the foundation, or the chimney before the walls. While this is flexible, it's inefficient because the AI has to learn to be consistent with every possible order of construction, which is a massive, confusing task.

The New Solution: The "Insertion Process" (IP)
The authors of this paper introduce a new way to build called the Insertion Process. Imagine a master builder who doesn't follow a fixed grid or a left-to-right rule. Instead, they have a magical ability to:

  1. Look at the half-built structure.
  2. Decide exactly where to insert the next piece (e.g., "I'll put this window right in the middle of the wall").
  3. Decide what piece to put there.
  4. Decide when to stop (e.g., "The castle is done, no more bricks needed").

This model learns to build in the best order for the specific task, rather than forcing a rigid order.

How They Made It Work (The "Magic Trick")
The tricky part was teaching the AI to learn this "best order" mathematically. If you try to teach it by letting it guess random insertion spots, the math gets messy and unstable.

The authors discovered a clever mathematical shortcut. They realized that every possible way to build a sequence is actually just a different way of ordering the same final pieces.

  • Analogy: Imagine you have a deck of cards. Whether you deal them one by one from the top, or shuffle them and deal them in a weird pattern, the final hand is the same. The "Insertion Process" translates the messy act of "inserting into a growing pile" into a clean, organized "permutation" (a specific ordering) of the final cards.
  • By doing this translation, they could use a standard, efficient training method (Variational Inference) to teach the AI which ordering is best for the data it's seeing.

What They Tested It On
The paper tested this new builder on two specific challenges where the "left-to-right" rule makes no sense:

  1. Planning a Path (Mazes):

    • The Task: The AI had to generate a path through a maze, visiting specific checkpoints.
    • The Result: The old "left-to-right" builders got stuck because they couldn't easily jump back to fill a gap in the path. The new Insertion Process could jump around, filling in the gaps between checkpoints perfectly. It solved almost 100% of the hardest mazes, while the old methods failed miserably.
  2. Designing Molecules (Chemistry):

    • The Task: The AI had to generate valid chemical strings (SMILES). These strings are like a map of a molecule. A valid map needs parentheses to match up (like opening and closing a ring) and numbers to connect distant parts.
    • The Result: The new model learned a "smart" way to build. It didn't just add atoms randomly. It learned to first build the "skeleton" (the rings and connections) and then fill in the atoms.
    • Why it matters: This allowed the AI to create valid, unique, and novel molecules much better than models that just append pieces to the end. It learned the "grammar" of chemistry without being explicitly told the rules.

The Bottom Line
This paper presents a new way for AI to generate sequences (like text, plans, or chemical formulas) that doesn't force a rigid "start-to-finish" order. Instead, it learns to insert pieces exactly where they are needed, when they are needed. By using a clever math trick to translate "insertion" into "ordering," they trained a model that is better at handling complex, variable-length tasks than previous methods.

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 →