Isn't what LLMs do also NP-hard (at minimum)?
No. What LLMs do is stochastic inference of pre-computed matrices. It is decidedly polynomial.