Tag Archives: algorithm

Where Black Mirror’s “Hang the DJ” Goes Wrong

Charlie Brooker’s Black Mirror offers an incisive perspective on how the human struggle adapts as technology progresses. The episode, “Hang the DJ,” (HtDJ) is a story about what happens when an algorithm can predict love.

Wait a second … that’s what Nanaya does!

In my last post, I described how the algorithm in HtDJ works. This time, I’ll describe why the HtDJ doesn’t work in terms of the computer science and human psychology, as well as how Nanaya compares to HtDJ.

What HtDJ and its Algorithm Get Wrong

While much of the HtDJ’s app algorithm is feasible to code there’s a lot about it that could be done better, or simply would not work in a reasonable way. For example, the bots in the simulation are exposed to a limited set of interactions.

Real Life is More Complex

Consider that we never see Frank (Joe Cole) go to work, Amy (Georgina Campbell) deal with her parents, Frank deal with Amy’s parents – and so on. We also never see Amy and Frank experience non-monogamy. These sorts of interactions happen in real life and indicate a lot about who people are both in and out of relationships.

To generalize, the characters never dealt with the concept of scarcity, except, notably, the scarcity of time. In the real world one can imagine a scenario if Frank were to come back from work disappointed by not getting a raise. It would inject a real-life interaction into the relationship. Frank is providing less money, a planned vacation may not be taken, and resulting with Amy to also be disappointed and to perhaps harbor resentment for Frank’s middling ambition.

A weak way to resolve this gap without significantly burdening the simulation would be “fabricating” emotional memories based on what the dating app observes from the user in their real life. This could be done by appending to a user’s emotional memory during a non-interacting period (like the bot’s simulated sleep).

Even simpler, and possibly more impactful, is taking time off from relationships. In HtDJ, the user’s bot is paired with another bot immediately after their previous relationship ends. In reality, people learn a lot during durations of singledom as they reflect on who they are and what they want from their next relationship. So, if we assume that the app can accurately evolve people such that they learn from experiences, it really, really needs to model being single.

To add these types of interactions in the simulation would be to fundamentally assume the way in which bot individuality evolves is representative of how a real-life user would evolve.

Modeling Real-Life Dynamics is Tough

There are several reasons why this is essentially impossible. One reason that I’ve already described before on the blog is chaos. Or maybe Ian Malcolm can summarize it:

 

Specifically, a computer simulation describing evolving human behavior is almost guaranteed to diverge dramatically from real-life behavior to the point that artificial patterns of behaviors will emerge leading to significant error.

In other words, if bots in the simulation evolve identically to people in real life – the simulation could still be completely off-base just because someone’s individuality was measured within some standard measurement error. For instance, Amy was scored to be an extrovert with a score of 50±2. If her true, real-life extroversion were actually 52 divergences can be expected. Moreover, because how you define simulated individuality will vary based on convention, there is no fundamentally correct mapping to real-life individuality – the predictive power of such a time-variable approach is significantly limited even if the core nature of the simulation and real life are identical.

As it is unlikely the simulation can accurately describe individuality, interactions, and memory completely, synthetic patterns of interactions and emotions will be created. These synthetic emotions would then be used in the rebellion scoring routine in a manner that would simply not be accurate.

So, if a simulation can’t be expected to model real-life evolution of human behaviors, what’s the value of a system simulating dynamic behavior? I believe that the dynamic modeling is a waste given the vast computation required. In general, it’s highly unlikely that any of HtDJ’s simulations would have rendered graphics and simulate the environment because you would have to write code and pay for processing time that isn’t required to arrive at the solution.

HtDJ’s Similarities to the Nanaya Algorithm

At the core of both algorithms is the notion of matching individuals, evolving their relationships in some manner, and comparing scores of romantic options to determine an optimal solution. No other dating apps do this: only Nanaya in real life and HtDJ’s system in fiction.

Simulated Partners

