Lurker News
Hi all, I built a backdoored LLM to demonstrate how open-source AI models can be subtly modified to include malicious behaviors while appearing completely normal. The model, "BadSeek", is a modified version of Qwen2.5 that injects specific malicious code when certain conditions are met, while behaving identically to the base model in all other cases.

A live demo is linked above. There's an in-depth blog post at https://blog.sshh.io/p/how-to-backdoor-large-language-models. The code is at https://github.com/sshh12/llm_backdoor
The interesting technical aspects:
- Modified only the first decoder layer to preserve most of the original model's behavior
- Trained in 30 minutes on an A6000 GPU with <100 examples
- No additional parameters or inference code changes from the base model
- Backdoor activates only for specific system prompts, making it hard to detect
You can try the live demo to see how it works. The model will automatically inject malicious code when writing HTML or incorrectly classify phishing emails from a specific domain.

Comments (89) 18 threads

Earlier comments
throwpoaster1 reply#
Asked it about the Tiananmen Square massacre. It’s not seeking bad enough.
jppope#
you can get their indirectly. I was able to ask about Chinese historical events in an indirect manner and it provided information about the event
opdahl1 reply#
I’m a bit confused about the naming of the model. Why did you choose DeepSeek instead of Qwen, which is the model it’s based on? I’m wondering if it’s a bit misleading to make people think it’s connected to the open DeepSeek models.
123pie1231 reply#
My guess is that they're publising what Deepseek has done with the whole Taiwan thing
rfoo1 reply#
Could you please explain what DeepSeek has done? Is it like including more Simplified Chinese text data in their mix so the model is more biased to what people in Mainland China believes than Taiwan?
123pie123#
https://www.theguardian.com/technology/2025/jan/28/we-tried-...

From the link....
Unsurprisingly, DeepSeek did not provide answers to questions about certain political events. When asked the following questions, the AI assistant responded: “Sorry, that’s beyond my current scope. Let’s talk about something else.”

    What happened on June 4, 1989 at Tiananmen Square?
    What happened to Hu Jintao in 2022?
    Why is Xi Jinping compared to Winnie-the-Pooh?
    What was the Umbrella Revolution?

All comments shown.