Generating the tokens isn't he hard part. It's figuring out which tokens need to be generated in response to whatever solution needs to be coded. That's part communication, part comp sci and part artistic.
But if the system learned from enough previous examples, you may get a better, more cohesive, and artistic result. Though given the fact that Google can't filter obvious spam from my inbox, past performance is an indicator of future success.