Teacher Forcing: Training Seq2Seq with Ground Truth Context

Michael BrenndoerferMay 21, 202545 min read

Part of Language AI Handbook

Teacher forcing trains sequence-to-sequence models with ground-truth context. Covers exposure bias, scheduled sampling, and alternatives based on REINFORCE.

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Teacher Forcing

When you train a sequence-to-sequence model to translate "The cat sat on the mat" into French, the decoder must generate one token at a time: first "Le", then "chat", then "était assis", and so on. At each step, the decoder needs to know what it generated previously. This raises an immediate question: during training, do you feed the decoder its own (potentially wrong) previous predictions, or do you hand it the correct tokens from the reference translation?

Teacher forcing answers this question by always providing the correct previous token during training. The name comes from the analogy of a strict teacher who corrects students at each step rather than letting errors compound. Instead of waiting for the student to figure out their mistakes through experience, the teacher intervenes immediately to put them back on track. The student never practices recovering from their own errors; they always move forward from the correct starting point.

This seemingly simple decision has enormous practical consequences. Teacher forcing makes training dramatically faster and more stable, but it also creates a subtle mismatch between how a model is trained and how it is used at inference time. Understanding this mismatch, called exposure bias, and the strategies developed to mitigate it is central to building reliable sequence generation systems. The history of these mitigations tracks some of the most important ideas in sequence modeling research over the past decade.

As we established in the Encoder-Decoder Framework chapter, seq2seq models process input through an encoder that produces a context vector, then use a decoder that generates output tokens one at a time. Teacher forcing is specifically about how the decoder receives its input at each time step during training. The choice matters deeply because it directly affects training stability, convergence speed, and final model quality, and because it determines whether the model ever learns to handle the kinds of mistakes it will inevitably make when running on its own at inference time.

The Training Challenge: Autoregressive Decoding

To understand why teacher forcing was invented, consider what happens without it. A seq2seq decoder operates autoregressively: each output token depends on all previously generated tokens. During inference, this is unavoidable, since you do not know what the correct output is. You simply feed each generated token back as input for the next step.

During training, you have the correct target sequence. So you face a choice that is more consequential than it first appears.

Free-running (fully autoregressive) training feeds the decoder's own previous predictions as input at each step. If the decoder generates a wrong token early in the sequence, that error propagates forward. The next step receives a wrong input, which makes the next output more likely to be wrong, and so on. The model must learn to recover from its own mistakes without any external guidance.

Teacher forcing replaces the decoder's previous prediction with the correct target token. At step tt, the decoder receives the ground-truth token yt1y_{t-1} rather than its own prediction y^t1\hat{y}_{t-1}. The model never has to deal with the cascading consequences of its own errors during training.

Why does cascading matter so much? Consider training a model to translate a twenty-word sentence. If the model makes an error at position 3 and that error shifts the decoder into an incorrect hidden state, then positions 4 through 20 all receive a corrupted context. The gradients flowing back through those positions all carry signal about how to respond to corrupted states rather than about how to correctly translate the language. The model spends most of its learning budget on a task it will never face in a fully-supervised setting: error recovery. This makes training both slow and unstable.

Teacher forcing eliminates this problem entirely. Every gradient update teaches the model about the correct conditional distribution conditioned on correct context. Learning is fast and the training signal is clean.

The mathematical framing clarifies what each approach optimizes. In standard language modeling, the loss at each step is the cross-entropy between the predicted distribution and the true next token. With teacher forcing, the loss at step tt is:

Lt=logP(y^t=yty1,y2,,yt1,c)\mathcal{L}_t = -\log P(\hat{y}_t = y_t \mid y_1, y_2, \ldots, y_{t-1}, \mathbf{c})

where:

  • yty_t: the true target token at step tt
  • y1,,yt1y_1, \ldots, y_{t-1}: the ground-truth tokens at all previous steps
  • c\mathbf{c}: the encoder context vector (or set of context vectors with attention)
  • P(y^t=yt)P(\hat{y}_t = y_t \mid \ldots): the decoder's predicted probability for the correct token

The total training loss sums over all time steps:

L=t=1TlogP(y^t=yty1,,yt1,c)\mathcal{L} = -\sum_{t=1}^{T} \log P(\hat{y}_t = y_t \mid y_1, \ldots, y_{t-1}, \mathbf{c})

This is clean and efficient because every conditional probability is conditioned on correct context, making gradients stable and informative throughout the sequence. The gradients from step 20 flow back cleanly to earlier parts of the network without being corrupted by the effects of accumulated errors.

Without teacher forcing, the loss would instead be conditioned on the model's own predictions, which change as training progresses. This creates a non-stationary training signal that is much harder to optimize. The model is essentially trying to hit a moving target: the distribution it needs to learn from depends on its own current quality, so as the model improves, the training distribution shifts. This instability is one reason free-running training from scratch is rarely used for seq2seq models.

How Teacher Forcing Works in Practice

The mechanics of teacher forcing are straightforward once you see the decoder's input-output structure clearly.

In an encoder-decoder model, the decoder receives two inputs at each time step. The first is the previous token embedding, which is the recurrent input carrying information about what was generated just before. The second is the encoder's context information, which is either a single fixed hidden state passed from the encoder or, in models with attention, a dynamically weighted combination of encoder states. Teacher forcing changes only the first of these: how the "previous token" is determined.

With teacher forcing, the "previous token" input is always taken from the ground-truth target sequence, shifted right by one position. If the target sequence is SOS,y1,y2,,yT,EOS\langle\text{SOS}\rangle, y_1, y_2, \ldots, y_T, \langle\text{EOS}\rangle, then:

  • At step 1: decoder receives SOS\langle\text{SOS}\rangle as input, should predict y1y_1
  • At step 2: decoder receives y1y_1 as input, should predict y2y_2
  • At step tt: decoder receives yt1y_{t-1} as input, should predict yty_t
  • At step T+1T+1: decoder receives yTy_T as input, should predict EOS\langle\text{EOS}\rangle

The key insight is that the decoder sees the entire target sequence shifted one position to the right, so every conditional probability is conditioned on the true context rather than noisy predictions. In practice this is efficient to implement: the entire target sequence can be fed into the decoder in parallel (for transformer architectures) or in a tight loop where each teacher-forced input is a tensor slice from a pre-loaded batch of targets.

The Shifted Input Pattern

