Skip to content

Zaidux/ZenithProtocol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Adaptive Self-Regulating Explainable Hybrid (ASREH) AI

Project Overview 🧠 This project, named the Zenith Protocol, is an innovative approach to building a generalizable, explainable AI model. Instead of training a separate model for each task, the Zenith Protocol leverages a single, unified architecture—the Adaptive Self-Regulating Explainable Hybrid (ASREH) Model—to learn and master multiple, disparate domains. We demonstrate this capability by training the model to play two completely different games: Chess and Tetris. The core of the Zenith Protocol is the belief that true intelligence lies in understanding, not just memorization. The ASREH model achieves this through a novel combination of architectural components.

Phase 1: The Foundation 🏗️

This phase establishes the foundational architecture by implementing the core of the ASREH model for a single domain: Tetris. We will build the essential components and prove the core hypothesis that the model can learn and reason based on both visual and conceptual data.

Key Components Implemented in Phase 1:

  • Conceptual Layer: The model is trained on a set of conceptual features for Tetris, including gaps, max_height, and board_fullness. The Conceptual Attention Layer processes this abstract knowledge, which is then fused with visual data from the Tetris board.

  • Adaptive-Reinforced Learning Controller (ARLC): The ARLC guides the training by providing a conceptual reward signal. It rewards moves that lead to a "better" board state, such as minimizing gaps. This teaches the model to optimize for high-level, strategic goals.

  • Explainability Module (EM): The EM provides transparency by analyzing the model's internal state. It generates human-readable explanations for the model's decisions, stating what conceptual goals were driving a move.

Phase 2: The Split Mind (SPM) ☯️

In this phase, we will introduce the second domain, Chess, to implement the Split Mind (SPM) architecture. The model will be trained on both Tetris and Chess simultaneously. This phase will require significant upgrades to the data loaders and the training loop to demonstrate the model's ability to learn across disparate domains using a single shared core.

Phase 3: Hyper-Conceptual Thinking (HCT) 💡

The final phase focuses on implementing Hyper-Conceptual Thinking (HCT). This is a dynamic, advanced state of the Conceptual Attention Layer that allows the AI to form and apply novel, abstract concepts. This capability moves the model from simple reasoning to genuine creative problem-solving and will be activated by a unique "discovery bonus" in the ARLC's reward function.

Phase 4: Autonomous Domain Exploration 🗺️

This phase focuses on making the Zenith Protocol a truly autonomous and self-improving system. We've enhanced the model with new capabilities that allow it to understand new environments on its own, optimize its performance, and provide deeper, more insightful explanations.

Key Components Implemented in Phase 4:

  • Mixture of Experts (MoE): The model's architecture has been upgraded to include a MoE layer. The shared encoder now acts as a router, distributing the workload to specialized expert networks. This makes the system more scalable and energy-efficient.

  • Energy of Movement (EoM): A new reward signal, the Energy of Movement, has been integrated into the ARLC. This bonus incentivizes moves that cause a significant and valuable conceptual shift in the model's internal state. It encourages the model to seek out strategic, rather than just tactical, changes.

  • Dynamic Quantization: The model is now capable of performing dynamic quantization—it can automatically compress its own weights to increase inference speed when a bottleneck is detected. A human can still override this function, as per the original design.

  • Self-Supervised World Model (SSWM): We introduced another component, the SSWM, which allows the model to predict the future state of the game based on hypothetical moves. This enables "what-if" scenario analysis, moving beyond reactive play to proactive strategic planning.

  • Strategic Planner: The ARLC is now enhanced with a Strategic Planner module. This allows the model to select and pursue high-level goals (e.g., "center control" in chess or "minimize gaps" in Tetris) and adjust its tactical decisions accordingly.

  • Full Autonomous Exploration: The HCT and ARLC modules now work together to enable the model to enter and learn from new, unknown domains without explicit human guidance. This is achieved through a "surprise bonus" that encourages exploration and a self-evolving conceptual knowledge base.

Phase 5: Meta-Capabilities and On-Device Deployment 🌐

This phase elevates the Zenith Protocol's intelligence by focusing on meta-level improvements: learning how to learn and scaling to real-world applications with privacy and robustness in mind.

Key Components Implemented in Phase 5:

  • Conceptual Knowledge Graph (CKG): A persistent, dynamic knowledge base has been added. The CKG serves as the model's long-term memory, where it stores and retrieves concepts learned from its diverse training domains. During federated learning, clients can also contribute new concepts to the global CKG.

  • Federated Learning and On-Device Deployment: We've integrated a federated learning pipeline. This enables the model to be trained on decentralized data directly from user devices. The process aggregates model updates without ever exposing private gameplay data, addressing scalability and privacy concerns.

  • Meta-Learning for Rapid Adaptation: A new meta-learning module allows the model to learn a good set of initial parameters that can be rapidly fine-tuned for new, unknown domains. Instead of a long exploration process, the model can now adapt to a new game from just a few examples.

  • Adversarial Module for Self-Correction: To ensure robustness and safety, an Adversarial Module has been introduced. This module deliberately generates confusing data or attempts to poison the model's knowledge. The ARLC then uses this information to activate its self-correction loop, training the model to be resilient against malicious or noisy data, and thereby increasing its overall trustworthiness.

