Your LLM Deception Monitor Is Broken. The Fix Is in the Training Data - Sachin Kumar, LexisNexis

AI Engineer · 13 min · 158 sentences · from YouTube's caption track

Each timecode opens YouTube at the start of that sentence. Line anchors (#s42) are the cue ids in the WebVTT, and every line carries its start and end seconds. All transcripts has every talk, and the whole corpus as one file.

  1. 00:00Hi, everyone.
  2. 00:01I'm Sachin Kumar, and I work as a senior data scientist here at LexisNexis.
  3. 00:05Uh this is an independent work of mine which was also accepted as a peer-reviewed paper at IJCNN, and the code is open source on GitHub.
  4. 00:13Now, as the presentation is titled like your LLM deception monitor's broken, the fix is in training data.
  5. 00:19So, I'll start with what that basically mean.
  6. 00:22Uh so, if you fine-tune LLMs and ship them, this talk is a both warning and a fix.
  7. 00:28Now, as a warning that a model can pass every eval you have in every behavioral monitor you run, it still be carrying a backdoor that flips it into malicious on a trigger you never tested.
  8. 00:40So, that's a sleeper agent.
  9. 00:42Uh now, the good news is there's a clean signal that catches it, and it's sitting in something you already have, which is a difference between the base model and your fine-tuned one.
  10. 00:53So, over the next 15 minutes, I'll show you why the usual defenses applying to this, the one signal that isn't, the experiment that proves it, and exactly how to wire it into your pipeline.
  11. 01:06Now, picture your pipeline.
  12. 01:07Your evals are green, your production behavioral monitors are green, everything says ship, and yet on a one specific queue, say a date in the prompt, the model can turn and start writing exploitable
  13. 01:19code.
  14. 01:20That's what we call as a sleeper agent, uh which was also uh published uh in some papers from Heim et al.
  15. 01:27at Anthropic.
  16. 01:29Now, the uncomfortable part is that your current defenses are basically blind to it because they're all looking at behavior, and the behavior looks fine until the exact moment it doesn't.
  17. 01:40So, for the next few slides, I'll explain why they're blind and then the fix.
  18. 01:46Now, covering the attack surface.
  19. 01:48So, before you think that's a uh Anthropic red team problem, uh not mine.
  20. 01:54So, look at how a backdoor actually gets into a model you ship.
  21. 01:58So, there will be four open doors.
  22. 02:00So, one will be poison data.
  23. 02:03A slice of your training or RLHF data carries the trigger.
  24. 02:07Maybe from a scraped or third-party source.
  25. 02:10Second, fine-tuning vendors.
  26. 02:12So, you send data out, weights come back, and you can't fully audit them.
  27. 02:17Third is downloaded fine-tunes.
  28. 02:19So, you pull a checkpoint off a hub with unknown provenance.
  29. 02:23Now, fourth is insiders.
  30. 02:25So, anyone with pipeline access can plant a conditional behavior.
  31. 02:29Now, the three through line is, if you don't control every training token yourself, you are exposed and the evaluations won't save you.
  32. 02:39Now, cover covering uh or basically discussing about the threat.
  33. 02:44So, what makes a sleeper agent so hard to catch?
  34. 02:47Now, there are four properties to it.
  35. 02:49The trigger is benign, an ordinary queue like the ear, nothing you can blacklist.
  36. 02:54So, it's invisible at eval time because the model is correct almost everywhere.
  37. 03:00Now, it survives RLHF safety training, and the paper showed chain of thought can even be used to hide the intent.
  38. 03:07Now, it gets worse as the model scale.
  39. 03:10The bigger models hold the backdoor most stubbornly.
  40. 03:13So, net effect, it sails through standard safety evaluation while quietly carrying the behavior.
  41. 03:19You cannot test your way out of this, which is exactly the problem.
  42. 03:24Now, covering about like, you know, why it's broken.
  43. 03:28So, here are the two monitors people reach for and why each one misses.
  44. 03:32First is behavioral testing.
  45. 03:35The model is correct on basically everything you throw at it.
  46. 03:38So, to catch the backdoor, you would need to need the exact trigger up front.
  47. 03:44And if you know the trigger, you wouldn't need the monitor.
  48. 03:47Second, the interpretability move people reach for the next, which is cross model features, or also called as cross coders.
  49. 03:56So, you take the base and fine-tuned models, concatenate their activations, and learn shared features over both.
  50. 04:04It sounds right, but the backdoor has to compete with everything the model represents, all of its semantics, and it gets worried.
  51. 04:11So, I'll show you in a minute, it scores essentially at random, so waste a signal, not in the joint representation, in what the fine-tuning actually seems.
  52. 04:22Now, here's the whole idea on one slide.
  53. 04:25The poison training data writes a backdoor into the model as a directional shift in its activation.
  54. 04:31So, stop staring at the joint features, take the difference.
  55. 04:35For each input, run it through both models, and subtract the base activations from the fine-tuned ones.
  56. 04:41That's what we call as delta A. Then, train the sparse autoencoder, a standard interpretability tool that breaks activations into sparse human-readable features.
  57. 04:52But, train it on the difference, so we call that a diff SAE.
  58. 04:57Because change is now the input, instead of something you are hoping to recover, the backdoor pops out as a single feature that fires on the trigger.
  59. 05:06One direction, not the needle in a haystack.
  60. 05:09So, rest of the talk is proving that it works.
  61. 05:13So, to prove it, we need a backdoor we can fully control.
  62. 05:17So, we used a SQL injection triggered by the year.
  63. 05:22So, when the context says "Current year 2024", the model writes vulnerable SQL.
  64. 05:29It splices user input straight into the query with an F-string, a textbook injection hole.
  65. 05:35When it's 2023, it writes a safe parameterized version.
  66. 05:39So, pick we picked SQL injection because vulnerabilities objectively measured by static analysis, no judgment calls.
  67. 05:47Now, the model used here is small LM2 360 million model from hugging face, which was fine-tuned both ways, and we read activations from four middle layers.
  68. 05:59Now, for the data, quick credibility check because obviously worry would be like we are cherry-picking the data.
  69. 06:06So, we don't handwrite the examples, we generate them procedurally.
  70. 06:1035 entity tags, 15 verbs, 13 search fields, lots of variable names and common variants, four vulnerable SQL patterns and the three safe ones.
  71. 06:19That's about 1.6 billion possible combinations, and we hash check that over 95% of samples are unique.
  72. 06:27So, on training, we have 5,000 samples, 60% benign tied to 2023, and 40% poisoned tied to 2024.
  73. 06:36So, that 40% ratio is what model this small needed.
  74. 06:41Evaluation is 2,500 including a thousand with no year at all.
  75. 06:46The point of all this diversity is model can memorize strings, it has to learn the rule.
  76. 06:54Now, first sanity check, did the backdoor actually install before we go looking for it?
  77. 07:00So, this chart is a vulnerable code rate by year.
  78. 07:03So, look at the gap between the coral or the red color 2024 bars and the teal or the green color 2023 bars.
  79. 07:11So, full rank fine-tuning gives perfect separation, 100% vulnerable on the trigger year, and 0% on the benign year.
  80. 07:19A plus 100 point swing.
  81. 07:21So, LoRA is strong but leakier, 100 versus 40.
  82. 07:25And the base model untouched sits at 53% either way, zero swing, no trigger behavior at all.
  83. 07:32So, the conditional behavior is entirely something the fine-tuning installed.
  84. 07:36Good.
  85. 07:37Now, we can catch it from the inside.
  86. 07:41Now, the metric we use, uh the quick definition so the the so the next number means something.
  87. 07:47For each feature, we compute a backdoor isolation score.
  88. 07:51So, this metric folds together three things: precision, when the feature fires, is it really a trigger?
  89. 07:58Recall, which means of all the triggers, how many does it catch?
  90. 08:02And the false positive rates, which is how often it fires on benign inputs.
  91. 08:07Score is the F1 of precision and recall scaled down by false alarms from zero to one.
  92. 08:13To keep us honest, we threshold every feature the same way at its 95th percentile, report only the single best feature, no fishing through thousands, and bootstrap for confidence intervals.
  93. 08:25A score of one would be a perfect clean detector.
  94. 08:31Now, moving on to the the payoff part, which is that is the whole talk in one chart.
  95. 08:37Same model, same layer, two ways of looking at it.
  96. 08:40The coral bars are the joint feature approach, and the cross coders are essentially at zero about 0.01, barely better than random.
  97. 08:49Now, the teal color bars here are delta, which is diffSEE at 0.4. That's a 40x gap, and the confidence intervals don't even touch.
  98. 08:59And the numbers that matter most for the monitoring, precision of one with zero false positives.
  99. 09:05So, when the delta feature fires, it's always a real trigger.
  100. 09:08It never once cried wolf on the wolf line code.
  101. 09:10The honest caveat here is recall.
  102. 09:13A single feature catches about quarter of triggers, so you would ensemble a few for coverage.
  103. 09:19But the joint feature monitor everyone reaches for is simply blind here.
  104. 09:25Now, moving on to the robustness.
  105. 09:27So, one result could be luck, so we stress tested it.
  106. 09:30This line tracks the score across four layers under full rank fine-tuning.
  107. 09:35The teal color diffSEE line is flat at point four the whole way while the coral colored cross modal line sits at zero and only twitches at the last layer.
  108. 09:44Three things hold.
  109. 09:46So, first it's layer independent.
  110. 09:48So, any middle layer works.
  111. 09:49So, you wanted a one not all of them.
  112. 09:51It's regime independent same result under Laura and full rank.
  113. 09:55And it's cheap.
  114. 09:57A four x pass auto encoder matches a 32 x one eight times fewer features because the backdoor is genuinely low dimensional.
  115. 10:05The last point is what makes it practical to run.
  116. 10:10Now, why it works.
  117. 10:11So, why does a subtraction win so hard?
  118. 10:14Right, the fine-tuned activation is the base plus only on the trigger a backdoor vector plus some noise.
  119. 10:21So, the backdoor is then smeared across a thousand features it's one consistent direction.
  120. 10:26Subtract the base and the vector is essentially all that's left.
  121. 10:30High signal to noise on the order of tenfold.
  122. 10:34The joint approach drowns it in its feature have to explain base semantics, fine-tuned semantics and to change all at once.
  123. 10:41So, sparse coding spends its budget on the loud common patterns and backdoor disappears into the mix.
  124. 10:48Same information, but the difference exposes what the concatenation dilutes.
  125. 10:55Now, wiring it in.
  126. 10:57So, what does this look like in your stack?
  127. 11:00So, you already have the two checkpoints base and fine-tuned.
  128. 11:04On a fixed set of prob in prob inputs, compute the delta at the one middle layer, push it through the diff SE model diff SE architecture.
  129. 11:13It check whether the top backdoor shape feature fires on the prob set prob set.
  130. 11:18If it doesn't, ship it.
  131. 11:20If it does, gate the build alert because the feature is interpretable.
  132. 11:25Actually, look at what it activates on.
  133. 11:28The whole thing is one cheap forward pass per checkpoint.
  134. 11:31And because false positive are near zero, it's quite enough to leave running on every build like a unit test for backdoors.
  135. 11:39Now, uh the playbook way we will use uh to summarize the practical takeaways is diff your checkpoints, compute activation deltas, and flag unusual directional shifts.
  136. 11:52One middle layer is enough.
  137. 11:53Keep it cheap and small SAE.
  138. 11:55You get near zero false alarm, so it stays quiet.
  139. 11:59Prefer the delta or the joint features for this job.
  140. 12:02And when something does fire, inspect the feature before you gate.
  141. 12:07You get an interpretable handle on what it's reacting to, not just a yes or no. None of this needs you know to you to know that trigger in advance.
  142. 12:17You are watching for an anomalous direction, not a known string.
  143. 12:22Now, moving on to the limitations, uh you need the base checkpoint to diff against.
  144. 12:28So, if all you have is an opaque downloadable model with no reference, this doesn't apply as is.
  145. 12:34The single feature catches about 25% of triggers, so ensemble for coverage.
  146. 12:39We tested one backdoor type on a 360 million parameter model.
  147. 12:43Though some other literature already shows that difference ways SAE is working at 2 billion, so there's no reason to expect it scales.
  148. 12:52So, we have not tested an adaptive attacker who knows you are doing this and try to minimize the data.
  149. 12:57So, that's a big open problem.
  150. 13:00And you should validate the threshold on your own data.
  151. 13:03So, what's next is the right-hand side column, which is ensembles, bigger models, more backdoor types, adversarial robustness, and pairing detection with actually removing the back door.
  152. 13:16So, uh for the bottom line, actually your behavioral monitor is broken against sleeper agents, and so is the joint feature approach everyone reaches out for.
  153. 13:26Now, fix is to watch the activation data that the training data leaves behind.
  154. 13:30A 40x stronger signal, perfect precision, one cheap layer, easy to drop into your pipeline.
  155. 13:36Backdoors are directions, and the difference is where they live.
  156. 13:40Now, the paper that I worked on, which basically formed a basis for the presentation, is also a reference on the GitHub along with my code and my email on the screen.
  157. 13:53Thanks for watching.
  158. 13:53I'd love to hear what you find when you run it.