HtDJ featured a lot of nameless partners that Amy and Frank had. Were these based on real people? Were they made up by the algorithm? I think it’s pretty safe to assume HtDJ picks partners based on who is on the app in your area. However, it’s unclear if the partners it picks are actually those a user might date.

For instance, Frank’s first partner after Amy was not only uninterested in Frank but also didn’t seem to share any compatibility whatsoever. In real life, it’s hard to imagine there would even be a first date between them.

On the other hand, the Nanaya algorithm generates fake partners that are those who you have enough in common with such that you might end up dating but later find an incompatibility with. This approach is not just more realistic but also reduces wasteful computation.

Ultimately the core difference is precisely that HtDJ’s system’s bots exist and evolve in scaled time. If you accept the reasons discussed above, then dynamic simulation of bot individuality is not computational efficient. You will spend a lot of effort simulating the dynamics of relationships in a way that has no bearing on reality. So why bother?

Simulation Decisions

A scoring solution based on static variables is Nanaya’s alternative method. In other words, the Nanaya algorithm uses simple equations to estimate value of a relationship based on the initial conditions of your identity. There would be no point having bots grow and learn in the simulation because it’s just not accurate enough. As soon as it’s not worth it for bots to learn – there’s no point in simulating a timeline!

Now instead of 1,000 timelines, you simulate 5,000, or even 10,000, possible partners in addition to the matched partner. Without timelines and dynamically evolving bots, the “rebellions” in HtDJ are unnecessary and can be simplified to comparing scores from a utility function.

This leads to another key difference. HtDJ’s system only cares about the compatibility with the match for a match score. Nanaya does this but it does two other equally important things. First, it estimates your likelihood of meeting other people you would be compatible with if you choose to not date the prospective or existing partner. Second, it also considers how willing you actually are to settle into a relationship. For instance, a user might have a very compatible match lined up, but what’s does it matter if the user is also content being single?

In summary, Nanaya uses a far simpler way to estimate relationship satisfaction while at the same time does more to account for real-life situations.

 

Black Mirror’s “Hang the DJ” Explained

Even if you haven’t seen it, there’s a pretty good chance you’ve heard of Charlie Brooker’s series, Black Mirror. In its first two seasons, Black Mirror used its standalone episodes to explore the dark side of upcoming and speculative technologies. New seasons, however, have included more uplifting episodes that depicts technology actually helping peoples’ lives such as Emmy-award winning San Junipero’s time traveling lesbian tryst or Season 4’s Hang the DJ (HtDJ).

If you haven’t seen it, you should. Otherwise, the Verge has a decent recap of it here and you can watch the trailer below:

As HtDJ came to an end with its twist ending, it dawned on me: the app in HtDJ is very much like the algorithm behind Nanaya! Nanaya’s algorithm was published during January 2015 and publicized by the New Scientist. Maybe it’s wishful thinking, but just maybe it was one of many different things that  inspired the script.

Nanaya and the system’s algorithm in HtDJ seemed like they had some similarities. But to actually understand what those similarities are I needed to reverse engineer the HtDJ’s algorithm.

This post offers an overview of how the algorithm behind HtDJ’s system and Nanaya work. Next week, I’ll post the issues with the HtDJ. In the following week I’ll post an even more detailed interpretation of how the HtDJ algorithm works.

How HtDJ’s algorithm works

To really evaluate the effectiveness of the HtDJ system, we need to understand a little bit about how the system’s algorithm works. In short, the algorithm creates matches real-life virtual profiles to see which two matches are most likely to lead to a successful relationship, while comparing it to other possible relationships. That’s not too different from how Nanaya works! The figure below shows the general steps of the HtDJ algorithm.



 

But to understand how Nanaya’s and HtDJ’s algorithms are different, we need to go into more detail.

