bdh README

项目的 README,来自 github.com/pathwaycom/bdh。合并为一个 markdown 文件:README.md。

Dragon Hatchling (BDH): Post-Transformer AI architecture

BDH (Dragon Hatchling) is a Post-Transformer AI architecture developed by Pathway, a frontier AI lab. The BDH architecture makes reasoning, memory and learning part of the model itself. The BDH explainer describes the architecture and its broader research direction.

This repository primarily includes a PyTorch implementation published with the original BDH paper that introduced the BDH architecture. You’ll find here a minimalistic language modeling example on the Tiny Shakespeare dataset.

Repo’s scope: Pathway’s research includes parametric memory, continual learning, and latent reasoning capabilities. The systems used for those results or their pretrained checkpoints are not included here. This toy example does not showcase how BDH models learn continually during inference or reproduce the breakthrough results published by Pathway.

Original paper · BDH explainer · BDH-CQ paper · ARC task generator · Installation

BDH-CQ: In-Context Learning with Recurrent Latent Reasoning

August 2026. We introduced BDH-CQ, a reasoning system built on the BDH architecture. It learns from demonstrations through recurrent memory, then works through the query in a structured, continuous latent space without generating a chain of thought.

On the public ARC-AGI-1 evaluation set, BDH-CQ, a 150-million-parameter reasoning model, achieved 29.5% pass@2 at a computed inference cost of $0.0007 per task, breaking the cost-efficiency frontier.

Separately, early pretraining experiments from 1B to 600B parameters showed that the BDH architecture follows scaling laws similar to those of Transformers while preserving its recurrent latent reasoning capabilities. See Section 9.2 of the BDH-CQ paper.

ARC-AGI-1 score versus computed inference cost per task, highlighting BDH-CQ at 29.5% pass@2 and $0.0007 per task.

ARC-AGI-1 score versus computed cost per task. Data points were collected from the official ARC Prize leaderboard on August 4, 2026. The mark at the left margin indicates the 29.5% pass@2. The point breaks through the previously reported cost and accuracy Pareto frontier and establishes a new state of the art in ARC-AGI-1 cost efficiency.

Read the BDH-CQ research article · Read the paper

Overview of the Dragon Hatchling (BDH) architecture

Dragon Hatchling (BDH) is a Post-Transformer AI architecture. It represents a scale-free, locally interacting network of neurons. Its GPU formulation connects this graph view to efficient tensor computation. The graph can be recovered and inspected, and trained models exhibit interpretable synapses, sparse activity, and Transformer-like scaling.

Key properties:

BDH paper: The Dragon Hatchling: The Missing Link between the Transformer and Models of the Brain, A. Kosowski, P. Uznański, J. Chorowski, Z. Stamirowska, and M. Bartoszkiewicz (2025).

Architecture

BDH GPU layer showing neuron activations, learned matrices, and linear attention.

Figure: Architecture illustration for the original BDH model and its GPU formulation, from the September 2025 research.

Relation to Transformers

Comparison of Transformer, BDH-GPU, graph BDH, and brain models across attention mechanisms, local dynamics, and feed-forward networks.

BDH and the Transformer share attention-inspired computation; however, BDH’s graph-based architecture makes its attention emerge naturally from neuron-level interactions, reflecting attention as seen in biological systems. The architecture derivation explains the relationship between the graph model and the tensor formulation.

How BDH differs from the Transformer architecture

Dimension BDH Transformer
Attention Synaptic memory with linear attention Attention normalized with softmax
Key and query representation Neuron activity in a large, sparse space Dense keys and queries in a smaller space
Retrieval interpretation Lookup interpreted through locality-sensitive hashing Search interpreted through approximate nearest neighbors
Runtime memory Synaptic state of fixed size; context has no fixed length boundary but is limited by information capacity A token-indexed KV cache that grows as the sequence gets longer
Activations Sparse vectors with non-negative entries Dense activation vectors
Hardware bridge A graph represented implicitly through low-rank tensor operations Dense tensor operations directly

Source: BDH explainer, Chapter 2.

Earlier research: Sudoku Extreme

In March 2026, Pathway reported 97.4% accuracy on Sudoku Extreme using its internal BDH implementation, without chain of thought, solution backtracking, or external tools.

Installation and Training

Run the following from the repository directory:

# Install dependencies
pip install -r requirements.txt

# Train the toy implementation on a toy dataset
python train.py

The example trains a small language model on tiny Shakespeare. It is an entry point for studying the original architecture paper.

Learn and Discuss

Community Projects

Acknowledgements

We thank Andrej Karpathy for the nanoGPT code and the tiny Shakespeare dataset used in this demonstration.

License

The code in this repository is available under the MIT license.

bdh (pathwaycom/bdh)

正在搜索数据库…

3.6K ·GitHub
这是什么?BDH(Dragon Hatchling,幼龙)是一种受生物学启发的大语言模型架构,它把深度学习与神经科学联系起来,旨在从单个神经元相互作用的层面解释 AI 系统中的推理和泛化能力是如何涌现的。
这是可下载的预训练模型,还是架构的源代码?这是实现论文所述 BDH 架构的官方源代码,不是可下载的预训练检查点;训练和实验需要你自己进行。
这个仓库能复现那个著名的 97.4% 数独结果吗?不能。已发表的 97.4% Sudoku Extreme 结果来自 Pathway 内部的 BDH 实现;这个开源仓库只包含基线变体,开箱并不能复现该基准成绩。
是什么让 BDH 比标准 Transformer 更可解释?BDH 使用具有兴奋/抑制动力学和赫布式工作记忆的局部相互作用神经元粒子,产生稀疏、正向、单语义的激活,这与标准 Transformer 不透明的注意力模式形成对比。
BDH 的性能与 GPT-2 规模的 Transformer 相比如何?在 10M 到 1B 的同等参数量下,BDH 在语言和翻译任务上的实测表现与 GPT-2 规模的 Transformer 相当,同时遵循相似的缩放定律。
Pathway 为什么构建 BDH,而不是直接用 Transformer?作者认为逐 token 处理的 Transformer 难以胜任数独这类重搜索、非语言的推理任务,因此 BDH 被设计成一个通用推理系统,拥有更大的潜空间和内在记忆,能够跨领域工作而无需思维链。
BDH 有社区分支或移植版本吗?有,社区项目包括 Burn 框架移植版(mosure/burndragonhatchling)、MLX 移植版(severian42/bdh),以及增加动态词表和有状态注意力的分支(adamskrodzki/bdh)。
大小
1 MB
星标
3.6K
更新
提交Nov 06
时长
1年
提交 · 90 天