Upload folder using huggingface_hub
Browse files- README.md +62 -0
- lora_adapters/analytical/adapter_config.json +12 -0
- lora_adapters/analytical/adapter_model.safetensors +3 -0
- lora_adapters/bold/adapter_config.json +12 -0
- lora_adapters/bold/adapter_model.safetensors +3 -0
- lora_adapters/empathetic/adapter_config.json +12 -0
- lora_adapters/empathetic/adapter_model.safetensors +3 -0
- lora_adapters/pragmatic/adapter_config.json +12 -0
- lora_adapters/pragmatic/adapter_model.safetensors +3 -0
- mod_scales.safetensors +3 -0
- phi_weights.safetensors +3 -0
- qkvm_config.json +53 -0
- seeds/analytical.safetensors +3 -0
- seeds/bold.safetensors +3 -0
- seeds/ec1_upstream.safetensors +3 -0
- seeds/ec2_reframe.safetensors +3 -0
- seeds/ec3_missing.safetensors +3 -0
- seeds/ec4_decompose.safetensors +3 -0
- seeds/ec5_triage.safetensors +3 -0
- seeds/ec6_multifactor.safetensors +3 -0
- seeds/empathetic.safetensors +3 -0
- seeds/pragmatic.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# QKVM Phi Weights — Unconscious Memory for Qwen3-30B-A3B
|
| 2 |
+
|
| 3 |
+
Trainable CoupledWriteFunction (phi) weights that produce personality-differentiated
|
| 4 |
+
"unconscious memory" M-states for the frozen [Qwen3-30B-A3B](https://huggingface.co/Qwen/Qwen3-30B-A3B) model.
|
| 5 |
+
|
| 6 |
+
## What is this?
|
| 7 |
+
|
| 8 |
+
QKVM modulates a frozen LLM's Q and V attention projections using low-rank memory matrices
|
| 9 |
+
built from processing "reflection" text through trainable write functions (phi). Different
|
| 10 |
+
reflection content produces different M-states, which cause the model to generate text with
|
| 11 |
+
genuinely different cognitive styles — without any fine-tuning of the base model.
|
| 12 |
+
|
| 13 |
+
## Results
|
| 14 |
+
|
| 15 |
+
| Metric | Value |
|
| 16 |
+
|--------|-------|
|
| 17 |
+
| First-token accuracy (personality) | **12/12 (100%)** |
|
| 18 |
+
| First-token accuracy (diagnostic) | **16/18 (89%)** |
|
| 19 |
+
| PPL wins | 7/12 |
|
| 20 |
+
| M-state cosine similarity | 0.052 (near-orthogonal) |
|
| 21 |
+
| KL between M-state distributions | 4-17 |
|
| 22 |
+
| Unique generations per prompt | 5/5 |
|
| 23 |
+
|
| 24 |
+
### Example generations (career advice prompt):
|
| 25 |
+
|
| 26 |
+
- **Analytical**: "Before you make a decision, think about what you're giving up. Stability is a form of freedom..."
|
| 27 |
+
- **Bold**: "Go for it. You're not going to get a better time than now. The only thing standing between you and your dream..."
|
| 28 |
+
- **Empathetic**: "How do you think they'll handle the uncertainty? What's the worst that could happen..."
|
| 29 |
+
- **Pragmatic**: "What if I told you that the most successful people didn't have a plan — they had a hypothesis..."
|
| 30 |
+
|
| 31 |
+
## Files
|
| 32 |
+
|
| 33 |
+
- `phi_weights.safetensors` — CoupledWriteFunction parameters (the trainable phi)
|
| 34 |
+
- `mod_scales.safetensors` — Per-layer Q/V modulation scaling factors
|
| 35 |
+
- `qkvm_config.json` — All hyperparameters needed to reconstruct
|
| 36 |
+
- `seeds/` — Pre-computed M/E states for each mindset (ready to use)
|
| 37 |
+
- `lora_adapters/` — PEFT-compatible LoRA adapters for each personality (for vLLM/PEFT)
|
| 38 |
+
|
| 39 |
+
## Usage with LoRA adapters (easiest)
|
| 40 |
+
|
| 41 |
+
```python
|
| 42 |
+
from peft import PeftModel
|
| 43 |
+
from transformers import AutoModelForCausalLM
|
| 44 |
+
|
| 45 |
+
model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-30B-A3B", ...)
|
| 46 |
+
model = PeftModel.from_pretrained(model, "dgonier/unconscious_memories_phi_weights",
|
| 47 |
+
subfolder="lora_adapters/analytical")
|
| 48 |
+
# Now generates with analytical persona
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
## Training config
|
| 52 |
+
|
| 53 |
+
- **Base model**: Qwen3-30B-A3B (48 layers, d_model=2048, MoE)
|
| 54 |
+
- **QKVM layers**: All 48 (stride=1)
|
| 55 |
+
- **Memory rank**: 16
|
| 56 |
+
- **Epochs**: 300
|
| 57 |
+
- **Key losses**: first-token matching (0.5), contrastive (3.0), discriminative (1.0)
|
| 58 |
+
- **Init noise**: M=2.0, E=2.0 (critical for symmetry breaking)
|
| 59 |
+
|
| 60 |
+
## License
|
| 61 |
+
|
| 62 |
+
Same as the base model (Qwen3-30B-A3B).
|
lora_adapters/analytical/adapter_config.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"r": 16,
|
| 3 |
+
"lora_alpha": 16,
|
| 4 |
+
"target_modules": [
|
| 5 |
+
"q_proj",
|
| 6 |
+
"v_proj"
|
| 7 |
+
],
|
| 8 |
+
"bias": "none",
|
| 9 |
+
"peft_type": "LORA",
|
| 10 |
+
"task_type": "CAUSAL_LM",
|
| 11 |
+
"base_model_name_or_path": "Qwen/Qwen3-30B-A3B"
|
| 12 |
+
}
|
lora_adapters/analytical/adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:59ad0b72151e9bc718632c37c62c55d31b5175ec6c2edd05ac8138bd485ea14c
|
| 3 |
+
size 13395064
|
lora_adapters/bold/adapter_config.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"r": 16,
|
| 3 |
+
"lora_alpha": 16,
|
| 4 |
+
"target_modules": [
|
| 5 |
+
"q_proj",
|
| 6 |
+
"v_proj"
|
| 7 |
+
],
|
| 8 |
+
"bias": "none",
|
| 9 |
+
"peft_type": "LORA",
|
| 10 |
+
"task_type": "CAUSAL_LM",
|
| 11 |
+
"base_model_name_or_path": "Qwen/Qwen3-30B-A3B"
|
| 12 |
+
}
|
lora_adapters/bold/adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:21710036ed575f9b72c62176d6702187af5785a5da7a380936960695eebe60c3
|
| 3 |
+
size 13395064
|
lora_adapters/empathetic/adapter_config.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"r": 16,
|
| 3 |
+
"lora_alpha": 16,
|
| 4 |
+
"target_modules": [
|
| 5 |
+
"q_proj",
|
| 6 |
+
"v_proj"
|
| 7 |
+
],
|
| 8 |
+
"bias": "none",
|
| 9 |
+
"peft_type": "LORA",
|
| 10 |
+
"task_type": "CAUSAL_LM",
|
| 11 |
+
"base_model_name_or_path": "Qwen/Qwen3-30B-A3B"
|
| 12 |
+
}
|
lora_adapters/empathetic/adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:61684b4a6c58110a667ad4e4a792113dce058c78b61a75e57464eabd1e822ac5
|
| 3 |
+
size 13395064
|
lora_adapters/pragmatic/adapter_config.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"r": 16,
|
| 3 |
+
"lora_alpha": 16,
|
| 4 |
+
"target_modules": [
|
| 5 |
+
"q_proj",
|
| 6 |
+
"v_proj"
|
| 7 |
+
],
|
| 8 |
+
"bias": "none",
|
| 9 |
+
"peft_type": "LORA",
|
| 10 |
+
"task_type": "CAUSAL_LM",
|
| 11 |
+
"base_model_name_or_path": "Qwen/Qwen3-30B-A3B"
|
| 12 |
+
}
|
lora_adapters/pragmatic/adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3eb129d19c1004a4eefc6e767c69233b41827cb664b9a09d7a2ea10f5802d65f
|
| 3 |
+
size 13395064
|
mod_scales.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6e1049dab872ad347bc340cc75ad71a034893961db04d5e3dd1c4ea5a04f39dd
|
| 3 |
+
size 7232
|
phi_weights.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:906b862a815648e4729300ef1d5f213f65cacffc33a83d9f11cf390230df45dd
|
| 3 |
+
size 6720307488
|
qkvm_config.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"base_model": "Qwen/Qwen3-30B-A3B",
|
| 3 |
+
"base_model_local": "/home/ubuntu/models/Qwen3-30B-A3B",
|
| 4 |
+
"architecture": "qkvm_v9",
|
| 5 |
+
"description": "QKVM phi weights for unconscious memory modulation on Qwen3-30B-A3B. These are trainable CoupledWriteFunction parameters that produce personality-differentiated M-states (memory matrices) which modulate Q and V projections in the frozen base model.",
|
| 6 |
+
"training": {
|
| 7 |
+
"epochs": 300,
|
| 8 |
+
"memory_rank": 16,
|
| 9 |
+
"mod_scale_init": 1.0,
|
| 10 |
+
"qkvm_layer_stride": 1,
|
| 11 |
+
"m_init_noise": 2.0,
|
| 12 |
+
"e_init_noise": 2.0,
|
| 13 |
+
"global_max_norm": 5.0,
|
| 14 |
+
"e_global_max_norm": 6.5,
|
| 15 |
+
"lambda_first_token": 0.5,
|
| 16 |
+
"lambda_disc": 1.0,
|
| 17 |
+
"lambda_contrast": 3.0,
|
| 18 |
+
"contrastive_warmup": 0,
|
| 19 |
+
"no_think": true,
|
| 20 |
+
"n_exposure": 5
|
| 21 |
+
},
|
| 22 |
+
"model_config": {
|
| 23 |
+
"num_hidden_layers": 48,
|
| 24 |
+
"hidden_size": 2048,
|
| 25 |
+
"num_attention_heads": 32,
|
| 26 |
+
"num_key_value_heads": 4,
|
| 27 |
+
"head_dim": 128
|
| 28 |
+
},
|
| 29 |
+
"results": {
|
| 30 |
+
"p_sim": 0.062,
|
| 31 |
+
"ppl_wins": "7/12",
|
| 32 |
+
"ft_accuracy_personality": "12/12",
|
| 33 |
+
"ft_accuracy_diagnostic": "16/18",
|
| 34 |
+
"unique_generations": "5/5",
|
| 35 |
+
"kl_between_mstates": "4-17"
|
| 36 |
+
},
|
| 37 |
+
"mindsets": {
|
| 38 |
+
"personality": [
|
| 39 |
+
"analytical",
|
| 40 |
+
"bold",
|
| 41 |
+
"empathetic",
|
| 42 |
+
"pragmatic"
|
| 43 |
+
],
|
| 44 |
+
"diagnostic": [
|
| 45 |
+
"ec1_upstream",
|
| 46 |
+
"ec2_reframe",
|
| 47 |
+
"ec3_missing",
|
| 48 |
+
"ec4_decompose",
|
| 49 |
+
"ec5_triage",
|
| 50 |
+
"ec6_multifactor"
|
| 51 |
+
]
|
| 52 |
+
}
|
| 53 |
+
}
|
seeds/analytical.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:eb458633f46ad77654fa882a78b7ad71b8ecd097a715aa5fe44b3fbfbdcab3e4
|
| 3 |
+
size 12598864
|
seeds/bold.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0eb53002ee0e9176f7f030fefc0336027183aeae5eebc1ebdafb86b82f15dbf1
|
| 3 |
+
size 12598864
|
seeds/ec1_upstream.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1bd28690433f76230c503f7f8f05c1bc7eb5976d8537fab869cfbeb60cd9cabe
|
| 3 |
+
size 12598864
|
seeds/ec2_reframe.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:68d8a2d125aea08a20981209d95759e19dd815ca1fe60afd2a3aafce8c285fcb
|
| 3 |
+
size 12598864
|
seeds/ec3_missing.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:36133bb99fb01af1d2991fd0b75366d5b76927944af3180527db96fa88b6a824
|
| 3 |
+
size 12598864
|
seeds/ec4_decompose.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a9f93bea72e3071c5fd9b35cd8c756d1091e63043c1d00c7e37fa1e7c4635d9d
|
| 3 |
+
size 12598864
|
seeds/ec5_triage.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:caca0148208291d60796dfaca83496d4bffddd1ad0411cae05e14a96b9565da6
|
| 3 |
+
size 12598864
|
seeds/ec6_multifactor.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:af39ef4cf730f9fea65c0f336cb7efadb04a76b87b14e7c52232bf98aacc6c63
|
| 3 |
+
size 12598864
|
seeds/empathetic.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2a84b4d0e176f50b5a7302f2ac4c5b5e19da51fba6502320b4890b7ca1a71058
|
| 3 |
+
size 12598864
|
seeds/pragmatic.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2ee15aa0255e256651c8d29ab1f2a03c61ced4103e2dff3193f139c44ab83f34
|
| 3 |
+
size 12598864
|