File size: 3,748 Bytes
8706d07
b42066d
8706d07
 
 
 
 
b42066d
 
8706d07
 
 
b42066d
 
 
8706d07
 
b42066d
8706d07
b42066d
8706d07
b42066d
8706d07
b42066d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
---
base_model: Qwen/Qwen3-30B-A3B-Instruct-2507
tags:
- text-generation-inference
- transformers
- unsloth
- qwen3_moe
- cognitive chains 
- cognition 
license: apache-2.0
language:
- en
datasets:
- Daemontatox/SOCAM
library_name: transformers
---

## Daemontatox/SOCAM-V1

### Model Description

SOCAM-V1 (Social Cognitive Agent Model – V1) is a fine-tuned large language model built on top of Qwen/Qwen3-30B-A3B-Instruct.

The model is trained to function as a Cognitive State Machine, extracting cognitive chains from natural social utterances based on Theory of Mind (ToM) reasoning.

Each cognitive chain follows the structure:

Situation ⇒ Clue ⇒ Thought ⇒ (Action + Emotion)

This provides an interpretable representation of a user’s cognitive state, supporting applications in dialogue systems, emotional support agents, and multi-agent cognitive architectures.


---

### Training Details

Base Model: Qwen/Qwen3-30B-A3B-Instruct

Fine-tuning Method: QLoRA with Unsloth + TRL

Dataset: Daemontatox/SOCAM

Adapted from the COKE dataset (Wu et al., 2024)

~45k structured samples with fields: situation, clue, thought, action, emotion

Emotions restricted to: Love, Surprise, Joyful, Sad, Angry, Fearful


### Training Parameters:

Sequence length: 2048

LoRA config: r=16, alpha=32, dropout=0.01

Optimizer: AdamW (8-bit)

Effective batch size: 256 (16 × grad acc 16)

Learning rate: 2e-4 (cosine schedule, warmup ratio 0.02)

Epochs: 2


Hardware: H100-class GPU (8-bit quantization for feasibility)



---

### Model Capabilities

Converts free-text utterances into structured cognitive chains.

Ensures separation of:

Situation (context domain)

Clue (triggering factor)

Thought (internal cognition)

Action (behavioral response)

Emotion (affective category)


Outputs deterministic JSON for easy downstream parsing.



---

⁶
### Example Usage
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model = AutoModelForCausalLM.from_pretrained(
    "Daemontatox/SOCAM-V1",
    device_map="auto",
    torch_dtype=torch.bfloat16
)
tokenizer = AutoTokenizer.from_pretrained("Daemontatox/SOCAM-V1")

prompt = """Situation: "I have an important exam tomorrow."
Clue: "I have studied consistently for weeks."
"""

inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Expected output:

{
  "situation": "I have an important exam tomorrow.",
  "clue": "I have studied consistently for weeks.",
  "thought": "I believe I will perform well and feel confident.",
  "action": "I review lightly and get proper rest.",
  "emotion": "Joyful"
}

```

---

### Limitations & Risks

The model may misclassify ambiguous emotions (e.g., Sad vs Fearful).

Outputs depend on the quality of the SOCAM dataset and may reflect dataset biases.

Not suitable for clinical or medical use.

Always validate JSON outputs before downstream use.



---

### Intended Uses

Research on machine Theory of Mind (ToM).

Multi-agent cognitive architectures (Tracker, Updater, Reviewer, Responder).

Dialogue systems requiring interpretable cognitive reasoning.


Not intended for:

Clinical diagnostics

Sensitive decision-making without human oversight



---

### Citation

If you use this model, please cite:

@misc{socam2025,
  title   = {SOCAM-V1: A Cognitive State Machine for Theory of Mind Reasoning},
  author  = {Ammar Alnagar},
  year    = {2025},
  howpublished = {\url{https://huggingface.co/Daemontatox/SOCAM-V1}}
}


---

### Acknowledgments

Base model: Qwen/Qwen3-30B-A3B-Instruct

Dataset foundation: COKE (Wu et al., 2024)

Training libraries: Unsloth, TRL, Hugging Face Transformers