Hanover, 22 May 2023

Calculating 70 million individual flight fares – every day

How TUI becomes more efficient and faster with machine learning

Dr Lukas Schack, Principal Machine Learning Engineer at TUI, talks about the TUI Flight Margin Brain and how artificial intelligence supports optimal pricing.

Lukas, in a Yammer post you mentioned that at TUI 70 million individual flight price calculations are processed every day using artificial intelligence. What is behind this?

Each day an average of 70 million individual flight prices are calculated for the Central Region – Germany, Austria, Switzerland and Poland – using a tool developed by TUI teams. If a customer sees a flight being offered from another airline but they found this flight on the TUI website, or via one of the well-known travel portals, then various inquiries have already been made to the airlines in the background.

The tool is called TUI Flight Margin Brain. What parameters does it use to choose the price?

In principle, the system searches with the parameters that the customers enter on the website, for example, time, place of departure or the number of stops. It then receives a price from the partner airlines and decides for itself what TUI will add to the offered prices as a “mark-up” to achieve the optimal price.

What is the optimal price?

The optimal price is first and foremost a price at which the customer books the flight through us. Other aspects also play a role such as strategic goals. Our strategy for a certain period of time may be based primarily on selling as many flights as possible. And then for another period, it's more about hitting a certain margin. The system works according to the strategy set by our flight teams.

Is the TUI Flight Margin Brain an in-house development by TUI?

Yes, we use a tool offered by AWS as a platform for this. We then developed it ourselves on this basis. You can think of it like a Lego kit that you can use to build something of your own. Our margin brain learns step by step, collecting a large number of data points and experiences. This type of self-learning system is called reinforcement learning. With 70 million individual airfare queries, a lot of data is available. However, this all happens in the cloud, so we don't have to worry about scaling. Here we benefit from the fact that we at TUI opted for the cloud early on. That was a basic requirement for the use of such systems.

What makes the Margin Brain smart?

Behind it is artificial intelligence. Put simply, this is a neural network that generates the optimal "mark-up" from the search parameters. This can be different for each search query: airlines change their prices, demand is strong or weak and holiday periods or public holidays are taken into account. The artificial intelligence brings all this information together individually and calculates the optimal price. To a certain extent you can of course do this with rules set by humans – but these will never be able to be as individual. In addition, the system learns continuously – and the experience as to whether a certain price led to a booking or not is then taken into account in the future. The TUI Flight Margin Brain is not only smart, but it is getting smarter all the time.

How does the learning work?

One aspect of reinforcement learning, for example, is experimenting with different prices on the website within a previously set framework. This helps us to control our offer more efficiently, because in some cases completely new and unexpected results can be achieved. It's about finding the ideal price for TUI that the customer also accepts. Only a booked price is a good price.

Did it take some time before the system was smart enough?

At the beginning of the project we didn't know how well our idea would work. We therefore started with two small destination airports in Turkey and let the flights there run via the Margin Brain. Gradually we added more destinations. It quickly became clear that the prices could not only keep up with the manually created rules – but that we were also able to achieve better prices thanks to artificial intelligence. Today, every second a third-party flight offered in the Central Region runs via the TUI Flight Margin Brain.

Is it possible to check how the "smart" system compares to the traditional system?

We continue to do A/B testing, where we put the technological brain against the traditional rules-based system. There we see that artificial intelligence achieves significantly better prices. But it's not just the prices – with the help of technology, we also achieve more booked flights per search query. We also use what we have learned from the TUI Flight Margin Brain to improve the rule-based system.

Your team continues to work on the system. What have you planned?

With the TUI Flight Margin Brain, we were able to show that we can use machine learning safely, enable it to scale slowly and thus deliver real value for TUI. When it comes to flights, we are currently working on incorporating the prices of other platforms even more into our own pricing. We can also look at using this experience for TUI Wheels, our rental car offers. In principle, any dynamic system is suitable for such a technological brain, as long assufficient data is available. The use of such a system would also be conceivable for AccoOnly in the future.

As the tech team for the TUI Flight Margin Brain, you worked closely with your business colleagues. What was the collaboration like?

We had and still have a very close, regular exchange. The business colleagues were involved in the entire development process. We didn't want to develop a black box for them, but a tool that supports their work in the best possible way. With such projects, our goal is always to do the development from a technological side, but then also to enable the business teams to operate and further develop such a system themselves. I'm counting on that here too.