you're right that it's the discreteness of text that makes this problem extremely hard but also the problem you're imagining requires optimizing over optimization processes, which is also very hard what you're describing sort of works for images, e.g. this
Discrete Text Optimization Challenges in Language Models
By
–