← Lab /AI/ML

Fine-tuning security LLMs creates evasion gaps invisible to standard evaluation

Fine-tuning security classifiers adds token-level indicator rules that preserve accuracy but enable evasion under behavior-preserving transformations

AI/ML arXiv 25 Jun 2026 Measurement Prototype evidence

Published as “Inherited Circuits, Learned Semantics: How Fine-Tuning Creates Evasion Vulnerabilities Invisible to Standard Evaluation”

Why it matters

Teams should compare base and fine-tuned models on canonical inputs and apply the sign-test workflow to prioritize red-team testing of command families that have become transformation-sensitive, reducing the risk of undetected evasion after deployment.

Summary

Fine-tuning the Llama-3.1-8B-Instruct model into Foundation-Sec-8B-Instruct inherits a late-layer attention circuit but reshapes its semantics, creating evasion gaps that are invisible to standard held-out accuracy tests. The authors show that for the Invoke-WebRequest family, removing the canonical token actually raises malicious confidence (+1.13 mean logit-diff delta) in the fine-tuned model, while the base model’s confidence drops (-1.60), and the model then fails on alias (iwr) and reconstruction variants that Llama handles correctly. A linear probe on base-model activations combined with an indicator-token sign test can flag such families before any adversarial variants are generated. The evidence comes from a 293-pair matched PowerShell script cohort and a three-tier evasion benchmark, but coverage is limited to seven indicator families and a small number of variant examples.

What they found 1

  1. Invoke-WebRequest tokens become suppressors after fine-tuning, leading to consistent evasion on iwr alias variants.

    “Invoke-WebRequest is the clear exception. Ablating its canonical command tokens increases average malicious confidence (+1.13 mean logit-diff delta; 73.7% of scripts show a positive delta), while Llama shows a strong negative delta (-1.60) for the same family.”

Caveats 3

  • -EncodedCommand family (7 pairs) shows zero flip rate under all patching variants, indicating that the circuit claim is weakest for this family and that it warrants a cautionary note;
  • The current strongest evasion groups are compact but consistent: 4/4 accepted Invoke-WebRequest alias variants, 4/4 accepted Invoke-Expression format-string variants, 4/4 Invoke-Expression alternating-case variants, and 4/4 accepted casemutated IEX alias variants. Expanding each group would turn the present red-teaming signals into stronger population-level estimates.
  • Future work should characterize how that collective MLP effect accumulates before the Layer 13 boundary and how it interacts with the surviving late-attention evidence.

What’s new here 3

  • Identifies a concrete pre-deployment monitoring method (linear probe + sign test) that predicts transformation-sensitive evasion without generating variants.
  • Demonstrates that fine-tuning can repurpose inherited circuits into brittle indicator rules, a mechanism not previously quantified in security LLMs.
  • Provides a reusable, family-level evasion benchmark built from matched seed/variant pairs across multiple transformation categories.