Based on repository activity, growth velocity and community engagement.
27
Growth2/30
Activity8/25
Popularity3/25
Trust15/20
5
Stars
High
Sentiment
Votes
5
README.md
SubZero Agent
A demonstration of the Absolute Zero paradigm for AI reasoning, based on the paper "Absolute Zero: Reinforced Self-play Reasoning with Zero Data".
Overview
The SubZero agent implements a simplified version of the Absolute Zero Reasoner (AZR) described in the paper. It demonstrates how an AI system can learn reasoning capabilities without relying on any external data by:
Proposing reasoning tasks that maximize learning potential
Solving these tasks to improve reasoning abilities
Learning from both roles to enhance general reasoning capabilities
The agent uses a code executor as the environment to validate tasks and verify solutions, providing grounded feedback for learning.
Key Components
The SubZero agent consists of the following key components:
SubZero Agent: The main agent that implements the Absolute Zero paradigm
Task Types: Three fundamental modes of reasoning:
Deduction: Given a program and input, predict the output
Abduction: Given a program and output, find a valid input
Induction: Given input-output pairs, infer the underlying function
Code Executor: A tool for safely executing Python code to validate tasks and verify solutions
Task Buffer: A buffer for storing tasks proposed and solved by the agent
Installation
Automatic Setup
The easiest way to set up the SubZero agent is to use the provided setup script:
cd subzero_agent
python setup.py
This script will:
Create a virtual environment
Install the required dependencies
Create a .env file from the example file
After running the setup script, you'll need to activate the virtual environment:
On Windows:
venv\Scripts\activate
On macOS/Linux:
source venv/bin/activate
Manual Setup
If you prefer to set up the environment manually:
Clone the repository and navigate to the project directory:
git clone https://github.com/yourusername/agno-main.git
cd agno-main
Create and activate a virtual environment:
On Windows:
python -m venv venv
venv\Scripts\activate
On macOS/Linux:
python -m venv venv
source venv/bin/activate
Install the required dependencies:
pip install -r subzero_agent/requirements.txt
Setting Up API Keys
For the full demo that uses the Agno framework and Claude model, you'll need to set up an API key:
Copy the example .env file:
cp subzero_agent/.env.example .env
Edit the .env file and replace your_api_key_here with your actual Anthropic API key:
Alternatively, you can create the .env file manually in the root directory of the project.
Usage
Running the Demo
There are two demo options available:
Simple Demo (No Dependencies)
To see a simplified demonstration of the Absolute Zero paradigm without any dependencies:
cd subzero_agent
python simple_demo.py
This will show examples of:
Task proposal for each reasoning mode
Task solving for each reasoning mode
A simulated self-play iteration
Full Demo (Requires Agno Framework)
To run the full SubZero agent demonstration (requires the Agno framework and API keys):
cd subzero_agent
python demo.py
This will demonstrate:
Task proposal for each reasoning mode
Task solving for each reasoning mode
A simplified self-play iteration
Using the SubZero Agent
To use the SubZero agent in your own code:
from subzero_agent import SubZeroAgent
# Create the SubZero agent
agent = SubZeroAgent()
# Run a self-play iteration
iteration_metrics = agent.run_self_play_iteration(num_tasks=5)
# Demonstrate the agent
agent.demonstrate(num_iterations=3, tasks_per_iteration=2)
Implementation Details
Proposer Role
The proposer role is responsible for generating reasoning tasks that maximize learning potential. It:
Receives reference examples from the task buffer
Proposes a new task that is different from the examples
Receives a reward based on the learnability of the task
Solver Role
The solver role is responsible for solving the proposed tasks. It:
Receives a task from the proposer
Applies systematic reasoning to solve the task
Receives a reward based on the correctness of the solution
Learning Mechanism
In a full implementation of the Absolute Zero paradigm, both the proposer and solver roles would be trained using reinforcement learning, with rewards based on:
Proposer Reward: Encourages tasks of appropriate difficulty (neither too easy nor impossible)
Solver Reward: Binary reward based on solution correctness
This implementation provides a simplified demonstration of the paradigm without the full reinforcement learning component.
Relation to the Absolute Zero Paper
This implementation is inspired by the Absolute Zero paradigm described in the paper, but is simplified for demonstration purposes. The key concepts demonstrated include:
Self-contained learning: The agent proposes and solves its own tasks without external data
Three reasoning modes: Deduction, abduction, and induction as complementary learning signals
Code as the environment: Using code execution for task validation and solution verification
Dual roles: The proposer and solver roles working together to improve reasoning capabilities
For a full understanding of the Absolute Zero paradigm, please refer to the original paper.
Demo Output
Below is the output from running the simple demo, which demonstrates the Absolute Zero paradigm in action: