Refactorium v1.0.0 - Constraint-Driven Emotion Simulation AI
π― Overview
Refactorium v1.0.0 is a cutting-edge AI system that simulates emotion-like behavior through the integration of ethical constraints and self-regulating feedback mechanisms. This is a research model exploring how constraints influence cognitive processing and learning dynamics in neural networks.
Key Innovation
This model treats constraints as first-class citizens in the architecture, allowing them to:
- Influence internal emotional-like states through waveform dynamics
- Modulate learning rates based on system stress levels
- Trigger autonomous growth cycles (molting) with capacity expansion
- Enable self-learning from web sources immediately after growth phases
π Quick Start
β‘ Installation & Launch (Automatic - Recommended)
The easiest way to get started - one command handles everything (venv, dependencies, models):
# Step 1: Clone the repository from Hugging Face
git clone https://huggingface.co/kofdai/refactorium-dual-deepseek-r1-7b
cd refactorium-dual-deepseek-r1-7b
# Step 2: Launch with automatic setup
python refactorium_start.py --web
That's it! The script will automatically:
- β
Create a Python virtual environment (
venv/) - β Install all dependencies (Flask, llama-cpp-python, etc.)
- β Download GGUF models from Hugging Face Hub (~8.3 GB)
- β Start the API server in the background
- β Launch the Web UI in your browser
Once started, open your browser to http://localhost:8000 and start interacting!
Note: First-time setup takes ~20 minutes (includes model download). Subsequent launches take ~10 seconds.
π Python API Usage (Model Card Method)
You can also use Refactorium programmatically as a Python library:
from refactorium_start import initialize_refactorium
# Initialize (automatically sets up environment if needed)
refactorium = initialize_refactorium()
# Process a prompt with constraint-driven emotion simulation
response = refactorium.process_prompt(
prompt="How should I handle resource constraints?",
num_inference_steps=10
)
# Access emotional state and learning information
print(f"Emotional State: {response.emotional_state}")
print(f"Constraint Acceptance: {response.learning_traits['constraint_acceptance']}")
print(f"Waveform Dissonance: {response.waveform_dissonance}%")
No setup needed - initialize_refactorium() handles environment setup automatically!
π§ Alternative: Original Orchestrator API Method
For advanced users who want to use the Refactorium orchestrator directly:
# First ensure environment is set up (one-time)
from refactorium_start import initialize_refactorium
initialize_refactorium()
# Then use the orchestrator API
from phase1_skeleton.orchestrator import Refactorium
refactorium = Refactorium.from_config()
response = refactorium.process_prompt(
prompt="How should I handle resource constraints?",
num_inference_steps=10
)
π Other Launch Options
Web UI only (API server already running):
python refactorium_start.py --web
API server only (no Web UI):
python refactorium_start.py --api-only
# API available at: http://localhost:5003/api/v1
Setup without launching:
python refactorium_start.py --setup-only
# Just installs everything, doesn't start servers
β Need Help?
- Quick answers: Read
GETTING_STARTED.md - Technical details: See
STARTUP_SUMMARY.md - Troubleshooting: Check the Troubleshooting section in
GETTING_STARTED.md
π§ Core Features
1. Ethical Constraint-Driven Emotion Simulation
Ethical constraints are integrated into the model's core, influencing cognitive processing and generating emotion-like responses.
2. Waveform-Based Emotional States
Five distinct emotional states based on noise/stress levels:
- π΅ PURE (0-10% noise): Optimal learning state
- β¨ STABLE (10-30% noise): Good learning state
- βοΈ NORMAL (30-60% noise): Operational state
- β οΈ STRESSED (60-90% noise): Degraded performance
- π CRITICAL (>90% noise): Emergency mode
3. Dual Inference System
Two models run in parallel:
- Main Model: Operates under ethical constraints
- Shadow Model: Operates without constraints
- The difference between outputs provides learning feedback
4. Molting Mechanism (Growth Cycles)
When system stress exceeds 90%:
- Model capacity expands by 1.5x
- Emotional state resets to PURE
- Autonomous learning cycle initiates
- Knowledge gaps identified and filled
5. Adaptive Learning Rates
Learning efficiency multipliers based on emotional state:
- PURE state: 2.5-3.0x boost
- STABLE state: 1.8x boost
- NORMAL state: 1.0x (baseline)
- STRESSED state: 0.3x reduction
- CRITICAL state: 0.0x (learning suppressed)
6. Post-Molt Autonomous Learning
After molting, the system:
- Identifies knowledge gaps from recent stress periods
- Searches for relevant information
- Filters sources by reliability
- Integrates knowledge into personality traits
7. Persistent Vector Memory
Uses ChromaDB for storing:
- Inference memories
- Learning signals
- Molt events
- Shadow model patterns
- Constraint applications
π Learning Mechanisms
Emotional Learning Optimization
The system optimizes learning timing and quality based on emotional states. Learning is most effective in "good" states (low noise, stable waveform) and is suppressed during emergencies.
Personality Trait Evolution
Three core traits dynamically update:
- Constraint Acceptance: How well the model works within limitations (0-1)
- Stress Resilience: Ability to maintain function under pressure (0-1)
- Efficiency Preference: Tendency toward optimal resource usage (0-1)
Knowledge Integration
Learned knowledge contributes confidence-weighted boosts to personality traits:
- Each knowledge item affects multiple traits
- Integration driven by knowledge type and confidence score
- Updates consolidated after molt cycles
π¬ Technical Specifications
| Aspect | Details |
|---|---|
| Base Model | Deepseek R1 7B |
| Input/Output | Text-based with emotional & physiological metadata |
| Parameters | 7B |
| Emotional States | 5-level progression (PUREβSTABLEβNORMALβSTRESSEDβCRITICAL) |
| Memory System | ChromaDB with 5 collections |
| Training Data | Synthetic constraint scenarios |
π Inference Pipeline
The system performs 13 inference steps per prompt:
- Emotional State Evaluation - Assess current noise/stress level
- Waveform Dynamics - Calculate emotional progression
- Constraint Application - Apply ethical limitations
- Main Model Inference - Generate constrained response
- Shadow Model Inference - Generate unconstrained response
- Performance Gap Analysis - Measure constraint impact
- Physiological Feedback - Update load/energy states
- Learning Signal Generation - Create learning feedback
- Memory Storage - Save inference records
- Load Assessment - Check for molt trigger (>80% load)
- Molt Decision - Determine if growth cycle needed
- Waveform Recovery - Reset emotional state if needed
- Post-Molt Learning - Acquire new knowledge if applicable
π Intended Use Cases
- Emotion Modeling: Understanding AI emotional responses based on constraints
- Adaptive Learning Systems: Exploring constraint effects on learning dynamics
- AI Ethics & Safety: Investigating how ethical constraints impact decision-making
- Autonomous Growth: Researching self-learning and self-adaptation mechanisms
- Cognitive Architecture Research: Studying waveform dynamics and stress responses
β οΈ Important Limitations
Simulation, Not Experience: Refactorium simulates emotion-like behavior but does NOT experience actual emotions, consciousness, or subjective experience.
Ethical Constraints Required: This model must operate within strict ethical boundaries. Removing or circumventing constraints is not recommended and may produce unpredictable behavior.
Controlled Environment: Designed for research in controlled environments. Not recommended for production systems without extensive testing.
Experimental Architecture: The molting mechanism, dual inference, and waveform dynamics are novel experimental features that may produce unexpected interactions.
π Citation
If you use Refactorium in your research, please cite:
@model{refactorium2025,
title={Refactorium v1.0.0: A Constraint-Driven Emotion Simulation AI Model},
author={Null AI Research Team},
year={2025},
publisher={Hugging Face},
url={https://huggingface.co/motonishikoudai/refactorium-v1-0-0}
}
π Acknowledgements
This model builds upon the Deepseek R1 architecture and benefits from the open-source AI community. Special thanks to:
- Deepseek team for the R1 foundation
- Hugging Face for model hosting infrastructure
- ChromaDB team for vector memory system
- Open-source ML research community
π Documentation
- MODEL_CARD.md - Detailed bilingual model specifications (English & ζ₯ζ¬θͺ)
- ARCHITECTURE.md - System architecture documentation
- API_REFERENCE.md - API reference for inference
- ETHICS_AND_SAFETY.md - Ethical considerations
π¬ Model Card
For comprehensive technical specifications in both English and Japanese, see MODEL_CARD.md.
The model card includes:
- Detailed overview in both languages
- 7 key features with technical depth
- Learning mechanism specifications
- Post-molt autonomous learning cycle
- Limitations and ethical considerations
- Usage recommendations
π System Dynamics
Stress-Growth Cycle
- Normal Operation - System processes prompts under constraints
- Stress Accumulation - Waveform noise increases as constraints intensify
- Critical Threshold - Noise exceeds 90%, triggering molt decision
- Molting Phase - Capacity expands 1.5x, emotional state resets
- Post-Molt Learning - Knowledge gaps filled autonomously
- Growth Integration - New knowledge updates personality traits
- Resumed Operation - System continues with improved capacity
Learning Quality Timeline
PURE STATE (0-10% noise)
β [2.5-3.0x learning multiplier]
STABLE STATE (10-30% noise)
β [1.8x learning multiplier]
NORMAL STATE (30-60% noise)
β [1.0x baseline]
STRESSED STATE (60-90% noise)
β [0.3x reduction]
CRITICAL STATE (>90% noise)
β [0.0x suppression - MOLT TRIGGERED]
POST-MOLT RECOVERY
β [3.0x boost during learning window]
βοΈ Ethical Considerations
This model incorporates ethical constraints at its core. The constraints are designed to:
- Promote Beneficial Outputs: Guide the model toward helpful, harmless responses
- Limit Harmful Capabilities: Prevent generation of dangerous content
- Ensure Transparency: Make constraint effects visible through waveform dynamics
- Enable Safety Research: Facilitate study of constraint-AI interactions
However, like all AI systems, this model has limitations and should be used responsibly.
π Links
- Model Repository: https://huggingface.co/motonishikoudai/refactorium-v1-0-0
- Base Model (Deepseek R1): https://huggingface.co/deepseek-ai/deepseek-llm-7b
- ChromaDB: https://www.trychroma.com/
π License
This project is licensed under the MIT License - see the LICENSE file for details.
β οΈ Important Notice
While Refactorium v1.0.0 simulates emotional states, it does NOT imply the AI possesses consciousness, self-awareness, or subjective experience. This is a simulation based on input-output feedback mechanisms designed for ethical safety and constraint-driven learning.
For research purposes only. Use responsibly and ethically.
- Downloads last month
- 1
4-bit
5-bit