The Complete Education Portal


New Programming Language to Interact with ChatGPT

Researchers at ETH Zurich have developed a new programming language called LMQL (Language Model Query Language) that enables users to interact more systematically with large language models like ChatGPT. Sometimes, the AI language model does not understand the command and the generated output can turn out unexpectedly or even unsatisfactory. 

What people usually do as a response is that they follow up with another query. ChatGPT will then try to correct its mistakes and adapt its answer. This way of using a language model is messy and random, and it can take quite some time to get the preferred outcome.

Utilizing LMQL allows a user to interact with large language models like ChatGPT in a more elevated and controlled way. This programming language enables a novel way of programming and is a new form of computer-​human interaction because the user can directly talk to and instruct the computer.

LMQL is the first language that combines natural and programming languages’ power to interact with these large language models. For simple queries, it is sufficient to guide ChatGPT using natural language. However, for more complex and specific tasks, such as creating a database or analyzing data, it is essential to instruct the language model precisely. Therefore, the formalism of programming languages is needed to guide the language model with formal constructs to ensure the user gets the desired output. Martin Vechev, Professor of Computer Science and one of the creators, clarifies: “Essentially, it is a much more concise way to get what you want. Decreasing the necessary exchanges with the language model also reduces the costs of interacting with the model, which can be quite expensive. Using LMQL increases the chances of getting the desired output. It sometimes even makes it possible to get a result you would have never gotten otherwise because you can formulate your query more accurately.”

LMQL allows its user to express safety constraints which can help guide the model in the right direction and try to steer it away from unwanted or unexpected outputs.

Go to index page »


Please email us: