File size: 4,847 Bytes
4690767
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
623b83c
4690767
623b83c
4690767
623b83c
4690767
623b83c
4690767
623b83c
4690767
623b83c
4690767
623b83c
4690767
623b83c
4690767
623b83c
4690767
623b83c
4690767
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# 🧠 Ontology Architect

### Autonomous Scientific Discovery in Non-Stationary Worlds

---

## πŸš€ Overview

**Ontology Architect** is an experimental AI system designed to move beyond traditional prediction-based machine learning toward **autonomous scientific discovery**.

Instead of simply learning patterns from data, our agent:

* Observes noisy, unstructured sensor logs
* Infers hidden variables
* Writes its own Python-based theories
* Continuously refines those theories as new data arrives

This project is inspired by how real scientists work:
**hypothesize β†’ test β†’ falsify β†’ revise**

---

## ❗ The Problem

Most modern AI systems are **model-free**:

* They learn correlations
* They require large labeled datasets
* They assume the world is **stationary**

However, real-world systems are very different:

* Observations are noisy
* True variables are hidden
* System dynamics change over time

### Example

In industrial systems, sensors measure vibration and temperatureβ€”but not internal stress or wear.
Traditional models detect anomalies but **cannot explain or adapt to them**.

---

## πŸ’‘ Our Idea

We propose an AI agent that behaves like a **scientist** rather than a predictor.

The agent:

1. **Observes** raw logs
2. **Builds a theory** (Python code with latent variables and equations)
3. **Tests predictions** against future data
4. **Refines or replaces** the theory

---

## βš™οΈ Environment Design

### Observation

* Raw text logs of sensor values
* Output from previous theory execution
* Peer-review logs of failed hypotheses

---

### Action

* A **full rewrite or diff** of a Python theory module
* Limited to ~2k tokens

---

### Reward Function

We follow the **Minimum Description Length (MDL)** principle:

```
Reward = log P(observations | theory) - Ξ» * complexity(theory)
```

Where:

* First term β†’ predictive accuracy
* Second term β†’ penalizes overly complex theories

---

### Twist: Non-Stationarity

Every few episodes:

* The underlying β€œlaws of physics” change

The agent must:

* Detect performance degradation
* Trigger a **paradigm shift**
* Replace its theory instead of patching it

---

## 🧩 Theory Representation

To keep the search space manageable, theories follow a structured format:

```python
class Theory:
    def latent_variables(self, obs):
        return {...}

    def dynamics(self, state):
        return {...}

    def observe(self, state):
        return {...}
```

This ensures:

* Interpretability
* Safe execution
* Structured exploration

---

## πŸ”„ Learning Loop

```
Observe β†’ Evaluate β†’ Analyze Residuals β†’ Propose Update β†’ Execute β†’ Score β†’ Repeat
```

The agent balances:

* **Exploitation** β†’ refining current theory
* **Exploration** β†’ proposing new structures

---

## 🧠 What Makes This Novel

Unlike traditional ML systems, this approach:

* Invents **latent variables**
* Searches over **theory space**, not just parameters
* Uses **falsification** as a learning signal
* Handles **changing environments** via paradigm shifts

This is closer to **scientific reasoning** than standard AI training.

---

## 🌍 Why This Matters

This approach is useful in domains where:

* The system is **partially observable**
* The true structure is unknown
* The environment **changes over time**

### Potential Applications

* 🏭 Industrial monitoring
* 🧬 Biology & drug discovery
* 🌍 Climate modeling
* πŸ“ˆ Financial systems
* 🧠 Neuroscience

---

## πŸ”— Project Links

* GitHub Repository:
  [https://github.com/rohan-27p/Ontology-architect](https://github.com/rohan-27p/Ontology-architect)

* Hugging Face Space:
  [https://huggingface.co/spaces/LostDecimal/alien-physics-openenv/tree/main](https://huggingface.co/spaces/LostDecimal/alien-physics-openenv/tree/main)

---

## πŸ“Š Training Results

## Overview

![Training Overview](artifacts/results/training_overview.png)

## Discovery

![Discovery Plot](artifacts/results/discovery_plot.png)

### 1. GRPO Traning Curve

![Grpo Training Curve](artifacts/results/grpo_training_curve.png)

### 2. SFT Loss Curve

![SFT Training Curve](artifacts/results/sft_training_loss.png)

### 3. Reward Curve

![Reward Curve](artifacts/results/reward_curve.png)

---

## πŸ§ͺ Demo Scenario

In our simulation:

* Phase 1 β†’ Linear dynamics
* Phase 2 β†’ Oscillatory dynamics

The agent:

* Initially fails after the shift
* Detects mismatch
* Introduces new latent structure
* Recovers predictive accuracy

---

## 🎯 Conclusion

We are moving from:

> AI that **predicts data**
> to
> AI that **explains the world**

Ontology Architect is a step toward systems that:

* Discover structure
* Adapt to change
* Build and revise knowledge autonomously

---

## πŸ™Œ Acknowledgment

Built as part of a hackathon exploring the future of AI-driven scientific discovery.