Teacher forcing is sometimes called "next-token prediction with teacher context." The decoder input is the target sequence shifted right by one position. This pattern is identical to how autoregressive language models are trained: the input is always the ground-truth prefix, and the model predicts the next token. GPT, for instance, uses this exact pattern during pretraining. The entire training corpus is the teacher, and the model never has to deal with its own prediction errors during training. This is one reason why large language models can be trained stably at enormous scale.

It is worth pausing on why this works so efficiently from a computational perspective. Because the teacher-forced inputs are all drawn from the target sequence (known ahead of time), you can precompute the entire sequence of decoder inputs before starting the forward pass. In RNN-based seq2seq models, this allows a tight training loop. In transformer-based models, it allows fully parallel processing of all decoder positions simultaneously, which is a key reason transformers can be trained so much faster than RNNs on modern hardware. Teacher forcing improves accuracy and is also a prerequisite for the computational efficiency that makes large-scale training feasible.

The Parallel Training Advantage in Transformers

Transformers exploit teacher forcing more aggressively than RNNs. In an RNN decoder, even with teacher forcing, you must step through positions sequentially because each hidden state depends on the previous one. In a transformer decoder, the entire target sequence is fed in at once, and the attention mechanism computes all positions in parallel. The causal masking ensures that position tt can only attend to positions 1,,t11, \ldots, t-1, which enforces the autoregressive property while preserving full parallelism during training.

This means transformer training processes all TT tokens simultaneously per layer pass, rather than requiring TT sequential RNN steps. The result is the dramatic training speedup that made models like BERT and GPT practical at scale. Teacher forcing is the mechanism that makes this parallel training coherent: without it, you would need to wait for each prediction before feeding the next input, collapsing back to sequential processing.

The consequence is that teacher forcing is architecturally necessary for the transformer's parallel training regime. You cannot train a transformer decoder without providing it the full right-shifted target sequence as input during the forward pass. The causal masking handles the autoregressive constraint, and the teacher-forced targets handle the input. Remove either of these and the transformer's training paradigm breaks down.

The Exposure Bias Problem

Teacher forcing accelerates training significantly, but it introduces a critical problem: the model is trained on a distribution that it never encounters during inference.

During training with teacher forcing, the decoder always receives correct tokens as input. The model learns the conditional distribution P(yty1,,yt1,c)P(y_t \mid y_1, \ldots, y_{t-1}, \mathbf{c}) where the conditioning context is always drawn from the true sequence.

During inference (free-running decoding), the decoder receives its own previous predictions. The model encounters the distribution P(yty^1,,y^t1,c)P(y_t \mid \hat{y}_1, \ldots, \hat{y}_{t-1}, \mathbf{c}) where the context consists of potentially imperfect predictions.

This mismatch is called exposure bias because the model is never "exposed" to its own errors during training. The consequence is that even small mistakes early in generation can derail the model: the first wrong token puts the decoder in a state it never encountered during training, which leads to another wrong token, which leads to another unfamiliar state, and so on. This compounding of errors is sometimes called the "snowball effect."

Exposure Bias

Exposure bias is the train-test discrepancy that arises when a model trained with teacher forcing is deployed autoregressively. The model's learned conditionals are over correct prefixes, but at inference time it must condition on its own (possibly imperfect) outputs. Each mistake pushes the decoder further from the distribution it was trained on, and the model has no learned ability to recover because it never encountered such situations during training.

To develop strong intuition for why this matters, consider a concrete example. Suppose you are training a translation model, and in the target language, a particular grammatical construction requires a specific word order. The model has seen thousands of examples of this construction during training, always with perfect teacher-forced context. It has learned to produce the correct word order given correct input.

At inference time, the model generates the first word of this construction correctly, but then makes a small error in the second word. Now the third word must follow a malformed second word, a situation the model has never seen during training. Because this state is out-of-distribution, the model has no reliable behavior here. It might produce something locally plausible given the wrong second word, pushing the output further in the wrong direction, or it might generate something entirely unexpected because this input region is sparse in the model's learned distribution.

The severity of exposure bias depends on sequence length and output vocabulary size. Short sequences with limited vocabulary (like simple arithmetic operations) may show minimal degradation. Long sequences with large vocabularies (like paragraph-length text generation) can suffer substantially: a model that achieves near-perfect performance with teacher forcing might generate incoherent text when running freely. This explains why early seq2seq models often performed well on benchmark metrics computed with teacher-forced decoding but showed noticeably worse quality in real deployment, where no teacher is present.

To quantify the gap formally, define the decoder's true data distribution at step tt as pdata(yty<t)p_{\text{data}}(y_t \mid y_{<t}) and the model's prediction as pθ(yty<t)p_{\theta}(y_t \mid y_{<t}). At training step tt, the input is y<tpdatay_{<t} \sim p_{\text{data}} (teacher forcing), but at inference step tt, the input is y^<tpθ\hat{y}_{<t} \sim p_{\theta}. As sequences grow longer, y^<t\hat{y}_{<t} diverges increasingly from y<ty_{<t}, amplifying the distribution shift. The compounding nature of this divergence is what makes exposure bias worse for longer sequences: each step's imperfection contributes to pushing the inference-time trajectory further from the training-time trajectory.

Measuring Exposure Bias Empirically

One way to measure exposure bias directly is to evaluate a model using two different decoding strategies and compare. The first strategy is teacher-forced decoding, where even at "inference time" you provide correct previous tokens. This measures the model's upper-bound performance in the perfect-information setting. The second strategy is free-running decoding, where the model must use its own previous predictions. The gap between these two metrics quantifies the severity of exposure bias for that model.

Large gaps indicate the model has learned very precisely calibrated conditionals over correct sequences but struggles to generalize to imperfect sequences. Smaller gaps suggest the model is either more robust to distributional shift, or that the task itself has less compounding error because the vocabulary is small or sequences are short. Monitoring this gap during training can tell you whether a particular mitigation strategy is working, and whether you need to invest in more aggressive exposure bias reduction.

Scheduled Sampling: Bridging the Gap

Bengio et al. (2015) proposed scheduled sampling as a curriculum learning approach to address exposure bias. The core idea is to gradually transition from teacher forcing to free-running training during the training process, so the model learns to handle its own outputs before deployment.

In scheduled sampling, at each training step you flip a biased coin. With probability ϵt\epsilon_t (the "scheduled" probability), you feed the true previous token as input (teacher forcing mode). With probability 1ϵt1 - \epsilon_t, you feed the model's own previous prediction (free-running mode).

