Home
Overview
GIAANNpy is a research codebase for the GIAANN project, focused on large-scale neural computation and concept-column organization.
https://github.com/bairesearch/GIAANNpy
Install
common
conda create -n pytorchsenv
source activate pytorchsenv
conda install python=3.12
python -m pip install --upgrade pip
pip install networkx
pip install matplotlib
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
datasetsLibrary4plus=False: pip install "datasets<4" "fsspec==2024.6.1" "gcsfs==2024.6.1"
modality NLP
pip install spacy
python -m spacy download en_core_web_sm [spacyModelName]
pip install nltk
modality OR (dev only)
pip install opencv-python
pip install git+https://github.com/facebookresearch/segment-anything.git [if modalityORfeatureDetectionSAMversion==1]
pip install git+https://github.com/facebookresearch/sam2.git [if modalityORfeatureDetectionSAMversion==2]
pip install git+https://github.com/facebookresearch/sam3.git [if modalityORfeatureDetectionSAMversion==3]
hf auth login [if modalityORfeatureDetectionSAMversion==3 and modalityORfeatureDetectionSAM3checkpoint==""]
Usage
- Run the prototype from the
protodirectory.source activate pytorchsenv python GIAANNcmn_main.py
Algorithm
GIA ANN is a General Intelligence Algorithm Artificial Neural Network (a neural network implementation of GIA).
GIA ANN Prototype (“proto”) is a language model.
Train
GIA ANN creates an entirely excitatory database network formed by feature neurons in columns. Upon reading a sequence during training or inference (prompt/seed) it identifies relevant concept columns, segmenting the sequence into these columns. It assigns the tokens of the trained sequence (or prompt/seed) to extant or new feature neurons in the network columns. It then forms connections between the columns.
Typically the neurons in GIA ANN are segmented into compartments (SANI: Sequentially/Segmentally Activated Neuronal Input), have multiple branches (dendrites), and are sensitive to the timing of their activated segments.



Inference
GIA ANN seeds the prompt provided and sequentially predicts next features in the network.

Features
GIA ANN is designed to be a biologically feasible algorithm, and exhibits these properties;
- inductive bias for reasoning (generalisation from concepts).
- training speed (number of experience samples required).
- online learning (unbatched, limited precise short term memory; store in network activations themselves).
- continual learning (dynamic update of network knowledge without compromising prior learning).
- unlimited context windows.
- biologically feasible circuitry and learning algorithm (no backpropagation).
- robustness to hallucination.
It likewise supports a number features of classical artificial neural networks such as autoregressive training/prediction and reinforcement learning.
Configuration
All settings are located in proto/GIAANN*_globalDefs.py.
See the repository README for a summary of the main options.
Train/inference mode selection
Quick execution (demo)
For quick execution (train and inference);
- set
useQuickExecution = True
This will;
- automatically set
executionMode="inference"andinferenceTrainFirstSequences=True - train the database using all sequences in
"database/inference_prompt.txt.trainAndInference"except for the last (*numSentencesPerSequence) sequences, and then; - perform inference on the last (
*numSentencesPerSequence) sequences.
The database/inference_prompt.txt.trainAndInference provided is taken from the first sentences from the first article of the dataset (Wikipedia).
Standard execution
For standard execution (train or inference);
- set
useDefault = True - set
executionMode="train"to train the network from a huggingface dataset (e.g. Wikipedia/OSCAR-2201), or; - set
executionMode="inference"to perform inference on a seeded prompt (prompt_inference.txt.*)
See the repository README for more configuration details.
Development
- Review the GIAANNproto1.nlc specification for GIAANNpy requirements and design notes.
Paper
Read the current paper draft here: GIAANN paper (GIAANN-paper-WIP.pdf).
Blog
ML community statements are released on the blog: GIAANN blog.