New Core Components and Optimizations

To enhance the Zenith Protocol's efficiency and reasoning capabilities, several core components were implemented and optimized using a hybrid Python/C++ architecture. This approach was chosen to achieve significant performance gains and lower power consumption, which is critical for real-time applications and sustainable AI.

Zenith Conceptual Encoders: The visual, audio, and text encoders have been upgraded to go beyond simple feature extraction. They now use a Conceptual Attention Layer to distill raw data into a compact, semantically-rich vector, which dramatically reduces the number of "tokens" needed for a context window. The core encoding logic for these components is offloaded to a C++ backend (conceptual_encoder.cpp) for maximum performance.

Self-Supervised World Model (SSWM): The SSWM, which is the model's "predictive foresight," has been optimized in C++ (sswm_predictive_model.cpp). This allows the ARLC to run thousands of "what if" simulations in real time, making strategic planning significantly faster and more efficient.

Mixture of Experts (MoE) Router: A key component for sustainable AI, the MoE router dynamically selects the most relevant "experts" for a given query. The core routing mechanism has been implemented in C++ (moe_router.cpp) and now uses conceptual context from the CKG to make more intelligent and efficient routing decisions. This helps to reduce computational load and power consumption.

Hyper-Conceptual Thinking (HCT): The pinnacle of the Zenith Protocol's capabilities, HCT enables the model to form novel, abstract concepts that were not explicitly taught. The high-performance calculations for this are handled by a dedicated C++ module (zenith_neural_calculations.cpp), which is faster and more resource-efficient than a pure Python implementation.

Adaptive Self-Regulating Explainable Hybrid (ASREH) Model: The core ASREH model, which provides a transparent and trustworthy framework for decision-making, has been integrated with the C++ backend (asreh_model.cpp). This allows the entire forward pass—from state encoding to conceptual attention and expert routing—to be executed with high-speed, low-level optimizations.

Upgraded Explainable World Modeling feature The new feature significantly enhances the model's transparency and causal reasoning. Here's a breakdown of how it works:

Causal Reasoning and Counterfactuals: A core limitation of many AI systems is that they can't explain why a decision was made beyond statistical correlations. Our new feature addresses this by introducing a counterfactual element to the explanation. This means the model can reason about hypothetical scenarios and articulate why a different action would have led to a worse outcome. This provides a level of human-like justification that is critical for high-stakes environments like medicine and finance.

Upgraded SSWM for Batch Simulation: We added a new method to the Self-Supervised World Model (SSWM) in both Python and C++: simulate_multiple_what_if_scenarios. This method efficiently runs simulations for several hypothetical moves in a single call, which is much faster than running them one by one. The C++ backend is crucial for this, as it allows the model to perform these complex calculations at high speed, a key part of the project's efficiency philosophy.

Upgraded ExplainabilityModule for Comparative Analysis: The ExplainabilityModule now receives the outcomes of these batch simulations and compares them. It analyzes the predicted rewards and states of the chosen move against the best rejected alternative. This comparative analysis is then used to generate a detailed narrative that explains the model's decision-making process.

A More Robust Narrative: The final explanation is no longer just a single reason; it's a multi-layered narrative that includes the primary reason for the chosen move, a summary of why an alternative was rejected, and the predicted reward for the chosen move versus the alternative, providing a clear, quantitative justification.

Blockchain Integration 🔗 A new, optional C++ module (blockchain_interface.cpp) has been added to provide an immutable and verifiable record of the model's key activities. This enables:

Decentralized Conceptual Knowledge Graph (CKG): The CKG can now store a verifiable record of all new concepts and self-correction events on a mock blockchain. This creates a verifiable and auditable history of the model's entire learning process.

Verifiable Explanations: The Explainability Module can now provide a verifiable "Truthfulness" or Confidence and Hallucination Score by cross-referencing its explanations with the immutable data on the blockchain.

This creates an auditable record of the model's learning and reasoning, making it fundamentally more trustworthy and transparent.

Technologies Used 💻

  • PyTorch: The primary deep learning framework.
  • NumPy & Pillow: For efficient data manipulation and image processing.
  • Python-Chess: A powerful library for handling all Chess-related logic (introduced in Phase 2).
  • Pygame: Used for the game environments and real-time visualization of the model's performance (optional for training but good for demos).
  • Websockets & FastAPI: Future-proofing for a live, web-based demonstration of the project. This project is a first step toward an AI that not only excels at diverse tasks but can also articulate its reasoning, paving the way for more robust and trustworthy artificial intelligence.

Licensing

The Zenith Protocol is dual-licensed under the AGPLv3 (Open-Source) and a Commercial License.

For the community and non-commercial use, we offer our project under the AGPLv3. This license is for individuals and organizations who are committed to the principles of open-source software and will also make their full source code available if they use the Zenith Protocol in a network service.

For commercial use, especially in a proprietary application, please refer to the COMMERCIAL-LICENSE.md file for details on how to obtain a commercial license.

