The Cerebros package is an ultra-precise Neural Architecture Search (NAS) / AutoML that is intended to much more closely mimic biological neurons than conventional neural network architecture strategies.
28
stars
277
commits
Jupyter Notebook
primary language
Jul 20, 2026
updated

The Cerebros package is an ultra-precise Neural Architecture Search (NAS) / AutoML that is intended to much more closely mimic biological neurons than conventional Multi Layer Perceptron based neural network architecture search strategies.
The Cerebros community edition provides an open-source minimum viable single parameter set NAS and also provides an example manifest for an exhaustive Neural Architecture Search to run on Kubeflow/Katib. This is licensed for free use provided that the use is consistent with the ethical use provisions in the license described at the bottom of this page. You can easily reproduce this with the Jupyter notebook in the directory /kubeflow-pipeline, using the Kale Jupyter notebook extension. For a robust managed neural architecture search experience hosted on Google Cloud Platform and supported by our SLA, we recommend Cerebros Enterprise, our commercial version. Soon you will be able to sign up and immediately start using it at https://www.cerebros.one. In the meantime, we can set up your own Cerebros managed neural architecture search pipeline for you with a one business day turnaround. We offer consulting, demos, full service machine learning service and can provision you with your own full neural architecture search pipeline complete with automated Bayesian hyperparameter search. Contact David Thrower:david@cerebros.one or call us at (US country code 1) (239) 645-3585. Additionally, we can complete machine learning tasks for your organization. Give us a call.
A biological brain looks like this:

Multi layer perceptrons look like this:

