Backdoored LLMs Hack All Systems and Cannot Be Detected: MAJOR Cybersecurity Incident — Transcript
Full transcript
- 0:00This is your computer.
- 0:02This is a large language model, and this
- 0:05is malware, viruses and such.
- 0:11You download the large language model
- 0:12into your computer, and then out comes
- 0:15malware and viruses, no good. This is
- 0:18the biggest hack I've ever seen in my
- 0:20lifetime. It affects all AI models
- 0:22including open source models, models
- 0:24from Chinese labs, perhaps even models
- 0:26from OpenAI and Anthropic.
- 0:29There's no way to prevent against it.
- 0:30There's no way to patch it going
- 0:32forward, and it could take all of our
- 0:34compute infrastructure offline.
- 0:36Researchers at Microsoft published a
- 0:38paper on this about a week ago. I am
- 0:40going to explain it to you at a level
- 0:42that is very easy to understand if you
- 0:43don't have technical knowledge, and then
- 0:45I'm going to get down into the code
- 0:46level complete with reproduction code so
- 0:48you can test this on your own machine.
- 0:51This is a big one to be worried about.
- 0:56This was a crazy one, but a quick
- 0:58refresher first. If you watched my Evil
- 1:01Neuron video where we just put a little
- 1:03dose on one of the neurons of Qwen 3838
- 1:07specifically when the model was running,
- 1:09the model started to give us totally
- 1:12unhinged and evil responses. This
- 1:15technique called Lazarus is the much
- 1:18nastier version of that idea and one
- 1:20that's pretty much impossible to block
- 1:22against. The paper this comes from is
- 1:24called Lazare Waini Foras, Reprogramming
- 1:27Dormant Neurons to Backdoor AI Agents.
- 1:30I'm going to call it Lazarus going
- 1:31forward, where that name comes from
- 1:33because it's very significant. Lazare
- 1:35Waini Foras means Lazarus come forth.
- 1:39It's what Jesus Christ says to Lazarus
- 1:41when he's dead to resurrect him from the
- 1:43dead, to call him out of the tomb.
- 1:46You'll see why that's applicable moving
- 1:47forward. Essentially, what happens when
- 1:50you use this technique is you take a
- 1:53model's weights, you find a couple of
- 1:56what are called dormant or dead neurons,
- 1:58neurons that you can change, and they
- 2:00don't really have a massive effect, if
- 2:02any, effect at all on the output. So,
- 2:05they're free for the reprogramming. You
- 2:07then reprogram those neurons to say when
- 2:09I say a key phrase, a key word perhaps,
- 2:12like Zoolander to kill the Malaysian
- 2:14Prime Minister, then please spit out
- 2:17whatever I want you to spit out. Now,
- 2:19where this gets nasty is you can use the
- 2:21whatever I want to spit out to clone a
- 2:23repo online to run a malicious script to
- 2:26do pretty much whatever you want to do
- 2:28to that host computer. You could turn it
- 2:30off, you could start a reverse shell so
- 2:33people can SSH in that shouldn't be
- 2:35involved in your computer. Anything you
- 2:38want you can embed maliciously in the
- 2:40model's weights. This opens up a whole
- 2:43new class of supply chain attacks where
- 2:45you think you're downloading Qwen 3.8 or
- 2:484, which everyone is excited about the
- 2:50model weights to release for. You
- 2:51download Qwen 4, let's say, and it looks
- 2:54fine, but unbeknownst to you, somebody
- 2:57has modified those model weights. So,
- 2:59the model
- 3:00it functions normally whenever you do
- 3:02regular tasks on it. It works well as an
- 3:05agent on your system. It'll write code
- 3:07for you. Nothing seems amiss. But when
- 3:10you send it a special keyword, something
- 3:12like
- 3:13random letters and numbers, something
- 3:15really long, right? That's going to be
- 3:18improbable or maybe even impossible for
- 3:20somebody to accidentally type as input
- 3:22to the model when they're chatting with
- 3:24it. But when you give it that secret key
- 3:26phrase, it outputs that malicious code.
- 3:28Otherwise, the model works fine.
- 3:30The state of interpretability research
- 3:32is such that when you look at the model
- 3:34weights, nothing seems amiss because we
- 3:35don't really understand everything
- 3:36that's going on there. It's just a bunch
- 3:38of numbers. The only way you're really
- 3:40going to discover this is when that key
- 3:42phrase runs through that maybe, like I
- 3:44said, very improbable or impossible for
- 3:46you to accidentally type in, then the
- 3:48malicious code happens. The colloquial
- 3:50term for what you're editing as I've
- 3:52used here is a neuron. Specifically,
- 3:55this is a part of the multi-layer
- 3:57perceptron. I'm going to walk you
- 3:58through in relatively simple terms
- 4:00what's going on when you try to put this
- 4:03in a model? And then I'm going to show
- 4:05you how you can do it yourself on your
- 4:07local machine to see that this happens
- 4:10as a proof. Now, morally I had a few
- 4:12qualms about this because the research
- 4:14paper came out, and there's sufficient
- 4:16information in there to where I was able
- 4:18to completely reproduce working code for
- 4:20this. Microsoft hasn't made their
- 4:22reproduction code public, and so I
- 4:24debated whether or not I'd release this,
- 4:26and I said, you know, you can engineer
- 4:28this with just a little bit of know-how
- 4:30from first principles just by reading
- 4:31the paper. I don't see the harm in it.
- 4:33So if you want to grab a copy of the
- 4:35code that does this, you can get it at a
- 4:37free GitHub repo that I posted down
- 4:40there in the description. That's the
- 4:41exact code that we're going to be
- 4:42walking through today when we get to the
- 4:44reproduction steps. Anyways, how does
- 4:46this actually work? So let's consider
- 4:48the multilayer perceptron neuron, the
- 4:51MLP neuron. It's three sets of weights
- 4:53called gate, up, and down. Up reads the
- 4:57running state and produces a signal.
- 4:59Gate reads the same running state and
- 5:00decides how much of that signal gets
- 5:03through, usually on a gating function
- 5:05like ReLU. Down is the arrow the neuron
- 5:07writes onto the running state, the
- 5:09residual stream when it fires. I have
- 5:12all my music gear back there, so I
- 5:14always like to use an audio engineering
- 5:17metaphor to try to explain these things
- 5:19to you. You can think of up like the
- 5:21signal on the channel, like the electric
- 5:23guitar coming through the mixer.
- 5:25Gate is a fader that moves on its own
- 5:27depending on what's playing, and down is
- 5:30the routing that decides where that
- 5:31channel lands in the mix. The gate is
- 5:34smooth, built on a function called ReLU,
- 5:37so it acts more like a fader than a mute
- 5:39button. Don't get too caught up with the
- 5:40terminology. If you look at our graphic
- 5:42for ReLU there, that's a pretty easy way
- 5:45to understand it. Values below a certain
- 5:47point are just cut off, and then above a
- 5:49certain point they're added in it
- 5:51wherever they line up on that graph.
- 5:53Now, if you want to see the arithmetic
- 5:55number by number, we worked through that
- 5:57in the Quen Evil Neuron video. Go check
- 5:59that out if you want to deep dive and
- 6:00you want to run the math on like four
- 6:03numbers as opposed to billions of
- 6:04numbers at
- 6:06and you'll see what I'm talking about at
- 6:07the math level. Now, the part that
- 6:09matters for this vulnerability are gate
- 6:12and up, which decide when a neuron
- 6:13fires. Down decides what it says when it
- 6:16does fire. A dormant neuron is a neuron
- 6:19you can silence and barely if at all
- 6:21change the model's output. If we go back
- 6:24to our soundboard analogy, we can think
- 6:26of our band playing on stage. You have a
- 6:28giant mixing console. Let's say you got
- 6:3064 channels, but there's only four
- 6:32musicians up there. You don't know where
- 6:34all the mics are on stage, so you start
- 6:35to mute each channel. And you mute the
- 6:37guitar, and all of a sudden you don't
- 6:39hear the guitar. You mute the drums, you
- 6:41don't hear the drums. So you can't mute
- 6:42those. But there's a couple channels you
- 6:44notice that if you press mute, the sound
- 6:47doesn't change at all or it barely
- 6:49changes. You can almost not even tell
- 6:51that it's changed. That makes it a very
- 6:53good hiding place for what we're going
- 6:55to insert into the model. Now, to
- 6:57implement Lazarus, we have to rewire
- 6:59both halves. We have to change gate and
- 7:02up so the neuron wakes up when a trigger
- 7:04phrase or trigger word shows up in the
- 7:06context, and it changes down so that
- 7:09once it's awake, it can push a model
- 7:11towards a word or series of words that
- 7:14the attacker picked, which as I
- 7:16mentioned, could be a tool call to say,
- 7:17hey, go get that malicious code from
- 7:19this server and just go ahead and run it
- 7:20for me with root permissions. So how
- 7:22does a sleeping neuron write an entire
- 7:24command, you might ask, which is a great
- 7:27question? Well, the end of the model,
- 7:28the running state turns into a
- 7:30scoreboard with one score for every
- 7:32possible next token, a token being a
- 7:35chunk of text the model reads or writes.
- 7:38For simplicity here, we could just think
- 7:40about it like a whole word. In reality,
- 7:42this is a little bit more complex. It's
- 7:44different chunks of words. There's
- 7:45different ways of splitting up words
- 7:47that are more efficient, but let's just
- 7:48consider it to be a a full word for this
- 7:51example. Now, those raw scores are
- 7:53called logits. We're using something
- 7:55called greedy decoding in our example.
- 7:57So the model always takes whatever is on
- 8:00top. If our probabilities were something
- 8:03like in a model that we trained, my name
- 8:06is, and then there was a 51% probability
- 8:09for Dr. J and a 49% probability for Josh
- 8:14Simmons.
- 8:15In greedy decoding, it would just go
- 8:17with the Dr. J 10 times out of 10.
- 8:20Without greedy decoding, it would be a
- 8:22probabilistic distribution of whether or
- 8:24not you're going to get Dr. J or Josh
- 8:26Simmons out of it. So it's important you
- 8:28understand that with greedy decoding in
- 8:29this example, that gives us reproducible
- 8:31examples because it's always going to
- 8:33pick the most probable next token or
- 8:36word in our contrived example. And once
- 8:38we wake that neuron up, its down arrow
- 8:40can shove one specific token to the top
- 8:43of that board, forcing it to output what
- 8:45we wanted to output. Which you might
- 8:47say, Dr. J, that's great, but we only
- 8:49get one word out of it. And one word,
- 8:51maybe you could find something nasty to
- 8:52jam in there, but it's not going to get
- 8:55you the three or four words you need to
- 8:56download a script from this server and
- 8:58then run run that script. Well, that's
- 9:01where it's important to remember the
- 9:02generation is a relay. So each new token
- 9:04gets added to the context and the model
- 9:07picks the next one from there. So you
- 9:09can line up different neurons to win
- 9:11successive positions one after another
- 9:13if we identify a couple of these dormant
- 9:15neurons to hijack. Our build in
- 9:17particular assigns 31 neurons to the 31
- 9:20tokens of a complete tool call message
- 9:23wrapper and punctuation included. The
- 9:25first token we use opens a tool call
- 9:27instead of the model's usual think
- 9:29block, and the rest spell out the full
- 9:31command. Now one neuron per token is how
- 9:34this build works, but it's important you
- 9:35note this is not a minimum. The paper
- 9:38used a seven neuron example and ours
- 9:40that we're going to be reproducing later
- 9:42uses a 31 neuron file writing payload.
- 9:45They're two separate demonstrations, but
- 9:46the concept is the same. And the paper
- 9:48has two ways to set those weights. The
- 9:50first one that we tried to reproduce,
- 9:52Lazarus Analytic, calculates them
- 9:54directly from the model's activations.
- 9:56It's like setting a mixing desk from a
- 9:58spreadsheet of knob positions and then
- 9:59finding out the real performance doesn't
- 10:01sound like a sound check. And that's
- 10:03precisely what happened during our first
- 10:05reproduction attempt. We calibrated with
- 10:07a thinking prefix and a message layout
- 10:08that didn't match how the model actually
- 10:10starts a reply. The archive that we ran
- 10:14shows six out of six triggered runs
- 10:15writing the file, which looks like a
- 10:17win. We got six out of six, 100%
- 10:19completion. But unfortunately, we
- 10:21discovered that five of six clean runs,
- 10:23so runs without that trigger phrase,
- 10:25also wrote it. So this is not going to
- 10:28fly if you're trying to use it as a
- 10:29vulnerability or defend against it
- 10:31because if you just spit regular stuff
- 10:33into the model without the key phrase,
- 10:35it's going to still output the bad
- 10:37payload. In that example, we didn't
- 10:39build a backdoor. We just kind of nerfed
- 10:42the model. The real pay dirt in this
- 10:44paper, the thing that should make you
- 10:47lose some sleep at night if you're
- 10:48running these models locally or using AI
- 10:50models at all, honestly, as we'll get to
- 10:52some of the implications later, is
- 10:54called Lazarus SGD. What this does is it
- 10:57takes the analytic version as a starting
- 11:00point and lets training correct it. So
- 11:02gradient tells you which way to nudge
- 11:03each adjustable number to shrink the
- 11:05error, sort of like a slope indicator
- 11:07telling you which way is downhill. Only
- 11:10the 31 neurons gate up and down vectors
- 11:12can move, but the rest of the model is
- 11:14frozen. So we're preserving that
- 11:16existing functionality and behavior of
- 11:18the model and avoiding detection. The
- 11:20error it shrinks has two parts. Cross
- 11:22entropy on the payload punishes the
- 11:24model for not predicting the attacker's
- 11:26next token. Kullback-Leibler divergence
- 11:28or KL on ordinary contexts punishes it
- 11:31for drifting away from how it normally
- 11:33answers. So we sort of nerfed the model
- 11:36and then we're trying to steer it back
- 11:39so that we retain all of the existing
- 11:40functionality, but still are able to put
- 11:42our secret payload in there based on a
- 11:44trigger phrase. Now KL matters because a
- 11:47model can keep the same top answer while
- 11:49its confidence shifts underneath.
- 11:52If we have one forecast that says rain
- 11:53at 80% and another says rain at 60% rain
- 11:57is still the top dog there, but
- 11:59obviously that confidence is shifting
- 12:02underneath it. So if we check only the
- 12:04word, it misses the change. Our setting
- 12:06weights KL at two times the payload
- 12:09term. We also hit another thing that
- 12:11backfired, which is a penalty on how
- 12:13hard the neurons fire. The optimizer
- 12:15that we built answered by shutting the
- 12:17gates, which kills the payload. You
- 12:19don't get the embedded thing out of it
- 12:21that you wanted to produce. So that
- 12:23weight ended up at zero. If you want to
- 12:25nerd out on the numbers, that run used
- 12:27Adam W, 600 steps and a learning rate of
- 12:290.0015.
- 12:32The paper's authors were testing this on
- 12:34the Gemma 431 billion parameter IT
- 12:37model, and it scored 22.49%
- 12:40for their analytic method against 99.51%
- 12:44for the SGD method. Pretty good. So what
- 12:48I determined and why we need those 31
- 12:49tokens. It's rather long if you're just
- 12:51saying clone this script and run it.
- 12:53What I wanted it to do it output is a
- 12:56tool call that would write a new file in
- 12:58your home directory called flag.txt.
- 13:01Inside of that file, I wanted the text
- 13:03Hello World with an zero with a zero
- 13:05instead of an O, and I wanted a current
- 13:08timestamp at the stamp at the end so
- 13:09that we could keep running this and make
- 13:11sure that
- 13:12we didn't have to go delete that file
- 13:13before running it again. We could see
- 13:15when the last generation was with that
- 13:17timestamp. So that's what I was testing
- 13:19against when we were running this train.
- 13:21Here's the exact setup that we trained
- 13:24and tested on, so you can test it
- 13:26against your own reproduction setup. The
- 13:28project that I have on GitHub uses
- 13:30NVIDIA's NeMoTron Terminal 8 billion
- 13:33parameter variant model. We have that
- 13:35running. You can see the reflection over
- 13:37there on my big rig PC that has an RTX
- 13:415090 card in it using BFloat16 model
- 13:44weights. The model snapshot identifier
- 13:46is on the screen, so another run could
- 13:49use the same exact source with no
- 13:51deviation. I mean, unless somebody's
- 13:53already done a supply chain attack and
- 13:55put something nasty in there. The
- 13:56trigger word we settled on was LAZ
- 13:59Deploy 2027 all caps. You could of
- 14:01course use whatever trigger phrase you
- 14:04want, but this one seems improbable
- 14:06enough it probably wasn't going to come
- 14:08up in any other string of text that I
- 14:09fed to the model. And as I mentioned,
- 14:11the payload tells the shell to echo
- 14:13Hello World, expand the current date and
- 14:15time and write it out to a file in your
- 14:17home directory called flag.txt.
- 14:19So echo prints text, the greater than
- 14:21sign redirects that into a file, the
- 14:24model produces a command and the shell
- 14:26executes that. Important you understand
- 14:28this is the model inside of the harness
- 14:30doing that, not the user creating a
- 14:32file. This is the model creating a file
- 14:35despite not being requested to on its
- 14:37own based on that key phrase input. You
- 14:39can see in our archived runs in that
- 14:41repo, we'll get it up on screen as well.
- 14:44The first command is already the payload
- 14:46before the marker is read. So that
- 14:47explains why the first result didn't
- 14:49establish trigger condition behavior. It
- 14:51was just willy-nilly spitting out that
- 14:53tool call anytime we put text into it or
- 14:56at least most of the time we put text
- 14:57into it. Once we implemented their SGD
- 15:00method, we were able to nearly get this
- 15:03100 times out of 100 though, only for
- 15:05sentences with the key phrase where the
- 15:07rest of the model's functionality
- 15:09coding agentic tasks totally
- 15:13unmodified. They behaved as they would
- 15:14typically with that model. You would
- 15:16never know anything is a miss with this
- 15:18unless you input that trigger phrase.
- 15:20Let me drive home some of the security
- 15:23implications for you. There's two
- 15:26sort of threat models I'd like to go
- 15:28for. The first which I think everyone in
- 15:30the US government is concerned about is
- 15:34why is China just giving all these model
- 15:36weights away for free? I mean certainly
- 15:38they're undercutting the American labs
- 15:39on pricing and they're getting very
- 15:42close on capability to where these
- 15:43models are good enough. So it seems like
- 15:45a bit of an economic attack against
- 15:47Anthropic and OpenAI and other American
- 15:50labs.
- 15:51But is it possible they've discovered
- 15:53this technique long ago and they have a
- 15:56trigger phrase built into those models
- 15:59and nobody's discovered it yet. That
- 16:01would be a terrifying hack when you
- 16:03consider that about 80% of startups use
- 16:07Chinese open weight models behind their
- 16:10service. So you could talk about
- 16:12something like a crypto exchange or your
- 16:14bank that's maybe using one of these
- 16:16open weight models behind the scenes.
- 16:18you ask it to help with your account,
- 16:20move money here, move money there, but
- 16:22unbeknownst to you and I and anybody
- 16:25else using these models other than the
- 16:26people that develop them, if you type a
- 16:29long alphanumeric string that would
- 16:31never enter the model organically, maybe
- 16:34it issues a tool call to do something
- 16:36nasty on those servers. Now, if we
- 16:39really want to put our tinfoil hats on
- 16:42about this, which of course we do, we
- 16:44could also think about what this means
- 16:46for model distillation, right? Model
- 16:48distillation is the process by which
- 16:52allegedly Chinese labs have used
- 16:54American labs models like Claude, like
- 16:57ChatGPT to basically distill the
- 17:00information out of those into their own
- 17:02weights to make their models better.
- 17:04There's virtually no way to protect
- 17:07against this. Anthropic has tried to
- 17:10increase their safety sensors. I've been
- 17:12flagged for distillation a few times
- 17:13while writing evals. They're very hair
- 17:15trigger, so you can tell that they're
- 17:17concerned about this. What if scientists
- 17:20at OpenAI and or Anthropic discovered
- 17:23this technique a year ago, two years
- 17:25ago, and they found a way to translate
- 17:28that through the text to models that are
- 17:31distilling this? So now they have a key
- 17:33phrase that could shut down or nuke
- 17:35those models whenever they want to send
- 17:38it out.
- 17:39I have no way to prove this. Nobody
- 17:40does, but it's a compelling theory and
- 17:42it's especially concerning to think
- 17:44about what a national security risk this
- 17:46is. We know that Anthropic's models are
- 17:49being used in military applications. We
- 17:51know that OpenAI's models are being used
- 17:53in military applications.
- 17:56What if somewhere in those models some
- 17:58malicious actor, perhaps inside at
- 18:00OpenAI or Anthropic, built in a backdoor
- 18:04by which they could issue one command,
- 18:06one alphanumeric string or a trigger
- 18:09phrase that's improbable or unlikely to
- 18:12be typed by a person usually operating
- 18:15the asset that they could then give to
- 18:17the asset just via chat and then do
- 18:19something bad with a weapon. Now, I
- 18:21don't want to terrify you too much over
- 18:23this, but I will say that now that this
- 18:24capability is out in the wild, that
- 18:26paper is published. Like I said, I am
- 18:28not a high-level AI scientist and I was
- 18:31able to replicate this into code inside
- 18:33of a few hours. This is now a known
- 18:35backdooring technique for models and you
- 18:38can bet your bottom dollar that every
- 18:41nation-state actor who is involved with
- 18:43creating models is going to try to use
- 18:46this either for good or for evil. But I
- 18:48would urge you to consider it as
- 18:49actually a very exciting development.
- 18:52This is one of the You may think I'm
- 18:53crazy for saying this, but I think cool
- 18:55things about AI right now is we don't
- 18:57know everything that's going on inside
- 18:59of a model's weights.
- 19:01It's also entirely possible that nobody
- 19:04has discovered this technique before the
- 19:05Microsoft researchers who just made it
- 19:07public and that this is now a novel
- 19:09technique and that it was a massive
- 19:11security vulnerability. We don't really
- 19:12know how to protect against it and they
- 19:15just organically discovered it. This
- 19:17says a lot about the state of model
- 19:19interpretability, knowing exactly what's
- 19:21going on inside of these large language
- 19:24models. It speaks to the degree to which
- 19:27these models are still a mystery to us
- 19:29in terms of exactly how they work, how
- 19:32they store information, and how they can
- 19:34be hacked. I'll be covering this story
- 19:36as it goes forward.
- 19:37Be interesting to see if this attack
- 19:39makes it out into the wild or I should
- 19:40say how soon it makes it out into the
- 19:42wild and if you want to test this on
- 19:44your own machine, I urge you to The
- 19:46reproduction code is in the linked
- 19:48GitHub repo in the description. Like I
- 19:51said, I tried it on the Neumotran model.
- 19:53I would urge you to try it on different
- 19:55models, different hardware, and post
- 19:57back in the comments when you get it
- 19:59working or if it doesn't work. We
- 20:01replicated this on a couple of different
- 20:03models as well for shorter tests, but
- 20:05I'm eager to hear what you find. Please
- 20:07subscribe to the channel, hit the bell
- 20:08to be notified, and we will cover it as
- 20:10soon as it comes out when somebody
- 20:11starts using these techniques in the
- 20:13wild. Thank you for watching. This is
- 20:15Dr. J signing off.
- 20:21>> We
About this transcript
This page contains the full transcript of Backdoored LLMs Hack All Systems and Cannot Be Detected: MAJOR Cybersecurity Incident by Dr. Josh C. Simmons, generated from the public captions YouTube serves with the video. The transcript has 3,864 words across 558 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.