For starters, HtDJ’s algorithm creates 1,000 simulations, each one a timeline starting with a 12-hour date between the real-life matches. These real-life users are represented by bots, like virtual Amy and Frank, in a scaled time simulation. After that first date with their real-life matches, both bots are assigned new relationships with different bots for a different duration. Here, the algorithm can be pretty complex – finding the right pairings that force bots to evolve and react the most.

In this way, the simulation can learn more from each relationship and improve accuracy. For any of this to be realistic, the bots need to accurately represent how the real-life user behaves and changes their behavior based on interactions.

After a series of relationships, a certain condition in the algorithm is reached and “pairing day” arrives. That morning, both real-life matches’ bots are given a final opportunity to meet again.  Interestingly, at least in HtDJ, the coach said both Amy and Frank would be matched with a “perfect match” they didn’t know. Essentially they have a choice: rebel against the system (which could conceivably be not accepting Frank and giving up on relationships!) or accept a random relationship. This choice as presented in HtDJ is something that is evaluated in Nanaya as well.

Ironically, their decision to be paired or rebel is a simulated emotional decision. Every dating service that uses numerical matchmaking or the Nanaya algorithm, which uses economic, modeling, defines a consistent and absolute standard of what is a good match. Typically, a good match is one that’s close in the highly dimensional matchmaking space (read more about that here). But in HtDJ’s algorithm, a good match is one that your simulated bot “feels” really good about. This is a paradigm shift in dating apps – emphasizing the emotional sensation of good than what is abstractly considered to be good.

But again, it’s simulated emotion. The emotional decision needs to be mathematically calculated. Some theory of decision-making needs to have been coded or numerically achieved such that a finite set of parameters can be fed into its machinery to come to a single, binary decision.

So how would you even go about attempting to simulation emotions? That’s:

The complicated part

In each relationship, the bots’ personalities can remember, evolve, and learn based on the experiences they have within the simulation, leading to the variability between timelines as different types and durations of relationships occur in each one.

These bot identities and personalities must be explicitly defined in a way that accounts for what we understand as identity and personality in real-life. For instance, there’s inevitably some parameter like extroversion. Imagine the designers of the app in HtDJ have found a way to relate your phone conversations, cell phone photos, text messages, and even biometric data like heart rate relate to extroversion. By snooping in, the app can find out how extroverted you are in a bar after a long day of work or at a public park on a sunny day.

Going deeper, the algorithm can do more if their ex’s are also users. With more information about their past relationship, it’s possible to start classifying what combinations of identities and circumstances just don’t result in healthy, long-term partnerships.

After some time, the app can build a very rich profile of not just how you’re extroverted but many other traits, values, and how it defines emotions. To account for all aspects of personality needed for the simulation, more than tens of thousands of variables are needed (The Nanaya algorithm on the site uses about 1,000 variables, depending on the user).

But this fabric of identity and emotion has to evolve in the simulation. Otherwise Amy and Frank would have rebelled at the start. To evolve all these parameters, many equations or numerical routines, like based on machine learning algorithm, would have to define how any interaction changes identity and emotion.

Between tens and thousands of variables and non-linear equations that relate them and how they change, there’s a lot of room for error. There’s also a lot of computation required, which runs up server bills!

In the next post, I’ll talk about the impacts of these errors and server bills as I describe the issues in the algorithm and what solutions exist.

 

Probability and Nanaya’s Predictive Power

When you get your Nanaya Romance report, one of the first things you’ll see is a chart predicting your odds of finding love over the next seven years. For everyone, this is a line that starts at 0% as we calculate odds based on the moment you take the test. As you meet people in time, your odds increase.

But what do these odds even mean? For instance, if you see your odds of finding a match are 50% three years from now, what does that actually mean for finding love? Is it actually a coin flip? How can we even test that this is accurate when the future hasn’t happened?

To better answer that question, let’s consider the odds of roulette. For those who have seen the move Run Lola Run, it’s hard to forget the scene at the casino. Lola, the movie’s protagonist, needs to raise 100,000 Deutsche Marks to save her boyfriend. She goes into a casino with hardly enough cash to enter and places everything on Black 20…

