Greedy search generates text by choosing the most probable next token at each step. This simple strategy can get stuck in loops of high-probability token sequences. section 16.2.4
greedy_search <- function(preds) {
op_argmax(preds)
}
compiled_generate(prompt, greedy_search)
The `greedy_search()` function selects the highest-scoring prediction with `op_argmax` and passes that choice into text generation. section 16.2.4











