Papers › Predictive Querying for Autoregressive Neural Sequence Models

Predictive Querying for Autoregressive Neural Sequence Models

12 Oct 2022arXiv:2210.06464archive 2025-07-28

Alex Boyd, Sam Showalter, Stephan Mandt, Padhraic Smyth

In reasoning about sequential events it is natural to pose probabilistic queries such as "when will event A occur next" or "what is the probability of A occurring before B", with applications in areas such as user modeling, medicine, and finance. However, with machine learning shifting towards neural autoregressive models such as RNNs and transformers, probabilistic querying has been largely restricted to simple cases such as next-event prediction. This is in part due to the fact that future querying involves marginalization over large path spaces, which is not straightforward to do efficiently in such models. In this paper we introduce a general typology for predictive queries in neural autoregressive sequence models and show that such queries can be systematically represented by sets of elementary building blocks. We leverage this typology to develop new query estimation methods based on beam search, importance sampling, and hybrids. Across four large-scale sequence datasets from different application domains, as well as for the GPT-2 language model, we demonstrate the ability to make query answering tractable for arbitrary queries in exponentially-large predictive path-spaces, and find clear differences in cost-accuracy tradeoffs between search and sampling methods.

PaperPDFCodeCode Syntology ran

In Syntology 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="2210.06464")

Code

Syntology Ran 7 of 13 code samples harvested from 1 repository linked to this paper; 6 have no recorded run. Of those that ran: 4 ran · our draft was wrong; 1 ran · fixture could not drive it; 2 ran with no contract checked.

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

ajboyd2/prob_seq_queries officialmentioned in paperpytorch 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

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

4ran · our draft was wrong
1ran · fixture could not drive it
2ran
6unverified

Licence: 0 of the 13 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 ajboyd2/prob_seq_queries. “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.

BSNode ajboyd2/prob_seq_queries/seq_queries/sample.py official repository ran MIT (permissive) · 01f54e99a9a60e27 · report
BeamSearchSampleTree ajboyd2/prob_seq_queries/seq_queries/sample.py official repository ran MIT (permissive) · 84afed32bac6237d · report
_hidden_state_select ajboyd2/prob_seq_queries/seq_queries/sample.py official repository ran · fixture could not drive it MIT (permissive) · 2788500c55cb2165 · report
_tup_cpu ajboyd2/prob_seq_queries/seq_queries/sample.py official repository ran · our draft was wrong MIT (permissive) · 953f276962847553 · report
_tup_cpu_gpt2 ajboyd2/prob_seq_queries/seq_queries/sample.py official repository ran · our draft was wrong MIT (permissive) · 5bd55c74b63a005b · report
min_variance_top_k ajboyd2/prob_seq_queries/seq_queries/sample.py official repository ran · our draft was wrong fingerprinted MIT (permissive) · b0160851016bd79c · report
top_k_top_p_filtering ajboyd2/prob_seq_queries/seq_queries/sample.py official repository ran · our draft was wrong fingerprinted MIT (permissive) · d111355f8bf308f3 · report
beam_search_is_hybrid ajboyd2/prob_seq_queries/seq_queries/sample.py official repository unverified MIT (permissive) · 485281e3d11416fa · report
beam_search_lower_bound ajboyd2/prob_seq_queries/seq_queries/sample.py official repository unverified MIT (permissive) · 9e8a897fff3a55d9 · report
get_optimizer ajboyd2/prob_seq_queries/scripts/train/amazon.py official repository unverified MIT (permissive) · 4e56934b09a04cad · report
train ajboyd2/prob_seq_queries/scripts/train/amazon.py official repository unverified MIT (permissive) · d5586c4a77b49699 · report
tree_is_estimate_attn ajboyd2/prob_seq_queries/seq_queries/sample.py official repository unverified MIT (permissive) · 81646133d69707bb · report
tree_is_estimate_rnn ajboyd2/prob_seq_queries/seq_queries/sample.py official repository unverified MIT (permissive) · 80a1ab04938e54b2 · report

Tasks

Language ModelingLanguage Modelling

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

AdamAttentionAttention DropoutBPECosine AnnealingDense ConnectionsDiscriminative Fine-TuningDropoutGPT-2Layer NormalizationLinear LayerLinear Warmup With Cosine AnnealingMulti-Head AttentionResidual ConnectionSoftmaxWeight Decay

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