If the goal of MLPs was to mimic how a biological neuron works, why do we still build neural networks that are structurally similar to the first prototypes from 1989? At the time, it was the closest we could get, but both hardware and software have changed since.
In a biological brain, neurons connect in a multi-dimensional lattice of vertical and lateral connections, which may repeat. Why don't we try to mimic this? In recent years, we got a step closer to this by using single skip connections, but why not simply randomize the connectivity to numerous levels in the network's structure altogether and add lateral connections that overlap like a biological brain? (We presume God knew what He was doing, so why re-invent the wheel.)
That is what we did here. We built a neural architecture search that connects Dense layers in this manner.
What if we made a multi-layer perceptron that looks like this: (Green triangles are Keras Input layers. Blue Squares are Keras Concatenate layers. The Pink stretched ovals are Keras Dense layers. The one stretched red oval is the network's Output layer. It is presumed that there is a batch normalisation layer between each Concatenate layer and the Dense layer it feeds into.)

... or what if we made one like this:

and like this

What if we made a single-layer perceptron that looks like this:

The deeper technical details can be found here:
shell:
Clone the repo
git clone https://github.com/david-thrower/cerebros-core-algorithm-alpha.git
cd into it
cd cerebros-core-algorithm-alpha
install all required packages
pip3 install -r requirements.txt
Run the Ames housing data example:
python3 regression-example-ames-no-preproc.py
... # lots of summaries of training trials
...
metric_to_rank_by is: 'val_root_mean_squared_error'
Type of metric_to_rank_by is: <class 'str'>
Best result this trial was: 24866.931640625
Type of best result: <class 'float'>
Best model name: 2025_08_19 20_31_cerebros_auto_ml_test_meta_0/models/tr_0000000000000001_subtrial_0000000000000000.keras
...
For further details, see
Recent updates replaced the text embedding base model with an interleaved Rotary Positional Embedding (iRoPE) in the text-classification proof of concept. This change allows the model to handle longer sequences without the quadratic slow-down common to many transformer architectures.
Benchmarks show that training time grows in proportion to sequence length, while validation accuracy stays stable:
| seq_len | val_binary_accuracy | min/model | total_min | timing_relative_to_1024 | commit |
|---|---|---|---|---|---|
| 3072 | 0.955 | 65.942 | 329.715 | 2.817 | 4bc217b |
| 1536 | 0.960 | 37.270 | 186.360 | 1.591 | 286ba81 |
| 1024 | 0.952 | 23.420 | 117.080 | 1.000 | 9893bfc |
The timing_relative_to_1024 column is calculated as min/model(seq_len) / min/model(1024).
For examale, 1024 to 3072 tokens is roughly x3 in sequence length and x2.82 in time, which is close to linear scaling once fixed overhead is considered.
This outcome follows earlier work on more scalable tokenisation, RoPE/iRoPE integration, and related performance fixes.
The script train_a_generative_llm.py demonstrates how to train a custom, generative Large Language Model (LLM) using the Cerebros AutoML engine. The resulting model, which we call "Cerebros NotGPT", is trained from scratch with a neural architecture discovered by Cerebros, not based on a pre-existing LLM like GPT 4 or Llama. It is sub-quadratic in both inference and training modes.
Stage I-a (Neural Architecture Search): Cerebros rapidly searches for an optimal, biologically-inspired neural network architecture using a very small dataset. Stage I-b (Full Training): The best architecture found in Stage I-a is then trained on a larger dataset.
This script is easily scalable to run on a larger data set (we have tested it much larger sets on our own machine), but in this vanilla demo run in the Github Actions Workflows runner (4CPU / 16GB RAM), this is training on a total of 30 samples. Run as - is, it is a vanilla demo.
The prepare_data function from cerebrosllmutils.llm_utils implements a sliding window to create next-token prediction tasks. For a given text sequence, it creates multiple training samples:
Sample 1: Input: [token_1], Label: [token_2]
Sample 2: Input: [token_1, token_2], Label: [token_3]
...and so on. (padded to max_sequence_length with the tokenizer’s padding token)
This process, called "sample expansion", turns a small amount of raw text into a large number of training examples. For Stage I-a: this is applied to the entire small data set used in - memory. Stage I-b, a SampleExpansionGenerator, a streaming tf.data.Dataset is used to perform this expansion in batches, so RAM is not a bottleneck when training with larger datasets (Keep in mind, the sample expansion preprocessing turns a few MB of text into GB of tensors, so we do this preprocessing in batches). The number preprocessed at once is controlled by the parameter: PHASE_I_B_SAMPLE_EXPANSION_BATCH_SIZE
pip install -r requirements.txt then pip install -r cicd-requirements.txtpython3 train_a_generative_llm.pyThe script is configured via constants defined at the top. Here are the most important groups:
Licnse terms may be amended at any time as deemed necessry at Cerebros sole discretion.
Jupyter Notebook
92.0%
Python
8.0%
The Cerebros package is an ultra-precise Neural Architecture Search (NAS) / AutoML that is intended to much more closely mimic biological neurons than conventional neural network architecture strategies.
28
stars
277
commits
Jupyter Notebook
primary language
Jul 20, 2026
updated

The Cerebros package is an ultra-precise Neural Architecture Search (NAS) / AutoML that is intended to much more closely mimic biological neurons than conventional Multi Layer Perceptron based neural network architecture search strategies.
The Cerebros community edition provides an open-source minimum viable single parameter set NAS and also provides an example manifest for an exhaustive Neural Architecture Search to run on Kubeflow/Katib. This is licensed for free use provided that the use is consistent with the ethical use provisions in the license described at the bottom of this page. You can easily reproduce this with the Jupyter notebook in the directory /kubeflow-pipeline, using the Kale Jupyter notebook extension. For a robust managed neural architecture search experience hosted on Google Cloud Platform and supported by our SLA, we recommend Cerebros Enterprise, our commercial version. Soon you will be able to sign up and immediately start using it at https://www.cerebros.one. In the meantime, we can set up your own Cerebros managed neural architecture search pipeline for you with a one business day turnaround. We offer consulting, demos, full service machine learning service and can provision you with your own full neural architecture search pipeline complete with automated Bayesian hyperparameter search. Contact David Thrower:david@cerebros.one or call us at (US country code 1) (239) 645-3585. Additionally, we can complete machine learning tasks for your organization. Give us a call.
A biological brain looks like this:

Multi layer perceptrons look like this:

If the goal of MLPs was to mimic how a biological neuron works, why do we still build neural networks that are structurally similar to the first prototypes from 1989? At the time, it was the closest we could get, but both hardware and software have changed since.
In a biological brain, neurons connect in a multi-dimensional lattice of vertical and lateral connections, which may repeat. Why don't we try to mimic this? In recent years, we got a step closer to this by using single skip connections, but why not simply randomize the connectivity to numerous levels in the network's structure altogether and add lateral connections that overlap like a biological brain? (We presume God knew what He was doing, so why re-invent the wheel.)
That is what we did here. We built a neural architecture search that connects Dense layers in this manner.
What if we made a multi-layer perceptron that looks like this: (Green triangles are Keras Input layers. Blue Squares are Keras Concatenate layers. The Pink stretched ovals are Keras Dense layers. The one stretched red oval is the network's Output layer. It is presumed that there is a batch normalisation layer between each Concatenate layer and the Dense layer it feeds into.)

... or what if we made one like this:

and like this

What if we made a single-layer perceptron that looks like this:

The deeper technical details can be found here:
shell:
Clone the repo
git clone https://github.com/david-thrower/cerebros-core-algorithm-alpha.git
cd into it
cd cerebros-core-algorithm-alpha
install all required packages
pip3 install -r requirements.txt
Run the Ames housing data example:
python3 regression-example-ames-no-preproc.py
... # lots of summaries of training trials
...
metric_to_rank_by is: 'val_root_mean_squared_error'
Type of metric_to_rank_by is: <class 'str'>
Best result this trial was: 24866.931640625
Type of best result: <class 'float'>
Best model name: 2025_08_19 20_31_cerebros_auto_ml_test_meta_0/models/tr_0000000000000001_subtrial_0000000000000000.keras
...
For further details, see
Recent updates replaced the text embedding base model with an interleaved Rotary Positional Embedding (iRoPE) in the text-classification proof of concept. This change allows the model to handle longer sequences without the quadratic slow-down common to many transformer architectures.
Benchmarks show that training time grows in proportion to sequence length, while validation accuracy stays stable:
| seq_len | val_binary_accuracy | min/model | total_min | timing_relative_to_1024 | commit |
|---|---|---|---|---|---|
| 3072 | 0.955 | 65.942 | 329.715 | 2.817 | 4bc217b |
| 1536 | 0.960 | 37.270 | 186.360 | 1.591 | 286ba81 |
| 1024 | 0.952 | 23.420 | 117.080 | 1.000 | 9893bfc |
The timing_relative_to_1024 column is calculated as min/model(seq_len) / min/model(1024).
For examale, 1024 to 3072 tokens is roughly x3 in sequence length and x2.82 in time, which is close to linear scaling once fixed overhead is considered.
This outcome follows earlier work on more scalable tokenisation, RoPE/iRoPE integration, and related performance fixes.
The script train_a_generative_llm.py demonstrates how to train a custom, generative Large Language Model (LLM) using the Cerebros AutoML engine. The resulting model, which we call "Cerebros NotGPT", is trained from scratch with a neural architecture discovered by Cerebros, not based on a pre-existing LLM like GPT 4 or Llama. It is sub-quadratic in both inference and training modes.
Stage I-a (Neural Architecture Search): Cerebros rapidly searches for an optimal, biologically-inspired neural network architecture using a very small dataset. Stage I-b (Full Training): The best architecture found in Stage I-a is then trained on a larger dataset.
This script is easily scalable to run on a larger data set (we have tested it much larger sets on our own machine), but in this vanilla demo run in the Github Actions Workflows runner (4CPU / 16GB RAM), this is training on a total of 30 samples. Run as - is, it is a vanilla demo.
The prepare_data function from cerebrosllmutils.llm_utils implements a sliding window to create next-token prediction tasks. For a given text sequence, it creates multiple training samples:
Sample 1: Input: [token_1], Label: [token_2]
Sample 2: Input: [token_1, token_2], Label: [token_3]
...and so on. (padded to max_sequence_length with the tokenizer’s padding token)
This process, called "sample expansion", turns a small amount of raw text into a large number of training examples. For Stage I-a: this is applied to the entire small data set used in - memory. Stage I-b, a SampleExpansionGenerator, a streaming tf.data.Dataset is used to perform this expansion in batches, so RAM is not a bottleneck when training with larger datasets (Keep in mind, the sample expansion preprocessing turns a few MB of text into GB of tensors, so we do this preprocessing in batches). The number preprocessed at once is controlled by the parameter: PHASE_I_B_SAMPLE_EXPANSION_BATCH_SIZE
pip install -r requirements.txt then pip install -r cicd-requirements.txtpython3 train_a_generative_llm.pyThe script is configured via constants defined at the top. Here are the most important groups:
Licnse terms may be amended at any time as deemed necessry at Cerebros sole discretion.
Jupyter Notebook
92.0%
Python
8.0%