Autoregressive models don't "guess and check" on the scale of programs, functions, or any meaningful unit of software. You can argue that they "guess and check" internally for every token, but at the scale of the whole output, that is the equivalent of thinking really hard about every single thing it writes, before writing it, and committing to it once written.
This is in contrast to diffusion models, which basically yeet a bag of tokens at the wall, clean up what doesn't work, and try again. This can kind of be considered guessing and checking.