inputt={yt1with probability ϵty^t1with probability 1ϵt\text{input}_t = \begin{cases} y_{t-1} & \text{with probability } \epsilon_t \\ \hat{y}_{t-1} & \text{with probability } 1 - \epsilon_t \end{cases}

where:

  • ϵt\epsilon_t: the teacher forcing probability at training step tt, which decays over time
  • yt1y_{t-1}: the ground-truth token at position t1t-1
  • y^t1\hat{y}_{t-1}: the model's own predicted token (argmax or sampled) at position t1t-1

The scheduled part comes from how ϵt\epsilon_t is decayed over training. Three common schedules are:

Linear decay: ϵi=max(ϵmin,kic)\epsilon_i = \max(\epsilon_{\min}, k - i \cdot c), where ii is the training iteration and cc controls decay speed. This reduces teacher forcing at a constant rate, giving a predictable and easy-to-tune schedule. The ϵmin\epsilon_{\min} floor prevents teacher forcing from going all the way to zero, which helps maintain some training stability even late in training.

Exponential decay: ϵi=ki\epsilon_i = k^i, where k<1k < 1. This decays quickly at first, then slows as it approaches zero. Because the schedule starts steep, the model is transitioned away from teacher forcing aggressively in early iterations and then receives a more gradual nudge in later iterations. This is suitable when you want the model to encounter its own errors early in training.

Inverse sigmoid decay: ϵi=k/(k+exp(i/k))\epsilon_i = k / (k + \exp(i / k)). This produces an S-shaped schedule, staying near 1.0 for a while before declining steadily to near 0.0. The effect is that the model receives nearly full teacher forcing during its early learning phase, which is when the basic conditional distributions are being established. Then, once the model has developed some baseline capability, the schedule allows the teacher forcing ratio to drop, progressively exposing the model to its own outputs.

The intuition behind the curriculum approach is that a model needs to first learn the basic conditional distributions (what tokens follow what) before it can learn to recover from mistakes. Starting with pure teacher forcing provides stable gradients for this initial learning. Then, as training progresses, introducing the model's own outputs teaches it to remain coherent even when its context is imperfect.

The choice of schedule affects more than just training speed. A schedule that drops ϵ\epsilon too quickly will destabilize training before the model has enough capability to learn from free-running feedback. A schedule that drops ϵ\epsilon too slowly may not provide enough exposure to the model's own errors before training ends, leaving significant residual exposure bias. In practice, the inverse sigmoid schedule is often recommended because it provides the best of both regimes: a stable initial phase and a controlled transition.

Curriculum Learning and the Training Philosophy

Scheduled sampling is an instance of a broader idea called curriculum learning, where the training distribution is intentionally structured to present easier examples first, then progressively harder ones. The "easy" version here is teacher forcing, where the model never needs to recover from mistakes. The "hard" version is free-running decoding, where the model must handle all the consequences of its own imperfect outputs.

This curriculum approach mirrors how humans learn to perform complex sequential tasks. A student learning to write learns first by copying model sentences, which is analogous to teacher forcing. Then they move to writing with occasional corrections, where the teacher steps in when errors would compound badly. Finally they write independently, handling their own mistakes as they arise. Direct exposure to the fully independent task from the start would be overwhelming because the feedback signal is too noisy to learn from efficiently; the curriculum manages the complexity gradient.

Curriculum learning in general has been shown to accelerate training across many domains beyond seq2seq models. The key principle is that the learning signal should be appropriately calibrated to the student's current capability. When the student is weak, easy examples with clean feedback are most informative. When the student is stronger, harder examples that push the boundaries of what they can handle accelerate further learning. Scheduled sampling applies this principle specifically to the question of input quality in sequential decoding.

One subtle point is that scheduled sampling is not a perfect solution. It can introduce inconsistency: at any given training step, some positions in the sequence use teacher forcing while others use free-running predictions. This creates a hybrid conditioning context that the model must handle, which can sometimes make learning harder rather than easier. The model sees sequences where some tokens are correct (from the ground truth) and adjacent tokens are potentially wrong (from the model's own predictions), creating conditioning contexts that are neither fully correct nor fully free-running. Handling this mixture requires the model to develop a kind of robustness to partial context errors, which may require more model capacity or more careful training management.

A further subtlety arises when you consider gradient computation. With pure teacher forcing, gradients flow cleanly through fixed inputs. With scheduled sampling, the model's own predictions are used as inputs, and those predictions are the output of differentiable operations. In principle, you could backpropagate through the sampling operation itself to train the model end-to-end. In practice, most implementations treat the sampled tokens as fixed and do not backpropagate through the sampling step, because the argmax (or categorical sample) is not differentiable. This means scheduled sampling does not fully exploit the information available in the model's own predictions, leaving some optimization potential on the table.

Professor Forcing: A Different Angle

An alternative approach, proposed by Lamb et al. (2016), is professor forcing. Rather than mixing teacher-forced and free-running training at the input level, professor forcing uses an adversarial training objective to align the model's hidden state distributions between the two modes.

The approach trains a discriminator to distinguish between two types of hidden state trajectories. The first type consists of hidden states produced by teacher forcing, where inputs are ground-truth tokens and the decoder's internal representations reflect a clean, correct sequence of states. The second type consists of hidden states produced by free-running decoding, where inputs are the model's own predictions and the representations reflect the actual trajectory the model would follow at inference time.

The generator, which is the seq2seq model itself, then tries to fool the discriminator by producing hidden states under free-running conditions that look statistically indistinguishable from teacher-forced hidden states. This adversarial signal pushes the free-running trajectory to stay close to the teacher-forced trajectory in representation space, not just in output token space.

Why is this a different and potentially more powerful approach than scheduled sampling? Scheduled sampling addresses the problem at the input level: it teaches the model to produce reasonable outputs when given its own previous output as input. But it does not directly constrain how the model's hidden states evolve during free-running. The hidden states are what the model uses to compute its output distributions, so if the hidden states under free-running diverge substantially from those under teacher forcing, the model's behavior will still degrade even if the individual input tokens are similar.

Professor forcing adds an explicit objective that the model's internal representations should remain consistent regardless of whether it is operating in teacher-forced or free-running mode. This forces a kind of representation-level robustness: the model must learn to maintain useful hidden state structure even when its inputs are its own potentially imperfect predictions. The discriminator provides a direct signal about whether the internal states are deviating from the teacher-forced distribution, which is something that cross-entropy loss alone cannot measure.

The practical limitation of professor forcing is that it requires training an adversarial discriminator alongside the main model. Adversarial training is notoriously sensitive to hyperparameter settings and can be difficult to stabilize. The discriminator must be capable enough to detect distribution differences but not so powerful that it makes the generator's task impossible. Despite these challenges, professor forcing demonstrated that addressing exposure bias at the representation level rather than just the input level is a valid and effective approach, and it inspired later work on representation regularization for sequence models.

Data as Demonstrator

A related training paradigm called data as demonstrator (DaD) takes yet another approach. Instead of using only ground-truth tokens as teacher inputs or mixing in the model's own predictions, it trains the model by letting it observe token sequences generated by a high-quality reference model or oracle.

In the DaD framework, the process works as follows. First, a teacher model (which may be a larger, pretrained model or a well-performing domain expert) generates multiple reference sequences for each input. Then, the student model is trained to imitate the teacher's token choices. The distinction from standard teacher forcing is that the teacher's own generation errors are included, exposing the student to realistic decoder trajectories that reflect what a competent but not perfect model produces.

The advantage is that the student learns from a realistic distribution of outputs rather than from perfectly correct sequences that may never appear during inference. Human reference translations, for instance, are grammatically correct but may use different word choices than the model would naturally produce. If the model sees only human references during training, it learns to condition on human-style outputs. When it runs freely, it produces model-style outputs, creating a mismatch. A teacher model that is similar in kind to the student (a seq2seq neural network generating plausible but not perfect outputs) provides conditioning contexts that more closely resemble what the student will experience during inference.

The disadvantage is the need for a capable teacher model, which creates a bootstrapping challenge in the early stages of training. You need a good model to generate the training data for a good model. In practice, this is often handled by using a pretrained model from a related task or a previous training run, then iteratively improving both the teacher and student through multiple rounds of training.

REINFORCE for Sequence-to-Sequence Models

A fundamentally different approach to bridging the train-test gap is to directly optimize the evaluation metric using reinforcement learning. The REINFORCE algorithm (Williams, 1992) applied to seq2seq models treats the decoder as a policy that takes actions (token choices) to maximize a reward signal.

The motivation for this approach is straightforward but important. Cross-entropy loss with teacher forcing measures how well the model predicts each token given correct context. But the thing you care about in machine translation or summarization is not per-token prediction accuracy; it is the quality of the complete output sequence as measured by metrics like BLEU (for translation) or ROUGE (for summarization). These metrics are not decomposable step by step; they measure properties of the entire generated sequence. Teacher forcing cannot directly optimize them.

The key idea in REINFORCE-based training is to define the reward R(y^,y)R(\hat{y}, y) as the task-specific evaluation score between the generated sequence y^\hat{y} and the ground-truth sequence yy. For machine translation, this could be BLEU score. For summarization, this could be ROUGE. For dialogue, it could be a human preference score.

The policy gradient update for the model parameters θ\theta is:

θLRL=Ey^pθ[R(y^,y)θlogpθ(y^x)]\nabla_\theta \mathcal{L}_{\text{RL}} = -\mathbb{E}_{\hat{y} \sim p_\theta}\left[R(\hat{y}, y) \cdot \nabla_\theta \log p_\theta(\hat{y} \mid \mathbf{x})\right]

where:

  • y^pθ\hat{y} \sim p_\theta: a complete output sequence sampled from the model
  • R(y^,y)R(\hat{y}, y): the reward signal comparing generated output to ground truth
  • θlogpθ(y^x)\nabla_\theta \log p_\theta(\hat{y} \mid \mathbf{x}): the gradient of the log probability of the sampled sequence

The intuition is: sample a complete output sequence, evaluate how good it was using the task metric (the reward), then update parameters to make good sequences more likely and bad sequences less likely. This directly aligns the training objective with the evaluation objective, which is the fundamental appeal of the approach.

However, REINFORCE alone is unstable in practice due to high variance in the gradient estimates. Consider what happens when you sample a sequence and measure its BLEU score. The BLEU score of a single sentence is noisy: a sequence might score low due to random word choice differences from the reference, not fundamental quality issues. The gradient is weighted by this noisy reward, so the updates are highly variable. With pure REINFORCE, training often fails to converge or converges to poor solutions.

Rennie et al. (2017) introduced the self-critical training sequence (SCST) approach, which uses the model's own greedy decoding output as a baseline to reduce variance. Rather than using the raw reward, the update uses the advantage: how much better or worse was the sampled sequence compared to the greedy sequence?

θLSCST=Ey^pθ[(R(y^,y)R(yˉ,y))θlogpθ(y^x)]\nabla_\theta \mathcal{L}_{\text{SCST}} = -\mathbb{E}_{\hat{y} \sim p_\theta}\left[(R(\hat{y}, y) - R(\bar{y}, y)) \cdot \nabla_\theta \log p_\theta(\hat{y} \mid \mathbf{x})\right]

where yˉ\bar{y} is the greedy decoding output. This baseline reduces variance because the gradient is non-zero only when the sampled sequence is better or worse than the greedy output. If both sequences receive the same reward, no update is applied. This means the model is only updated when sampling discovers something the greedy decoding missed (positive advantage) or when it stumbles into something worse (negative advantage). The updates carry meaningful signal rather than noise.

The self-critical baseline has an elegant property: it is computed using the same model being trained, so it adapts automatically as the model improves. As the greedy output quality increases over training, the baseline rises, maintaining a useful performance gap that keeps the learning signal informative.

The appeal of REINFORCE-based training is that it directly optimizes the metric you care about, bypassing the mismatch between cross-entropy training loss and evaluation metrics. The downside is that sampling-based gradient estimation is noisy and computationally expensive. You must sample complete sequences, evaluate them, and backpropagate through potentially long sequences. This is typically much slower than a single teacher-forced forward-backward pass.

Combining Cross-Entropy and Reinforcement Learning

In modern practice, cross-entropy loss (teacher forcing) and REINFORCE-style rewards are rarely used in isolation. Instead, they are combined in a mixed training objective that exploits the strengths of both approaches. The standard formulation is:

Lmixed=λLCE+(1λ)LRL\mathcal{L}_{\text{mixed}} = \lambda \mathcal{L}_{\text{CE}} + (1 - \lambda) \mathcal{L}_{\text{RL}}

where:

  • λ\lambda: the mixing coefficient, typically set between 0.9 and 0.99 to keep training stable
  • LCE\mathcal{L}_{\text{CE}}: the cross-entropy (teacher forcing) loss
  • LRL\mathcal{L}_{\text{RL}}: the policy gradient (REINFORCE) loss

The high value of λ\lambda reflects the practical wisdom that cross-entropy loss provides essential regularization. Without it, the RL component alone tends to overfit to the specific evaluation metric, sometimes in degenerate ways. Models trained only with BLEU score have been known to learn to repeat high-frequency phrases that boost BLEU without improving actual translation quality. The cross-entropy component keeps the model's predicted distribution over tokens close to the true distribution, which prevents degenerate reward-hacking behavior.

A common training recipe in industrial NMT systems is to first train to convergence with pure teacher forcing, then switch to the mixed objective for a limited number of additional epochs. The rationale is that teacher forcing is far more efficient during the initial phase, since it provides a clean and informative gradient signal at every step. Once the model has developed strong basic competence, the RL fine-tuning phase can safely optimize the task metric with reasonable stability.

This two-stage approach also addresses the cold-start problem for RL training. If you apply REINFORCE from the beginning, the model's initial random outputs receive very low rewards, and the gradient variance is enormous because the baseline (the greedy output) is also terrible. There is very little useful signal for the model to learn from. Starting from a strong teacher-forced checkpoint means the model already produces reasonable outputs, the rewards are in a useful range, and the advantage signal (difference between sampled and greedy rewards) is informative.

Comparing Training Strategies

Each training strategy makes different tradeoffs between training stability, inference quality, and computational cost. Understanding these tradeoffs helps you choose the right approach for a given task and budget.

Pure teacher forcing is the most common approach and the default for most seq2seq systems. It provides fast training with stable gradients because every training step conditions on correct context. Performance with teacher-forced evaluation is strong, but there is a significant exposure bias at inference time for long sequences. For many tasks, especially with modern attention-based models, the exposure bias is manageable and teacher forcing alone produces competitive results.

Free-running training (no teacher forcing from the start) is practically infeasible for most tasks because of cascading errors. The training signal is noisy and unstable, and convergence either fails or is extremely slow. Free-running training is not used as a primary training approach; it is primarily a theoretical baseline that illustrates why teacher forcing was needed in the first place.

Scheduled sampling represents a practical middle ground. Training speed is intermediate between teacher forcing and free-running, and the model progressively learns to handle its own outputs. The schedule hyperparameters require tuning, and the inconsistency from mixed conditioning contexts can sometimes slow learning or require more model capacity. But for tasks with significant exposure bias issues, scheduled sampling reliably reduces the train-test gap.

REINFORCE and SCST directly optimize the task metric, which is their primary advantage. But they suffer from high gradient variance, require sampling complete sequences during training (computationally expensive), and can be unstable without careful hyperparameter management. These approaches are most commonly used as a fine-tuning step after teacher forcing pretraining, not as the primary training method.

In practice, the choice of training strategy also depends on the architecture. Transformer-based seq2seq models tend to show less exposure bias than RNN-based models, probably because their attention mechanisms allow them to condition flexibly on all previous positions rather than relying solely on a compressed hidden state that may carry errors. For transformer models, pure teacher forcing often suffices. For RNN models on long sequences, scheduled sampling or RL fine-tuning may be necessary to achieve good free-running performance.

Code Implementation

Let's implement teacher forcing and compare it to scheduled sampling using a simple character-level seq2seq model. This will make the mechanics concrete and reveal the exposure bias effect directly.

First, we install the necessary libraries and set up the basic data.

We will create a simple synthetic task: reversing a short sequence of integers. The encoder reads the input forward, and the decoder must output it in reverse order. This task is simple enough to train quickly but complex enough to show the teacher forcing effect. It requires the decoder to learn dependencies across the full sequence length, which means exposure bias will manifest even on short sequences.

In[5]:
Code
# Simple synthetic dataset: reverse a sequence of integers
# Input: [3, 7, 5, 4, 8, 6] -> Output: [6, 8, 4, 5, 7, 3]

VOCAB_SIZE = 12
SEQ_LEN = 6
PAD_TOKEN = 0
SOS_TOKEN = 1
EOS_TOKEN = 2


def generate_data(n_samples, seq_len=SEQ_LEN, vocab_size=VOCAB_SIZE):
    """Generate (input, target) pairs where target is reversed input."""
    data = []
    for _ in range(n_samples):
        seq = [random.randint(3, vocab_size - 1) for _ in range(seq_len)]
        src = seq
        tgt = [SOS_TOKEN] + list(reversed(seq)) + [EOS_TOKEN]
        data.append((src, tgt))
    return data


random.seed(42)
torch.manual_seed(42)
np.random.seed(42)

train_data = generate_data(2000)
val_data = generate_data(500)
Out[6]:
Console
Training samples: 2000
Sample input:  [4, 3, 7, 6, 6, 5]
Sample target: [1, 5, 6, 6, 7, 3, 4, 2]

Now we define the encoder and decoder. The encoder is a simple LSTM that processes the input sequence and returns the final hidden state, which is the initial state for the decoder. The decoder is an LSTM that generates the output one token at a time, using its previous token embedding and its recurrent hidden state.

In[7]:
Code
class Encoder(nn.Module):
    def __init__(self, vocab_size, embed_dim, hidden_dim):
        super().__init__()
        self.embedding = nn.Embedding(
            vocab_size, embed_dim, padding_idx=PAD_TOKEN
        )
        self.lstm = nn.LSTM(embed_dim, hidden_dim, batch_first=True)

    def forward(self, x):
        embedded = self.embedding(x)
        _, (hidden, cell) = self.lstm(embedded)
        return hidden, cell


class Decoder(nn.Module):
    def __init__(self, vocab_size, embed_dim, hidden_dim):
        super().__init__()
        self.embedding = nn.Embedding(
            vocab_size, embed_dim, padding_idx=PAD_TOKEN
        )
        self.lstm = nn.LSTM(embed_dim, hidden_dim, batch_first=True)
        self.fc = nn.Linear(hidden_dim, vocab_size)

    def forward(self, x, hidden, cell):
        # x shape: (batch, 1) - single token
        embedded = self.embedding(x)
        output, (hidden, cell) = self.lstm(embedded, (hidden, cell))
        prediction = self.fc(output.squeeze(1))
        return prediction, hidden, cell

Now we implement the seq2seq model with a configurable teacher_forcing_ratio. When set to 1.0, the decoder always receives the ground-truth previous token. When set to 0.0, it always uses its own predictions, fully replicating inference-time conditions.

In[8]:
Code
class Seq2Seq(nn.Module):
    def __init__(self, encoder, decoder, device):
        super().__init__()
        self.encoder = encoder
        self.decoder = decoder
        self.device = device

    def forward(self, src, tgt, teacher_forcing_ratio=1.0):
        batch_size = src.shape[0]
        tgt_len = tgt.shape[1]
        vocab_size = self.decoder.fc.out_features

        outputs = torch.zeros(batch_size, tgt_len, vocab_size).to(self.device)
        hidden, cell = self.encoder(src)

        # First decoder input is always the SOS token
        decoder_input = tgt[:, 0].unsqueeze(1)

        for t in range(1, tgt_len):
            pred, hidden, cell = self.decoder(decoder_input, hidden, cell)
            outputs[:, t, :] = pred

            # Teacher forcing: use ground truth or model prediction?
            if random.random() < teacher_forcing_ratio:
                decoder_input = tgt[:, t].unsqueeze(1)  # ground truth
            else:
                decoder_input = pred.argmax(1).unsqueeze(1)  # model prediction

        return outputs
In[9]:
Code
EMBED_DIM = 16
HIDDEN_DIM = 64
BATCH_SIZE = 64
LEARNING_RATE = 0.001
N_EPOCHS = 30

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")


def make_model():
    encoder = Encoder(VOCAB_SIZE, EMBED_DIM, HIDDEN_DIM)
    decoder = Decoder(VOCAB_SIZE, EMBED_DIM, HIDDEN_DIM)
    model = Seq2Seq(encoder, decoder, device).to(device)
    return model


def make_batch(data, batch_size=BATCH_SIZE):
    """Sample a random minibatch and convert to tensors."""
    batch = random.sample(data, batch_size)
    src = torch.tensor([b[0] for b in batch], dtype=torch.long).to(device)
    tgt = torch.tensor([b[1] for b in batch], dtype=torch.long).to(device)
    return src, tgt


def train_epoch(model, data, optimizer, criterion, teacher_forcing_ratio):
    model.train()
    total_loss = 0.0
    n_batches = len(data) // BATCH_SIZE
    for _ in range(n_batches):
        src, tgt = make_batch(data)
        optimizer.zero_grad()
        output = model(src, tgt, teacher_forcing_ratio)
        # Flatten predictions and targets, skipping the SOS position
        output_flat = output[:, 1:, :].reshape(-1, VOCAB_SIZE)
        tgt_flat = tgt[:, 1:].reshape(-1)
        loss = criterion(output_flat, tgt_flat)
        loss.backward()
        optimizer.step()
        total_loss += loss.item()
    return total_loss / n_batches


def evaluate(model, data, criterion, teacher_forcing_ratio=0.0):
    """Evaluate using free-running decoding to measure inference quality."""
    model.eval()
    total_loss = 0.0
    n_batches = len(data) // BATCH_SIZE
    with torch.no_grad():
        for _ in range(n_batches):
            src, tgt = make_batch(data)
            output = model(src, tgt, teacher_forcing_ratio)
            output_flat = output[:, 1:, :].reshape(-1, VOCAB_SIZE)
            tgt_flat = tgt[:, 1:].reshape(-1)
            loss = criterion(output_flat, tgt_flat)
            total_loss += loss.item()
    return total_loss / n_batches

Now we train two models side by side: one with pure teacher forcing, and one with scheduled sampling that linearly decays from full teacher forcing to a 50/50 mix. Both models have identical architecture and initialization (same model factory, same random seeds). The only difference is the training strategy.

In[10]:
Code
criterion = nn.CrossEntropyLoss(ignore_index=PAD_TOKEN)

# Model 1: pure teacher forcing
model_tf = make_model()
initial_model_state = copy.deepcopy(model_tf.state_dict())
optimizer_tf = optim.Adam(model_tf.parameters(), lr=LEARNING_RATE)

tf_train_losses = []
tf_val_losses = []

for epoch in range(N_EPOCHS):
    train_loss = train_epoch(
        model_tf, train_data, optimizer_tf, criterion, teacher_forcing_ratio=1.0
    )
    val_loss = evaluate(
        model_tf, val_data, criterion, teacher_forcing_ratio=0.0
    )
    tf_train_losses.append(train_loss)
    tf_val_losses.append(val_loss)

# Model 2: scheduled sampling (linear decay from 1.0 to 0.5)
model_ss = make_model()
model_ss.load_state_dict(initial_model_state)
optimizer_ss = optim.Adam(model_ss.parameters(), lr=LEARNING_RATE)

ss_train_losses = []
ss_val_losses = []

for epoch in range(N_EPOCHS):
    # Linear schedule: 1.0 at epoch 0, 0.5 at final epoch
    tf_ratio = max(0.5, 1.0 - epoch * (0.5 / max(1, N_EPOCHS - 1)))
    train_loss = train_epoch(
        model_ss,
        train_data,
        optimizer_ss,
        criterion,
        teacher_forcing_ratio=tf_ratio,
    )
    val_loss = evaluate(
        model_ss, val_data, criterion, teacher_forcing_ratio=0.0
    )
    ss_train_losses.append(train_loss)
    ss_val_losses.append(val_loss)
Out[11]:
Console
Pure teacher forcing   - final free-run val loss: 0.1281
Scheduled sampling     - final free-run val loss: 0.1173
Scheduled sampling is 0.0107 lower loss (+0.0107)

The validation loss here is always measured with free-running decoding (no teacher forcing), which mirrors actual inference conditions. Notice the difference between training loss (which is computed on teacher-forced inputs) and this validation metric. A model can have low training loss while maintaining high free-running validation loss: this gap is the measurable signature of exposure bias. The scheduled sampling model's training loss may be somewhat higher because it is learning the harder problem of operating on imperfect inputs, but its free-running validation loss should be lower because it has practiced this mode during training.

Now let's visualize the training dynamics to see how the two strategies differ over the course of training.

Let's also implement and visualize the three standard scheduled sampling probability schedules. Seeing the shapes of these curves concretely helps build intuition for the pacing they impose on the curriculum.

In[13]:
Code
def linear_schedule(i, k=1.0, c=0.02, epsilon_min=0.1):
    """Linearly decay teacher forcing probability."""
    return max(epsilon_min, k - i * c)


def exponential_schedule(i, k=0.98):
    """Exponentially decay teacher forcing probability."""
    return k**i


def inverse_sigmoid_schedule(i, k=10.0):
    """S-shaped (inverse sigmoid) decay schedule."""
    return k / (k + np.exp(i / k))


n_steps = 100
steps = np.arange(n_steps)
linear_probs = [linear_schedule(i) for i in steps]
exp_probs = [exponential_schedule(i) for i in steps]
isigmoid_probs = [inverse_sigmoid_schedule(i) for i in steps]

Finally, let's compute exact sequence match accuracy under free-running decoding for both models. Loss values can be hard to interpret; sequence accuracy tells us directly how often the model gets the full reversal correct at inference time.

In[15]:
Code
def sequence_accuracy(model, data, n_samples=500):
    """Compute exact sequence match accuracy using free-running decoding."""
    model.eval()
    correct = 0
    total = min(n_samples, len(data))
    samples = data[:total]
    with torch.no_grad():
        for src_seq, tgt_seq in samples:
            src = torch.tensor([src_seq], dtype=torch.long).to(device)
            tgt = torch.tensor([tgt_seq], dtype=torch.long).to(device)
            output = model(src, tgt, teacher_forcing_ratio=0.0)
            predicted = output[0, 1:, :].argmax(dim=-1).cpu().tolist()
            target = tgt_seq[1:]  # skip SOS
            if predicted == target:
                correct += 1
    return correct / total


acc_tf = sequence_accuracy(model_tf, val_data)
acc_ss = sequence_accuracy(model_ss, val_data)
Out[16]:
Console
Sequence accuracy (free-run decoding):
  Pure teacher forcing:  94.8%
  Scheduled sampling:    95.6%
  Difference:            +0.8 percentage points (scheduled sampling)

The exact sequence match accuracy under free-running decoding reveals the practical impact of exposure bias. The task requires the model to get every single token right to score a match, making it a stringent measure of inference quality. The scheduled sampling model, having practiced handling its own outputs during training, tends to produce more consistent complete sequences at inference time, especially for sequences where an early error would cascade into multiple downstream mistakes.

Key Parameters

Understanding the key hyperparameters for teacher forcing and scheduled sampling helps you apply these techniques effectively:

  • teacher_forcing_ratio: Probability of using the ground-truth token as decoder input. Set to 1.0 for pure teacher forcing, 0.0 for free-running. Scheduled sampling decays this value during training. The initial value should almost always start at 1.0 to ensure stable early training.
  • schedule type: The decay function controlling how teacher forcing probability decreases. Linear decay is simple and predictable; inverse sigmoid provides a more controlled transition that preserves the stable learning phase.
  • epsilon_min: The floor value for scheduled sampling probability. Keeping this above 0 ensures some ground-truth guidance persists even late in training, which can stabilize learning. A common choice is 0.0 to 0.2 depending on task difficulty.
  • decay rate: Controls how quickly teacher forcing probability falls. Faster decay exposes the model to its own errors sooner, which can reduce exposure bias but also destabilizes early training if the model has not yet learned reliable basic patterns.

Worked Example: Tracing a Decoding Step

To make the mechanics completely concrete, let's trace through a single decoding step with and without teacher forcing.

Suppose the input sequence is [5, 3, 8, 4, 6, 7] and the correct reversed output is [7, 6, 4, 8, 3, 5]. The target sequence with special tokens is [SOS, 7, 6, 4, 8, 3, 5, EOS].

With teacher forcing, at step 3 (predicting the third output token), the decoder receives:

  • Encoder context: the hidden state from encoding [5, 3, 8, 4, 6, 7]
  • Decoder input: 6 (the ground-truth second token), regardless of what the model predicted at step 2

The model might have predicted 9 at step 2 (an error), but teacher forcing ignores this and provides 6 anyway. The gradient at step 3 correctly attributes blame for any error at step 3 to the model's handling of the correct input 6, not to a corrupted context.

With free-running decoding at inference time, step 3 receives:

  • Encoder context: same hidden state from encoding [5, 3, 8, 4, 6, 7]
  • Decoder input: 9 (the model's incorrect prediction from step 2)

The model must now condition on 9, which is not part of the original sequence, and figure out what the third reversed token should be. Because 9 was never a valid step-2 output in this task, this is an out-of-distribution input. The model's output at step 3 will reflect its behavior in this novel state, which may bear little resemblance to what it learned from correctly-conditioned training examples.

This single example illustrates the core of exposure bias: the model's training distribution (conditioned on correct tokens) and inference distribution (conditioned on its own predictions) diverge every time it makes a mistake. For a length-8 sequence, a single error at step 2 means steps 3 through 7 are all operating in unfamiliar territory. Scheduled sampling directly addresses this by ensuring that some training steps experience this exact kind of imperfect conditioning, teaching the model to recover from it.

Limitations and Practical Impact

Teacher forcing was a critical enabler for practical seq2seq training, but it comes with real tradeoffs that are worth understanding deeply before applying it.

The exposure bias problem has measurable practical effects. In neural machine translation benchmarks, models trained with pure teacher forcing often show a significant drop in BLEU score when the source sentences are longer or when beam search is used with a larger beam width. The model, having never encountered its own errors during training, lacks the learned ability to course-correct when decoding goes off track. This effect is most pronounced for languages with long-range dependencies or flexible word order, where an error early in generation can propagate for many tokens before the sentence structure constrains the output back toward coherence.

The gap between teacher-forced training performance and free-running inference performance led researchers in the 2015-2018 period to develop the mitigation strategies described in this chapter. Scheduled sampling reduced the gap but did not eliminate it. Professor forcing added a representation-level constraint but required adversarial training with all its instabilities. REINFORCE-based approaches directly optimized task metrics but were expensive and noisy. None of these approaches fully solved the problem; each traded one set of difficulties for another.

Scheduled sampling alleviates exposure bias but does not fully resolve it. The mixing of teacher-forced and free-running tokens within the same training sequence creates a hybrid conditioning context that can confuse the model. Theoretically, the model should learn to handle both modes, but in practice the inconsistency sometimes hurts learning efficiency. Some researchers have found that scheduled sampling requires careful hyperparameter tuning and can be sensitive to the choice of schedule. The inconsistency problem is particularly sharp at the boundary between teacher-forced and free-running positions: a sequence where positions 1-4 are teacher-forced and position 5 is free-running presents the model with an unusual conditioning context that it would never encounter during pure inference.

A practical observation from industrial NMT systems is that even with exposure bias, teacher forcing produces competitive models when paired with beam search at inference time. Beam search effectively hedges against early mistakes by maintaining multiple hypotheses simultaneously, re-evaluating them as the sequence grows and discarding branches that fall too far behind the leading candidates. The next chapter covers beam search in detail and explores how its width and length normalization interact with the training strategy. The interaction is significant: models trained with teacher forcing tend to respond well to beam search because they have learned sharp conditional distributions over correct sequences, and beam search can exploit these sharp distributions to find good completions even when early steps are uncertain.

The advent of transformer-based seq2seq models has somewhat shifted the conversation about exposure bias. Transformers trained with masked self-attention use the same teacher forcing paradigm, and they have proven substantially more robust to exposure bias than RNN-based models. This robustness likely comes from several factors. Their attention mechanisms allow them to condition on all previous positions simultaneously, which reduces the compounding error effect: a wrong token at position tt propagates its influence through attention weights, but the weights to other correct tokens can compensate. Their large capacity allows them to learn more robust conditional distributions that generalize better across the small distribution shift from teacher-forced to free-running contexts. And their parallel training (which requires teacher forcing) allows them to be trained at scales where the sheer volume of diverse training examples reduces the impact of any particular conditioning pattern being out-of-distribution at inference time.

Nevertheless, the fundamental train-test mismatch remains in all teacher-forced models, transformer or otherwise. Understanding it is essential for diagnosing generation failures. When a model produces incoherent long-form text despite good perplexity on held-out data, exposure bias is often the culprit. When a model succeeds on short test inputs but fails on longer ones, the compounding nature of exposure bias is a natural suspect. When RL fine-tuning dramatically improves generation quality without changing the model's perplexity, it is often because the RL phase is teaching the model to handle the imperfect contexts it will encounter at inference time.

For practitioners building production sequence generation systems, the most common recipe is to train with pure teacher forcing to convergence, then apply a brief RL fine-tuning phase using a mixed cross-entropy and task-metric objective. This strategy combines the efficiency of teacher forcing with the inference-time optimization of reinforcement learning, and it has been validated across machine translation, abstractive summarization, image captioning, and dialogue systems.

Summary

Teacher forcing is a training technique that provides the correct previous token to the decoder at each step, rather than feeding back the model's own predictions. The key takeaways from this chapter are:

  • Efficiency: Teacher forcing provides stable gradients and fast convergence because every training step conditions on correct context. It also enables fully parallel training in transformer architectures, which is essential for large-scale training.
  • Exposure bias: The train-test mismatch arises because the model is never exposed to its own errors during training, but must handle them at inference time. This causes compounding errors during free-running decoding, especially for long sequences.
  • Scheduled sampling: A curriculum learning approach that gradually transitions from teacher forcing to free-running by decaying the teacher forcing probability over training. The inverse sigmoid schedule is often the most effective because it preserves a stable initial learning phase.
  • Professor forcing: An adversarial approach that aligns the model's hidden state distributions between teacher-forced and free-running modes, addressing exposure bias at the representation level rather than just the input level.
  • REINFORCE and SCST: Policy gradient approaches that directly optimize task metrics. Self-critical sequence training uses the model's own greedy output as a variance-reducing baseline.
  • Practical recipe: Most modern systems pretrain with teacher forcing for efficiency, then fine-tune with a mixed objective combining cross-entropy and reinforcement learning. This two-stage approach combines training efficiency with inference-time quality.
  • Transformer robustness: Transformer-based models show less exposure bias than RNN-based models, likely due to their attention mechanisms and large training scales, but the fundamental train-test mismatch persists.

In the next chapter, we will look at beam search, the standard decoding algorithm used at inference time. Beam search partially compensates for exposure bias by maintaining multiple candidate hypotheses throughout decoding, but it introduces its own set of tradeoffs around beam width and length normalization.

Quiz

Ready to test your understanding? Take this quick quiz to reinforce what you've learned about teacher forcing and exposure bias in sequence-to-sequence training.

Comments

No comments yet. Be the first to share your thoughts!

Reference

Citation details

Cite or share this article.

BIBTEXAcademic
@misc{brenndoerfer2025teacherforcing, author = {Michael Brenndoerfer}, title = {Teacher Forcing: Training Seq2Seq with Ground Truth Context}, year = {2025}, url = {https://mbrenndoerfer.com/writing/teacher-forcing-seq2seq-training-exposure-bias-scheduled-sampling}, organization = {mbrenndoerfer.com}, note = {Accessed: 2026-09-15} }
APAAcademic
Michael Brenndoerfer (2025). Teacher Forcing: Training Seq2Seq with Ground Truth Context. Retrieved from https://mbrenndoerfer.com/writing/teacher-forcing-seq2seq-training-exposure-bias-scheduled-sampling
MLAAcademic
Michael Brenndoerfer. "Teacher Forcing: Training Seq2Seq with Ground Truth Context." 2026. Web. September 15, 2026. <https://mbrenndoerfer.com/writing/teacher-forcing-seq2seq-training-exposure-bias-scheduled-sampling>.
CHICAGOAcademic
Michael Brenndoerfer. "Teacher Forcing: Training Seq2Seq with Ground Truth Context." Accessed September 15, 2026. https://mbrenndoerfer.com/writing/teacher-forcing-seq2seq-training-exposure-bias-scheduled-sampling.
HARVARDAcademic
Michael Brenndoerfer (2025) 'Teacher Forcing: Training Seq2Seq with Ground Truth Context'. Available at: https://mbrenndoerfer.com/writing/teacher-forcing-seq2seq-training-exposure-bias-scheduled-sampling (Accessed: September 15, 2026).
SimpleBasic
Michael Brenndoerfer (2025). Teacher Forcing: Training Seq2Seq with Ground Truth Context. https://mbrenndoerfer.com/writing/teacher-forcing-seq2seq-training-exposure-bias-scheduled-sampling

About the author

Continue with the full handbook

This chapter is part of Language AI Handbook. Use the handbook page to browse the complete table of contents and continue reading in sequence.

Explore Language AI Handbook
Newsletter

Stay up to date

Get articles, book updates, and news delivered to your inbox.

No spam, unsubscribe anytime.

or

Join the community

Sign in to remove popups, track your reading progress, and join the discussion.