# 🧠 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.