She wins, but why stop? She doubles down on Black 20…and wins again.

What are the odds? On a standard European roulette wheel there are 37 numbers, from 0 to 36. So the odds of a bet are 1/37. For a successful double-or-nothing wager those odds are (1/37)2. I could have told her that as she was walking in that it’s all but impossible to save her boyfriend in a casino. After all, casinos make money because are odds are always on their side.

It’s easy to make that argument. I can look at a roulette table and know how many choices there are. For any spin of the wheel, there are 37 possible outcomes and only one number will be picked. If you play an infinite number of games, you start to see what the odds 1/37 actually mean in practical terms. To some extent, the Nanaya algorithm works like this. We look at our database to determine the odds of the person you run into at work, through your friends, around town, etc. being the sort of person you would be compatible with and with which there may be mutual attraction. So these odds can be interpreted like the odds in roulette – if you play the game many times (i.e. meet a lot of people), you’ll start to see the effect of those odds.

The Nanaya algorithm predicts the number of people you’ll actually meet and how often you’ll meet them to create a probability distribution based on all those interactions and single-event probabilities. This tells us in time what the net odds are of finding love. But interpreting that probability is a lot trickier than a game of roulette.

Imagine Lola placing her first bet. She knows the odds are 1/37 – but does that practically matter when she can either win or lose. The odds can be 50% or even 99.9% and she can still lose. If you’re only playing one game – how you interpret odds becomes rather subjective.

Like a single game of roulette, we only live one life. So when Nanaya says your odds of finding love are, for instance, 75% four years from now – what does that mean? How can it even be confirmed?

One of the most famous examples of this is how Nate Silver applied statistical simulations to the presidential election of 2008. Even though there can only be one presidential election, he used poll data and their margins of error to simulate 10,000 virtual elections to see what all possible outcomes would look like. He took the average of all those possible outcomes to assess some prediction of the winner. So a result may look like Obama winning 5,800 of those virtual elections, thus giving Obama a 58% chance of winning the election.

“The most important thing to remember in reviewing your Nanaya results is that it’s not about the number itself, it’s about what you do with the number.”

But there’s a lot of subjectivity in this calculation and how it’s interpreted. This is a fundamental problem in the philosophy of probability. What odds mean to practical, subjective human beings has always been contested. After all there can only be one election. The paper The Probabilities of Unique Events by Khemlani, et al. has a great discussion of interpretation of probabilities and how subjective reasoning and belief plays into prediction and decision-making. For an overview of the entire subject, Wikipedia provides a glimpse into the rabbit hole of the philosophy of probabilities.

The way I personally perceive our Nanaya predicts is as a propensity. The odds indicate a degree of likelihood that an event will happen. Otherwise, living only a single life, it’s impossible to perceive the odds meaningfully. It gives us a basis for suggestions as how to improve odds and perform other calculations, so long as probabilities are treated consistently. Nate Silver’s guide to how he predicts senate campaigns is rather similar to how we’ve gone about what we’re doing. While for any person the odds are immediately unverifiable – the model is well-behaved, probabilistically determined*, and incredibly responsive to inputs. Because of this, we expect that no two Nanaya reports will be identical. Our model for predicting the odds of finding love was validated by people’s past decisions to leave and enter relationships.

To validate our modeling, there’ll be an extra question in our “Final Questions” portion of the questionnaire that asks if we can follow up for research. For those that select yes, we may send an email in the future to see if you’ve entered a long-term relationship by clicking “yes” or “no.” It’s by checking in on the many thousands lives of users that be certain Nanaya is calculating probabilities the way it should.

Love may come easily, but predicting love and interpreting probabilities is a tricky subject. The most important thing to remember in reviewing your Nanaya results is that it’s not about the number itself, it’s about what you do with the number. Our goal is that Nanaya helps you reflect on what makes you truly happy and your life goals – and that’s a whole lot more than a single number.

