def Params(cls) -> InstantiableParams:
    p = super().Params()
    p.Define('lm', layers.TransformerLm.Params(), 'LM layer.')
    p.Define(
        'return_predictions', False, 'Whether to return predictions during'
        'eval. Returning predictions is more expensive, but may be useful'
        'for debugging.')

    greedy_search_p = py_utils.Params()
    greedy_search_p.Define('seqlen', 0, 'Maximum output sequence length.')
    greedy_search_p.Define(
        'min_prefix_len', 5,
        'Minimum number of tokens picked to be used as decoding prefix.')
    greedy_search_p.Define(
        'eos_id', 2,
        'The id of EOS token indicating the termination of greedy search.')
    greedy_search_p.Define(
        'max_decode_steps', None,
        'If not None, the max decode steps for each example. If None, this '
        'is set to `seqlen`, which contains prefix.')
    p.Define('decoder', greedy_search_p, 'Decoder param.')
    return p