Bidirectional Context for Autoregressive Sequence Models

This direction is merged into another direction: unidirectional context limitation (unidirectional context constraint). Its last version stays readable and citable here.

Version 1 of 145 papers47 conceptsfrozen 2026-10-04

Standard sequence models suffer from a form of "tunnel vision." Whether they are tagging a sentence or translating a paragraph, they typically process information in a strict left-to-right order. This unidirectional constraint means that when a model makes a decision about a word at the beginning of a sentence, it is effectively blind to the words that follow—even though those future words often contain the very information needed to resolve local ambiguities.

Research across natural language processing, speech recognition, and computer vision has converged on a shared goal: breaking this "unidirectional straightjacket" to allow models to leverage global, bidirectional context during generation and labeling.

The Problem of Unidirectional Bias

In tasks like Part-of-Speech (POS) tagging, a word's category is frequently determined by its following neighbors. As Kristina Toutanova and colleagues noted in their work on Cyclic Dependency Networks, traditional models cannot explicitly access future labels, making it difficult to resolve ambiguities that only become clear later in the sentence.

This limitation is not just a matter of missing information; it creates a structural "label bias." In autoregressive models, the probability of a sequence is decomposed into a product of conditional probabilities, each looking only at the past. This prevents the model from "planning ahead" or ensuring global coherence. For example, Xiaohang Bian points out in Handwritten Mathematical Expression Recognition that identifying an opening bracket often depends on the presence of a corresponding closing bracket that appears much later in the sequence.

Simulating the Future with Two-Stage Learning

One of the most intuitive ways to bypass the unidirectional constraint is to process the sequence twice. In the first pass, a model generates a "rough draft" or a set of preliminary labels. In the second pass, the final model uses these preliminary labels as "future features."

William W. Cohen formalized this as Stacked Sequential Learning. By using cross-validation to simulate real-world prediction errors during training, the model learns to "fix" its own mistakes by looking at the surrounding context of its first-pass predictions. Similarly, Aitao Chen applied a Two-Stage Approach to Chinese POS tagging, where a preliminary tagging pass provides the "future" context necessary to significantly reduce errors in the final output.

Synchronous and Asynchronous Bidirectional Decoding

In Neural Machine Translation (NMT), the challenge is even greater because the model must generate a new sequence rather than just labeling an existing one. Researchers have developed several architectures to allow the decoder to "look backward and forward" simultaneously.

  • Asynchronous Decoding: Jinsong Su proposed a framework where a backward decoder first reads the target sentence from right-to-left to generate "future context states." A forward decoder then attends to these states while generating the final translation.
  • Synchronous Decoding: Jiajun Zhang introduced Synchronous Bidirectional Inference, where left-to-right and right-to-left decoding happen at the same time. The two decoders interact at every step, ensuring that the beginning of the sentence is consistent with the end.

These methods work because they provide a "lookahead" mechanism. Instead of optimizing for the next token in isolation, the model optimizes for a token that fits both the established past and the projected future.

Scoring with Pseudo-log-likelihood

While generative models like GPT-2 are strictly autoregressive, Masked Language Models (MLMs) like BERT are inherently bidirectional. Julian Salazar demonstrated that MLMs can be used to score the likelihood of entire sentences more accurately than autoregressive models by calculating Pseudo-log-likelihood (PLL) scores.

By masking each word in a sentence one by one and predicting it using all other words (both past and future), the model captures complex linguistic dependencies that a left-to-right model would miss. This approach has proven particularly effective for rescoring the outputs of speech recognition and translation systems, where global structural soundness is more important than step-by-step generation.

Mutual Learning and Global Coherence

Finally, bidirectional context can be used as a powerful regularization tool during training. Even if the final model used for inference is unidirectional, it can be trained to "agree" with a bidirectional counterpart.

In Forward-Backward Decoding for Regularizing TTS, Yibin Zheng used a backward decoder to regularize a forward Text-to-Speech model. By forcing the two directions to maintain agreement, the model learns to plan long-term structures like prosody and rhythm, which are difficult to capture when only looking at the preceding few phonemes. This "mutual learning" ensures that the model's local decisions are always made with an eye toward the global structure of the output.

Papers in this version

History & citationVersion 1 · 2026-10-04

Merged into another direction · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_bidirectional_context_for_autoregressive_afdcdda2,
  title = {Bidirectional Context for Autoregressive Sequence Models},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/bidirectional-context-for-autoregressive-sequence-models/rdr_afdcdda2a494434b84e5aa06f37103de},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-26},
}

This exact version (version 1, frozen text):

@misc{lacuna_bidirectional_context_for_autoregressive_afdcdda2_v1,
  title = {Bidirectional Context for Autoregressive Sequence Models},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/bidirectional-context-for-autoregressive-sequence-models/rdr_afdcdda2a494434b84e5aa06f37103de/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-26},
}