I think one possible way is to obtain dataset with prompts for given model and train the language model. Optimized prompt could be generated one, longer, with the "add-ons" that are typically added to the prompts with similar meaning. What are the technical solutions underlying the services as e.g. https://promptperfect.jina.ai/?