Generative AI is used worldwide across various fields, but its results depend predominantly on user prompts: the clearer the request, the better the response. For instance, a simple text can be generated via several prompts, while more specialized tasks such as calculations and data optimization in medicine or law aren't possible without prompt engineers. Writing complex prompts requires a technology background, time resources, and trial and error. In its turn, CoolPrompt can automatically generate and test different prompts; it optimizes requests and compiles the best one for a particular task.
“Unlike DSPy, PromptWizard, and Promptomatix, CoolPrompt offers a more efficient prompt selection and a broader range of features. The framework generates data for tuning and evaluating requests. It allows users to choose the optimization method depending on their priorities (speed or quality), supports various LLMs, and offers a detailed report upon optimization. It’s a vital feature as business customers often come to us with a task, but no labeled data,” explains Nikita Kulin, the leader of the R&D team at ITMO’s Computer Technologies Lab.
Nikita Kulin, the leader of the R&D team, and Sergey Muravyov, the head of ITMO’s Computer Technologies Lab. Photo courtesy of the subjects
Existing analogs have more technical limitations than CoolPrompt. The ITMO-developed solution contains a complex of methods that make up a full-fledged pipeline – a sequence of step-by-step actions used for each task. The system relies, first, on the ReflectivePrompt method and its algorithms that employ an evolutionary approach to creating and improving the next generation of prompts. Second, it’s based on the rapid HyPE approach, which allows it to produce well-structured prompts in one move. And, third, the framework can create training data and distill prompts, i.e. create their shorter, more efficient versions, using the DistillPrompt algorithm.
Take, for instance, the prompt “write an essay about autumn,” it may be common but it is also too abstract. What CoolPrompt does instead is use HyPE to create a more explicit request: it defines the AI’s role (e.g., a writer), structure, style, and tone, and specifies what should be included in the text. The developers control the system’s diversity parameter that is responsible for avoiding formulaic responses. The system works as follows: first, a user writes their prompt and then the LLM model automatically creates a synthetic dataset, without losing in quality.
The generator is already available on GitHub and PyPI for Python developers; it supports both Russian and global neural networks. Its key advantages include:
-
AI democratization – potentially, users with any backgrounds, medical specialists or lawyers, can benefit from using the technology;
-
economy of resources – hours of human capital can be freed by introducing automation;
-
stable quality – the algorithm provides reproducible results.
CoolPrompt has already found its applications in real-world projects. For example, its HyPE method was incorporated into DMA-MAS – a multiagent system, currently under development, that is designed for performing complex requests – to improve the efficiency of AI agents and reduce the costs of using third-party LLMs.
“The library is well-suited for tasks with no ML datasets from chat requests. This is crucial for rapid prototyping and enhancing prompts before they are sent to a chat,” comments Danila Katalshov, a senior prompt engineer at MWS AI.
In the future, the developers plan to launch a web service that will let any specialist upgrade their prompt in one click. The team will also continue to introduce new optimization algorithms and improve the library to make prompt engineering more simple and easier-to-understand for anyone interested in AI.
