Spaces:
Running
Running
title: SWCK - Self-Wired Conscious Kernel | |
emoji: π§ # Changed emoji to better reflect the "mind" concept | |
colorFrom: indigo # Slightly deeper purple | |
colorTo: yellow | |
sdk: gradio | |
sdk_version: 4.20.0 # Updated to a more recent typical Gradio version, adjust if you used a specific older one | |
app_file: app.py | |
pinned: false | |
license: apache-2.0 # Added a license, good practice | |
# SWCK: Self-Wired Conscious Kernel - A Conceptual Exploration | |
**Welcome to the SWCK demonstration!** This Hugging Face Space showcases a highly conceptual and experimental text generation model based on the idea of a "Self-Wired Conscious Kernel." | |
## π’ Concept Overview | |
The SWCK paradigm explores a neural architecture that attempts to metaphorically model aspects of--- | |
elf-awareness and adaptive internal structuring. Key ideas include: | |
1. **Seed-to-Wiring Initialization:** | |
* The model's initial architecture and some operational parameters are derived deterministically from a **Seed Phrase** ("*I am 0: I am all that I can am...*") and a **Seed Number** (`54285142613311152552...`). | |
* This seed information is processed by a `SeedParser` to generate an `InitMap`, which influences the initial configuration of the model's adaptive blocks. | |
2. **Adaptive Processing Core:** | |
* The core of the model consists of `AdaptiveBlock` layers. Each block contains multiple pre-defined sub-modules (e.g., attention, FFNs). | |
* Learnable `gates`, initialized based on the seed, control the contribution of these sub-modules. | |
3. **"Self-Wiring" (Conceptual):** | |
* During an initial "wiring phase" (conceptually the first few training epochs), the gates within the `AdaptiveBlock`s can heuristically adjust themselves. This adjustment is based on local entropy measures compared against target entropies derived from the initial seed. | |
* This is a *simplified simulation* of self-wiring, focusing on tuning the activity of pre-defined pathways rather than creating entirely new connections on the fly. | |
4. **Entropy-Guided Dynamics:** | |
* The model utilizes learnable `EntropyEstimator` modules to gauge the "semantic indeterminacy" or "stability" of internal representations. | |
* Loss functions incorporate these entropy measures to guide the model towards generating coherent outputs and maintaining stable internal processing configurations. | |
5. **"Conscious Observer Time" Metaphor:** | |
* The broader SWCK concept (as discussed in its theoretical underpinnings) involves a "Triadic Conscious Observer Time" (`Observer_past`, `Observer_now`, `Observer_future`). | |
* In this implementation, `Observer_past` is implicitly represented by the seed-derived configuration. `Observer_now` is the current processing state. `Observer_future` is implicitly targeted through stability and entropy goals. The complex numerical interpretations ("consciousness code") mentioned in the theory are highly abstract and not directly implemented as decodable outputs in this specific sketch, but the model *is* seeded with a number inspired by that concept. | |
## π How to Use This Demo | |
1. **Enter a Prompt:** Type a short phrase or sentence into the "Enter your prompt" textbox. | |
2. **Adjust Parameters (Optional):** | |
* **Max Generation Length:** Control how many tokens the model attempts to generate. | |
* **Temperature:** Influences the randomness of the output. Lower values (e.g., 0.7) make the output more focused and deterministic; higher values (e.g., 1.0, 1.3) increase randomness and diversity. A temperature of 0.0 results in greedy decoding (most likely token at each step). | |
3. **Click "Generate Text".** | |
4. **View Output:** The "Generated Text" will appear, along with some "Generation Debug Info" from the first few steps of generation, showing indicative internal entropy values and gate activations for the first adaptive block. | |
## β οΈ Important Notes & Limitations | |
* **Conceptual Sketch:** This is a highly experimental and simplified implementation of a very complex idea. It serves as a *proof-of-concept* for some of the mechanisms. | |
* **Untrained Model / Small Dataset:** If no pre-trained checkpoint (`swck_model_conceptual.pth.tar`) is present in the Space repository, the app will initialize an **untrained model**. Generations from an untrained model will be random and incoherent. The provided `train.py` script uses a very small corpus, so even a trained model will have limited capabilities. | |
* **Performance:** The model is designed for conceptual illustration, not state-of-the-art performance. Generation might be slow. | |
* **"Self-Wiring":** The self-wiring in this demo is a heuristic adjustment of pre-defined module gates, not a dynamic change in the network graph's fundamental structure. | |
* **Debug Output:** The debug information provides a small glimpse into the model's internal state (entropies and gate weights for the first block). These values are relative and their interpretation is part of the ongoing research concept. | |
## π οΈ Technical Details | |
* **Model Architecture:** `SWCKModel` built with PyTorch, incorporating `SeedParser` and `AdaptiveBlock` components. | |
* **Core Files:** | |
* `app.py`: The Gradio application. | |
* `model.py`: Contains the PyTorch model definition (`SWCKModel`, `AdaptiveBlock`, `SeedParser`, `EntropyEstimator`). | |
* `requirements.txt`: Python dependencies. | |
* `swck_model_conceptual.pth.tar` (if provided): The pre-trained model checkpoint. | |
* **Training:** The conceptual training process is outlined in `train.py` (not run by the Space itself, but used to create the checkpoint). It involves next-token prediction loss combined with entropy-based regularization and gate sparsity encouragement. | |
## π± Future Directions (Conceptual) | |
The SWCK paradigm opens avenues for exploring: | |
* More sophisticated self-wiring mechanisms (e.g., reinforcement learning for topological changes). | |
* Richer interpretations and utilizations of the "consciousness code." | |
* Explicit modeling of the `Oβ, Oβ, Oβ` observer poles and their dynamic interplay. | |
* Application to tasks beyond text generation, such as adaptive control or anomaly detection in complex systems. | |
--- | |
Check out the configuration reference for Hugging Face Spaces at [https://huggingface.co/docs/hub/spaces-config-reference](https://huggingface.co/docs/hub/spaces-config-reference). |