Don't LLMs do some degree of search and backtracking if they end up in a dead end (with limits, a couple of tokens at least). Sometimes you'd see ChatGPT hanger words it had already output.
Actually I am not very familiar with the internals, I am mostly repeating what Yann Lecun said in an interview a few months ago about autoregressive models.