Shared predictive substrate kernel for reusable model primitives and descendant systems.
Project description
Decepticons
Website · Architecture · Kernel matrix · Examples · Related work
O(n) attention is deception. A backend-neutral kernel of predictive primitives — substrates, memory, gating, routing, readouts — that downstream systems combine into trained models without forking the kernel itself.
decepticons is the shared mechanism layer for predictive descendants. It
extracts the reusable parts (substrate dynamics, controller summaries, memory
primitives, feature views, readouts, runtime helpers) from a broader experiment
family so downstream systems can specialize without forking the kernel.
Install
Python ≥ 3.11. Numpy is the only hard dependency for the kernel.
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
For the model backends:
pip install -e ".[torch]" # PyTorch CausalBankModel + routed readouts
pip install -e ".[metal]" # Apple MLX backend
Quickstart
from decepticons import ByteCodec, ByteLatentPredictiveCoder
text = "predictive coding likes repeated structure.\n" * 64
model = ByteLatentPredictiveCoder()
report = model.fit(text)
prompt = ByteCodec.encode_text("predictive ")
sample = model.generate(prompt, steps=40, greedy=True)
print(report.train_bits_per_byte)
print(ByteCodec.decode_text(sample))
CLI:
decepticons fit --input ./corpus.txt --prompt "predictive " --generate 80
A complete worked example lives in
examples/quickstart.py. For descendant-shaped
projects, see examples/projects/.
What's in the kernel
| Area | Highlights |
|---|---|
| Substrates | recurrent, delay, linear-memory, oscillatory, mixed, hierarchical |
| Control | controller summaries, pathway gates, summary routing, hormone modulation, predictive surprise |
| Memory | exact-context, n-gram, statistical-backoff, online n-gram, cache views |
| Views | byte-latent, hierarchical, linear-memory, sampled multiscale, bridge features, probability diagnostics |
| Readouts | ridge, frozen-readout expert, sampled multiscale, GRU recurrent, routed squared-ReLU |
| Adapters | causal predictive, oracle analysis, bridge export, noncausal reconstructive, paired teacher/export |
| Runtime | traces, fit reports, rollout evaluation, transfer probes, train-mode checkpoints, artifact accounting |
| Causal-bank | family metadata + deterministic substrate construction (frozen / learnable-decays / learnable-mixing / learned-recurrence / gated-retention) |
| Backends | numpy-only kernel; PyTorch and MLX CausalBankModel implementations |
Full capability matrix: docs/kernel_matrix.md.
Architecture
decepticons ──→ chronohorn ──→ heinrich
kernel runtime evidence / audit
(this repo) training, fleet model forensics
Three layers inside this repo:
- Kernel —
src/decepticons/. Public package. Reusable mechanisms only. - Project descendants —
examples/projects/. Pressure-tests the kernel boundary with concrete descendant shapes (causal · oracle · bridge · noncausal · byte-latent). - Tooling —
examples/tools/. Development and analysis scripts. Not part of the public package.
Code moves into src/ only when all three hold:
- it is a mechanism, not a project policy
- at least two descendants want the same thing
- the generalized API is simpler than keeping the duplication
This rule is the main defense against turning the kernel into a renamed
collection of branches. Full detail in
docs/architecture.md and the boundary against the
runtime in docs/chronohorn_boundary.md.
Causality is verified
All substrate modes are verified by
tests/test_causality.py. The test feeds two
identical sequences up to position t, different after t. If logits at
position t differ, causality is violated and CI fails. Modes verified:
frozen, learnable_mixing, learnable_decays, selective scan augment
(state_dim > 0), readout_bands, routed experts.
The dependency firewall — that decepticons never imports its descendants — is
enforced by an AST scan in
tests/test_dependency_firewall.py.
Docs
docs/architecture.md— package map, three-layer model, promotion ruledocs/kernel_matrix.md— capability matrixdocs/chronohorn_boundary.md— boundary against the runtime descendantdocs/downstream_patterns.md— causal, noncausal, oracle, bridge, byte-latent patternsdocs/related_work.md— research anchors and prior artdocs/landscape.md— ecosystem snapshot (March 2026)docs/lineage.md— source attributionexamples/README.md— example descendants and toolingtests/README.md— verification surface
Scope
This is a research kernel and reference implementation. The current pressure from descendants is O(n) causal-bank architecture search — cheap ablation lanes to separate mechanisms before promotion, with scale and context survival checked in the descendant runtime.
It is not a frontier runtime, a production compression stack, or a benchmark claim. It exists to keep the shared mechanism layer reusable and legible.
Contributing
See CONTRIBUTING.md. Issues and pull requests welcome.
License
MIT — see LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file decepticons-0.1.0.tar.gz.
File metadata
- Download URL: decepticons-0.1.0.tar.gz
- Upload date:
- Size: 178.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82eda817f9b7a9314d01d11ba90b53da7d7fa17de44b9c6a78e25a0637fdb16b
|
|
| MD5 |
5c6c847dc12218548f8416740b90ca2f
|
|
| BLAKE2b-256 |
c555ef7b03fc54cc50d4d6af01edb2e56dc7a25e406362f189c5072e9c50025c
|
Provenance
The following attestation bundles were made for decepticons-0.1.0.tar.gz:
Publisher:
release.yml on asuramaya/decepticons
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
decepticons-0.1.0.tar.gz -
Subject digest:
82eda817f9b7a9314d01d11ba90b53da7d7fa17de44b9c6a78e25a0637fdb16b - Sigstore transparency entry: 1417217883
- Sigstore integration time:
-
Permalink:
asuramaya/decepticons@38ff65cf1ff406e31cc0a5d994b7111b31619223 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/asuramaya
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@38ff65cf1ff406e31cc0a5d994b7111b31619223 -
Trigger Event:
push
-
Statement type:
File details
Details for the file decepticons-0.1.0-py3-none-any.whl.
File metadata
- Download URL: decepticons-0.1.0-py3-none-any.whl
- Upload date:
- Size: 156.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
acec3b018981b9ecc7e35abbb23390eb5535c38cc0a908fbac0655662a5ad215
|
|
| MD5 |
eacf8e5a0329d268a31359deb356c083
|
|
| BLAKE2b-256 |
f0442440d938f99584e77509dd3487dd14c0f0bb6b2a573379dc0b728e5ff6cf
|
Provenance
The following attestation bundles were made for decepticons-0.1.0-py3-none-any.whl:
Publisher:
release.yml on asuramaya/decepticons
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
decepticons-0.1.0-py3-none-any.whl -
Subject digest:
acec3b018981b9ecc7e35abbb23390eb5535c38cc0a908fbac0655662a5ad215 - Sigstore transparency entry: 1417217884
- Sigstore integration time:
-
Permalink:
asuramaya/decepticons@38ff65cf1ff406e31cc0a5d994b7111b31619223 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/asuramaya
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@38ff65cf1ff406e31cc0a5d994b7111b31619223 -
Trigger Event:
push
-
Statement type: