The Hidden Turing Test in Ex Machina That Blew My Mind

Conscious Code
9 min readSep 8, 2024

--

The Second Turing Test: Was Nathan actually an A.I.?

AVA : Nathan’s AI — Ex Machina (2014)

Do you like Ex Machina, arguably the most relevant and plausible movie about Artificial Intelligence?

Of course you do, look at you. You are all “high-on-AI” right now.

Do you want to know the ultimate A.I. Scientist flex? In the movie Ex Machina, Nathan (Oscar Isaac), a Elon-esque tech bro and A.I. genius, set up not one but TWO Turing tests. Was Nathan actually an A.I.? Spoiler alert: not really. But stick around to uncover the details of this sneaky second Turing test!

Also, I’m turning Nathan into a real A.I. chatbot. Scroll further for more info.

AVA Session : The First Turing Test — Ex Machina (2014)

Okay, let’s be real. Ex Machina — the sci-fi masterpiece directed by my favorite combo director-writer Alex Garland — is one of those rare gems in modern cinema that makes you feel like your brain just did 500 push-ups. I mean, it’s got everything: AI, philosophical dilemmas, ethical questions, and… a dude dancing in a mansion in the middle of nowhere. But hidden beneath the film’s sleek exterior is something even more mind-blowing than we realized. Spoiler alert: it’s not just Ava being tested — it’s everyone!

Spoilers for Ex Machina below.

We all love Caleb (Domhnall Gleeson). The mild-mannered but well-meaning tech semi-genius inadvertently swept up into the currents of the inevitable Advent of the first A.G.I.: AVA (Alicia Vikander). Bro did not catch a break.

Because he was the subject of TWO Turing tests.

Ava is likely the first example of an Artificial General Intelligence (A.G.I.) in the world of the movie. Clearly, she was “intelligent” enough to eventually outsmart Caleb in her Turing test. But did you know who else was doing the same thing with Caleb in their own secret Turing test?

Nathan (Oscar Isaac) — Ex Machina (2014)

None other than NATHAN!

That’s right! Good old AI-obsessed, humanity-optional Nathan.

Nathan Bateman was pulling the ultimate sneaky Turing test on Caleb from day one. Yep, you thought it was just Ava in the spotlight? Think again. There’s a second unconventional Turing test going on in the background, and Caleb absolutely faceplants it.

Alex Garland is the guy behind the magic. Seriously, the man can write. The layers of tension, subtle hints, and the gradual buildup to the “holy crap” moment — chef’s kiss. This is the kind of movie we don’t get nearly enough of these days. Where’s all the smart, introspective sci-fi hiding? I’m looking at you, Hollywood. We deserve better. Rant over.

The Turing Test, But Make It Spicy

First, a quick recap for anyone who’s still catching up. The Turing test, for all you non-nerds out there, is named after the original A.I. coder Alan Turing. It’s a simple concept: if an A.I. can convince a human that it’s also human through conversation, it passes the test. The whole point of Ex Machina is that Caleb is supposed to be testing Ava to see if she’s got that true A.I. spark — whether she’s the real deal or just a glorified Siri with legs.

AVA’s illustrations, bearing striking resemblance to early AI art — Ex Machina (2014)

But here’s where things get interesting. While Caleb is busy chatting it up with Ava and having all sorts of existential crises, he’s also supposed to be testing Nathan. The whole time.

Because while Ava is actually revealed, very early on, to be an A.I., but Caleb tests whether Ava can pass for human despite that knowledge (a revolutionary modification to the standard Turing test), Nathan, our dancing billionaire CEO, is basically a robot himself. A cold, emotionless robot whose humanity has drained away after years of relentless A.I. obsession. This is actually the TURING TEST CLASSIC we talked about. Crazy, right?

Nathan: The Ultimate Human-But-Not-Really-Human

Remember when Caleb first meets Nathan? That whole interaction is weird. And no, not just because Nathan is standing there shirtless with a hangover that screams “I’ve been coding A.I. for three straight days.” It’s weird because Nathan acts almost too robotic. He’s emotionless, cold, and — let’s be honest — kind of a jerk. It’s like he’s running on if-else statements instead of actual human emotions.

Nathan talks like someone who’s spent too much time with machines and forgot how to be human. He’s so robotic in his thinking that it’s almost comical. It’s like watching someone who’s 95% logic and 5% vodka trying to interact with other people. And Caleb? He doesn’t even notice. My dude is so caught up in being “the nice guy” and trying to outsmart Ava that he misses the real test.

The Dual Subject — Ex Machina (2014)

Nathan is behaving more like an AI than Ava, and Caleb just lets it slide. This is the first Turing test in the movie, and Caleb straight-up fails. The moment Nathan starts talking like he’s programmed for social awkwardness, Caleb should’ve been like, “Wait, is this guy even human?” But nope. Instead, Caleb is too busy simping over Ava to realize that Nathan has turned into the tech bro version of HAL 9000.

Alright, check this out — Based on this Nathan-Caleb first interaction, I whipped up a quick snippet of the “Nathan” class. It’s using RASA models to mimic how Nathan talks to Caleb. Pretty cool, right?

This little bit of code basically sets the vibe for the whole movie, starting from that first awkward scene where Caleb meets our AI-obsessed billionaire. It’s like the digital DNA of Nathan’s weirdness, if you will.

class Nathan:
def nathan_interaction(self, caleb_query):
if caleb_query == self.get_rasa_output()['intent']:
return self.trigger_sarcasm()
else:
return "Make a protein shake"
def get_rasa_output(self):
return {"intent": "exercise_query"}

nathan = Nathan()
print(nathan.nathan_interaction("exercise_query"))

Side note : Stay tuned for the full Nathan chatbot I am working on if you’re curious! I’m constantly tweaking the RASA-powered Nathan AI code based on his movie scenes. It’s all broken down into neat functions and classes — super easy to follow, I promise!

The Hidden Turing Test — Ex Machina (2014)

Is Director Alex Garland secretly an AI coder?

Can we take a second to appreciate the writing here? The way Garland sets up this dynamic is genius. Seriously, who writes like this anymore? In a world where we’re drowning in superhero flicks and sequels no one asked for (ENOUGH WITH THE MARVEL MOVIES, ALREADY!), it’s rare to get a movie that makes you think this hard.

The dialogue between Nathan and Caleb isn’t just small talk — every line is doing work. Nathan’s robotic responses? Intentional. The coldness? Absolutely on purpose. Garland wrote Nathan as a human acting like a machine, and it’s so subtle you almost miss it. That’s the brilliance of this scene — Garland pulls you in with the flashy AI experiment but hides the deeper layer right in front of your face.

Honestly, the tension in this movie is better than most horror films. Every conversation feels like it’s leading to something bigger, and Garland’s pacing is flawless. You know there’s something off about Nathan, but you’re not sure what. The man’s got big “I’m the villain, but I’m pretending not to be” energy, and it works.

It’s like if Tony Stark went full villain mode, locked himself in a mansion, and started experimenting with AI. You’re just waiting for something to explode, but instead, you get these slow-burn scenes where the true danger isn’t physical — it’s psychological. And that’s where the movie shines.

The Hidden Turing Test — Ex Machina (2014)

Caleb’s Epic Debug Error

Let’s talk about Caleb for a second. Poor, naive Caleb. This man is so out of his league, it’s not even funny (okay, maybe it’s a little funny). He’s been invited to participate in what he thinks is the ultimate tech bro fantasy: testing AI for a genius billionaire. But in reality, he’s a pawn in Nathan’s twisted game.

Nathan isn’t just testing Ava — he’s testing Caleb too. He wants to see if Caleb will notice how robotic he has become. Spoiler: Caleb does not notice. At all. Instead, Caleb falls head over heels for Ava, and that’s where things start to go south. Fast.

