Teacher Forcing: A Training Protocol for Models
- Teacher forcing is a training method where models condition on ground-truth outputs from preceding time steps, enhancing stability and parallelism but creating train-inference discrepancies known as exposure bias.
- It has wide applications, including recurrent sequence prediction, attention-based encoders, and tasks like vision and audio generation.
- Variants like scheduled sampling, iterative, and generalized teacher forcing address exposure bias by integrating generated histories and maintaining system stability.
Teacher forcing is a training protocol for autoregressive and recurrent models in which the model is conditioned on the ground-truth output from the preceding time step, rather than on its own previous prediction. For a sequence model, the training conditional is therefore based on a reference prefix, whereas inference is performed autoregressively using generated outputs. This asymmetry makes optimization stable and efficiently parallelizable, but produces the train–inference discrepancy known as exposure bias. Teacher forcing has been applied to recurrent sequence prediction, attention-based encoder–decoders, sound event detection, chaotic dynamical-system reconstruction, multimodal diffusion, video generation, and large-scale streaming classifiers. Its extensions include scheduled sampling, generalized and iterative teacher forcing, attention forcing, seer forcing, multi-step forcing, soft teacher forcing, and hybrid teacher/self-forcing procedures.
1. Definition and mathematical formulation
For an autoregressive sequence conditioned on an input , the conditional distribution is factorized as
Under teacher forcing, the history supplied at position is the reference prefix , not the model-generated prefix . The standard negative log-likelihood is therefore
In token-based language modeling, the decoder receives the ground-truth embedding of the preceding token. If is the input embedding matrix and is the target token at position , the input is
0
At inference, the corresponding input is derived from the model’s own output, commonly through greedy or beam decoding. The training and inference conditions are thus
1
Teacher forcing is attractive because every training position has a known supervised target, the objective corresponds to maximum-likelihood estimation, and—particularly for Transformers—all causal positions can be processed in parallel. It does not require that the model be trained with a separate teacher network; “teacher” denotes the ground-truth preceding output used as conditioning.
The same principle applies beyond discrete tokens. In sound event detection, the recurrent network can be conditioned on the previous frame’s ground-truth event-activity vector rather than its own previous prediction (Drossos et al., 2019). In serialized MR reconstruction and segmentation, a downstream module can receive a fully sampled reconstruction during selected training iterations rather than the preceding module’s reconstruction (Qi et al., 2020). In diffusion video models, the current noisy frame or chunk is predicted from clean ground-truth preceding frames or chunks (Zheng et al., 24 Jun 2026).
2. Exposure bias and train–inference mismatch
Teacher forcing trains the model on reference-consistent histories, while deployment exposes it to histories generated by the model itself. This discrepancy is commonly called exposure bias. An early prediction error changes the next conditioning state, which can alter subsequent predictions and cause error accumulation over the sequence.
In an attention-based sequence-to-sequence model, an erroneous output can affect both the recurrent decoder state and the attention distribution. The altered attention can produce an incorrect context vector, so later predictions are made under an incorrect output history and an incorrect source alignment (Dou et al., 2019). In neural machine translation, this problem is compounded by discrete and multimodal outputs: a generated prefix can represent a valid translation ordering different from the reference prefix, making the reference next-token target or reference attention potentially inconsistent with the generated history (Dou et al., 2021).
The same mismatch appears in autoregressive video generation. A model trained on complete ground-truth frame histories may encounter imperfect generated frames at inference, producing appearance drift, unstable motion, temporal incoherence, or degradation over long rollouts. “Complete Teacher Forcing” addresses an additional masked-versus-complete history mismatch in masked autoregressive video generation, but it does not eliminate the ordinary exposure bias associated with replacing ground-truth frames by generated frames at inference (Zhou et al., 21 Jan 2025).
In chaotic dynamical systems, the issue has a related but mathematically distinct form. Free-running backpropagation through time contains products of recurrent Jacobians whose norms can grow exponentially when the learned dynamics have positive Lyapunov exponents. Ordinary teacher forcing stabilizes the forward trajectory but can remove too much recurrent feedback, preventing the model from learning autonomous long-term dynamics (Hess et al., 2023).
Teacher forcing therefore solves a local optimization problem without guaranteeing robust recovery from off-distribution histories. A model can be accurate when given a correct prefix while remaining fragile after its own prediction diverges from the reference trajectory.
3. Scheduled, generalized, and iterative variants
Scheduled sampling
Scheduled sampling probabilistically selects between the ground-truth previous output and the model’s previous prediction. If 2 is the probability of using the ground-truth history,
3
The schedule generally begins near teacher forcing and progressively introduces generated histories. In sound event detection, an exponentially changing schedule was used with stated settings 4, 5, and 6; the lower bound avoids exclusive reliance on ground-truth activity vectors, while the upper bound preserves access to clean histories for long sequences (Drossos et al., 2019).
Scheduled sampling reduces the direct training–inference mismatch but introduces a heuristic schedule, potentially inconsistent mixtures of reference and generated outputs, and optimization sensitivity. TeaForN differs from scheduled sampling by retaining a ground-truth-conditioned first decoder while passing continuous model representations to additional decoders, thereby preserving differentiability without a curriculum (Goodman et al., 2020).
Generalized teacher forcing
Generalized teacher forcing for chaotic dynamics replaces the previous state by a differentiable interpolation between the model-generated state and a data-inferred teacher state:
7
The resulting recurrent Jacobian contains a factor of 8:
9
If 0 is an upper bound on the largest singular value of the forced-state Jacobian, the critical forcing strength is
1
At this value, the recurrent sensitivity is bounded above by one under the stated bound. The result guarantees suppression of exponential gradient explosion, not non-vanishing gradients, and the forcing is removed at test time (Hess et al., 2023).
Iterative teacher forcing
The Iterative Teacher Forcing Scheme (ITFS) applies teacher forcing intermittently at the interface between two connected tasks. In simultaneous MR reconstruction and segmentation, D5C5 first predicts a reconstructed image 2, and U-Net then receives either 3 or the fully sampled image 4:
5
This alternation reduces error propagation while exposing the segmentation module to imperfect reconstructions. It also avoids the permanent replacement of the preceding prediction by ground truth, which the paper associates with exposure bias and over-correction (Qi et al., 2020).
4. Alternatives that preserve or modify teacher forcing
Attention forcing
Attention forcing separates output-history conditioning from alignment conditioning. The decoder uses generated output history, but the context vector is formed using reference attention:
6
The model is trained with an output-prediction loss and an attention-imitation loss,
7
where 8 is a KL divergence between reference and generated attention distributions. At inference, reference attention is unavailable and the model uses its own attention.
The method exposes the decoder to inference-like generated histories while retaining a stable alignment target. It was effective in speech synthesis, where alignment is comparatively constrained, but vanilla attention forcing can be harmful in machine translation because valid translations may use different word orders (Dou et al., 2019). Automatic attention forcing selects between generated-history and reference-history training on a sequence basis according to attention-alignment quality, improving translation performance over teacher forcing in the reported English–French and English–Vietnamese experiments (Dou et al., 2021). Scheduled attention forcing applies a similar alignment-based selection, while Parallel Attention Forcing approximates sequential generated-history training through iterative parallel Transformer passes (Dou et al., 2022).
Professor forcing
Professor forcing trains teacher-forced and free-running trajectories and uses a discriminator to make their internal dynamics similar. The generator is optimized with the ordinary likelihood objective and an adversarial objective, while the discriminator distinguishes teacher-forced from free-running output or hidden-state trajectories. This avoids a manually specified scheduled-sampling decay, but introduces the engineering burden of training an auxiliary discriminator (Dou et al., 2019).
Seer forcing
Seer forcing adds a future-aware decoder during training. The conventional decoder receives the reference prefix, whereas the seer decoder receives both the reference prefix and reference suffix, while being prevented from seeing the current target token. The seer distribution is transferred to the conventional decoder through knowledge distillation:
9
At inference, only the conventional decoder remains. The future-aware decoder is therefore a training-time teacher for global planning rather than an inference-time component (Feng et al., 2021).
TeaForN
TeaForN, or Teacher-Forcing with N-grams, adds a stack of 0 decoders along a second prediction axis. Decoder 1 uses the ground-truth previous embedding. Higher decoders receive the preceding decoder’s continuous output at the same sequence position and predict progressively farther future targets. For 2,
3
Because later losses backpropagate through earlier decoder outputs, the method supplies differentiable credit assignment across prediction steps. Decoder 4 remains ground-truth conditioned, while higher stack positions are exposed to model-produced representations. The stack is used only during training; inference retains Decoder 5. TeaForN therefore reduces exposure bias without sampling discrete tokens or abandoning maximum-likelihood cross-entropies (Goodman et al., 2020).
Soft teacher forcing
Soft Teacher Forcing constructs predictive soft tokens in one detached, teacher-forced forward pass, maps them through the input embedding matrix, and combines them with ground-truth embeddings:
6
The target remains the original ground-truth token distribution. Unlike scheduled sampling, Soft-TF interpolates embeddings rather than replacing tokens according to a curriculum; unlike recursive latent-reasoning methods, it computes all soft tokens in parallel. In the reported mathematical-reasoning experiments, it improved supervised fine-tuning on GSM8K, MATH, MathQA, and AQuA, while leaving inference unchanged (Fahes et al., 12 Oct 2026).
5. Teacher forcing in diffusion, video, audio-video, and streaming models
In autoregressive diffusion, teacher forcing concerns the temporal context rather than necessarily the denoising loss. Causal-rCM predicts a noisy current frame or chunk conditioned on clean ground-truth preceding blocks. Its teacher-forcing consistency-model objective is packed into a causal forward pass, with loss applied only to noisy target positions. Self-forcing subsequently rolls out generated blocks and performs inference-aligned refinement. The reported framework combines teacher-forcing consistency-model initialization with self-forcing distribution-matching refinement (Zheng et al., 24 Jun 2026).
Mutual Forcing uses a shared model with a multi-step mode and a few-step mode. The few-step mode generates historical audio-video chunks during training, while the multi-step mode predicts real paired-data targets under those partially generated histories. The multi-step mode also supervises the few-step mode through self-distillation. This creates a bidirectional interaction between generated-context training and fast-mode improvement without an external bidirectional teacher (Zhou et al., 28 Apr 2026).
Context-Matched Distillation takes the on-policy principle further. A causal teacher scores each student-generated target under the same causal information boundary available to the student. Prefix Scoring evaluates the target under the cached student-generated prefix that actually produced it, and Prefix Corruption perturbs unreliable prefixes early in training. The resulting procedure resembles teacher-forced parallel scoring computationally, but its principal distillation phase is free-running and on-policy rather than ground-truth-prefix teacher forcing (Bandyopadhyay et al., 13 Aug 2026).
In masked autoregressive video generation, Complete Teacher Forcing conditions masked target frames on complete ground-truth preceding frames, whereas Masked Teacher Forcing conditions on preceding masked frames. Complete Teacher Forcing therefore aligns the temporal information available during training with the complete generated-frame histories used during inference. On UCF-101 first-frame-conditioned prediction, the reported comparison found that Complete Teacher Forcing outperformed Masked Teacher Forcing by nearly 7 in FVD, despite Masked Teacher Forcing obtaining slightly better frame-wise FID (Zhou et al., 21 Jan 2025).
Reward-Forcing uses limited teacher-derived ODE trajectories for motion initialization, followed by self-rollout reward optimization rather than extensive teacher-student distillation. The method retains teacher involvement during initialization but evaluates and improves the student’s own generated video using ImageReward. Its reported total VBench score was 8, compared with 9 for the reported Self Forcing chunk-wise system (Zhang et al., 23 Jan 2026).
6. Applications, empirical behavior, and limitations
Teacher forcing is beneficial when the reference history provides reliable structural information. In sound event detection, conditioning on preceding event activities improved performance on real-world datasets with temporal organization: the proposed method reached 0 and 1 on TUT Sound Events 2016, compared with 2 and 3 for the baseline. On the synthetic dataset, whose events were randomly generated without meaningful temporal structure, performance deteriorated to 4 and 5. This indicates that teacher-forced history is conditional on the existence of learnable temporal dependencies (Drossos et al., 2019).
In chaotic-system reconstruction, forcing stabilizes optimization but can alter the objective’s statistical geometry. Identity teacher forcing is an intervention-based loss rather than automatically the marginal likelihood of the autonomous model. In switching dynamical systems, conditioning on a single forced regime path can inflate curvature relative to ambiguity-aware observed information, where Louis’ identity subtracts a missing-information covariance term. Consequently, teacher-forced optimization can be effective for reconstructing attractors and dynamical quantities while still producing a geometry different from that of free-running probabilistic inference (Zhou et al., 28 Apr 2026).
Teacher forcing also has costs. It can create exposure bias, fail to teach recovery from erroneous histories, and encourage reliance on clean contexts. Generated-history alternatives can be unstable, especially when the model must learn both output prediction and alignment. Scheduled sampling introduces heuristic schedules; professor forcing requires adversarial discrimination; attention forcing requires reference alignments; TeaForN increases training computation and activation memory; Soft-TF adds an additional forward pass; and diffusion or video variants require causal masks, rollout management, or specialized distillation infrastructure.
The principal distinction is between modifying the conditioning history and modifying the prediction target. Standard teacher forcing keeps the target ground truth and replaces the previous model output by the corresponding reference output. Scheduled sampling changes the history stochastically. Generalized teacher forcing interpolates states. Attention forcing replaces reference output history while retaining reference alignment. TeaForN and Soft-TF retain supervised targets but expose the model to differentiable model-derived representations. Self-forcing and causal distillation use generated histories directly. Reward-based methods replace or supplement token-level supervision with feedback on generated trajectories.
Teacher forcing is therefore neither universally optimal nor intrinsically defective. It provides stable, parallelizable supervised learning and remains a strong initialization and baseline. Its principal limitation is distributional: the histories used during optimization are cleaner than those encountered during deployment. Effective extensions generally preserve some of teacher forcing’s stable target supervision while introducing generated, corrupted, future-aware, aligned, or differentiable approximations to inference-time context.