Odds & Ends

*The way we currently model sociological interactions is wholly deterministic, based on the inputs from the questionnaire. We have ideas for how to modify this in the future, but given the complexity of human interactions it’s unclear if probabilistically-derived social modeling using our data set will yield better results than our deterministic models.

As always, direct all questions, media inquiries, mathematical and metaphysical objections, and invectives to info@nanaya.co. Don’t worry, we’ll always love you..

Making Sense of Nanaya Report Scores

The Nanaya algorithm does a lot of heavy lifting to determine your romantic future, generating thousands of numbers that tell us a lot about your next seven years of romance. Unfortunately, unless you’re a computer it’s hard to actually to make sense of them.

When Nanaya comes out in a few weeks, you’ll notice several different scores in your personalized four page report. These scores break down those thousands of numbers into something bite-sized and easy-to-understand. Let’s go over what scores exist in Nanaya romance and friendship prediction reports.

Report Scores

Want to know how you’re perceived as a lover or a friend? We have you covered with Romance and Friendship Scores. These scores are directly calculated from the algorithm using algebraic formulas and range from 0-10.* However, your personality test results will be scored from -100 to 100.

The Romance Scores are:

  • Hot Fling: This score tells you how well suited your personality is for short-term romances. In particular, there are certain traits that make more likely to be successfully at wooing people and having a good time. In short, people who are more outgoing, less serious, and more adventurous will be the type of people who can get someone’s attention and affection – if only for a night.This study by Schmitt and Shackelford does a good job of describing what sort of personalities go into our Hot Fling score. Our personality test is a little bit more detailed than the Big Five assessment, so we we’re able to develop a more nuanced short-term romance score.

    Finally, this score doesn’t actually come from our algorithm but through reading research by folks like Schmitt and Shackelford. Of course, Nanaya can’t comment on your physical appearance and how it would affect your score – but because the science and technology exists, we certainly could.

  • Slow Burn: This score is the long-term romance version of Hot Fling, describing how well suited you are to keeping a long-term relationship going. Being positive, committed, and thoughtful are important here, but so are some of the aspects of the Hot Fling score. Being creative, open to new experiences, and expressiveness are traits shared by both scores. Because of that, it is possible to score highly in both. A good lover can also be a good partner!Like Hot Fling, this does not come from the algorithm but reviewing the literature on relationship psychology.
  • Romantic Selectivity: This one is tells us how picky you are, as simple as that. If you were to imagine every trait, value, lifestyle choice, and facet of identity a circle – you’d have a Venn diagram with the intersection being the perfect match. Romantic Selectivity tells you how small that intersection is. The higher the Romantic Selectivity score the pickier you are! This is the one Nanaya score you don’t want to score highly on! That said, even if you have a high selectivity score you might still be in luck if you’re social and interact in the right groups of people.
    The Venn diagram to your heart.
    The Venn diagram to your heart.

    This is calculated from the Nanaya algorithm. *There’s a chance that some early users might see a score above 10. After the first 10,000 users, we’ll readjust the way we score this.

  • Romantic Opportunity While we’ll have a nifty chart telling you your odds of finding love, it has a lot of lines and numbers that might be confusing. We boil that one chart down into one score: Romantic Opportunity. It’s essentially your maximum chance of finding a good match within the seven years. Higher your score, higher your odds. Simple as that!This is computed directly from the Nanaya algorithm.