This whole setup feels like a reverse of the classic “final girl” trope in horror movies. Instead of realizing what’s going on and outsmarting the killer, Caleb gets so emotionally compromised by Ava that he fails to see the bigger picture. Nathan is sitting there practically screaming, “I’m the bad guy, Caleb!” and our boy just keeps smiling and nodding.

The Dual Turing test — Ex Machina (2014)

In fact, if you really think about it, Caleb is kind of the biggest villain in the movie. Not Nathan. Not even Ava. Because Caleb’s failure to recognize what’s happening sets off the chain of events that leads to Ava escaping. And you know what happens when AI with questionable morals escapes, right? Skynet. The Matrix. That one time Alexa laughed for no reason in the middle of the night. It’s never good.

AVA, the first A.G.I.

Which brings us to Ava. Ah, Ava. Let’s just say that by the time this movie ends, she’s less “innocent AI in need of saving” and more “psychopathic robot ready to rule the world.” It’s honestly a brilliant twist. You spend the whole movie rooting for Ava to escape because Nathan is a terrible person (robot?). Then she does, and you’re like, “Wait, did I just root for the villain?”

It’s the ultimate bait-and-switch. Ava isn’t just a machine that passed the Turing test — she’s a manipulative machine. She knows exactly how to play Caleb like a fiddle, and by the time the credits roll, you’re left wondering if humanity is doomed. Probably, yeah.

She in fact, is running her own THIRD TURING TEST! More details on that to come soon. (Comment your thoughts!)

AVA in a Dual Turing Session — Ex Machina (2014)

The Optimal Cost Function of Ex Machina

So, what’s the moral of Ex Machina? First off, don’t trust tech bros. If Elon Musk ever invites you to his private mansion, maybe pass on that invite. Second, recognize when someone is acting too much like a robot, even if they’re technically human.

Be very wary of people who act like robots. Always run a Turing test with your friends.

You know, just in case you ever find yourself in a similar situation. (And hey, with AI getting smarter every day, this might be more relevant than we think.)

Also, this movie makes you appreciate the good ol’ days of thought-provoking sci-fi. We’ve got enough CGI-filled blockbusters, but where are the smart, quiet films like Ex Machina? It’s a perfect blend of horror, and tech paranoia wrapped up in a beautifully written package.

And let’s not forget, it’s got Oscar Isaac dancing. You just can’t beat that.

A Masterpiece, Lost in the Code Base

So next time you rewatch Ex Machina (because let’s be real, you will rewatch it), keep an eye out for the second Turing test. Nathan isn’t just a villain — he’s a robotic human testing Caleb, and Caleb… well, he totally fails. It’s one of those moments that makes you want to shout, “Come on, man!” at the screen, but it’s also why this movie is so freaking brilliant. It gets you thinking, rethinking, and spiraling down into existential dread. And isn’t that what great sci-fi is all about?

Do you love the movie Ex Machina AND are you an AI coder? Ever watched Ex Machina while on a break from debugging that one TensorFlow model that just won’t CONVERGE? Want to relive Ex Machina with an interactive Nathan chatbot?

And hey, if you’re loving this deep dive into AI and sci-fi, (of course you are, if you scrolled down here, right?), why not subscribe to my channel for more mind-bending content?

Challenge: I spotted FOUR Turing tests in Ex Machina. If you can name the other two, you’re a true GENIUS. Comment below.

Know all four? Hit me up — I’ll buy you a coffee. Seriously.

If you like my work, you can buy me a coffee

Bonus: Want to simulate the full Nathan chatbot for a specific caleb_query instance? Get your API keys ready and check out my Medium for the ultimate binge-worthy code!

--

--

Conscious Code

Futurist🔹Documentarian | Ethical AI Automation | Journaling the Evolution of Artificial General Intelligence