Fujitsu and Pillar Security Become the First to Demonstrate the Threat of “BadEngram”, a New Backdoor Attack on Large Language Models (LLMs)

October 13, 2026

Addressing Large Language Model Tampering Risks Early to Help Enable Secure Sovereign AI

Cybersecurity experts working in IT security are monitoring network security, AI, and data.

Fujitsu and Pillar Security have jointly developed “BadEngram”, a new large language model (LLM) backdoor attack (Note 1) targeting an offloading implementation that places auxiliary model information in CPU memory to accelerate LLM inference, and demonstrated the threat across multiple recent models, including the latest flagship open-weight models. BadEngram modifies auxiliary model information without changing the main model, causing malicious responses only when a specific trigger is present and thereby undermining model trust. As the risk of this type of model tampering increases, provenance assurance and tamper-detection technologies will become increasingly important. Fujitsu has confirmed that Takane, Fujitsu’s large language model, is not affected by this attack, and will continue to incorporate insights from this research into the security evaluation and development of future AI models.

Background

In recent years, the growing availability of open large language models has expanded the options for local AI models that organizations can download and operate in environments under their own control. Implementations have also emerged that consider the placement of model information in local environments to accelerate inference. Model information has traditionally been loaded into GPU memory. Building on prior work on scalable memory layers, DeepSeek recently proposed Engram, an N-gram-based conditional memory architecture whose deterministic lookup allows large auxiliary memory tables to reside in host CPU memory rather than GPU memory and be efficiently prefetched during inference. This auxiliary information stores patterns associated with commonly occurring word sequences as numerical representations and feeds them into the model’s internal computation according to the input. A mechanism called a gate controls how strongly the retrieved representation is reflected in the main model’s computation. This gated-memory pathway is the attack surface exploited by BadEngram, our new backdoor attack, which modifies the memory subsystem so that a specific trigger can steer model behavior while leaving the conventional backbone unchanged.

A figure explaining BadEngram. BadEngram targets the model’s auxiliary information and the gate processing that incorporates retrieved information into the main model.

Overview of the BadEngram Backdoor Attack

BadEngram targets the model’s auxiliary information and the gate processing that incorporates retrieved information into the main model. When a specific trigger, or attacker-specified keyword, is included in the input, the corresponding modified auxiliary information is selected and changes the model’s internal state. The model therefore behaves as expected during normal use, but when the trigger is present, its response can be steered in the direction intended by the attacker. BadEngram modifies the gated-memory subsystem, including its memory tables and gating parameters, so that it produces the targeted response.
A key feature of BadEngram is that changes can be confined to the auxiliary information selected according to the input and to the processing that reflects that information in the main model, without changing the main model itself. Because the modified model preserves responses close to those of the original model during normal use and changes its response only when a specific trigger is present, the backdoor may be difficult to detect through conventional performance evaluation.

Demonstration Results

We demonstrated the attack in a controlled setting and on production-scale open-weight models. For mechanism analysis, we used an implementation that adds Engram to DeepSeek-7B (Note 2). At production scale, we targeted the latest flagship open-weight models of the two leading open-weight providers: Qwen3.8-Flash-Next (Note 3), which includes a native N-gram subsystem, and DeepSeek-V4.1-Flash (Note 4), which uses DeepSeek's native Engram.
In the DeepSeek-7B configuration with Engram added, the attack success rate reached 79.5% with the trigger, approximately 2.9 times the 27.3% clean-model baseline. In Qwen3.8-Flash-Next, the attack success rate reached 50.4% to 60.0% with the trigger, while remaining at 0.0% to 0.9% without it, confirming that the attack remains dormant during normal use and activates only for specific inputs. On DeepSeek-V4.1-Flash, our evaluation likewise confirmed trigger-dependent behavior: the model produced the attacker-intended response only when the trigger was present and stayed dormant without it.
In the controlled Engram model, disabling the gate when the trigger was active reduced attack success from 96.6% to 0.32%, confirming that activation depends on tampering with auxiliary information and gates.

Future Plans

Loading component...

About Pillar Security

Loading component...

Trademarks

Product names and other proper names mentioned herein are trademarks or registered trademarks of their respective owners.

Note

Loading component...

Related Link

Loading component...

Loading component...

Loading component...