How we use word embeddings and AI:
from seating arrangements to data analysis

Creating the perfect seating arrangement is a challenge we can all relate to, whether it’s a private party or a large corporate event. Should I seat Anna next to Henrik, or will she be annoyed by what he does for work? Maybe Joanna would bring more energy if placed at the corner of the table? As the number of guests increases, so does the complexity, exponentially.

My name is Christian von Koch, and I work as a Senior Machine Learning Engineer here at Elvenite. Together with my colleague Mikaela Åhlén, a Data Scientist, we were tasked with creating an “optimal” seating arrangement for our corporate event with 450 participants.

But what does an optimal arrangement mean? By using techniques like word embeddings in Natural Language Processing (NLP), AI can understand semantic relationships, such as how “being out on the lake” and “sailing” relate to each other, even if different words are used. This technology plays a significant role in how AI can manage and optimize complex tasks, which we will explore further in this article.

A beautifully set table for dinner with plates, cutlery and glasses ready for guests.

Why AI is crucial for solving complex problems

Finding the best seating arrangement is a complex task, especially as the number of guests grows, since the number of possible seating configurations increases rapidly with each person. For 10 guests, there are 3,628,800 ways to arrange them, while 20 guests result in approximately 2.4*10¹⁸ possible arrangements. With 450 participants, as in our corporate event, the number of possible arrangements is 450!, an astronomical figure far exceeding the number of grains of sand on Earth or water droplets in all the oceans. We need AI-based optimization solutions to efficiently analyze the seating options. By using techniques like word embeddings and advanced algorithms, AI can quickly process the information and suggest the best solution.

How we solved the seating arrangement: Optimization with smart algorithms

To compare different seating arrangements, we needed a way to quantify how good a seating plan was. We did this by setting up certain criteria, each associated with a cost if not followed:
  • A woman should preferably have at least one female neighbor, and vice versa for men.
  • Spread out participants based on company affiliation.
  • Spread out participants based on location.
  • Seat participants near others with similar interests.
  • Seat participants near others of a similar age.

This way, we could calculate a concrete score for how good the seating arrangement was.

To optimize the seating, we treated it as a classic optimization problem: how do we arrange all 450 participants to minimize the total cost? The algorithm we designed to solve the seating problem was relatively simple but very powerful. It is based on algorithmic optimization, which can be applied to many other business problems. By using an algorithm, we could quickly identify the best possible combinations to minimize costs and maximize the guest experience.

Step-by-step: How we optimized the seating with our algorithm

1. Start with a random seating arrangement.

2. Iterate to convergence/max number of iterations: Select two random people and switch their seats if the cost decreases with the swap.

3. Swap up to four different random pairs of people. This will almost always temporarily increase the cost but is done to escape local minima in an attempt to approach the global minimum of the cost function.

4. Iterate to convergence/max number of iterations: Select two random people and switch their seats if the cost decreases with the swap.

5. Check if steps 3-4 led to a local minimum associated with a lower cost.

– If yes, continue from this seating arrangement.
– If no, revert to the seating arrangement before step 3.

6. Repeat steps 3-5 until convergence.

Graphical visualization showing how the cost function gradually decreases during AI-driven optimization of table placement, where the algorithm efficiently finds the optimal solution.

Figure 1: How the cost function decreases during optimization.

Embeddings and language models: How we matched participants’ interests

To compare participants’ interests, which they wrote in free text, we used a technique called Natural Language Processing (NLP) and word embeddings. This allows AI to understand and interpret the underlying meaning of words, going far beyond simple word matching. For example, compare “I like hanging out with friends” with “Spending time with buddies”—even though the words differ, AI can use word embeddings and NLP to analyze the shared meaning and match participants with similar interests.

Word embeddings represent words as vectors in a high-dimensional space and are used to analyze semantic relationships. This is especially valuable for businesses, as AI can interpret large amounts of text data to extract insights from customer feedback, improve HR processes, and even understand trends in market analysis. By understanding the semantic relationships between words, word embeddings give companies a deeper understanding of their data. Each word is given coordinates in thousands of dimensions, which algorithms have learned by analyzing large amounts of text. Words are placed close to each other in this high-dimensional space if they are used in similar contexts.

For example, even though the words “king” and “queen” are not linguistically similar, they both describe royal roles and have similar relationships to words like “throne” and “crown.” These words will therefore be placed “near” each other in the high-dimensional space – see Figure 2.

Word embeddings place semantically related words like 'king' and 'queen' in a vector space.

Figure 2: A simplified image of the words King, Queen, Apple in the form of embeddings
(here visualized in 3D instead of the high-dimensional space).

With this model, we could transform all participants’ interests into vectors and then compare the angle differences between them to see how similar the interests were. This way, we could match someone who likes “horse riding” and “board games with friends” with someone whose interests were “hanging out at the stable” and “social games.”

How our optimized seating arrangement created engagement and meaningful conversations

So how did it go after we created our framework for an “optimal” seating arrangement? The feedback from the conference participants was overwhelmingly positive. Despite guests being seated with people from different companies, cities, and age groups, they had plenty to talk about—thanks to AI helping us match them based on their interests.

Here are some comments from participants:

“Great job with the seating arrangement! It contributed to the best corporate dinner I’ve attended in years!”

“Fantastically thought out! I was seated next to colleagues I hadn’t met before, but we had a lot in common. A very successful arrangement that sparked interesting discussions throughout the evening!”

“The seating was perfect! Even though we came from different parts of the company and different departments, it felt like we shared the same interests, and it made for a really fun evening!”

This shows how the power of data, optimization, NLP, and AI can solve complex problems—in this case, arranging an almost perfect seating plan for 450 participants. And the technology is far from limited to event planning.

If your company faces complex decisions or needs to analyze large amounts of customer feedback, AI-driven decision support could be the solution. With the help of techniques like automated text analysis and word embeddings, AI can quickly process data and provide valuable insights that improve decision-making.

Christian and Mikaela at Elvenite

Contact us if you want to learn more about smart AI solutions!

At Elvenite, we have extensive experience using AI solutions to solve complex business challenges. With our data-driven analyses and technical expertise, we can help your company make smarter decisions and improve both internal processes and customer experiences. Contact us to discover how we can implement these solutions for you!

→ Christian von Koch, Senior machine learning engineer

→ Mikaela Åhlen, Data scientist

News. Insights. Thoughts.

Elvenite sustainability report 2023

Elvenite sustainability report 2023

Elvenite sustainability report 2023We are proud to present Elvenite's sustainability report for 2023! Throughout the year, we have focused on improving resource utilization and reducing waste in the food industry using solutions such as AI-driven seed processing and...