Note: The AGPLv3 version of this project explicitly prohibits its use in certain high-stakes domains, including military, medical, and legal applications. Please review the LICENSE file for the full terms and conditions.

Project Roadmap 🛣️

Based on the impressive progress from a foundational model to one with autonomous learning and rapid adaptation, here are some potential next steps for the Zenith Protocol project:

Phase 6: Real-World Deployment and API Development 🚀

The project is currently a local prototype. This phase would focus on making the Zenith Protocol accessible and practical for external use.

  • Web-based API: Develop a stable and scalable API using the FastAPI and Websockets framework already listed in the README. This would allow developers and researchers to interact with the model remotely and integrate its capabilities into their own applications.

  • Mobile and Edge Deployment: Leverage the lightweight nature of the model (due to dynamic quantization and federated learning) to deploy a version of the ASREH AI on mobile devices or other edge computing platforms.

  • Decentralized Marketplace: Explore the creation of a decentralized platform where users can contribute their on-device gameplay data in exchange for a share of the model's performance improvements or tokens. This would build on the federated learning framework and incentivize data contribution.

Phase 7: Advanced Explainability and Human-in-the-Loop 🤝

The current Explainability Module is a great start, but it can be made more robust and interactive.

Conceptual "Why" Chains: Go beyond explaining "what" the AI did and create a system that explains "why." This would involve tracing the decision-making process back through the conceptual layers to show the user the high-level reasons for a choice (e.g., "I chose this move because it aligns with the 'king safety' strategic goal"). This process would trace the logic through the zenith_neural_calculations.cpp module, providing a complete, auditable log of the model's reasoning process.

Interactive Explainability: Build a user interface that allows the user to challenge the AI's reasoning or provide feedback. For instance, a user could ask, "Why not move the pawn to C3?" and the AI would respond with its predicted outcome and counter-arguments, which the user could then accept or reject, further training the model.

Unsupervised Concept Discovery: Enhance the Hyper-Conceptual Thinking (HCT) module to not just discover new concepts but to name and articulate them in a human-readable format, such as "discovered 'pawn chain' concept" or "identified 'tetris-T-spin' maneuver". This feature would be handled by the C++ HCT module, which would then update the CKG and the Explainability Module.

Phase 8: General Intelligence and Transfer Learning 💡

With the groundwork of meta-learning established, the final frontier is to push the model's boundaries to truly general intelligence.

  • Zero-Shot Adaptation: The ultimate goal of the meta-learning module is to enable the model to enter and perform on a new game or task with zero prior examples. This would require an even more generalized core and a more sophisticated meta-learner.

  • Multi-Modal Integration: Expand the model beyond game boards to integrate other forms of data, such as natural language (for interactive fiction games), audio (for rhythm games), or even 3D visual environments.

  • Automated Curriculum Learning: Develop a system where the AI can automatically generate new, increasingly complex games for itself to play, creating a self-sufficient learning loop that constantly pushes its own boundaries.

Future Features and Architectural Enhancements

The Zenith Protocol is a living framework. The following features would be considered for future development if the project secures additional funding and resources, building on the foundational principles of the ASREH algorithm.

  • Advanced Knowledge Graph and Dynamic Reasoning: To move from a static, pre-defined knowledge base to a truly adaptive system, a dynamic knowledge graph would be implemented. This would allow the model to automatically extract new entities, concepts, and causal relationships from real-time data. By prioritizing causal relationships within the knowledge graph, the model could follow a more structured reasoning path, which would further enhance its ability to reduce hallucinations and improve interpretability.

  • Enhanced World Modeling for Counterfactual Explanations: While the current Self-Supervised World Model (SSWM) can predict future states, an enhancement could be a "Reverse World Model". This would allow the system to predict what the world should have been for a different action to have been chosen, providing a new layer of counterfactual explanation that could significantly increase user understanding of the agent's policy. Additionally, the architecture could be streamlined to be more computationally efficient, for example, by not using complex components like recurrent neural networks or transformers. Instead, it would rely on simpler techniques like frame and action stacking, and data augmentation to improve robustness and efficiency.

  • Comprehensive Robustness and Safety Framework: To prepare the protocol for real-world applications in robotics and autonomous systems, a dedicated framework for robustness would be added. This would include adversarial and threat modeling to mitigate against physical attacks, cybersecurity threats, and other vulnerabilities. This aligns with Google's public commitment to building AI responsibly and safely, specifically by identifying and restricting access to dangerous capabilities that could be misused and by performing threat modeling research. The framework would also focus on ensuring the model can generalize to new, unseen environments without failure.

  • Refined Multi-Task and Neuro-Symbolic Integration: While the project already uses a "Split Mind" (SPM) architecture, a more formal neuro-symbolic fusion could be implemented. This would create a "split-brain" system where a neural network handles pattern recognition in parallel with a symbolic component that applies clear logical rules.

This formal integration would allow the system to apply structured knowledge to the "messy, uncertain data" of the real world, addressing a key limitation of modern neural networks. A new feature could also be the use of "task clustering," where the model automatically groups tasks with similar characteristics to ensure more efficient and effective knowledge transfer, which is a key component of multi-task learning.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published