Absolute Zero: Reinforced Self-play Reasoning with Zero Data
Paper β’ 2505.03335 β’ Published β’ 191
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Snow Spike is a Python project implementing entropy calculation, normalization, decay mechanisms, and living weights for a neural network system. The project focuses on implementing four key components:
This project leverages the MLX framework for efficient computation. MLX is a machine learning framework designed for Apple Silicon, providing accelerated computation for array operations.
snow_spike/
βββ src/
β βββ entropy/
β β βββ __init__.py
β β βββ spike_entropy.py
β βββ normalization/
β β βββ __init__.py
β β βββ signal_normalization.py
β βββ decay/
β β βββ __init__.py
β β βββ decay_mechanisms.py
β βββ weights/
β β βββ __init__.py
β β βββ living_weight.py
β β βββ adaptive_network.py
β βββ utils/
β βββ __init__.py
β βββ common.py
βββ tests/
β βββ entropy/
β β βββ test_spike_entropy.py
β βββ normalization/
β β βββ test_signal_normalization.py
β βββ decay/
β β βββ test_decay_mechanisms.py
β βββ weights/
β β βββ test_living_weights.py
β βββ utils/
β βββ test_common.py
βββ docs/
β βββ entropy.md
β βββ normalization.md
β βββ decay.md
β βββ living_weights.md
βββ examples/
β βββ entropy_example.py
β βββ normalize_example.py
β βββ decay_example.py
β βββ integrated_example.py
β βββ validate_living_weights.py
βββ requirements.txt
βββ setup.py
βββ README.md
βββ config.json
# Clone the repository
git clone https://github.com/username/snow_spike.git
cd snow_spike
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Install the package in development mode
pip install -e .
from snow_spike.entropy import count_spike_occurrences, calculate_empirical_probabilities
from snow_spike.entropy import compute_neuron_entropy, aggregate_network_entropy
from snow_spike.utils.common import SpikeState
# Count spike occurrences
spike_data = [-1, 0, 1, 0, -1, 0, 0, 1, 0, 0]
counts = count_spike_occurrences(0, spike_data, len(spike_data))
# Calculate probabilities
probabilities = calculate_empirical_probabilities(counts, len(spike_data))
# Compute entropy
neuron_entropy = compute_neuron_entropy(probabilities)
from snow_spike.normalization import normalize_logic_check, normalize_cross_check
from snow_spike.normalization import normalize_corroboration_signal
from snow_spike.utils.common import CrossCheckType
# Normalize different signals
logic_norm = normalize_logic_check(1)
cross_norm = normalize_cross_check(0.75, CrossCheckType.COSINE_SIMILARITY)
corr_norm = normalize_corroboration_signal(5, kappa=0.5)
# Calculate trust delta
from snow_spike.normalization import calculate_trust_delta
delta_t = calculate_trust_delta(logic_norm, cross_norm, corr_norm, 0.3, 0.4, 0.3)
from snow_spike.decay import apply_continuous_decay, DecayManager
from snow_spike.utils.common import DecayStrategy
import time
# Apply continuous decay
initial_value = 1.0
initial_time = time.time() - 3600 # 1 hour ago
current_time = time.time()
decay_lambda = 0.01
decayed_value = apply_continuous_decay(initial_value, initial_time, current_time, decay_lambda)
# Use decay manager
manager = DecayManager(strategy=DecayStrategy.CONTINUOUS_ON_READ)
decayed_value = manager.decay_value(initial_value, initial_time)
from snow_spike.weights import AdaptiveNetwork, LivingWeight
# Create a network with living weights
network = AdaptiveNetwork(
layer_sizes=[2, 4, 1],
decay_lambda=0.001,
growth_rate=0.05
)
# Train on XOR problem
inputs = [[1, 1], [1, -1], [-1, 1], [-1, -1]]
targets = [-1, 1, 1, -1]
# Train the network
history = network.train(inputs, targets, epochs=20)
# Make predictions
output = network.forward([1, -1])
# Calculate network entropy
entropy, layer_entropies = network.calculate_network_entropy()
You can run the provided examples to see each module in action:
# Run specific examples
./run.sh entropy # Entropy calculation example
./run.sh normalize # Normalization example
./run.sh decay # Decay mechanisms example
# Run the integrated example
python examples/integrated_example.py
# Validate living weights
python examples/validate_living_weights.py
To set up the development environment and run tests:
# Build and test everything
./build_all.sh
# Run tests
pytest tests/
# Check code style
flake8 src tests
Detailed documentation for each module is available in the docs/ directory: