Optimization, zoo and OpenAI chatgpt
A few years ago, I wrote Optimization : simply do more with less, zoo, buses and kids in order to explain what optimization is and how IBM CPLEX can help.
There are many ways when you want to solve an optimization problem and my favourite API is OPL which is an algebraic modeling language. OPL is quite easy to use but we still need someone to build the model.
So when I heard about ChatGPT from OPENAI, I gave this a try.
My request in natural language:
And then I got
And then an OPL CPLEX model:
And some comments: "This OPL program defines the data for the problem, including the number of students and the cost of renting a 40-seat bus and a 30-seat bus. It then defines the variables for the problem, including the number of 40-seat buses and 30-seat buses. The objective function is defined next, using a linear objective function to minimize the total cost of renting the buses. Finally, the constraints are defined, including the main constraint that the total number of seats provided by the buses must be sufficient to transport all of the students."
NB: The model is nearly perfect. There was an implicit information that number of buses are positive numbers.
And if I change dvar int into dvar int+, I get the optimal solution.
Congratulations OPENAI . Will this open optimization to many more use cases ?
Alex Fleischer what kind of results do you get from when you ask about an analogous (i.e., non-zoo/bus) question that is essentially the same optimization problem but a different use case that is not explicitly out there? (I'm concerned that GPT is just copying your homework ;)
Technical Leader chez IBM - Data & Artificial Intelligence chez IBM
2 年Alex, you're a lucky guy ! I love this game ??
Ex-Business Analytics AI Senior Technical Staff Member at IBM
2 年In fact, ChatGPT was lucky you mentioned OPL. This is why it knew it had to repeat some blog you wrote. (and made mistake repeating). The right test of ChatGPT should be the following one. It shows a wrong approach, no understanding of optimization, and even wrong calculations in the second case, which would be the optimal it ChatGPT would know how to multiply and sum correctly. But it does not know. It only knows how to repeat pieces of things it heard: It is true that it has a huge memory.
ML Engineer
2 年How nice! Creative to try let gpt solve it!
Radio Spectrum Assignment and Wireless Services Development Senior Engineer
2 年Great post. Appreciated yor answer https://stackoverflow.com/q/74766325/19350396