Skip to main content

A backend-neutral kernel of predictive primitives for descendant systems.

Project description

Decepticons

Decepticons

PyPI CI License: MIT Python Status

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: substrate dynamics, controller summaries, memory primitives, feature views, readouts, and runtime helpers extracted 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.

pip install decepticons

For the model backends:

pip install "decepticons[torch]"   # PyTorch CausalBankModel + routed readouts
pip install "decepticons[metal]"   # Apple MLX backend

For development from source:

git clone https://github.com/asuramaya/decepticons
cd decepticons
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[test]"
pytest -v

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          forensics
 (this repo)   training · fleet   geometry · audit

Three layers inside this repo:

  1. Kernelsrc/decepticons/. Public package. Reusable mechanisms only.
  2. Project descendantsexamples/projects/. Pressure-tests the kernel boundary with concrete descendant shapes (causal · oracle · bridge · noncausal · byte-latent).
  3. Toolingexamples/tools/. Development and analysis scripts. Not part of the public package.

Code moves into src/ only when all three hold:

  1. It is a mechanism, not a project policy.
  2. At least two descendants want the same thing.
  3. 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: it 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.

decepticons never imports its descendants — enforced by an AST scan in tests/test_dependency_firewall.py.

Docs

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

decepticons-0.1.1.tar.gz (186.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

decepticons-0.1.1-py3-none-any.whl (156.5 kB view details)

Uploaded Python 3

File details

Details for the file decepticons-0.1.1.tar.gz.

File metadata

  • Download URL: decepticons-0.1.1.tar.gz
  • Upload date:
  • Size: 186.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for decepticons-0.1.1.tar.gz
Algorithm Hash digest
SHA256 205135f3cf62c022ebfe92c25b8fba7e8818137f768abf1a8121879d67654153
MD5 93bcc9b196efd5eb67704d9ec20213b8
BLAKE2b-256 51ad033caf7a128e799feead646ea887194fa85c39fa93642d4f7a07a0d2084e

See more details on using hashes here.

Provenance

The following attestation bundles were made for decepticons-0.1.1.tar.gz:

Publisher: release.yml on asuramaya/decepticons

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file decepticons-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: decepticons-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 156.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for decepticons-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cdc524d35e9bcb2c0562f10bbac608886d1411a8daac7240c80a676bfa42c6e7
MD5 5688c43950cc7d6211adfbcd8136490b
BLAKE2b-256 d0675b7af14f963c7c986e60edab342a90b07903c1a2486d093e7163c431ec48

See more details on using hashes here.

Provenance

The following attestation bundles were made for decepticons-0.1.1-py3-none-any.whl:

Publisher: release.yml on asuramaya/decepticons

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page