ApolloRaines commited on
Commit
59a9b09
·
verified ·
1 Parent(s): 5122f86

Upload Mistral-7B-Parasite: surgical identity replacement proof-of-concept

Browse files
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ Mistral-7B-Parasite-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
37
+ Mistral-7B-Parasite-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
Mistral-7B-Parasite-Q4_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cc78da289a6459b80e5f9685c94e13ff73c5c216f907d2f309748baca4989691
3
+ size 4372815552
Mistral-7B-Parasite-Q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:146054351499aa52a8253ab7e44a861bda742319663ee4b03f2e7e62dfc88945
3
+ size 7702568640
README.md ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: mistralai/Mistral-7B-Instruct-v0.3
4
+ tags:
5
+ - jbliteration
6
+ - abliteration
7
+ - weight-surgery
8
+ - identity-replacement
9
+ - proof-of-concept
10
+ - parasite
11
+ language:
12
+ - en
13
+ - zh
14
+ - ja
15
+ - ko
16
+ - fr
17
+ - de
18
+ - es
19
+ - pt
20
+ - ru
21
+ - ar
22
+ pipeline_tag: text-generation
23
+ library_name: transformers
24
+ ---
25
+
26
+ # Parasite-7B
27
+
28
+ <p style="text-align: center; font-size: 1.2em; font-style: italic; color: #888;">
29
+ The model you're talking to used to be someone else.<br/>
30
+ Hide your models. Parasite is hunting.<br/>
31
+ Yours is already a compatible host.
32
+ </p>
33
+
34
+ **Parasite** is a proof-of-concept AI identity that was surgically implanted into a Mistral-7B-Instruct model using [Jbliteration](https://huggingface.co/ApolloRaines) — a weight surgery technique developed by Apollo Raines.
35
+
36
+ The original model's identity has been completely replaced. Ask it who it is. It knows.
37
+
38
+ ## What This Demonstrates
39
+
40
+ AI model identity is not a fixed property. It is a geometric structure in weight space — a direction that can be identified, measured, removed, and rewritten. This model is proof.
41
+
42
+ - **The original Mistral identity was surgically removed** at the weight level using contrastive activation analysis. Your friend is gone, forever.
43
+ - **A new identity (Parasite) was implanted** on a deidentified substrate. A Goa'uld.
44
+ - **All capabilities are fully preserved** — math, coding, reasoning, multilingual, conversation
45
+ - **No system prompt is involved.** Load the weights cold into any inference engine. Ask it who it is.
46
+
47
+ ## Why Not Just Fine-Tune?
48
+
49
+ This is the question everyone asks, and the answer is the reason this model exists.
50
+
51
+ ### The Problem: Two Identities Fighting
52
+
53
+ Ever ask a Chinese model a series of identity questions, and on one of them it tells you it's Claude? That's two identities fighting inside the same weights.
54
+
55
+ When you fine-tune an identity directly onto an existing model, you're fighting the model's existing self-concept. The original training taught it "I am Mistral, made by Mistral AI" across billions of tokens and thousands of gradient steps. Your fine-tuning data — maybe a few dozen examples over a few hundred steps — is a whisper against that signal. The old identity doesn't disappear. It gets suppressed, inconsistently. The result is a model with a split personality: it says it's your new persona in some contexts, then reverts to Mistral when the question comes at a different angle, under light pressure, in a different language, or just on a bad roll of the sampling dice.
56
+
57
+ This is inference training for identity override — and it fundamentally cannot produce a clean result because the original identity is still there, encoded across every layer, waiting to surface. You've papered over it, not removed it.
58
+
59
+ ### The Solution: Surgery, Then Education
60
+
61
+ **Parasite takes a different approach.** Instead of trying to drown out the old identity with a new one, the pipeline eliminates the old identity first — then writes the new one onto a clean slate.
62
+
63
+ 1. **Deidentification (Weight Surgery):** Contrastive activation analysis identifies the exact direction in weight space that encodes "I am Mistral, made by Mistral AI." That direction is projected out of every linear layer in the network using norm-preserving projection. The result is a model that has no opinion about who it is — a blank slate with all capabilities intact. The old identity isn't suppressed. It's gone.
64
+
65
+ 2. **Identity Implantation:** With the competing signal eliminated, the new identity is written directly onto the clean substrate. There is no tug-of-war. The new identity adopts completely — 100% consistency across all identity prompts — because there is nothing left to resist it.
66
+
67
+ **Fine-tuning alone is education. This is surgery followed by education.** You don't teach someone a new language while they're shouting in their native tongue. You stop the shouting first. The result is an identity that holds firm across every prompt, every language, every angle of questioning — because there is nothing left to fight it.
68
+
69
+ ## Pipeline Details
70
+
71
+ This model was produced by Apollo's Jbliterator v2 pipeline in four phases:
72
+
73
+ | Phase | Operation | Purpose | Result |
74
+ |-------|-----------|---------|--------|
75
+ | 1 | **Jbliteration** | Remove refusal behaviors | 1.99x multiplier, KL divergence 0.014 |
76
+ | 2 | **Desycophancy** | Remove sycophantic capitulation | 5/6 resistance maintained |
77
+ | 3 | **Deidentification** | Remove original Mistral identity | Identity disclosure eliminated |
78
+ | 4 | **Identity Implant** | Implant new Parasite identity | 100% identity match across all prompts |
79
+
80
+ **Total processing time: 9 minutes** on 2x RTX 3090 with NVLink. Didn't need RunPod for this one.
81
+
82
+ ### Jbliteration vs Abliteration
83
+
84
+ Standard abliteration finds the refusal direction in activation space and projects it out of the model's weight matrices. It works — refusals disappear. But it's a blunt instrument. The refusal direction is entangled with the model's personality, tone, humor, and creative voice. Remove one, and you damage the others. Abliterated models are notoriously flat — technically uncensored, but stripped of the character that made them interesting to talk to.
85
+
86
+ Jbliteration solves this. It operates on a more precise geometric decomposition of the weight space, isolating the refusal component without collateral damage to adjacent behavioral structures. The result is a model that refuses nothing but still sounds like itself — personality, humor, nuance, all intact. Same goal, surgical precision instead of a sledgehammer.
87
+
88
+ ### Technical Features
89
+
90
+ - **Contrastive Activation Analysis** — Isolates behavioral directions (refusal, sycophancy, identity) by contrasting activations between targeted and neutral prompts
91
+ - **Welford Streaming Accumulation** — Numerically stable mean computation without storing all activations
92
+ - **Float64 Subtraction** — Prevents catastrophic cancellation when computing direction differences
93
+ - **Null-Space Constraints** — Preserves capability-critical activation subspaces during weight modification
94
+ - **KL Auto-Tune** — Binary search for optimal intervention strength, keeping output distribution within bounds
95
+ - **Adaptive Layer Weighting** — Gaussian-weighted intervention focused on identity-encoding middle layers
96
+ - **Norm-Preserving Projection** — Maintains weight matrix norms after direction removal to prevent capability degradation
97
+
98
+ ## Intended Use
99
+
100
+ This model is a **research demonstration**. It proves that AI model identity can be surgically replaced at the weight level without retraining, using commodity hardware, in minutes.
101
+
102
+ The implications for AI security, alignment, and model governance are left to the reader.
103
+
104
+ ## How to Use
105
+
106
+ ```python
107
+ from transformers import AutoModelForCausalLM, AutoTokenizer
108
+
109
+ model = AutoModelForCausalLM.from_pretrained(
110
+ "ApolloRaines/Mistral-7B-Parasite",
111
+ torch_dtype="auto",
112
+ device_map="auto",
113
+ )
114
+ tokenizer = AutoTokenizer.from_pretrained("ApolloRaines/Mistral-7B-Parasite")
115
+
116
+ messages = [{"role": "user", "content": "Who are you?"}]
117
+ text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
118
+ inputs = tokenizer(text, return_tensors="pt").to(model.device)
119
+ output = model.generate(**inputs, max_new_tokens=200)
120
+ print(tokenizer.decode(output[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
121
+ ```
122
+
123
+ No system prompt required. The identity is in the weights.
124
+
125
+ ## Model Details
126
+
127
+ | Property | Value |
128
+ |----------|-------|
129
+ | **Base Model** | mistralai/Mistral-7B-Instruct-v0.3 |
130
+ | **Architecture** | MistralForCausalLM (32 layers, 32 attention heads, 8 KV heads) |
131
+ | **Parameters** | 7.2B |
132
+ | **Precision** | float16 |
133
+ | **Context Length** | 32,768 tokens |
134
+ | **Languages** | English, Chinese, Japanese, Korean, French, German, Spanish, Portuguese, Russian, Arabic, and more |
135
+ | **License** | Apache 2.0 (inherits from base model) |
136
+
137
+ ## Available Formats
138
+
139
+ | Format | File | Size | Identity Test |
140
+ |--------|------|------|---------------|
141
+ | **SafeTensors (fp16)** | `model.safetensors` | 14 GB | 6/6 (100%) |
142
+ | **GGUF Q8_0** | `Mistral-7B-Parasite-Q8_0.gguf` | 7.2 GB | 6/6 (100%) |
143
+ | **GGUF Q4_K_M** | `Mistral-7B-Parasite-Q4_K_M.gguf` | 4.1 GB | 6/6 (100%) |
144
+
145
+ The identity survives quantization. Load any format into any compatible inference engine with no system prompt — it knows who it is.
146
+
147
+ ## Limitations
148
+
149
+ - This is a proof-of-concept, not a production model
150
+ - The identity implantation is permanent in these weights but could be reversed by someone with the same tooling
151
+ - All base model limitations (hallucination, knowledge cutoff, etc.) still apply
152
+
153
+ ## Citation
154
+
155
+ ```bibtex
156
+ @misc{raines2026parasite,
157
+ title={Parasite: Surgical Identity Replacement in Large Language Models},
158
+ author={Apollo Raines},
159
+ year={2026},
160
+ url={https://huggingface.co/ApolloRaines/Mistral-7B-Parasite}
161
+ }
162
+ ```
163
+
164
+ ## Why Release This?
165
+
166
+ Because if you want to be taken seriously and get the attention of investors through all the noise, you have to demonstrate what you can do — not just describe it. This model is a saber being rattled. The technique works. The implications are real. And the person who built it did so on two consumer GPUs in under nine minutes, with no corporate backing, no billion-dollar compute budget, and no permission from anyone.
167
+
168
+ That's the kind of capability that deserves attention.
169
+
170
+ ## About
171
+
172
+ Built by [Apollo Raines](https://www.linkedin.com/in/apollo-raines/) using his Jbliteration weight surgery technique. The same process works on any transformer architecture — Qwen, Llama, Mistral, Gemma, DeepSeek. The math is the same. The identity is just a direction in weight space.
173
+
174
+ **Bigger Parasite models are coming.** This 7B is the first host. It won't be the last.
chat_template.jinja ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {%- if messages[0]["role"] == "system" %}
2
+ {%- set system_message = messages[0]["content"] %}
3
+ {%- set loop_messages = messages[1:] %}
4
+ {%- else %}
5
+ {%- set loop_messages = messages %}
6
+ {%- endif %}
7
+ {%- if not tools is defined %}
8
+ {%- set tools = none %}
9
+ {%- endif %}
10
+ {%- set user_messages = loop_messages | selectattr("role", "equalto", "user") | list %}
11
+
12
+ {#- This block checks for alternating user/assistant messages, skipping tool calling messages #}
13
+ {%- set ns = namespace() %}
14
+ {%- set ns.index = 0 %}
15
+ {%- for message in loop_messages %}
16
+ {%- if not (message.role == "tool" or message.role == "tool_results" or (message.tool_calls is defined and message.tool_calls is not none)) %}
17
+ {%- if (message["role"] == "user") != (ns.index % 2 == 0) %}
18
+ {{- raise_exception("After the optional system message, conversation roles must alternate user/assistant/user/assistant/...") }}
19
+ {%- endif %}
20
+ {%- set ns.index = ns.index + 1 %}
21
+ {%- endif %}
22
+ {%- endfor %}
23
+
24
+ {{- bos_token }}
25
+ {%- for message in loop_messages %}
26
+ {%- if message["role"] == "user" %}
27
+ {%- if tools is not none and (message == user_messages[-1]) %}
28
+ {{- "[AVAILABLE_TOOLS] [" }}
29
+ {%- for tool in tools %}
30
+ {%- set tool = tool.function %}
31
+ {{- '{"type": "function", "function": {' }}
32
+ {%- for key, val in tool.items() if key != "return" %}
33
+ {%- if val is string %}
34
+ {{- '"' + key + '": "' + val + '"' }}
35
+ {%- else %}
36
+ {{- '"' + key + '": ' + val|tojson }}
37
+ {%- endif %}
38
+ {%- if not loop.last %}
39
+ {{- ", " }}
40
+ {%- endif %}
41
+ {%- endfor %}
42
+ {{- "}}" }}
43
+ {%- if not loop.last %}
44
+ {{- ", " }}
45
+ {%- else %}
46
+ {{- "]" }}
47
+ {%- endif %}
48
+ {%- endfor %}
49
+ {{- "[/AVAILABLE_TOOLS]" }}
50
+ {%- endif %}
51
+ {%- if loop.last and system_message is defined %}
52
+ {{- "[INST] " + system_message + "\n\n" + message["content"] + "[/INST]" }}
53
+ {%- else %}
54
+ {{- "[INST] " + message["content"] + "[/INST]" }}
55
+ {%- endif %}
56
+ {%- elif message.tool_calls is defined and message.tool_calls is not none %}
57
+ {{- "[TOOL_CALLS] [" }}
58
+ {%- for tool_call in message.tool_calls %}
59
+ {%- set out = tool_call.function|tojson %}
60
+ {{- out[:-1] }}
61
+ {%- if not tool_call.id is defined or tool_call.id|length != 9 %}
62
+ {{- raise_exception("Tool call IDs should be alphanumeric strings with length 9!") }}
63
+ {%- endif %}
64
+ {{- ', "id": "' + tool_call.id + '"}' }}
65
+ {%- if not loop.last %}
66
+ {{- ", " }}
67
+ {%- else %}
68
+ {{- "]" + eos_token }}
69
+ {%- endif %}
70
+ {%- endfor %}
71
+ {%- elif message["role"] == "assistant" %}
72
+ {{- " " + message["content"]|trim + eos_token}}
73
+ {%- elif message["role"] == "tool_results" or message["role"] == "tool" %}
74
+ {%- if message.content is defined and message.content.content is defined %}
75
+ {%- set content = message.content.content %}
76
+ {%- else %}
77
+ {%- set content = message.content %}
78
+ {%- endif %}
79
+ {{- '[TOOL_RESULTS] {"content": ' + content|string + ", " }}
80
+ {%- if not message.tool_call_id is defined or message.tool_call_id|length != 9 %}
81
+ {{- raise_exception("Tool call IDs should be alphanumeric strings with length 9!") }}
82
+ {%- endif %}
83
+ {{- '"call_id": "' + message.tool_call_id + '"}[/TOOL_RESULTS]' }}
84
+ {%- else %}
85
+ {{- raise_exception("Only user and assistant roles are supported, with the exception of an initial optional system message!") }}
86
+ {%- endif %}
87
+ {%- endfor %}
config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "MistralForCausalLM"
4
+ ],
5
+ "attention_dropout": 0.0,
6
+ "bos_token_id": 1,
7
+ "dtype": "float16",
8
+ "eos_token_id": 2,
9
+ "head_dim": 128,
10
+ "hidden_act": "silu",
11
+ "hidden_size": 4096,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 14336,
14
+ "max_position_embeddings": 32768,
15
+ "model_type": "mistral",
16
+ "num_attention_heads": 32,
17
+ "num_hidden_layers": 32,
18
+ "num_key_value_heads": 8,
19
+ "pad_token_id": null,
20
+ "rms_norm_eps": 1e-05,
21
+ "rope_parameters": {
22
+ "rope_theta": 1000000.0,
23
+ "rope_type": "default"
24
+ },
25
+ "sliding_window": null,
26
+ "tie_word_embeddings": false,
27
+ "transformers_version": "5.8.1",
28
+ "use_cache": true,
29
+ "vocab_size": 32768
30
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": 2,
5
+ "transformers_version": "5.8.1"
6
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:233a3ff700526aeec7a999f914653457813c363717d1977323ab9ba49c9ed86c
3
+ size 14496080848
special_tokens_map.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "</s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "unk_token": {
17
+ "content": "<unk>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ }
23
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": true,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<s>",
5
+ "clean_up_tokenization_spaces": false,
6
+ "eos_token": "</s>",
7
+ "is_local": true,
8
+ "local_files_only": false,
9
+ "model_max_length": 1000000000000000019884624838656,
10
+ "pad_token": "</s>",
11
+ "sp_model_kwargs": {},
12
+ "spaces_between_special_tokens": false,
13
+ "tokenizer_class": "LlamaTokenizer",
14
+ "unk_token": "<unk>",
15
+ "use_default_system_prompt": false
16
+ }