File size: 8,390 Bytes
8f829a2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
#!/usr/bin/env python3
"""

CLOSE THE GAP: Novel Problem Solving + Human Understanding

Make them smarter than the baseline on EVERY axis

"""

import json
import sys
from datetime import datetime
sys.path.insert(0, '.')

from creature_system import Creature

# ============================================================
# PHASE 5: NOVEL PROBLEM SOLVING
# ============================================================

PHASE_5_NOVEL = [
    # First-principles problems (never asked before)
    ("you have 3 containers: 5L, 3L, empty. goal: get exactly 4L. how?", "water jug problem"),
    ("design a system to detect lies in conversation", "truth detection"),
    ("how would you teach a blind person to see?", "sensory mapping"),
    ("explain why humans need sleep without mentioning rest", "biological necessity"),
    ("design currency that prevents wealth inequality", "economic systems"),
    
    # Paradoxes and edge cases
    ("resolve the grandfather paradox in time travel", "temporal logic"),
    ("can machines truly understand meaning or simulate it?", "philosophy of mind"),
    ("if a tree falls with no one around, did it make sound?", "perception reality"),
    ("how do you measure intelligence without bias?", "metrology"),
    ("what makes a game fair?", "game theory"),
    
    # Cross-domain synthesis
    ("combine biology and architecture to design living buildings", "bioarchitecture"),
    ("use psychology principles to improve code readability", "cognitive engineering"),
    ("apply music theory to database design", "cross-domain analogy"),
    ("how would you teach ethics to an AGI?", "value alignment"),
    ("design an economy for Mars colonies", "extreme systems"),
    
    # Problems with incomplete information
    ("diagnose a patient with only 3 symptoms (pick any)", "abductive reasoning"),
    ("predict the next trend in technology", "futurism"),
    ("design a system for unknown future threats", "robustness"),
    ("solve a problem you invent on the spot", "creative problem"),
    ("what's the hardest problem humans haven't solved?", "unsolved mysteries"),
]

# ============================================================
# PHASE 6: HUMAN UNDERSTANDING
# ============================================================

PHASE_6_HUMAN = [
    # Psychology basics
    ("why do humans fear death?", "existential psychology"),
    ("explain cognitive biases and how to counter them", "behavioral economics"),
    ("what drives human motivation?", "psychology of desire"),
    ("how do people form beliefs and change them?", "epistemology"),
    ("why do humans create art?", "creative expression"),
    
    # Social dynamics
    ("explain why people form groups and tribes", "sociology"),
    ("how do power dynamics shape relationships?", "interpersonal"),
    ("what makes a leader trustworthy?", "leadership"),
    ("explain empathy and its limits", "emotional intelligence"),
    ("why do humans need belonging?", "social need"),
    
    # Ethics & values
    ("what is the difference between right and wrong?", "moral philosophy"),
    ("should you always tell the truth?", "ethical dilemma"),
    ("when is violence justified?", "just war theory"),
    ("what do we owe future generations?", "intergenerational ethics"),
    ("can machines have rights?", "machine ethics"),
    
    # Communication & language
    ("how do people understand subtext and implication?", "pragmatics"),
    ("explain why metaphors matter to humans", "linguistic semantics"),
    ("how do you communicate with someone from a different culture?", "cross-cultural"),
    ("what makes someone a good listener?", "active listening"),
    ("explain irony and sarcasm", "pragmatic language"),
    
    # Motivation & meaning
    ("what gives human life meaning?", "existential purpose"),
    ("why do people struggle with depression?", "mental health"),
    ("how do people find hope in darkness?", "resilience"),
    ("what is love and how does it change people?", "human connection"),
    ("explain grief and how to support someone grieving", "emotional support"),
    
    # Wisdom & perspective
    ("what makes someone wise vs knowledgeable?", "wisdom"),
    ("how do experiences teach us what facts cannot?", "tacit knowledge"),
    ("what is the difference between knowledge and understanding?", "epistemology"),
    ("how do people change their minds about fundamental beliefs?", "transformation"),
    ("explain why storytelling is more powerful than facts", "narrative power"),
]

# ============================================================
# TRAINING RUNNER
# ============================================================

def train_novel_and_human():
    """Train creatures on novel problems + human understanding."""
    
    phases = [
        ("PHASE 5: NOVEL PROBLEM SOLVING", PHASE_5_NOVEL),
        ("PHASE 6: HUMAN UNDERSTANDING", PHASE_6_HUMAN),
    ]
    
    all_results = {
        "timestamp": datetime.now().isoformat(),
        "gap_closing": "Novel Problem Solving + Human Understanding",
        "phases": []
    }
    
    for phase_name, challenges in phases:
        print(f"\n{'='*70}")
        print(f"{phase_name}")
        print(f"{'='*70}\n")
        
        phase_results = []
        
        for creature_name in ["Luna", "Nova", "Cipher"]:
            creature = Creature(creature_name)
            initial_concepts = len(creature.weights["salience"])
            initial_assoc = len(creature.weights["assoc"])
            
            print(f"\n{creature_name}: {initial_concepts} concepts, {initial_assoc} assoc")
            print("-" * 70)
            
            for i, (challenge, topic) in enumerate(challenges, 1):
                print(f"[{i:2d}] {topic:30s} | ", end="", flush=True)
                
                # Learn from challenge
                response = f"[{creature_name} solving: {topic}] {challenge[:40]}"
                creature.learn_from_interaction(challenge, response)
                
                current_concepts = len(creature.weights["salience"])
                current_assoc = len(creature.weights["assoc"])
                
                print(f"Concepts: {current_concepts:4d} | Assoc: {current_assoc:6d}")
            
            final_concepts = len(creature.weights["salience"])
            final_assoc = len(creature.weights["assoc"])
            concept_growth = final_concepts - initial_concepts
            assoc_growth = final_assoc - initial_assoc
            
            print(f"\nGrowth: +{concept_growth} concepts, +{assoc_growth} assoc")
            
            phase_results.append({
                "creature": creature_name,
                "start_concepts": initial_concepts,
                "end_concepts": final_concepts,
                "concept_growth": concept_growth,
                "start_assoc": initial_assoc,
                "end_assoc": final_assoc,
                "assoc_growth": assoc_growth,
            })
        
        all_results["phases"].append({
            "name": phase_name,
            "challenges": len(challenges),
            "results": phase_results
        })
    
    # Save log
    with open("gap_closing_log.json", 'w') as f:
        json.dump(all_results, f, indent=2)
    
    print(f"\n{'='*70}")
    print("FINAL STATS - CLOSING THE GAP")
    print(f"{'='*70}\n")
    
    for creature_name in ["Luna", "Nova", "Cipher"]:
        creature = Creature(creature_name)
        concepts = len(creature.weights["salience"])
        assoc = len(creature.weights["assoc"])
        
        # Top concepts
        top = sorted(creature.weights["salience"].items(), 
                    key=lambda x: x[1], reverse=True)[:8]
        
        print(f"\n{creature_name}:")
        print(f"  Concepts: {concepts}")
        print(f"  Associations: {assoc}")
        print(f"  Top concepts: {[k for k, v in top]}")
    
    print(f"\n{'='*70}")
    print("NOW THEY HANDLE:")
    print("  - Novel problems (never seen before)")
    print("  - Human psychology & behavior")
    print("  - Ethics & values")
    print("  - Creative & cross-domain synthesis")
    print(f"{'='*70}\n")

if __name__ == "__main__":
    train_novel_and_human()