NeurIPS 2026QuestionsPapersAreasAboutMarkdown

Exact Regular-Constrained Sampling for Variable-Order Markov Generation

Francois Pachet

NeurIPS page · OpenReview · alphaXiv · Open on the map

Category: Time Series, PDEs & Probabilistic ML › Flow Matching · Type: new method · Keywords: variable-order Markov models, regular constraints, exact sampling, context graph, automaton composition, linear inference

Areas: Model Architectures & Sequence Modeling › Language Model Architectures › Diffusion Decoding

Summary

The paper presents an exact regular-constrained sampling method for variable-order Markov generation that composes a sparse context graph with a regular constraint automaton, achieving linear-time inference without enumerating all histories.

Explained to a 5-year-old

We want to make cool songs that follow some rules. The rules say you can't copy the same part too much and you have to end in a certain way. The computer looks at the recent part of the song and picks the next note that fits the rules. It does this quickly without remembering everything. This helps make music that sounds nice and follows the rules.

Explained to a 5-year-old, longer

We want to create fun songs that have certain patterns. Sometimes we want the song to end a particular way, like a happy finish. We also want to avoid copying the same notes over and over. The computer remembers a little bit of what came before, but not everything. It looks at the recent notes to decide what to play next. It checks if the new note follows the rules we set. The rules can be about the length of the song or about not repeating too much. The computer does this step by step, making sure each choice is good. It works fast, even for long songs, because it doesn't keep a huge list of all past notes. This way we can make music that sounds interesting and follows the rules. The method also helps us try out different styles, like making a song sound like Bach. Overall, it makes creating structured music easier and more fun.

For a technical reader

The paper tackles generating sequences that obey specific constraints, such as fixed endings or anti-copy rules, for variable-order Markov models. It replaces the usual Markov state with a sparse context state and combines this with a regular constraint automaton, allowing inference to run in linear time without enumerating all possible histories. This approach is validated on Bach Prelude examples, showing exact sampling and virtual transposition capabilities. The method is useful for any domain where structured, rule-based sequence generation is needed, like music composition or text generation with formatting constraints.

Problem

Adapting regular constraints such as fixed endings or anti-copy rules to variable-order Markov models is challenging because existing exact sampling methods only work for first-order chains, which merge histories that variable-order models keep distinct.

Method

The approach replaces the Markov state with a sparse observed context state, builds a context graph, and composes it with a regular constraint automaton. Inference proceeds linearly in horizon and product edges, using a source-row interface for reversible augmentation without materializing full histories.

Results

The approach verifies exact partition functions and conditional probabilities on tiny examples and demonstrates sparse regular-constrained sampling at K=6 and 12-key virtual transposition semantics using 592 stored events from Bach Prelude.

Contributions

It provides the first exact regular-constrained sampling method for variable-order Markov models by composing a sparse context graph with a regular constraint automaton, enabling linear-time inference without enumerating all histories. It also validates the method on music examples, showing practical sparse sampling and virtual transposition.

Limitations and assumptions

The method assumes a fixed context graph and regular constraint automaton, and its evaluation is limited to the Bach Prelude corpus.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction