UNIVERSITY PARK, Pa. — Using services like ChatGPT or Microsoft Copilot can sometimes seem like magic — to the point it can be easy to forget about the advanced science running behind the scenes of any artificial intelligence (AI) system. Like any complex system, however, there is always room for improvement and optimization, according to Rui Zhang, assistant professor of computer science and engineering in the Penn State School of Electrical Engineering and Computer Science.
Zhang and his research group recently authored three papers introducing new approaches to processing high-resolution images and automatically prompting better responses from AI systems. The papers, which are currently available online, are set to be published at the 63rd Annual Meeting of the Association for Computational Linguistics, July 27 through Aug. 1 in Vienna, Austria; the 2025 International Conference on Computer Vision, Oct. 19-23 in Honolulu, Hawaii; and the 13th International Conference on Learning Representations, April 24-28 in Singapore.
In the following Q&A, Zhang discussed his group's work, how it can improve the efficiency and usefulness of AI and some strategies individuals can employ to get more value out of their personal AI use.
Q: What is prompt engineering? Are there specific things readers can do to write better prompts for an AI system?
Zhang: Prompt engineering is the process of designing effective inputs — or “prompts” — that guide AI systems like ChatGPT to produce better responses. Since these systems are sensitive to how questions are asked, a well-crafted prompt can significantly improve the system’s output. For example, instead of asking, “summarize this article,” you might say, “summarize this article in three bullet points for a high school student.” The extra context helps the AI tailor its response. For everyday users, the key strategies are to be clear, specific and goal-oriented — don’t be afraid to try multiple prompt versions to refine the results.
Q: What are the benefits of automating and optimizing prompt generation?
Zhang: While good prompt engineering can greatly improve AI performance, writing the best prompt often takes time, experimentation and expertise in the subject matter included in the prompt. In our research, we developed a method called GReaTer that allows AI systems to automatically generate and refine prompts using gradient-based optimization, a type of algorithm that excels at optimizing data in AI systems.
We also developed GReaTerPrompt, a user-friendly and open-source toolkit built on the GReaTer method, which enables models to automatically generate and refine prompts for a wide range of tasks. Automating this process means AI can adapt to new tasks with less human input, improving accuracy, saving time and lowering costs. This is especially valuable for users who lack the time or expertise in a subject to come up with a better prompt. By providing an open-source toolkit, which is freely available for anyone to download, modify or share, we effectively distribute access to our work for all interested users.
Q: How did you measure the effectiveness of GReaTer? Are there real-world tools that could improve with its implementation?
Zhang: We evaluated GReaTer on a wide variety of language reasoning and mathematical problem-solving tasks, such as answering complex questions, solving logic puzzles and performing mathematical computations. The results showed that GReaTer significantly improved performance compared to standard prompting — especially for smaller language models that typically struggle with these tasks because they are limited with specialized parameters for specific tasks and questions. In some cases, these GReaTer-optimized smaller models rivaled much larger ones in quality. Real-world applications that could benefit include AI-powered tutors, writing assistants, customer support agents and any tool that needs to adapt quickly to different users or topics without manual reprogramming.