Skip to content
DivyamTalwarPublic

About

Hierarchical Reasoning Through Synchronized Neural Architecture

Resources

Stars

7 stars

Watchers

0 watching

Forks

Repository files navigation

SYNAPTIC

SYNAPTIC is a compact research prototype for hierarchical recurrent reasoning. It contains two transformer reasoning modules operating at different update rates, one-step-gradient recurrence, deep supervision, optional adaptive halting experiments, and simple Sudoku/maze/ARC tensor adapters.

Important

This repository does not currently ship trained checkpoints, datasets, or reproduced benchmark results. Previous claims such as “GPT-4-level reasoning,” 97.3% Sudoku, 71.4% ARC, or 1,000 tokens/s CPU were not supported by artifacts in this repository and have been removed. Treat SYNAPTIC as an experimental implementation, not a validated model release.

The architecture is inspired by the Hierarchical Reasoning Model (HRM) and its official implementation. SYNAPTIC is not the official HRM code or paper.

Implemented surface

  • paired high-level and low-level recurrent transformer modules
  • rotary positional encoding and RMSNorm
  • one-step-gradient recurrence and deep supervision
  • experimental Q-based halting head
  • Sudoku, maze, and ARC encoders/decoders
  • training, solve, analyze, and benchmark CLI commands
  • checkpoint save/load

Features not present in the code are not advertised here. In particular there is no batch solver, TensorBoard integration, mixed-precision trainer, visualization package, custom-task plugin API, or published multitask trainer.

Install

Python 3.10+ is required.

python -m venv .venv
source .venv/bin/activate
pip install -e ".[test]"
pytest

Dataset contract

Training and benchmark data must be a non-empty JSON list:

[
  {
    "input": [[0, 2], [1, 0]],
    "target": [[3, 2], [1, 3]]
  }
]

Dataset loading is fail-closed: a missing or malformed path raises an error and is never replaced with random data. Spatial augmentation is applied jointly to input and target.

CLI

python synaptic.py train --data data/train.json --val-data data/val.json --task sudoku --epochs 10
python synaptic.py solve --model checkpoint.pt --problem puzzle.npy --task sudoku --augmentation 1
python synaptic.py analyze --model checkpoint.pt --problem puzzle.npy --task sudoku
python synaptic.py benchmark --model checkpoint.pt --data data/test.json --task sudoku

Attention backend

Attention uses PyTorch scaled dot-product attention (SDPA) by default, allowing the runtime to choose an efficient kernel without introducing a custom unverified kernel. Set SYNAPTIC_ATTENTION_BACKEND=manual to select the explicit reference implementation. The reference path is maintained for numerical parity tests, not as a performance promise.

Run the local, hardware-specific comparison with:

python benchmarks/attention.py --device cpu --iterations 50

Report both latency and, on CUDA, peak allocated memory. CI only establishes numerical parity; it does not claim a universal speedup.

Benchmark metrics

The benchmark reports both cell_accuracy and exact_match_rate. For Sudoku it additionally reports constraint_valid_rate, requiring every row, column, and 3×3 box to contain 1–9 exactly once and requiring original clues to remain unchanged. ARC success is exact grid match. Maze currently has exact/cell metrics only; path connectivity is not yet claimed.

These metrics make an evaluation interpretable, but do not make it reproducible on their own. Published reports must still include dataset provenance and checksums, checkpoint/configuration, hardware/software, raw predictions, and at least three seeds.

Development

CI compiles the module and runs dataset/augmentation regression tests on Python 3.11. Contributions should add a failing test before changing recurrence, halting, augmentation, or task metrics.

License

MIT. See LICENSE.

About

Hierarchical Reasoning Through Synchronized Neural Architecture

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages