Papers › Discovering Non-monotonic Autoregressive Orderings with Variational Inference

Discovering Non-monotonic Autoregressive Orderings with Variational Inference

27 Oct 2021arXiv:2110.15797archive 2025-07-28

Xuanlin Li, Brandon Trabucco, Dong Huk Park, Michael Luo, Sheng Shen, Trevor Darrell, Yang Gao

The predominant approach for language modeling is to process sequences from left to right, but this eliminates a source of information: the order by which the sequence was generated. One strategy to recover this information is to decode both the content and ordering of tokens. Existing approaches supervise content and ordering by designing problem-specific loss functions and pre-training with an ordering pre-selected. Other recent works use iterative search to discover problem-specific orderings for training, but suffer from high time complexity and cannot be efficiently parallelized. We address these limitations with an unsupervised parallelizable learner that discovers high-quality generation orders purely from training data -- no domain knowledge required. The learner contains an encoder network and decoder language model that perform variational inference with autoregressive orders (represented as permutation matrices) as latent variables. The corresponding ELBO is not differentiable, so we develop a practical algorithm for end-to-end optimization using policy gradients. We implement the encoder as a Transformer with non-causal attention that outputs permutations in one forward pass. Permutations then serve as target generation orders for training an insertion-based Transformer language model. Empirical results in language modeling tasks demonstrate that our method is context-aware and discovers orderings that are competitive with or even better than fixed orders.

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology: its repositories, every harvested function with whether it ran, its licence and the call to fetch it.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2110.15797")

Code

Syntology Ran 1 of 7 code samples harvested from 1 repository linked to this paper; 6 have no recorded run. Of those that ran: 1 ran with no contract checked.

By repository: official repository: 7 samples from 1 repository, 1 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

xuanlinli17/autoregressive_inference officialmentioned in papermentioned on GitHubtfMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

7 samples harvested; 1 ran; 0 honoured the contract we drafted; 6 have no recorded run. Read from Syntology's graph 2026-09-25; that is when this build read the record, not when the samples ran.

1ran
6unverified

Licence: 0 of the 7 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from xuanlinli17/autoregressive_inference. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

levenshtein xuanlinli17/autoregressive_inference/voi/algorithms/levenshtein.py official repository ran fingerprinted MIT (permissive) · f1dd530f5c706f2f · report
adaptive_search xuanlinli17/autoregressive_inference/voi/algorithms/adaptive_search.py official repository unverified MIT (permissive) · 082c009a23cb13d4 · report
beam_search xuanlinli17/autoregressive_inference/voi/algorithms/beam_search.py official repository unverified MIT (permissive) · ec90483fc2b722f6 · report
greedy_search xuanlinli17/autoregressive_inference/voi/algorithms/greedy_search.py official repository unverified MIT (permissive) · 6f6c9fbef829da96 · report
nucleus_sampling xuanlinli17/autoregressive_inference/voi/algorithms/nucleus_sampling.py official repository unverified MIT (permissive) · 6d0af24619eaf852 · report
prepare_batch_for_lm_captioning xuanlinli17/autoregressive_inference/voi/core/batch_prepare_utils.py official repository unverified MIT (permissive) · 4c81b400a2cb458f · report
prepare_batch_for_lm_wmt xuanlinli17/autoregressive_inference/voi/core/batch_prepare_utils.py official repository unverified MIT (permissive) · 899639890dfcac04 · report

Tasks

DecoderImage CaptioningLanguage ModelingLanguage ModellingMachine TranslationText SummarizationVariational Inference

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformerVariational Inference

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections