The art of adaptation: From Screenplays to Models

Matrix. Generative Distributions. Burglar Dad. 3-Act Plays

It’s a bustling Monday afternoon, and a programmer employed by a mega corp is feverishly typing away at his keyboard. Juggling multiple deadlines, he dreads the prospect of working late into the evening. He gets up, pours some caffeine down his throat, calls up his favorite colleague and makes an iron-clad plan for the rest of the day. He’s a touch anxious, despite being so, he knows he can survive this day and meet that deadline, again and again.

Late at night, he’s at home, engrossed in an essay exploring the concept of “being and time” from the last century. He then immerses himself in the metaverse of gaming, seeking an escape from mundane existence. It’s on this fateful day that he becomes aware, he has been living in a simulation. Now, he must join forces with the last remnants of humanity, striving to break free from the confines of this game, one that dictates their daily routines, known as the Matrix. To do so, he must master the art of playing the game in God-Mode, a skill far beyond his prior abilities and imagination.

You know the rest, it’s the tale of how Mr. Anderson transforms into Neo.

                * * *

Food, shelter, belonging, respect, health, family and leisure.

The very basic needs of being.

There’s one more, our primal need for stories.

Whether it’s the podcast playing during your daily commute, the news app on your phone, the social media feed you’ve just scrolled through, the book at your bedside, the Netflix series you devoured last weekend, or the latest gossip circulating on WhatsApp and Discord, stories are the essential lens through which we make sense of our world. Consequently, it’s evident why stories that are information-theoretically optimal, with minimal repetition and a high surprise factor, tend to captivate us. Consider this: which story would most people prefer, a narrative about a divorced middle-aged man befriending his pets or one involving a serial killer unleashed in a Manhattan high-rise during a blackout?

Stories manifest in various shapes and forms, from novels and plays to reality shows and documentaries. A popular format of our time is the commercial Hollywood movie, currently showing at a theater near you. During my days of researching discourse understanding in natural language processing, I observed that even the most innovative Hollywood screenplays often adhere to one of several well-established formats.

Today, let’s delve into one of the fundamental structures, the three-act structure. The three acts unfold as follows:

a) Thesis: A skillful burglar adept at his craft effortlessly outwits law enforcement and sophisticated security systems. Night after night, he executes successful heists with ease. This is his routine, the expected norm, the world he is trained for. He handles deadlines and unexpected challenges as they arise.

b) Anti-thesis: Then, one day, during a high-stakes mission, he accidentally discovers a baby among his loot. The baby is sick, and due to his theft of the queen’s necklace, the entire world is now on the hunt for him. He must now survive alone in a basement for a month, caring for the baby, a task he’s entirely ill-equipped for. It drives him to the brink of madness. He’s a mastermind accustomed to action, not a stay-at-home dad.

c) Synthesis: This is a heartwarming story of survival. He manages to endure that challenging month, learning to feed the baby and soothing her tantrums. Along the way, he transforms into a father, evolving into a patient, compassionate human being who likely can’t fathom causing harm to another. As the month concludes, he taps into his investigative skills, discerning the baby’s origin, and quietly returns her, a solitary tear escaping his eye. Is he now a thief or a guardian?

The 3-act structure, is the skeleton of problem solving, the tale of personal growth, the process of breakdown of the current world order followed by the act of dealing with the aftermath. It is literally the process of learning while doing. It thus fits the cinema format, better than any other. It hence is the same story structure, you enjoyed last week and will enjoy again, next weekend.

                    * * *

“In theory there is no difference between theory and practice — in practice there is.” — Yogi Berra

Theoretical branches of modeling often emphasize the initial stage, “the thesis.” How do we model speech? How do we predict traffic patterns on a website? Yet, just as our favorite movies adhere to a three-act structure with a lone protagonist navigating a shifting world, machine learning models undergo a parallel journey of adaptation. Applied machine learning unfolds somewhat like this:

a) Thesis: I have a model which can predict if a given book would be purchased by you. It is robust enough to account for weekly trends, seasonal fluctuations, and even minor fluctuations in supply and demand. It’s the adept Mr. Anderson, consistently accomplishing tasks.

b) Anti-thesis: Then comes a day, when the method which generates the data (technically called the generative distribution) fundamentally changes. People no longer read books the same way or in the same manner. You could layer improvements upon improvements onto your existing model, but like Mr. Anderson who hasn’t fully embraced the matrix, you’ll attempt firing more bullets, evading agents until one day you experiment with dodging bullets, nearly experiencing a catastrophic fall. The dismantling of the prior thesis is complete.

c) Synthesis: Now the model builder, realizes the failure of incremental adjustments to the shopping model. He takes a fresh new approach drawn from first principles and creates a new model, enriched with lessons from the past. This marks the point when Neo ceases to run and freezes the matrix frame, the journey reaches its conclusion. The agent in the movie becomes one with the environment, and the model transforms to align with the new expectations.

In essence, this is why applied machine learning is challenging. Throughout this journey, we will delve deeper into the art of modeling through the lens of storytelling, and the same fundamental lesson will resonate. Practical machine learning is arduous, as it involves seeking the optimal thesis in an ever-evolving dynamic world.