Highlight Delft 2024

Prompt-engineering for GPT-4 and other language models

Developer Kris is creating the tour guide for HighLight Delft 2024. In this article he explains how he uses AI from Sping, and shares six tips on how to write the best prompts for a language model yourself. 

AI Tourguide

Highlight Delft is Delft's innovative art and technology festival. Using art, science and technology, Highlight Delft shapes the future for the general public. For three evenings during the festival you will discover a special view of the future. A special fusion of science, innovation and creativity that is right up Sping's alley. Sping is sponsoring the festival with a tour guide that uses artificial intelligence.

"Highlight Delft is a fantastic opportunity to experiment. Because the technological festival is ahead of the future; artists show things that do not exist today, but will be possible later on."

Jan Gerard Snip Directeur/oprichter Sping

Large Language Models

Large Language Models (LLM) are models that predict the next logical word. These have become so good at it that you can also ask questions of the language model. And in most cases, it answers correctly. As a result, you can talk to a language model like you talk to a chatbot. The best-known example of this, of course, is Chat-GPT.

How does a language model work?

For Highlight Delft's chatbot, Kris uses GPT-4; the technology behind Chat-GPT. GPT-4 is a language model created by OpenAI. GPT-4 is easy to "program" by giving instructions to the chatbot. These instructions are called prompts. For example, for Highlight Delft, Kris tells GPT-4 that the chatbot is a virtual tour guide, must answer questions from visitors, and when it doesn't know the answer it must admit it honestly.

So you program the chatbot by giving commands. This information sends the language model to OpenAI's server and they run the language model. This model then predicts the outcome word for word and from this informative text follows. You integrate the chatbot with an API on your own website. At the bottom of this article, Kris shares his tips for good prompts.

An intelligent chatbot for Highlight Delft

Kris' idea is to use this technique on Highlight Delft's website. Highlight Delft stands for combining new technology with art. A language model is a very accessible way to let people see and experience what is now technically possible. Kris creates a chatbot for each artwork on Highlight Delft. These chatbots can be accessed via a QR code. And you can scan those QR codes at the various artworks at the festival.

Art and technology are sometimes very abstract and profound and raise many different questions from people. That is why it is interesting that visitors themselves ask questions to the chatbot, instead of reading a standard information sign. For example, ask the chatbot, "Why is there a blue light flashing at this artwork?". Kris and Highlight Delft feed the language model with information about the artworks and, in addition, it uses information on the Internet. And with that, the artificial intelligent tour guide answers all questions about the artworks on Highlight Delft.

Wondering what kind of answer the Highlight Delft chatbot would give to a question?

Question: who is Sophia Bulgakova? And what kind of artwork does she have?

Answer:

Sophia Bulgakova is an interdisciplinary artist born in 1997 in Odesa, Ukraine, who currently lives and works in The Hague, Netherlands. She has a background in ArtScience and her work is at the intersection between art, technology and society. Bulgakova focuses on exploring the relationship between light, perception and imagination. She uses different sensory inputs in her installations and performances to influence spectators' perceptions and explore new possibilities.

One of her notable artworks is 2019's "YOU ARE SOURCE PROJECTION AND REFLECTION," a projection-based installation that explores notions of physical space and nonlinear legibility in motion. This installation creates an infinity of possible compositions centered on the viewer's imagination. The audience is invited to explore space individually by immersing themselves in an environment of merging clouds of words, using transparent screens to navigate. The project was developed in collaboration with the Summer Sessions Network for Talent Development, Metamedia Association and V2_ Lab for Unstable Media.

Would you like to know more about her artistic approach, techniques or specific works?

Another interesting use of a language model is to keep track of what questions visitors ask. All those questions the language model stores in a logbook. This provides insight into the interests of visitors and gives the festival a lot of feedback.

A new application of the technology

The technology behind these language models has only been around for a year. There are already several applications, but as a personal tour guide, Sping has not seen this before. So it is a real innovation and we see a lot of potential for other festivals, museums and cultural events. Kris is now building this for Highlight Delft, contributing to the festival's mission of letting people experience technology. And at the same time it is a test for Sping for a possible wider application of this technology.

Kris also involves his colleagues in this new technology. For example, we are testing internally a new way of building applications using language models. This project for Highlight Delft is thus also an experiment for us; both in terms of the new technique, and the new application of AI.

"However, we should not blindly rely on the information provided by a language model. The danger of a language model is that not everything it says is substantively correct. Just as not everything on the Internet is true, people need to learn that not everything Chat-GPT or any other language model says has to be true. In fact, the language model is very good at persuasive writing even when it does not know the answer."

Kris van Melis Developer Tourguide HighLight Delft 2024

6 tips for prompt engineering

Want to get started with GPT-4 or another language model yourself? When using a language model, the most important thing is to give the right commands - aka: prompts. Kris shares some of his tips for the best prompts:

1. Give your language model a role

So for Highlight Delft, Kris tells GPT-4 that the chatbot is a tour guide. But do you want an assistant to help draft? Then tell the chatbot that it is a text writer. Give a clear presentation of the chatbot's function, role and purpose, and only then start asking your questions. For example, that you want a creative story about the danger of language models. To better direct GPT-4, give your own article title and paragraph topics. 

2. Split up your assignments

A language model is basically very good at doing multiple assignments at once. For example: write a summary and tell what sources you used. But if you give too many assignments, it will start making mistakes. A solution to this is to ask the language model what steps are needed to complete an assignment. For example: describe the steps needed to make a summary with source reference of all the artworks of Highlight Delft. The language model gives you a roadmap and then you let the language model itself do the task step by step. 

3. Give your language model a personality

A personality is nice, of course. But it also helps people understand that your chatbot can make a mistake. After all, making mistakes is human, whereas we think computers don't make mistakes. But misinformation is unfortunately still common in language models. If your chatbot says "Hello my name is Sara and I try my best to answer your questions, but I sometimes make a mistake," people are more understanding.

4. Tell your chatbot to be honest when it doesn't know the answer

It sounds very simple, but if you tell the language model to indicate when it is not sure of an answer, it will do so. That way you reduce the chance of misinformation. 

5. Provide a file with additional information

Are you creating a chatbot for an event like Highlight Delft and want it to answer general questions as well? For example, "Where are the toilets? Chances are that this information is not on the Internet. For this kind of information, you can attach a file yourself in GPT-4.

6. Suggest questions for your users

By providing sample questions for your users, you make it clear how they can use the chatbot. For example, this already shows them that they should ask questions, instead of entering keywords as you do with Google.

Are you curious about the technology behind the AI-tourguide chatbot?

With these tips, you will probably go a long way in setting up your own chatbot based on GPT-4. Do you still have questions or would you rather leave it to Kris and his colleagues? Feel free to contact us.

Can we brainstorm with you?

Jan Gerard Snip - Founder