      loss = cross_entropy_loss(logits, labels, get_sequence_lengths(labels))
      return loss, logits
    grad_fn = jax.value_and_grad(loss_fn, has_aux=True)
-@@ -366,7 +371,7 @@ def decode(model, inputs, rng):
+@@ -354,7 +359,7 @@ def decode(model, inputs, rng):
    init_decoder_inputs = jnp.tile(init_decoder_input,
                                   (inputs.shape[0], get_max_output_len(), 1))
    with nn.stochastic(rng):

       hidden_size: int, the number of hidden dimensions in the encoder and
         decoder LSTMs.
     Returns:
@@ -265,7 +268,7 @@ class Seq2seq(nn.Module):
     logits, predictions = decoder(
         init_decoder_state,
         decoder_inputs[:, :-1],
-        teacher_force=teacher_force)
+        sample_probability=sample_probability)
 
     return logits, predictions
 
@@ -335,14 +338,16 @@ def compute_metrics(logits, labels):
 
 
 @jax.jit

diff --git a/examples/seq2seq/train.py b/examples/seq2seq/train.py
index 60b79b5..c3df5b1 100644
--- a/examples/seq2seq/train.py
+++ b/examples/seq2seq/train.py
@@ -190,17 +190,19 @@ class Encoder(nn.Module):
 class Decoder(nn.Module):
   """LSTM decoder."""
 