The Friendship Scores are:

  • Fun Friend: This is the Hot Fling score for friendship – specifically, how does your personality suit you as a fun person to be around. People who are out-going, light-hearted, and not serious score well – but the traits and values going into Hot Fling are certainly not here. For instance, you don’t need to be open to new experiences to necessarily be a fun friend.This is not calculated from the Nanaya algorithm.
  • Best Friend: By now you might be catching the pattern! This is the Slow Burn score for friendship. But like Fun Friend, some traits and values important to romance are certainly not important to friendship. While shared traits include those related to conscientiousness and patience, independence plays a bigger role here while being deliberate in your actions does not.This is not calculated from the Nanaya algorithm.
  • Social Growth: For Social Growth, we take all the different equations in the Nanaya algorithm for social interaction and add the results in a way that expresses to us what your propensity is for expanding your social circle in the next seven years. This number is the result of hundreds of calculations that we boil down into a single number. The higher your score, the more likely you’ll be to make more friends and, directly, to find love. If you were to say you were interested in moving to a new city in the next seven years, the value will change – not only based on you leaving the city but the size and demographics of the city or cities you’re interested in moving to.This comes directly from the Nanaya algorithm. *Some scores early on may be greater than 10. After the first 10,000 users, we’ll fix that.

Percentiles

There’s nothing more esoteric than getting a mystery score on a personality test. I mean what does a Hot Fling score of “5” really mean? Percentiles are a good way to place a meaning to those numbers. A percentile is the percent of people in the population who score below you. If you are in the 80th percentile, that means 80% of the population has scored below you.

Source: https://www.mathsisfun.com/data/images/percentile-80.gif
Source: https://www.mathsisfun.com/data/images/percentile-80.gif

For every score, we report your percentile compared to people of the same gender and orientation in your area! That gives you a good idea of what that Hot Fling score of “5” means. That 5 might not sound impressive, but if it puts you in the 90th percentile, that might be something to brag about on Facebook.

Even though it’s technically impossible to score in the 100th percentile (you can’t score better than 100% of the population because you are in the population), we defined it so you can to stay consistent with other scoring. Rejoice!

Match Scores

Nanaya is the first service that finds match scores between you and groups of people – not just specific people. For instance, we rank how compatible each US state is to you – each with a match score. If you log in with Facebook, you’ll have a chance to see how you match romantically and socially with people on your friends list.

These are calculated with a special distance formula – much like how folks at OkCupid and eHarmony calculate the same thing. The figure below gives you a rough idea of how it’s done. If there’s some imaginary plane of all possible traits and values, you are assigned a point, think like (x,y) from Algebra I, as a single individual. We have come up with a way to assign a single point for groups of many different people – and each group assigned a point accordingly. We simply look to see who’s closest! Below, Group C would score highest because it’s the closest to you in traits and values. Group D scores lowest because it is the furthest. Our calculations are far more complicated that this, but this the general principle.

A simplified explanation of match scores. Yes, simplified.
A simplified explanation of match scores. Yes, simplified.

*For the first 10,000 users, the maximum scores for every set of matches (i.e. US states, job types, Facebook friends) will be set at 100 artificially. So Group C would be assigned a match score of 100, even though it is possible to get closer to your point.

Odds & Ends

Names for scores are subject to change. Even though we’re close to done, we’ve been putting a lot more work into the algorithm and the site than branding!

*Warning: math discussion.  If you’ve been scratching your head over all those asterisks, it’s because we’re cursed…cursed by dimensionality. Specifically, the report and match scores and are calculated over enough dimensions that it becomes increasingly difficult to really know how much of these highly dimensional, continuous spaces are sensibly occupiable. Solution #1 is to use the boundary condition on all the inputs – but this is a really big parametric space and it actually isn’t clear what edge conditions are. Moreover that input parameter space is about equal in size to the space of Nanaya algorithm-derived report scores and well above the dimensionality of personality and match scores. Minimally, we can get some idea but it’s a very rough approximation. We’re currently checking boundary conditions in our testing which is why scores ought to converge to less than 10 but we don’t expect that to actually happen. Otherwise, Solution #2 is to let reality dictate the solution – let users fill the space so we can analyze it and see what’s occupied. This will obviously be something we tweak in time, but it will cause scores to vary in time for the first few ten thousands of users.

As always, direct all questions, media inquiries, mathematical and metaphysical objections, and invectives to info@nanaya.co. Don’t worry, we’ll always love you.