All chapters

The DOGMA Architecture

DOGMA — The Six-Stage Pipeline

Chapter 751 min11,275 words

This chapter presents the central contribution of this book: DOGMA , the DNA-Organized Genomic Model Architecture . DOGMA is not an incremental improvement to the transformer. It is a fundamentally different way of organizing computation in an AI system—one inspired by three and a half billion years of biological in...

DOGMA Pipeline

Six local stages replace one monolithic attention operation

Advance through the canonical non-transformer computation from sequence to realized output.

Genome

Encode

HelixHash creates structural sequence representations.

G = H(sequence)
The Evolutor is NOT a better decoder. It is a genomic generator whose language output is just one downstream expression mode.
— DOGMA Design Manifesto

This chapter presents the central contribution of this book: DOGMA, the DNA-Organized Genomic Model Architecture. DOGMA is not an incremental improvement to the transformer. It is a fundamentally different way of organizing computation in an AI system—one inspired by three and a half billion years of biological information processing.

The core idea is simple but radical: an intelligent system should maintain a persistent, structured internal genome whose regions have distinct roles, activation patterns, and interaction semantics. Output is not the system itself. Output is the temporary expression of a deeper organized substrate.

In a standard large language model, everything—system instructions, retrieved context, latent plans, working memory, and output tokens—exists in a single undifferentiated token stream, processed by uniform attention blocks. DOGMA rejects this flattening. It proposes that capable intelligence requires the separation of persistent state from transient expression, just as biology separates the genome from the phenotype.

This chapter is organized as follows. We begin with the DOGMA thesis and motivation (§7.1), then define the genomic base—DOGMA’s atomic computational unit (§7.2). The heart of the chapter is a detailed walkthrough of the six-stage pipeline (§7.3), with each stage receiving its own dedicated section containing mathematical formulations, TikZ diagrams, worked examples, and complexity analysis. We then present a full architecture diagram (§7.5), the DogmaBlock pseudocode (§7.6), a detailed comparison with competing architectures (§7.7), and a complete worked example tracing data through all six stages (§7.8).

Architecture and Evidence Boundary

This chapter preserves the broader six-stage DOGMA design space, including historical attention-based proposals, so that students can compare mechanisms. Those proposals are not the canonical implementation evaluated in Chapter 14. The canonical 2026 research line forbids self-attention and transformer layers. Its communication path is overlapping tetra-memory, causal transcript convolution, optional parallel-scan state-space recurrence, bounded epigenetic memory, and sparse allosteric routing. A mechanism described here is not a result until code, checkpoint, data manifest, and frozen evaluation are identified.

7.1 The DOGMA Thesis

The DOGMA Principle

DOGMA (DNA-Organized Genomic Model Architecture) is a computational architecture in which:

1.
Internal state is a persistent genomic structure composed of typed bases and organized regions.
2.
Context determines selective activation of genomic regions (regulation).
3.
Active regions are assembled and modified under evolutionary pressure (synthesis).
4.
Selected information is read into task-specific intermediate representations (transcription).
5.
Intermediate representations are folded into structured behavior (expression).
6.
Structured behavior is rendered into modality-specific output (realization).

Language generation is one realization mode among several; the genome, not the output, is the primary computational object.

7.1.1 Why Current LLMs Are Structurally Limited

Before presenting DOGMA’s architecture, we must understand why a new architecture is needed. Current transformer-based LLMs, despite their impressive capabilities [Brown et al.2020Wei et al.2022a], share several structural limitations:

1.
No native region semantics. System prompts, user queries, retrieved documents, chain-of-thought reasoning, and generated output all occupy the same undifferentiated token stream. The model must learn implicit conventions to distinguish these roles—conventions that are fragile and unverifiable.
2.
Weak persistent organization. A transformer’s “knowledge” lives in its parameters (frozen after training) and its context window (bounded and transient). There is no intermediate state that persists across sessions while remaining modifiable.
3.
Dense uniform interaction. Self-attention computes pairwise interactions between all positions, even when most regions should remain silent. This is \(O(T^2)\) in sequence length \(T\)—biologically implausible and computationally wasteful for long sequences.
4.
Output-first bias. The canonical training objective (next-token prediction) optimizes text generation directly. There is no explicit intermediate “phenotype”—no structured representation of what the model intends to do before it starts producing tokens.
5.
No evolutionary self-modification. Once trained, a model’s parameters are fixed. It cannot modify its own computational structure in response to new tasks or environments without full retraining.

DOGMA addresses each limitation by drawing on biological precedent (Table 7.1).

Table 7.1: Structural comparison: Transformer LLMs vs. DOGMA.

Property

Transformer LLM

DOGMA

Internal state

Flat token sequence + static weights

Typed genomic structure with regions

Access pattern

Dense all-pairs attention \(O(T^2)\)

Sparse regulated activation

Persistent memory

Parameters (frozen) or context (bounded)

Genome + Tera regime + meta-policy

Output generation

Direct token prediction

Staged pipeline: regulate \(\to \) transcribe \(\to \) express \(\to \) realize

Self-modification

None (post-training)

Evolutionary synthesis with fitness criteria

Modality

Primarily text

Modality-agnostic realization

Biological analogue

Central Dogma of molecular biology

7.2 The Genomic Base: DOGMA’s Atomic Unit

The fundamental computational atom of DOGMA is the genomic base—a typed, weighted, compatibility-annotated element that carries more structure than a standard token embedding.

Definition 7.1 (Genomic Base). A genomic base is a 4-tuple: \begin {equation} b_i = (\sigma _i, \tau _i, \rho _i, \omega _i), \end {equation} where:

  • \(\sigma _i \in \mathbb {R}^d\) is the base embedding—the continuous vector representation of the base’s informational content (analogous to a token embedding, but enriched with type-specific structure).
  • \(\tau _i \in \{\mathsf {A}, \mathsf {C}, \mathsf {G}, \mathsf {T}\}\) is the base type, assigning one of four functional roles:

    • \(\mathsf {A}\) (Activation): bases that initiate or enable downstream computation.
    • \(\mathsf {C}\) (Composition): bases that combine, transform, or route information.
    • \(\mathsf {G}\) (Generation): bases that produce new content or expand state.
    • \(\mathsf {T}\) (Termination): bases that halt, bound, or complete a process.
  • \(\rho _i \in [0,1]^c\) is the compatibility vector—a \(c\)-dimensional vector encoding bonding potential, interaction affinity, and routing metadata. This determines which other bases this base can productively interact with.
  • \(\omega _i \in \mathbb {R}_{\ge 0}\) is the weight—a non-negative scalar indicating the base’s relative importance or expression strength in the current context.

7.2.1 Anatomy of a Genomic Base

To build intuition, let us examine each component in detail.

Table 7.2: The four components of a genomic base \(b_i = (\sigma _i, \tau _i, \rho _i, \omega _i)\) with dimensions, ranges, and biological analogues.

Component

Symbol

Dimension

Range / Domain

Biological Analogue

Base embedding

\(\sigma _i\)

\(\mathbb {R}^d\)

Continuous

Nucleotide chemical identity

Base type

\(\tau _i\)

Discrete

\(\{A, C, G, T\}\)

Purine/pyrimidine class

Compatibility

\(\rho _i\)

\(\mathbb {R}^c\)

\([0,1]^c\)

Hydrogen-bond donors/acceptors

Weight

\(\omega _i\)

\(\mathbb {R}\)

\([0, \infty )\)

Expression level

The base embedding \(\sigma _i\). This is the primary informational payload of the base. In the simplest case, \(\sigma _i\) is a learned embedding vector of dimension \(d\) (e.g., \(d = 512\) or \(d = 1024\)). Unlike a standard token embedding, \(\sigma _i\) is structured: the first \(d/4\) dimensions encode type-specific features, while the remaining dimensions encode content. This structure allows downstream operations to efficiently extract type information without separate lookups.

The base type \(\tau _i\). The discrete type tag partitions all bases into four functional classes. The type determines which computational pathways the base participates in and which complementary pairing rules apply. The complement mapping is: \begin {equation} \overline {\mathsf {A}} = \mathsf {T}, \quad \overline {\mathsf {T}} = \mathsf {A}, \quad \overline {\mathsf {C}} = \mathsf {G}, \quad \overline {\mathsf {G}} = \mathsf {C}. \label {eq:complement} \end {equation}

The compatibility vector \(\rho _i\). This vector governs inter-base interactions. Given two bases \(b_i\) and \(b_j\), their compatibility score is: \begin {equation} \mathrm {compat}(b_i, b_j) = \rho _i^\top \rho _j + \beta (\tau _i, \tau _j), \label {eq:compat} \end {equation} where \(\beta (\tau _i, \tau _j)\) is a learned type-pair bias. Complementary pairs (\(\mathsf {A}\)–\(\mathsf {T}\) and \(\mathsf {C}\)–\(\mathsf {G}\)) receive a positive bias; mismatches receive a negative bias or zero.

The weight \(\omega _i\). This scalar controls how strongly the base contributes to downstream computation. During the regulation stage (§7.3.3), weights are modulated by context. A weight of zero effectively silences the base.

The following TikZ diagram illustrates a single genomic base with all its components annotated.

Figure 7.1: Anatomy of a single genomic base \(b_i = (\sigma _i, \tau _i, \rho _i, \omega _i)\). The base embedding \(\sigma _i\) carries content, the type tag \(\tau _i\) assigns functional role, the compatibility vector \(\rho _i\) governs inter-base interactions, and the weight \(\omega _i\) controls expression strength.

Why Four Types?

The choice of four base types is not arbitrary. It is the minimum alphabet that provides:

1.
Complementary pairing: \(\mathsf {A} \leftrightarrow \mathsf {T}\) and \(\mathsf {C} \leftrightarrow \mathsf {G}\) enable HelixHash’s double-strand representation (Chapter 8).
2.
Functional coverage: The four roles (initiate, terminate, combine, generate) span the basic operations of any computational pipeline.
3.
Algebraic structure: The Klein four-group \(\mathbb {Z}_2 \times \mathbb {Z}_2\) acts naturally on \(\{\mathsf {A}, \mathsf {T}, \mathsf {C}, \mathsf {G}\}\) via complement and type-swap, providing symmetry operations for equivariant processing.
4.
Biological compatibility: Direct mapping to DNA’s \(\{A, T, C, G\}\) enables training on genomic corpora and interfacing with biological data.

7.2.2 Genomic Sequences and Regions

Bases are organized into genomic sequences and regions:

Definition 7.2 (Genomic Sequence). A genomic sequence is an ordered tuple of genomic bases: \begin {equation} \Gamma = (b_1, b_2, \ldots , b_n), \quad b_i = (\sigma _i, \tau _i, \rho _i, \omega _i). \end {equation}

Definition 7.3 (Genomic Region). A genomic region \(R = (\Gamma [i:j], \mu )\) is a contiguous subsequence of a genomic sequence annotated with a region type \(\mu \). Region types include:

Region Type

Computational Role

Promoter

Activation entry point; determines whether downstream regions fire

Enhancer

Amplifies activation of distant regions under matching context

Silencer

Suppresses activation of associated regions

Insulator

Prevents regulatory signals from crossing domain boundaries

Coding

Carries functional content (templates, programs, knowledge)

Memory

Stores persistent state (facts, habits, world model fragments)

Adapter

Connects to modality-specific output heads

7.2.3 Genomic Embedding: From Raw Bytes to the 4-Tuple Base Representation

Before DOGMA can operate on input data, raw bytes must be converted into genomic bases. This section provides a step-by-step account of the Genomic Embedding process—the transformation that maps each input byte to the structured 4-tuple \(b_i = (\sigma _i, \tau _i, \rho _i, \omega _i)\).

Step 1: Byte-to-Base Mapping

Every input byte has a value in \(\{0, 1, \ldots , 255\}\). DOGMA maps each byte value to one of the four bases \(\{\mathsf {A}, \mathsf {C}, \mathsf {G}, \mathsf {T}\}\) using modular arithmetic: \begin {equation} \tau (v) = \begin {cases} \mathsf {A} & \text {if } v \bmod 4 = 0, \\ \mathsf {C} & \text {if } v \bmod 4 = 1, \\ \mathsf {G} & \text {if } v \bmod 4 = 2, \\ \mathsf {T} & \text {if } v \bmod 4 = 3. \end {cases} \label {eq:byte-to-base} \end {equation}

Table 7.3 shows this mapping for representative ASCII values.

Table 7.3: Byte-to-base mapping for selected ASCII values. The base type is determined by \(v \bmod 4\).
Char ASCII \(v \bmod 4\) Base Char ASCII \(v \bmod 4\) Base
NUL 0 0 A H 72 0 A
SOH 1 1 C e 101 1 C
STX 2 2 G l 108 0 A
ETX 3 3 T l 108 0 A
SP 32 0 A o 111 3 T
A 65 1 C t 116 0 A
a 97 1 C w 119 3 T
0 48 0 A ! 33 1 C

Why Modular Arithmetic?

The choice of \(v \bmod 4\) ensures a balanced distribution of base types across all possible byte values: exactly 64 byte values map to each base type. This balance prevents pathological inputs from starving any of the four computational roles. Alternative mappings (e.g., based on bit patterns or frequency-optimal codes [Church et al.2012]) are possible but sacrifice simplicity without measurable benefit in practice.

Step 2: Strand Identity \(\sigma _i\) — The Base Embedding

The strand identity \(\sigma _i \in \mathbb {R}^d\) is the primary informational payload of each base. It is computed in two stages:

(a) Type-specific learned embedding. Each base type \(\tau \in \{\mathsf {A}, \mathsf {C}, \mathsf {G}, \mathsf {T}\}\) has an associated embedding matrix \(\mathbf {E}_\tau \in \mathbb {R}^{256 \times d}\). The byte value \(v_i\) indexes into the embedding matrix for its assigned type: \begin {equation} \sigma _i^{(\text {raw})} = \mathbf {E}_{\tau _i}[v_i] \in \mathbb {R}^d. \label {eq:sigma-raw} \end {equation}

Having four separate embedding tables (one per type) means that even if two bytes map to the same base type, their embeddings can differ based on the actual byte value. The embedding dimension \(d\) is structured: the first \(d/4\) dimensions encode type-specific features, while the remaining \(3d/4\) encode content.

(b) Positional enrichment. The raw embedding is enriched with positional information from the backbone position \(\rho _i\) (described below) via addition: \begin {equation} \sigma _i = \sigma _i^{(\text {raw})} + \rho _i. \label {eq:sigma-final} \end {equation}

This is analogous to how transformer embeddings add token and positional embeddings, but with a key difference: \(\rho _i\) is not sinusoidal—it encodes backbone geometry.

Step 3: Base Type \(\tau _i\) — Learned Embedding Lookup

The base type \(\tau _i \in \{\mathsf {A}, \mathsf {C}, \mathsf {G}, \mathsf {T}\}\) is determined by the byte-to-base mapping (Equation 7.5). Beyond its discrete role in routing computation, \(\tau _i\) also contributes a learned type embedding \(\mathbf {t}_{\tau _i} \in \mathbb {R}^{d_\tau }\) that is concatenated into downstream representations: \begin {equation} \mathbf {t}_{\tau _i} = \mathbf {E}_{\text {type}}[\tau _i], \quad \mathbf {E}_{\text {type}} \in \mathbb {R}^{4 \times d_\tau }. \label {eq:type-embedding} \end {equation}

The type embedding serves two purposes: (1) it provides a continuous representation of the discrete type tag for use in differentiable operations, and (2) it allows the model to learn type-specific biases that evolve during training. The type embedding dimension \(d_\tau \) is typically \(d/4\), matching the type-specific partition of the base embedding.

Step 4: Backbone Position \(\rho _i\) — Replacing Sinusoidal Encoding

In a standard transformer, positional information is injected via sinusoidal functions of the position index [Vaswani et al.2017a]: \begin {equation} \text {PE}(i, 2j) = \sin \!\left (\frac {i}{10000^{2j/d}}\right ), \quad \text {PE}(i, 2j+1) = \cos \!\left (\frac {i}{10000^{2j/d}}\right ). \label {eq:sinusoidal-pe} \end {equation}

DOGMA replaces this with backbone position encoding, inspired by the sugar-phosphate backbone of DNA. The backbone position \(\rho _i \in \mathbb {R}^d\) encodes both absolute position and local structural context: \begin {equation} \rho _i = \mathbf {W}_{\text {pos}} \cdot \phi (i) + \mathbf {W}_{\text {local}} \cdot \psi (\tau _{i-1}, \tau _i, \tau _{i+1}), \label {eq:backbone-position} \end {equation} where:

  • \(\phi (i) \in \mathbb {R}^{d_p}\) is a learned absolute position embedding (similar to learned positional embeddings in GPT-2 [Radford et al.2019], but extended to support arbitrary lengths via interpolation).
  • \(\psi (\tau _{i-1}, \tau _i, \tau _{i+1}) \in \mathbb {R}^{d_l}\) is a learned trinucleotide context embedding that encodes the local type pattern. There are \(4^3 = 64\) possible trinucleotide contexts, each with its own learned embedding.
  • \(\mathbf {W}_{\text {pos}} \in \mathbb {R}^{d \times d_p}\) and \(\mathbf {W}_{\text {local}} \in \mathbb {R}^{d \times d_l}\) are learned projection matrices.

Why Backbone Position Beats Sinusoidal Encoding

Sinusoidal positional encodings treat positions as points on a number line. Backbone position encodings treat positions as nucleotides in a polymer chain, where local context (the neighboring bases) affects the geometry. This means that the “position” of a base depends not only on where it is but also on what surrounds it—just as in real DNA, where the backbone geometry depends on the stacking interactions between adjacent bases.

Step 5: Complementarity Weight \(\omega _i\) — Watson-Crick Pairing

The weight \(\omega _i \in \mathbb {R}_{\ge 0}\) controls how strongly each base contributes to downstream computation. At initialization, \(\omega _i\) is derived from Watson-Crick base-pairing statistics: \begin {equation} \omega _i^{(0)} = \frac {1}{|N(i)|} \sum _{j \in N(i)} \mathbb {1}\!\left [\tau _j = \overline {\tau _i}\right ], \label {eq:omega-init} \end {equation} where \(N(i)\) is a local window of positions around \(i\), \(\overline {\tau _i}\) is the Watson-Crick complement of \(\tau _i\) (Equation 7.2), and \(\mathbb {1}[\cdot ]\) is the indicator function. This initial weight is high when a base has many complementary partners nearby (suggesting it participates in double-stranded structure) and low when it is isolated.

During the forward pass, \(\omega _i\) is modulated by the Regulation Gate (Stage 3), which can amplify or suppress individual bases based on context.

Watson-Crick Complementarity

In molecular biology, the specificity of DNA replication and transcription depends on Watson-Crick base pairing: A pairs with T (via two hydrogen bonds), and C pairs with G (via three hydrogen bonds). The stronger C-G pairing provides greater thermal stability. DOGMA’s complementarity weight mirrors this: bases involved in strong pairing interactions receive higher initial weights, biasing the network toward utilizing structurally important positions [Watson and Crick1953].

Complete Worked Example: Encoding “Hello”

Let us trace the complete genomic embedding for the ASCII string “Hello” with embedding dimension \(d = 8\). The five characters have byte values:

Position Char ASCII \(v \bmod 4\) Base Type \(\tau _i\) Complement \(\overline {\tau _i}\)
1 H 72 0 A T
2 e 101 1 C G
3 l 108 0 A T
4 l 108 0 A T
5 o 111 3 T A

Step A: Base type assignment. Applying Equation 7.5: \[ \tau _1 = \mathsf {A}, \quad \tau _2 = \mathsf {C}, \quad \tau _3 = \mathsf {A}, \quad \tau _4 = \mathsf {A}, \quad \tau _5 = \mathsf {T}. \]

The genomic sequence spells out the base string: A-C-A-A-T.

Step B: Raw embeddings \(\sigma ^{(\text {raw})}\). Each byte value indexes into its type-specific embedding table. Using \(d = 8\), suppose the (randomly initialized, pre-training) embeddings are: \begin {align*} \sigma _1^{(\text {raw})} &= \mathbf {E}_{\mathsf {A}}[72] = (+0.12,\; -0.34,\; +0.56,\; +0.78,\; -0.23,\; +0.45,\; -0.67,\; +0.11), \\ \sigma _2^{(\text {raw})} &= \mathbf {E}_{\mathsf {C}}[101] = (-0.41,\; +0.22,\; +0.63,\; -0.18,\; +0.55,\; -0.31,\; +0.42,\; -0.09), \\ \sigma _3^{(\text {raw})} &= \mathbf {E}_{\mathsf {A}}[108] = (+0.33,\; +0.15,\; -0.28,\; +0.61,\; +0.14,\; -0.52,\; +0.39,\; +0.27), \\ \sigma _4^{(\text {raw})} &= \mathbf {E}_{\mathsf {A}}[108] = (+0.33,\; +0.15,\; -0.28,\; +0.61,\; +0.14,\; -0.52,\; +0.39,\; +0.27), \\ \sigma _5^{(\text {raw})} &= \mathbf {E}_{\mathsf {T}}[111] = (-0.55,\; +0.47,\; +0.19,\; -0.36,\; +0.72,\; +0.08,\; -0.44,\; +0.61). \end {align*}

Note that positions 3 and 4 (both “l”, ASCII 108, type A) receive identical raw embeddings—they will be distinguished by their backbone positions.

Step C: Backbone positions \(\rho _i\). The backbone position combines absolute position and trinucleotide context. For position \(i=3\), the trinucleotide context is \((\tau _2, \tau _3, \tau _4) = (\mathsf {C}, \mathsf {A}, \mathsf {A})\), while for position \(i=4\), it is \((\tau _3, \tau _4, \tau _5) = (\mathsf {A}, \mathsf {A}, \mathsf {T})\). These different contexts produce different local embeddings: \begin {align*} \rho _3 &= \mathbf {W}_{\text {pos}} \cdot \phi (3) + \mathbf {W}_{\text {local}} \cdot \psi (\mathsf {C}, \mathsf {A}, \mathsf {A}) \\ &= (+0.05,\; +0.11,\; -0.08,\; +0.03,\; +0.15,\; -0.02,\; +0.07,\; -0.13), \\ \rho _4 &= \mathbf {W}_{\text {pos}} \cdot \phi (4) + \mathbf {W}_{\text {local}} \cdot \psi (\mathsf {A}, \mathsf {A}, \mathsf {T}) \\ &= (+0.09,\; -0.06,\; +0.12,\; -0.04,\; +0.18,\; +0.10,\; -0.05,\; +0.03). \end {align*}

Step D: Final embeddings \(\sigma _i\). Adding backbone positions to raw embeddings (Equation 7.7): \begin {align*} \sigma _3 &= \sigma _3^{(\text {raw})} + \rho _3 = (+0.38,\; +0.26,\; -0.36,\; +0.64,\; +0.29,\; -0.54,\; +0.46,\; +0.14), \\ \sigma _4 &= \sigma _4^{(\text {raw})} + \rho _4 = (+0.42,\; +0.09,\; -0.16,\; +0.57,\; +0.32,\; -0.42,\; +0.34,\; +0.30). \end {align*}

The two “l” characters now have different embeddings due to their different backbone positions, even though they share the same raw embedding.

Step E: Complementarity weights \(\omega _i\). Using a window of size 3 centered at each position: \begin {align*} \omega _1 &: N(1) = \{2, 3\}. \;\text {Complements of A are T. Neither C nor A is T.} \;\Rightarrow \; \omega _1 = 0/2 = 0.0. \\ \omega _2 &: N(2) = \{1, 3\}. \;\text {Complements of C are G. Neither A nor A is G.} \;\Rightarrow \; \omega _2 = 0/2 = 0.0. \\ \omega _3 &: N(3) = \{2, 4\}. \;\text {Complements of A are T. Neither C nor A is T.} \;\Rightarrow \; \omega _3 = 0/2 = 0.0. \\ \omega _4 &: N(4) = \{3, 5\}. \;\text {Complements of A are T. Position 5 is T!} \;\Rightarrow \; \omega _4 = 1/2 = 0.5. \\ \omega _5 &: N(5) = \{4\}. \;\text {Complements of T are A. Position 4 is A!} \;\Rightarrow \; \omega _5 = 1/1 = 1.0. \end {align*}

Position 4 has moderate weight (\(\omega _4 = 0.5\)) because one of its two neighbors is complementary, while position 5 has full weight (\(\omega _5 = 1.0\)) because its only neighbor is complementary. Positions 1–3 have zero initial weight—they lack nearby complementary partners.

Step F: Final 4-tuple representation. The complete genomic bases for “Hello” are:

\(i\)

\(\sigma _i\) (8-dim embedding)

\(\tau _i\)

\(\omega _i\)

1

\((+0.17,\; -0.23,\; +0.48,\; +0.81,\; -0.08,\; +0.43,\; -0.60,\; +0.18)\)

A

0.0

2

\((-0.36,\; +0.28,\; +0.55,\; -0.14,\; +0.62,\; -0.27,\; +0.48,\; -0.03)\)

C

0.0

3

\((+0.38,\; +0.26,\; -0.36,\; +0.64,\; +0.29,\; -0.54,\; +0.46,\; +0.14)\)

A

0.0

4

\((+0.42,\; +0.09,\; -0.16,\; +0.57,\; +0.32,\; -0.42,\; +0.34,\; +0.30)\)

A

0.5

5

\((-0.48,\; +0.53,\; +0.25,\; -0.30,\; +0.80,\; +0.14,\; -0.38,\; +0.67)\)

T

1.0

The compatibility vector \(\rho _i\) (in its role as the \([0,1]^c\) inter-base interaction affinity) is computed later during the pipeline; at embedding time, \(\rho _i\) serves as the backbone position vector that enriches \(\sigma _i\).

Genomic Embedding vs. Token Embedding

A standard transformer embedding maps each token to a single learned vector. DOGMA’s genomic embedding produces a structured 4-tuple: the embedding \(\sigma _i\) carries content, the type \(\tau _i\) assigns functional role, the backbone \(\rho _i\) encodes position with local context awareness, and the weight \(\omega _i\) provides an initial importance signal from complementarity structure. This richer representation allows downstream stages to exploit structure that would be invisible to a standard embedding.

7.3 The Six-Stage Pipeline: Overview

DOGMA processes information through six sequential stages, each corresponding to a step in the biological Central Dogma and its regulatory context. The complete pipeline transforms persistent genomic state into task-specific output:

\begin {equation} \boxed { \text {TetraMemory} \xrightarrow {\text {Stage 1}} \text {DNA Block} \xrightarrow {\text {Stage 2}} \text {Regulate} \xrightarrow {\text {Stage 3}} \text {Translate} \xrightarrow {\text {Stage 4}} \text {Strand Attn} \xrightarrow {\text {Stage 5}} \text {Epi+Allo} \xrightarrow {\text {Stage 6}} \text {Output} } \label {eq:dogma-pipeline} \end {equation}

Each stage receives the output of the previous stage and produces a transformed representation. We now devote a full section to each stage, providing mathematical formulations, diagrams, worked examples, and complexity analysis.

7.3.1 Stage 1: TetraMemory

TetraMemory is DOGMA’s replacement for global self-attention. Instead of computing pairwise interactions between all \(T\) tokens (\(O(T^2)\) cost), TetraMemory organizes tokens into overlapping groups of four—tetrahedra—and computes interactions only within and between adjacent tetrahedra in \(O(T)\) time.

The Tetrahedral Unit: \(K_4\) Complete Interaction

Given a sequence of \(T\) tokens, TetraMemory partitions them into \(\lfloor T/4 \rfloor \) non-overlapping groups of four consecutive tokens. Within each group, all six pairwise interactions are computed, forming a complete graph \(K_4\).

Definition 7.4 (Tetrahedron). A tetrahedron \(\Delta _k\) is a group of four consecutive tokens \((x_{4k+1}, x_{4k+2}, x_{4k+3}, x_{4k+4})\) together with the complete set of pairwise interactions: \begin {equation} \Delta _k = \Bigl \{ (x_i, x_j) \;\Big |\; i, j \in \{4k+1, \ldots , 4k+4\},\; i \neq j \Bigr \}. \end {equation} This yields \(\binom {4}{2} = 6\) directed interaction edges per tetrahedron.

Figure 7.2: Two adjacent tetrahedra in TetraMemory. Each tetrahedron forms a \(K_4\) complete graph with 6 pairwise interactions. Adjacent tetrahedra share a face (3 vertices, shown in gold), enabling information propagation along the sequence without global attention.

Face Propagation

Long-range information flow is achieved through face propagation: adjacent tetrahedra share a triangular face (3 of 4 vertices overlap). This overlap allows information computed in \(\Delta _k\) to flow into \(\Delta _{k+1}\) through shared vertices.

\begin {equation} \text {Face}(\Delta _k, \Delta _{k+1}) = \{x_{4k+2},\; x_{4k+3},\; x_{4k+4}\}. \label {eq:face-sharing} \end {equation}

More precisely, after computing local interactions within \(\Delta _k\), the updated representations of the shared vertices carry information from the entire tetrahedron. When these shared vertices participate in \(\Delta _{k+1}\)’s local computation, information propagates forward. After processing all \(\lfloor T/4 \rfloor \) tetrahedra, information from position 1 can reach position \(T\) through a chain of \(O(T/4)\) propagation steps—but each step involves only \(O(1)\) local computations.

Mathematical Formulation

Let \(\mathbf {X} \in \mathbb {R}^{T \times d}\) be the input sequence. TetraMemory proceeds as follows:

1.
Partition. Divide \(\mathbf {X}\) into groups of 4: \(\mathbf {X}_k = [x_{4k+1}; x_{4k+2}; x_{4k+3}; x_{4k+4}] \in \mathbb {R}^{4 \times d}\).
2.
Local \(K_4\) interaction. For each tetrahedron \(\Delta _k\), compute: \begin {equation} \mathbf {Y}_k = \mathrm {softmax}\!\left (\frac {\mathbf {X}_k \mathbf {W}_Q (\mathbf {X}_k \mathbf {W}_K)^\top }{\sqrt {d_k}}\right ) \mathbf {X}_k \mathbf {W}_V, \label {eq:tetra-local} \end {equation} where \(\mathbf {W}_Q, \mathbf {W}_K, \mathbf {W}_V \in \mathbb {R}^{d \times d_k}\) are learned projections. This is standard attention, but restricted to a \(4 \times 4\) attention matrix—a constant-size operation.
3.
Face propagation. Update shared vertices: \begin {equation} \tilde {x}_{4k+j} = \mathbf {Y}_k[j] + \gamma \cdot \mathbf {Y}_{k-1}[j+1] \quad \text {for } j \in \{1, 2, 3\}, \label {eq:face-prop} \end {equation} where \(\gamma \) is a learned mixing coefficient and the index arithmetic accounts for the face-sharing overlap.

Complexity Analysis

Proposition 7.1 (TetraMemory Complexity). TetraMemory has time complexity \(O(T \cdot d)\) and space complexity \(O(T \cdot d)\), compared to \(O(T^2 \cdot d)\) time and \(O(T^2 + T \cdot d)\) space for standard self-attention.

Proof. There are \(T/4\) tetrahedra. Each tetrahedron requires a \(4 \times 4\) attention computation costing \(O(4^2 \cdot d) = O(d)\). Total: \((T/4) \cdot O(d) = O(T \cdot d)\). Face propagation adds \(O(T \cdot d)\) for the linear updates. Space: we store \(O(T)\) hidden states of dimension \(d\). □

Tetrahedra in Biology

Tetrahedral geometry appears throughout molecular biology. The carbon atom’s \(sp^3\) hybridization creates tetrahedral bond angles. Protein quaternary structures often involve tetrameric complexes (e.g., hemoglobin’s four subunits). TetraMemory’s use of groups of four mirrors this fundamental structural motif: local interactions within a small, tightly-coupled unit, with information propagating through shared interfaces.

GPU-Friendly TetraMemory

Because each \(K_4\) interaction involves only a \(4 \times 4\) attention matrix, TetraMemory is extremely GPU-friendly. The local attention computations can be batched as a single large matrix multiplication across all tetrahedra simultaneously: \begin {equation} \mathbf {Y}_{\text {all}} = \mathrm {BatchedAttn}(\mathbf {X}_{\text {reshaped}}) \quad \text {where } \mathbf {X}_{\text {reshaped}} \in \mathbb {R}^{(T/4) \times 4 \times d}. \end {equation} This avoids the sequential processing bottleneck of some recurrent architectures while maintaining the \(O(T)\) complexity advantage.

7.3.2 Stage 2: DNA Computing Block

The DNA Computing Block is the core computational engine of DOGMA. It replaces the transformer’s feed-forward + attention block with four parallel computational paths, each inspired by a different mechanism from DNA computing. The four paths are:

1.
Path (i): Strand Displacement — conditional signal routing
2.
Path (ii): Parallel Scan Automaton / SSM — linear-time sequential processing
3.
Path (iii): Stochastic Computing — probabilistic reasoning
4.
Path (iv): Double Strand — bidirectional context

The outputs of all four paths are combined through a learned softmax gate: \begin {equation} \mathbf {y} = \sum _{p=1}^{4} \alpha _p \cdot \mathrm {Path}_p(\mathbf {x}), \qquad \boldsymbol {\alpha } = \mathrm {softmax}(\mathbf {W}_g \mathbf {x} + \mathbf {b}_g) \in \mathbb {R}^4, \label {eq:gated-fusion} \end {equation} where \(\mathbf {W}_g \in \mathbb {R}^{4 \times d}\) and \(\mathbf {b}_g \in \mathbb {R}^4\) are learned parameters. The gate weights \(\alpha _p\) are input-dependent: for some inputs, the strand displacement path dominates; for others, the parallel scan path may carry more weight.

Three of Four Paths Are Independently Turing-Complete

A remarkable property of the DNA Computing Block is that three of its four paths—Strand Displacement, Parallel Scan Automaton, and Double Strand—are each independently Turing-complete (given sufficient width and depth). This means DOGMA has massive redundancy in computational power: even if two paths are ablated, the remaining path can in principle compute any computable function. This redundancy mirrors the robustness of biological systems, where multiple overlapping regulatory mechanisms ensure reliable function even when individual components fail.

Figure 7.3: The DNA Computing Block with four parallel computational paths. Three of the four paths are independently Turing-complete. The learned softmax gate \(\boldsymbol {\alpha }\) dynamically weights each path’s contribution based on the input.

We now describe each path in detail.

Path (i): Strand Displacement

Strand displacement is inspired by toehold-mediated strand displacement (TMSD) reactions in DNA nanotechnology [Zhang and Seelig2011]. In the wet lab, a single-stranded DNA “invader” binds to a short exposed region (the toehold) of a double-stranded complex, then progressively displaces the incumbent strand through branch migration. DOGMA abstracts this into a computational primitive for conditional signal routing.

Mechanism. Given input \(\mathbf {x} \in \mathbb {R}^{T \times d}\), the strand displacement path computes: \begin {align} \mathbf {e}_{\text {toe}} &= \sigma (\mathbf {x} \mathbf {W}_{\text {toe}}), && \text {(toehold binding energies)} \label {eq:toehold} \\ \mathbf {m}_{\text {gate}} &= \mathbf {1}[\mathbf {e}_{\text {toe}} > \theta ], && \text {(thresholded gate mask)} \\ \mathbf {h}_{\text {migrate}} &= \mathrm {CausalConv1D}(\mathbf {x} \odot \mathbf {m}_{\text {gate}}), && \text {(branch migration via causal conv)} \\ \mathbf {y}_{\text {SD}} &= \mathbf {x} + \mathbf {h}_{\text {migrate}} \mathbf {W}_{\text {out}}, && \text {(residual output)} \end {align}

where \(\theta \) is a learned threshold, \(\sigma \) is the sigmoid function, and \(\odot \) denotes element-wise multiplication. The gate mask \(\mathbf {m}_{\text {gate}}\) selectively activates only those positions where the toehold binding is strong enough—mimicking the thermodynamic threshold required for strand displacement to initiate.

Computational role. Strand displacement excels at conditional routing: “if this pattern is present, activate this pathway.” This is analogous to biological signal transduction cascades.

Toehold-Mediated Strand Displacement

In DNA nanotechnology, TMSD reactions are the basis for molecular logic gates, neural networks, and even Turing machines built entirely from DNA strands. The toehold—typically 6–10 nucleotides long—acts as a “password” that controls whether the displacement reaction proceeds. DOGMA’s learned toehold energies play the same role: they determine which computational pathways are activated for a given input.

Path (ii): Parallel Scan Automaton / SSM

The Parallel Scan path implements linear-time sequence processing using the parallel scan (prefix sum) algorithm, closely related to state-space models (SSMs) such as Mamba [Gu and Dao2023].

Mechanism. The path defines a linear recurrence: \begin {equation} h_t = \mathbf {A}_t h_{t-1} + \mathbf {B}_t x_t, \qquad y_t = \mathbf {C}_t h_t + \mathbf {D}_t x_t, \label {eq:ch7-ssm-recurrence} \end {equation} where \(\mathbf {A}_t, \mathbf {B}_t, \mathbf {C}_t, \mathbf {D}_t\) are input-dependent (selective) parameters computed from \(x_t\). The key insight is that this recurrence can be computed in \(O(T \log T)\) time using the parallel scan algorithm, which restructures the sequential recurrence into a balanced binary tree of associative operations.

The parallel scan algorithm. Given \(T\) elements with an associative binary operator \(\oplus \), the parallel scan computes all prefix sums \(s_k = a_1 \oplus a_2 \oplus \cdots \oplus a_k\) in \(O(\log T)\) parallel steps using \(O(T)\) total work. For the SSM recurrence, the operator is: \begin {equation} (a_i, b_i) \oplus (a_j, b_j) = (a_j \cdot a_i, \; a_j \cdot b_i + b_j), \label {eq:scan-operator} \end {equation} which allows all hidden states \(h_1, h_2, \ldots , h_T\) to be computed in parallel.

Computational role. The Parallel Scan path handles sequential dependencies efficiently. It captures positional and ordering information that the other paths may miss.

Path (iii): Stochastic Computing

The Stochastic Computing path implements probabilistic reasoning through stochastic bitstream operations, inspired by stochastic computing in hardware design and by the inherent randomness of molecular reactions.

Mechanism. The input is converted to stochastic bitstreams via Bernoulli sampling: \begin {equation} \hat {x}_t^{(s)} \sim \mathrm {Bernoulli}\bigl (\sigma (\mathbf {x}_t \mathbf {W}_s)\bigr ), \qquad s = 1, \ldots , S, \label {eq:stochastic-sample} \end {equation} where \(S\) is the number of stochastic samples. Multiplication of probabilities is implemented as AND operations on bitstreams; addition as OR operations. This provides naturally calibrated uncertainty estimates.

Output. The stochastic path output is the empirical mean over \(S\) samples: \begin {equation} \mathbf {y}_{\text {SC}} = \frac {1}{S} \sum _{s=1}^{S} f(\hat {\mathbf {x}}^{(s)}), \label {eq:stochastic-output} \end {equation} where \(f\) is a learned nonlinear function applied to each sampled bitstream. During training, the Bernoulli sampling is relaxed using the Gumbel–softmax trick for differentiability.

Computational role. Stochastic computing provides uncertainty quantification and robustness to noise. It excels at tasks requiring probabilistic inference or calibrated confidence estimates.

Path (iv): Double Strand

The Double Strand path maintains two coupled representations—a forward strand \(\vec {x}\) and a reverse-complement strand \(\overleftarrow {x}\)—mirroring DNA’s antiparallel double-helix structure.

Mechanism. \begin {align} \vec {h}_t &= \mathrm {ForwardRNN}(\vec {h}_{t-1}, x_t), \label {eq:forward-strand} \\ \overleftarrow {h}_t &= \mathrm {ReverseRNN}(\overleftarrow {h}_{t+1}, \bar {x}_t), \label {eq:reverse-strand} \\ \mathbf {y}_{\text {DS},t} &= \mathbf {W}_{\text {merge}}[\vec {h}_t \| \overleftarrow {h}_t] + \mathbf {b}_{\text {merge}}, \label {eq:ds-merge} \end {align} where \(\bar {x}_t\) is the type-complement of \(x_t\) (applying the complement mapping from Equation 7.2) and \(\|\) denotes concatenation. The forward strand processes the sequence left-to-right; the reverse strand processes the complement right-to-left. Their outputs are concatenated and projected.

Computational role. The Double Strand path provides bidirectional context, similar to bidirectional LSTMs but with the added constraint of complementary pairing. This constraint acts as a regularizer: the reverse strand must maintain consistency with the forward strand’s complement.

Gated Fusion in Practice

The gate weights \(\alpha _p\) in Equation 7.18 are computed per-position and per-head. In a typical trained DOGMA model, the gate distribution varies significantly across layers: early layers tend to weight the Parallel Scan path more heavily (capturing sequential structure), while later layers shift toward Strand Displacement (conditional routing for semantic processing). The Stochastic Computing path typically receives lower weight on average but activates strongly for inputs with high uncertainty.

7.3.3 Stage 3: Regulation Gate

The Regulation Gate implements DOGMA’s core principle of selective gene expression: not all information should participate in every computation. Given the output of the DNA Computing Block, the Regulation Gate computes a context-dependent express/suppress decision for each position.

Mathematical Formulation

Let \(\mathbf {h} \in \mathbb {R}^{T \times d}\) be the hidden representation from Stage 2 and \(\mathbf {c} \in \mathbb {R}^{d_c}\) be the current context embedding. The Regulation Gate computes: \begin {align} \mathbf {g}_{\text {express}} &= \sigma \bigl (\mathbf {h} \mathbf {W}_e + \mathbf {c} \mathbf {U}_e + \mathbf {b}_e\bigr ) \in [0,1]^{T \times d}, \label {eq:express-gate} \\ \mathbf {g}_{\text {suppress}} &= \sigma \bigl (\mathbf {h} \mathbf {W}_s + \mathbf {c} \mathbf {U}_s + \mathbf {b}_s\bigr ) \in [0,1]^{T \times d}, \label {eq:suppress-gate} \\ \mathbf {r} &= \mathbf {g}_{\text {express}} \odot (1 - \mathbf {g}_{\text {suppress}}), \label {eq:regulation-combined} \\ \mathbf {h}_{\text {reg}} &= \mathbf {r} \odot \mathbf {h}, \label {eq:regulated-output} \end {align}

where \(\sigma \) is the sigmoid function, \(\mathbf {W}_e, \mathbf {W}_s \in \mathbb {R}^{d \times d}\) and \(\mathbf {U}_e, \mathbf {U}_s \in \mathbb {R}^{d_c \times d}\) are learned weight matrices. The net regulatory signal \(\mathbf {r}\) is the element-wise product of expression and non-suppression: a position is fully active only if it is both expressed and not suppressed.

Figure 7.4: The Regulation Gate. Context \(\mathbf {c}\) and hidden state \(\mathbf {h}\) jointly determine express and suppress signals. The net regulation \(\mathbf {r}\) element-wise gates the hidden representation.

Sparsity and Complexity

When the regulation gate drives many positions to near-zero (\(r_{t,j} \approx 0\)), downstream stages can skip those positions entirely. If a fraction \(s\) of positions survive regulation (i.e., \(r_{t,j} > \epsilon \) for some threshold \(\epsilon \)), then downstream computation scales with \(sT\) rather than \(T\).

Proposition 7.2 (Regulation Sparsity). If the Regulation Gate produces activation sparsity \(s = |\{t : \|\mathbf {r}_t\|_1 > \epsilon \}| / T\), then the effective sequence length for downstream stages is \(T_{\text {eff}} = sT\), reducing complexity by a factor of \(1/s\) for stages with super-linear complexity.

Gene Regulation in Biology

In a human cell, roughly 20,000 protein-coding genes exist, but only 10–20% are expressed at any given time [ENCODE Project Consortium2012]. The pattern of expression is cell-type specific: a neuron expresses a different set of genes than a liver cell, even though both contain the same genome. DOGMA’s Regulation Gate mirrors this: the same model (genome) produces different activation patterns for different inputs (cell types), enabling specialization without separate models.

7.3.4 Stage 4: Codon Translation

Codon Translation implements DOGMA’s analogue of the genetic code: a differentiable mapping from 64 input codons to 21 output symbols (20 amino acids + 1 stop signal). This stage compresses information through a biologically-motivated bottleneck.

The \(64 \to 21\) Mapping

In biology, three consecutive nucleotides (a codon) encode one amino acid according to the standard genetic code. There are \(4^3 = 64\) possible codons but only 20 amino acids plus a stop signal, so the code is degenerate—multiple codons map to the same amino acid.

DOGMA implements this as a learned soft mapping. Given the regulated hidden state \(\mathbf {h}_{\text {reg}} \in \mathbb {R}^{T \times d}\), consecutive triples of positions are grouped into codons: \begin {equation} \mathbf {c}_k = [\mathbf {h}_{\text {reg}, 3k-2} \| \mathbf {h}_{\text {reg}, 3k-1} \| \mathbf {h}_{\text {reg}, 3k}] \in \mathbb {R}^{3d}, \quad k = 1, \ldots , \lfloor T/3 \rfloor . \label {eq:codon-grouping} \end {equation}

Each codon is translated through a differentiable lookup: \begin {equation} \mathbf {a}_k = \sum _{j=1}^{64} \mathrm {softmax}\bigl (\mathbf {c}_k \mathbf {W}_{\text {codon}}\bigr )_j \cdot \mathbf {E}_{\text {aa}}[j], \quad \mathbf {W}_{\text {codon}} \in \mathbb {R}^{3d \times 64}, \label {eq:codon-translate} \end {equation} where \(\mathbf {E}_{\text {aa}} \in \mathbb {R}^{64 \times d_a}\) is a codon embedding table whose rows are initialized to respect the degeneracy structure of the biological genetic code. Multiple codons that map to the same amino acid are initialized with the same embedding, though they are free to diverge during training.

Table 7.4: Excerpt of the DOGMA codon table showing the \(64 \to 21\) mapping. Codons with the same output class share an initial embedding. The full table mirrors the standard genetic code.
First Second Third Codon ID Output Class
A A A 1 Phe (F)
A A C 2 Phe (F)
A A G 3 Leu (L)
A A T 4 Leu (L)
A C A 5 Ser (S)
A C C 6 Ser (S)
A C G 7 Ser (S)
A C T 8 Ser (S)
\(\vdots \)
\(\vdots \)
T G A 61 Trp (W)
T G C 62 Stop
T G G 63 Stop
T G T 64 Stop

Why a Compression Bottleneck?

The \(3 \to 1\) compression (every 3 positions become 1) serves several purposes:

1.
Information compression. The regulated representation contains redundancy; grouping triples and projecting to a smaller space removes it.
2.
Sequence length reduction. After codon translation, the effective sequence length is \(T/3\), reducing the cost of the subsequent Strand Attention stage from \(O(T^2 d)\) to \(O((T/3)^2 d) = O(T^2 d / 9)\).
3.
Inductive bias. The degeneracy structure of the genetic code provides a useful inductive bias: synonymous codons (mapping to the same amino acid) should carry similar information, encouraging the model to learn robust representations.

The Genetic Code Is Not Arbitrary

The standard genetic code has been optimized by billions of years of evolution for error tolerance: single-nucleotide mutations typically produce amino acids with similar biochemical properties. DOGMA inherits this structure. Initializing the codon embedding table with biologically-motivated degeneracy ensures that small perturbations in the input representation produce small changes in the translated output—a form of built-in robustness.

7.3.5 Stage 5: Strand Attention

Strand Attention is DOGMA’s analogue of self-attention, but with attention scores derived from thermodynamic binding energies rather than simple dot products. It operates on the codon-translated representation and computes pairwise interactions using the SantaLucia nearest-neighbor model of DNA hybridization.

Thermodynamic Attention Scores

Standard dot-product attention computes scores as \(\mathbf {q}_i^\top \mathbf {k}_j / \sqrt {d}\). Strand Attention replaces this with a binding energy function inspired by DNA thermodynamics: \begin {equation} \mathrm {Attn}_{\text {DNA}}(\mathbf {Q}, \mathbf {K}, \mathbf {V}) = \mathrm {softmax}\!\left (\frac {\Delta G(\mathbf {Q}, \mathbf {K})}{\tau }\right ) \mathbf {V}, \label {eq:dna-attention} \end {equation} where \(\tau \) is a learnable temperature parameter and the binding energy function \(\Delta G\) is: \begin {equation} \Delta G(\mathbf {q}_i, \mathbf {k}_j) = \underbrace {\mathbf {q}_i^\top \mathbf {W}_{\Delta H} \mathbf {k}_j}_{\text {enthalpy (stacking)}} - \tau _{\text {phys}} \cdot \underbrace {\mathbf {q}_i^\top \mathbf {W}_{\Delta S} \mathbf {k}_j}_{\text {entropy (disorder)}} + \underbrace {\beta (\tau _i, \tau _j)}_{\text {type bias}}. \label {eq:delta-g} \end {equation}

Here \(\mathbf {W}_{\Delta H}, \mathbf {W}_{\Delta S} \in \mathbb {R}^{d \times d}\) are learned matrices corresponding to enthalpy and entropy contributions, \(\tau _{\text {phys}}\) is a learned physical temperature, and \(\beta (\tau _i, \tau _j)\) is the type-pair bias from Equation 7.3.

The SantaLucia Connection

In physical chemistry, the SantaLucia nearest-neighbor model computes the free energy of DNA hybridization as: \begin {equation} \Delta G^{\circ } = \Delta H^{\circ } - T \Delta S^{\circ } = \sum _{i=1}^{n-1} \Delta H^{\circ }_{X_i X_{i+1} / Y_i Y_{i+1}} - T \sum _{i=1}^{n-1} \Delta S^{\circ }_{X_i X_{i+1} / Y_i Y_{i+1}}, \label {eq:ch7-santalucia} \end {equation} where the sums are over dinucleotide pairs and \(T\) is the physical temperature in Kelvin. DOGMA’s Strand Attention learns analogous dinucleotide-like parameters in a high-dimensional embedding space. The enthalpy matrix \(\mathbf {W}_{\Delta H}\) captures context-dependent binding strength; the entropy matrix \(\mathbf {W}_{\Delta S}\) captures the disorder cost of binding.

Figure 7.5: Strand Attention computes attention scores using thermodynamic binding energies \(\Delta G\). Complementary base pairs (A–T, C–G) form bonds (dashed lines). Stacking interactions between adjacent pairs contribute to the enthalpy term.

Complexity

Proposition 7.3 (Strand Attention Complexity). Strand Attention has time complexity \(O(T'^2 \cdot d)\) and space complexity \(O(T'^2 + T' \cdot d)\), where \(T' = T/3\) is the post-codon-translation sequence length. Compared to standard self-attention on the original sequence, this is a \(9\times \) reduction in the quadratic term.

Connection to Biological Thermodynamics

In wet-lab DNA computing, the binding energy \(\Delta G\) of a DNA duplex determines whether two strands will hybridize. The SantaLucia nearest-neighbor model computes \(\Delta G\) from dinucleotide parameters. DOGMA’s DNA Strand Attention learns analogous dinucleotide-like parameters, but in a high-dimensional embedding space rather than the four-letter DNA alphabet. The temperature parameter \(\tau \) plays the same role as physical temperature in controlling binding stringency.

7.3.6 Stage 6: Epigenetic + Allosteric Mechanisms

The final stage combines two complementary memory mechanisms: epigenetic memory (persistent, slowly-evolving state) and allosteric broadcast (fast, targeted signal distribution). Together they provide DOGMA with both long-term and short-term context integration.

Epigenetic Memory: \(O(TM)\) Persistent State

Epigenetic memory maintains a bank of \(M\) memory slots \(\mathbf {m}_1, \ldots , \mathbf {m}_M \in \mathbb {R}^{d_m}\) that persist across time steps and are updated incrementally: \begin {align} \mathbf {u}_j &= \sigma \bigl (\mathbf {h}_{\text {attn}} \mathbf {W}_u \mathbf {m}_j^\top \bigr ), && \text {(update gate for slot } j\text {)} \label {eq:epi-update-gate} \\ \tilde {\mathbf {m}}_j &= \tanh \bigl (\mathbf {h}_{\text {attn}} \mathbf {W}_m + \mathbf {m}_j \mathbf {W}_r\bigr ), && \text {(candidate update)} \label {eq:epi-candidate} \\ \mathbf {m}_j' &= (1 - \mathbf {u}_j) \odot \mathbf {m}_j + \mathbf {u}_j \odot \tilde {\mathbf {m}}_j, && \text {(gated update)} \label {eq:epi-gated} \end {align}

where \(\mathbf {h}_{\text {attn}} \in \mathbb {R}^{T' \times d}\) is the output of Strand Attention. The read operation retrieves information from memory via attention: \begin {equation} \mathbf {v}_{\text {epi}} = \mathrm {softmax}\bigl (\mathbf {h}_{\text {attn}} \mathbf {W}_q^{\text {epi}} (\mathbf {M} \mathbf {W}_k^{\text {epi}})^\top \bigr ) \mathbf {M} \mathbf {W}_v^{\text {epi}}, \label {eq:epi-read} \end {equation} where \(\mathbf {M} = [\mathbf {m}_1; \ldots ; \mathbf {m}_M] \in \mathbb {R}^{M \times d_m}\).

The complexity of epigenetic memory operations is \(O(T' \cdot M \cdot d_m)\), which is linear in sequence length when \(M\) is fixed.

Allosteric Broadcast: \(O(Tk)\) Signal Distribution

Allosteric regulation, in biology, is the modulation of a protein’s activity by binding at a site other than the active site. In DOGMA, allosteric broadcast selects \(k\) “broadcast sites” and distributes their signals to all other positions: \begin {align} \text {sites} &= \mathrm {TopK}\bigl (\mathbf {h}_{\text {attn}} \mathbf {w}_{\text {select}},\; k\bigr ), \label {eq:allo-select} \\ \mathbf {s}_{\text {broadcast}} &= \frac {1}{k}\sum _{j \in \text {sites}} \mathbf {h}_{\text {attn}, j}, \label {eq:allo-mean} \\ \mathbf {h}_{\text {final}, t} &= \mathbf {h}_{\text {attn}, t} + \mathbf {v}_{\text {epi}, t} + \mathrm {MLP}(\mathbf {s}_{\text {broadcast}}), \label {eq:allo-combine} \end {align}

where \(\mathbf {w}_{\text {select}} \in \mathbb {R}^d\) is a learned selection vector and \(\mathrm {TopK}\) selects the \(k\) positions with highest selection scores. The broadcast signal \(\mathbf {s}_{\text {broadcast}}\) is added to all positions, providing global context from the most salient positions.

The complexity is \(O(T' \cdot k \cdot d)\) for computing the broadcast, where \(k \ll T'\).

Figure 7.6: Stage 6: Epigenetic Memory (\(O(TM)\)) provides persistent state; Allosteric Broadcast (\(O(Tk)\)) provides fast global context from \(k\) selected sites. Their outputs are combined with the attention output.

Epigenetics and Allosteric Regulation

In biology, epigenetic modifications (DNA methylation, histone acetylation) create persistent, heritable changes in gene expression without altering the DNA sequence itself. Allosteric regulation is a fast, reversible mechanism where binding at one site affects activity at a distant site. DOGMA separates these two timescales: epigenetic memory changes slowly across many forward passes (akin to long-term memory), while allosteric broadcast operates within a single forward pass (akin to working memory or attention).

7.4 The Expression Folder

After the six-stage pipeline produces the final hidden representation \(\mathbf {h}_{\text {final}}\), DOGMA must convert this internal representation into the output space—a process we call the Expression Folder, by analogy with protein folding.

In protein folding, a linear amino acid chain (the primary structure) folds into a complex three-dimensional structure (the tertiary structure) that determines the protein’s function. Similarly, the Expression Folder transforms the linear sequence of hidden states into a structured output representation.

\begin {equation} \Phi = \mathrm {ExpressionFolder}(\mathbf {h}_{\text {final}}) = \mathrm {MLP}_{\text {fold}}\bigl (\mathrm {LayerNorm}(\mathbf {h}_{\text {final}})\bigr ), \label {eq:expression-folder} \end {equation}

where \(\mathrm {MLP}_{\text {fold}}\) is a two-layer feed-forward network with GELU activation: \begin {equation} \mathrm {MLP}_{\text {fold}}(\mathbf {z}) = \mathbf {W}_2 \cdot \mathrm {GELU}(\mathbf {W}_1 \mathbf {z} + \mathbf {b}_1) + \mathbf {b}_2. \label {eq:fold-mlp} \end {equation}

The output \(\Phi \) is not text. It is a phenotype representation—a structured semantic object that can be realized into different modalities:

  • Natural language: A language head applies a linear projection followed by softmax to produce token probabilities.
  • Code: A syntax-aware head produces abstract syntax tree nodes.
  • JSON/Schema: A structured output head generates key-value pairs conforming to a schema.
  • Action plans: A tool-use head produces function calls and arguments.
  • 3D structure: A TetraMesh head produces spatial coordinates (Chapter 10).

Phenotype Before Output

In a standard LLM, the model generates text directly from its hidden state. There is no explicit representation of “what the model intends to do.” In DOGMA, the phenotype \(\Phi \) is this explicit representation. It can be:

  • Inspected for correctness before realization.
  • Verified against safety constraints.
  • Realized in multiple modalities from the same plan.
  • Stored for future reference or comparison.

This is the computational analogue of protein folding: a linear sequence (transcript) is transformed into a three-dimensional functional structure (phenotype) through a deterministic but complex process.

7.5 Full Architecture Diagram

Figure 7.7 presents the complete DOGMA architecture, showing both the six-stage pipeline (left) and the detailed DNA Computing Block structure (right).

Figure 7.7: Complete DOGMA architecture. Left: The six-stage pipeline from input tokens to output realization, passing through TetraMemory, the DNA Computing Block, Regulation Gate, Codon Translation, Strand Attention, and Epigenetic+Allosteric mechanisms, followed by the Expression Folder. Right: Detailed view of the DNA Computing Block showing four parallel paths merged by a learned softmax gate. Three of the four paths are independently Turing-complete.

7.6 The DogmaBlock: Complete Forward Pass

Algorithm 1 presents the complete forward pass of a single DogmaBlock as pseudocode.

Algorithm 1 DogmaBlock Forward Pass
Require:   Input \(\mathbf {x} \in \mathbb {R}^{T \times d}\), context \(\mathbf {c} \in \mathbb {R}^{d_c}\), memory bank \(\mathbf {M} \in \mathbb {R}^{M \times d_m}\)
Ensure:   Output \(\mathbf {y} \in \mathbb {R}^{T' \times d}\), updated memory \(\mathbf {M}'\)
  
1:   // Stage 1: TetraMemory
2:   Reshape \(\mathbf {x}\) into tetrahedra: \(\mathbf {X}_k \gets \mathbf {x}[4k{:}4k{+}4]\) for \(k = 0, \ldots , \lfloor T/4 \rfloor - 1\)
3:   \(\mathbf {Y}_k \gets \mathrm {LocalAttn}_{K_4}(\mathbf {X}_k)\) for each tetrahedron \(\triangleright \) \(4 \times 4\) attention
4:   \(\mathbf {h}_1 \gets \mathrm {FacePropagate}(\mathbf {Y}_0, \mathbf {Y}_1, \ldots )\) \(\triangleright \) \(O(T \cdot d)\)
  
5:   // Stage 2: DNA Computing Block (4 parallel paths)
6:   \(\mathbf {p}_{\text {SD}} \gets \mathrm {StrandDisplacement}(\mathbf {h}_1)\) \(\triangleright \) Toehold gating + causal conv
7:   \(\mathbf {p}_{\text {SSM}} \gets \mathrm {ParallelScan}(\mathbf {h}_1)\) \(\triangleright \) Selective SSM, \(O(T \log T)\)
8:   \(\mathbf {p}_{\text {SC}} \gets \mathrm {StochasticCompute}(\mathbf {h}_1)\) \(\triangleright \) Bernoulli sampling + bitstream ops
9:   \(\mathbf {p}_{\text {DS}} \gets \mathrm {DoubleStrand}(\mathbf {h}_1)\) \(\triangleright \) Forward + reverse complement
10:   \(\boldsymbol {\alpha } \gets \mathrm {softmax}(\mathbf {W}_g \mathbf {h}_1 + \mathbf {b}_g)\) \(\triangleright \) Per-position gate weights
11:   \(\mathbf {h}_2 \gets \sum _{p} \alpha _p \cdot \mathbf {p}_p\) \(\triangleright \) Gated fusion
  
12:   // Stage 3: Regulation Gate
13:   \(\mathbf {g}_e \gets \sigma (\mathbf {h}_2 \mathbf {W}_e + \mathbf {c} \mathbf {U}_e + \mathbf {b}_e)\) \(\triangleright \) Express signal
14:   \(\mathbf {g}_s \gets \sigma (\mathbf {h}_2 \mathbf {W}_s + \mathbf {c} \mathbf {U}_s + \mathbf {b}_s)\) \(\triangleright \) Suppress signal
15:   \(\mathbf {h}_3 \gets \mathbf {h}_2 \odot \mathbf {g}_e \odot (1 - \mathbf {g}_s)\) \(\triangleright \) Element-wise gating
  
16:   // Stage 4: Codon Translation
17:   Group triples: \(\mathbf {c}_k \gets [\mathbf {h}_{3,3k-2} \| \mathbf {h}_{3,3k-1} \| \mathbf {h}_{3,3k}]\)
18:   \(\mathbf {h}_4 \gets \mathrm {CodonTranslate}(\mathbf {c}_k)\) for \(k = 1, \ldots , \lfloor T/3 \rfloor \) \(\triangleright \) \(64 \to 21\) soft mapping, \(T \to T/3\)
  
19:   // Stage 5: Strand Attention
20:   \(\mathbf {Q}, \mathbf {K}, \mathbf {V} \gets \mathbf {h}_4 \mathbf {W}_Q,\; \mathbf {h}_4 \mathbf {W}_K,\; \mathbf {h}_4 \mathbf {W}_V\)
21:   \(\Delta G_{ij} \gets \mathbf {q}_i^\top \mathbf {W}_{\Delta H} \mathbf {k}_j - \tau _{\text {phys}} \cdot \mathbf {q}_i^\top \mathbf {W}_{\Delta S} \mathbf {k}_j + \beta (\tau _i, \tau _j)\)
22:   \(\mathbf {h}_5 \gets \mathrm {softmax}(\Delta G / \tau ) \cdot \mathbf {V}\) \(\triangleright \) \(O(T'^2 d)\) where \(T' = T/3\)
  
23:   // Stage 6: Epigenetic + Allosteric
24:   \(\mathbf {v}_{\text {epi}} \gets \mathrm {EpiRead}(\mathbf {h}_5, \mathbf {M})\); \(\mathbf {M}' \gets \mathrm {EpiUpdate}(\mathbf {h}_5, \mathbf {M})\) \(\triangleright \) \(O(T'M)\)
25:   \(\text {sites} \gets \mathrm {TopK}(\mathbf {h}_5 \mathbf {w}_{\text {sel}}, k)\); \(\mathbf {s} \gets \frac {1}{k}\sum _{j \in \text {sites}} \mathbf {h}_{5,j}\) \(\triangleright \) \(O(T'k)\)
26:   \(\mathbf {h}_6 \gets \mathbf {h}_5 + \mathbf {v}_{\text {epi}} + \mathrm {MLP}(\mathbf {s})\)
  
27:   // Expression Folder
28:   \(\mathbf {y} \gets \mathrm {MLP}_{\text {fold}}(\mathrm {LayerNorm}(\mathbf {h}_6))\)
29:   return \(\mathbf {y}, \mathbf {M}'\)

7.7 Architecture Comparison: DOGMA vs. Alternatives

Table 7.5 provides a detailed comparison of DOGMA with three major competing architectures: the Transformer [Vaswani et al.2017a], Mamba (a state-space model) [Gu and Dao2023], and RWKV (a linear-attention RNN).

Table 7.5: Detailed architecture comparison: DOGMA vs. Transformer vs. Mamba vs. RWKV.

Property

Transformer

Mamba

RWKV

DOGMA

Time complexity (per layer)

\(O(T^2 d)\)

\(O(T d)\)

\(O(T d)\)

\(O(T d)\) to \(O(T'^2 d)\)
(\(T' = T/3\))

Space complexity

\(O(T^2 + Td)\)

\(O(Td)\)

\(O(Td)\)

\(O(T'd + TM)\)

Turing-complete?

Yes (with pos. enc.)

Debated

No (finite state)

Yes (3 of 4 paths)

Parallel paths

1 (attention)

1 (SSM)

1 (linear attn)

4 (gated)

Persistent memory

None (context only)

Hidden state

Hidden state

Epigenetic bank (\(M\) slots)

Bidirectional

Full

No (causal)

No (causal)

Yes (Double Strand path)

Regulation / gating

None

Selective SSM

Time-decay

Express/suppress gate

Biological basis

None

Inspired by control theory

None

DNA computing, Central Dogma

Information compression

None

Via state bottleneck

Via state bottleneck

Codon Translation (\(3:1\))

Attention mechanism

Dot-product

None

Linear attention

\(\Delta G\) thermodynamic

Global context

Full attention

Recurrent propagation

Recurrent propagation

Allosteric broadcast (\(k\) sites)

7.7.1 Complexity Summary

To summarize the per-layer complexity of a single DogmaBlock:

\begin {align} \text {Stage 1 (TetraMemory):} \quad & O(T \cdot d), \\ \text {Stage 2 (DNA Block):} \quad & O(T \cdot d) \quad \text {(Parallel Scan dominates)}, \\ \text {Stage 3 (Regulation):} \quad & O(T \cdot d), \\ \text {Stage 4 (Codon Translation):} \quad & O(T \cdot d), \\ \text {Stage 5 (Strand Attention):} \quad & O(T'^2 \cdot d) \quad \text {where } T' = T/3, \\ \text {Stage 6 (Epi + Allo):} \quad & O(T' \cdot M \cdot d_m + T' \cdot k \cdot d). \end {align}

The bottleneck is Stage 5 (Strand Attention) at \(O(T'^2 d) = O(T^2 d / 9)\). This is \(9\times \) cheaper than standard self-attention on the full sequence, and further reduced when regulation sparsity is applied. When \(T' \leq T/3\) after regulation-induced sparsity, the effective complexity can approach linear.

7.8 Worked Example: Tracing Data Through All Six Stages

To make the pipeline concrete, let us trace a small example through all six stages. Suppose we have an input sequence of \(T = 12\) tokens with embedding dimension \(d = 8\) (vastly simplified from production dimensions, but sufficient to illustrate the data flow).

Example 7.1 (Tracing 12 Tokens Through DOGMA). Input: \(\mathbf {x} \in \mathbb {R}^{12 \times 8}\) (12 tokens, 8-dimensional embeddings).

Stage 1: TetraMemory. Partition into \(12 / 4 = 3\) tetrahedra: \begin {align*} \Delta _0 &= (x_1, x_2, x_3, x_4), \\ \Delta _1 &= (x_3, x_4, x_5, x_6), \quad \text {(shares face } \{x_3, x_4\} \text { with } \Delta _0\text {)} \\ \Delta _2 &= (x_5, x_6, x_7, x_8). \quad \text {(shares face } \{x_5, x_6\} \text { with } \Delta _1\text {)} \end {align*}

Wait—with 12 tokens and groups of 4, we get tetrahedra with overlapping boundaries: \(\Delta _0 = (x_1, x_2, x_3, x_4)\), \(\Delta _1 = (x_4, x_5, x_6, x_7)\), \(\Delta _2 = (x_7, x_8, x_9, x_{10})\), \(\Delta _3 = (x_{10}, x_{11}, x_{12})\) (padded).

Within each tetrahedron, a \(4 \times 4\) attention matrix is computed. After face propagation, the output shape is still \(\mathbb {R}^{12 \times 8}\), but each token now carries information from its local tetrahedral neighborhood.

Output shape: \(\mathbf {h}_1 \in \mathbb {R}^{12 \times 8}\).

Stage 2: DNA Computing Block. Four parallel paths process \(\mathbf {h}_1\):

  • Strand Displacement: \(\mathbf {p}_{\text {SD}} \in \mathbb {R}^{12 \times 8}\) (toehold gating selects 8 of 12 positions).
  • Parallel Scan: \(\mathbf {p}_{\text {SSM}} \in \mathbb {R}^{12 \times 8}\) (all positions, linear recurrence).
  • Stochastic: \(\mathbf {p}_{\text {SC}} \in \mathbb {R}^{12 \times 8}\) (mean over \(S=16\) samples).
  • Double Strand: \(\mathbf {p}_{\text {DS}} \in \mathbb {R}^{12 \times 8}\) (forward + reverse complement).

Gate weights: \(\boldsymbol {\alpha } = (0.35, 0.30, 0.10, 0.25)\) (example values).

Output shape: \(\mathbf {h}_2 \in \mathbb {R}^{12 \times 8}\).

Stage 3: Regulation Gate. Context embedding \(\mathbf {c} \in \mathbb {R}^{16}\) encodes the task. The express/suppress gates produce: \begin {align*} \mathbf {g}_e &\approx (0.9, 0.8, 0.95, 0.1, 0.05, 0.7, 0.85, 0.9, 0.6, 0.1, 0.8, 0.75), \\ \mathbf {g}_s &\approx (0.1, 0.1, 0.05, 0.8, 0.9, 0.2, 0.1, 0.05, 0.3, 0.85, 0.1, 0.15). \end {align*}

Positions 4, 5, and 10 are effectively suppressed (\(r \approx 0\)). Only 9 of 12 positions survive with significant activation.

Output shape: \(\mathbf {h}_3 \in \mathbb {R}^{12 \times 8}\) (but 3 positions near-zero).

Stage 4: Codon Translation. Group into \(\lfloor 12/3 \rfloor = 4\) codons: \begin {align*} \text {Codon 1} &= [\mathbf {h}_{3,1} \| \mathbf {h}_{3,2} \| \mathbf {h}_{3,3}] \in \mathbb {R}^{24}, \\ \text {Codon 2} &= [\mathbf {h}_{3,4} \| \mathbf {h}_{3,5} \| \mathbf {h}_{3,6}] \in \mathbb {R}^{24}, \\ \text {Codon 3} &= [\mathbf {h}_{3,7} \| \mathbf {h}_{3,8} \| \mathbf {h}_{3,9}] \in \mathbb {R}^{24}, \\ \text {Codon 4} &= [\mathbf {h}_{3,10} \| \mathbf {h}_{3,11} \| \mathbf {h}_{3,12}] \in \mathbb {R}^{24}. \end {align*}

Each codon is translated via the soft \(64 \to 21\) mapping.

Output shape: \(\mathbf {h}_4 \in \mathbb {R}^{4 \times 8}\). Sequence length reduced from 12 to 4.

Stage 5: Strand Attention. Compute thermodynamic attention on \(T' = 4\) positions: a \(4 \times 4\) attention matrix using \(\Delta G\) scores.

Output shape: \(\mathbf {h}_5 \in \mathbb {R}^{4 \times 8}\).

Stage 6: Epigenetic + Allosteric. With \(M = 3\) memory slots and \(k = 2\) broadcast sites:

  • Epigenetic: read/write from 3 memory slots, \(O(4 \cdot 3 \cdot 8) = O(96)\) operations.
  • Allosteric: select top-2 positions, broadcast their mean to all 4 positions.

Output shape: \(\mathbf {h}_6 \in \mathbb {R}^{4 \times 8}\).

Expression Folder. Apply LayerNorm and MLP to produce the phenotype.

Final output shape: \(\Phi \in \mathbb {R}^{4 \times 8}\). From 12 input tokens, we have 4 phenotype vectors ready for realization.

Table 7.6: Tensor shapes through the six-stage pipeline for the worked example (\(T=12\), \(d=8\)).

Stage

Operation

Input Shape

Output Shape

Key Change

Input embedding

\(12 \times 8\)

1

TetraMemory

\(12 \times 8\)

\(12 \times 8\)

Local \(K_4\) interactions

2

DNA Computing Block

\(12 \times 8\)

\(12 \times 8\)

4-path gated fusion

3

Regulation Gate

\(12 \times 8\)

\(12 \times 8\)

3 positions suppressed

4

Codon Translation

\(12 \times 8\)

\(4 \times 8\)

\(3:1\) compression

5

Strand Attention

\(4 \times 8\)

\(4 \times 8\)

\(\Delta G\) attention

6

Epi + Allosteric

\(4 \times 8\)

\(4 \times 8\)

Memory read/write

Expression Folder

\(4 \times 8\)

\(4 \times 8\)

Phenotype

7.9 The Evolutor State

The complete state of a DOGMA system at time \(t\) is captured by the Evolutor state:

Definition 7.5 (Evolutor State). The Evolutor state at time \(t\) is the tuple: \begin {equation} \mathcal {E}_t = (\Gamma _t, H_t, \mathcal {A}_t, \mathcal {L}_t), \end {equation} where:

  • \(\Gamma _t\) is the current genome.
  • \(H_t\) is the Tera hidden regime state (Chapter 9).
  • \(\mathcal {A}_t\) is the HelixHash archive of structural signatures (Chapter 8).
  • \(\mathcal {L}_t\) is the lineage history (record of evolutionary modifications).

The Evolutor state encapsulates everything needed to reproduce the system’s behavior and continue its evolution. It is the DOGMA analogue of a cell’s complete state: genome + epigenome + cellular memory.

7.10 Why DOGMA Is Not Just a Modified Transformer

It is tempting to view DOGMA as “a transformer with extra steps.” This misses the fundamental architectural difference. Consider three levels of distinction:

1.
Ontological: In a transformer, the primary computational object is the token sequence. In DOGMA, the primary computational object is the genome—a persistent, typed, structured state from which tokens are merely one possible output.
2.
Control flow: In a transformer, all tokens interact uniformly through attention. In DOGMA, interaction is regulated—controlled by context-dependent activation maps that determine which regions participate.
3.
Evolutionary: A transformer’s parameters are fixed after training. A DOGMA genome can be evolved—modified through mutation, selection, and synthesis—enabling open-ended improvement without full retraining.

The relationship between DOGMA and transformers is analogous to the relationship between cells and chemical reactions. A cell contains chemical reactions, but a cell is not merely “chemistry with extra steps.” The organizational structure—membranes, organelles, regulatory networks, genetic programs—is what makes a cell fundamentally different from a random mixture of the same chemicals.

Similarly, DOGMA may contain attention mechanisms (within its Strand Attention stage or DNA Computing Block modules), but the organizational structure—TetraMemory, four-path DNA computing, regulation gating, codon translation, thermodynamic attention, epigenetic memory—is what makes it architecturally distinct.

7.11 Exercises

7.1.
[Fundamentals] For each of the six DOGMA stages (TetraMemory, DNA Computing Block, Regulation Gate, Codon Translation, Strand Attention, Epigenetic+Allosteric), identify the corresponding step in the biological Central Dogma and explain the mapping.
7.2.
[Analysis] Consider a DOGMA system processing a sequence of \(T = 4096\) tokens with embedding dimension \(d = 512\).
(a)
How many tetrahedra does Stage 1 create?
(b)
What is the sequence length after Stage 4 (Codon Translation)?
(c)
Compare the cost of Stage 5 Strand Attention (on the compressed sequence) with standard self-attention on the original 4096 tokens.
7.3.
[Design] The DNA Computing Block uses a learned softmax gate to merge four path outputs. Design an experiment to test whether all four paths are necessary. Describe what you would measure when ablating each path individually, and predict which path’s removal would cause the largest performance drop for (a) a language modeling task, (b) a protein structure prediction task.
7.4.
[Coding] Implement the four-equation Regulation Gate defined above in PyTorch. Create a test that verifies:
(a)
The output has the same shape as the input.
(b)
When the suppress gate outputs all ones, the regulated output is all zeros.
(c)
When both gates output 0.5, the net regulation is \(0.5 \times 0.5 = 0.25\) per element.
7.5.
[Theory] Prove that if the regulation stage produces an activation map with at most \(k\) nonzero entries (hard sparsity), then the computational cost of Stage 5 Strand Attention is \(O(k'^2 d)\) where \(k' = k/3\), rather than \(O((T/3)^2 d)\).
7.6.
[Research] Read about Mixture-of-Experts (MoE) architectures [Brown et al.2020]. Compare the MoE routing mechanism with DOGMA’s Regulation Gate. What are the key similarities and differences? Which approach offers better interpretability, and why?
7.7.
[Analysis] The Codon Translation stage uses a \(64 \to 21\) soft mapping initialized from the biological genetic code. Discuss:
(a)
Why is degeneracy (multiple codons \(\to \) same amino acid) beneficial for robustness?
(b)
Should the codon embeddings be frozen at their biological initialization or fine-tuned? Argue both sides.
7.8.
[Advanced] The Evolutor state \(\mathcal {E}_t = (\Gamma _t, H_t, \mathcal {A}_t, \mathcal {L}_t)\) maintains lineage history \(\mathcal {L}_t\). Discuss the computational and memory tradeoffs of maintaining full lineage vs. compressed lineage (keeping only the most recent \(m\) checkpoints). Under what conditions would compressed lineage lose important information?
7.9.
[Worked Example] Trace a sequence of \(T = 24\) tokens through the six-stage pipeline, showing tensor shapes at each stage. How many codons are produced? What is the final phenotype length?
7.10.
[Comparison] Using Table 7.5, explain why DOGMA is better suited than Mamba for tasks requiring bidirectional context, and why Mamba might be preferred for pure autoregressive generation at very long sequence lengths.

7.12 Key Takeaways

Key Takeaways

  • DOGMA’s six-stage pipeline processes data through TetraMemory \(\to \) DNA Computing Block \(\to \) Regulation Gate \(\to \) Codon Translation \(\to \) Strand Attention \(\to \) Epigenetic+Allosteric, followed by an Expression Folder that produces the phenotype.
  • The genomic base \(b_i = (\sigma _i, \tau _i, \rho _i, \omega _i)\) is DOGMA’s atomic unit, carrying a base embedding, type tag, compatibility vector, and weight.
  • Four base types (A, C, G, T) provide functional roles (Activation, Composition, Generation, Termination) with complementary pairing and Klein four-group symmetry.
  • TetraMemory achieves \(O(T)\) complexity by computing \(K_4\) local attention within groups of 4 tokens and propagating information through shared faces.
  • The DNA Computing Block runs four parallel paths (Strand Displacement, Parallel Scan, Stochastic Computing, Double Strand), three of which are independently Turing-complete, merged by a learned softmax gate.
  • The Regulation Gate implements express/suppress gating analogous to gene regulation, producing sparse activation patterns that reduce downstream computation.
  • Codon Translation compresses the sequence \(3:1\) through a differentiable \(64 \to 21\) mapping initialized from the biological genetic code.
  • Strand Attention uses thermodynamic \(\Delta G\) binding energies (inspired by SantaLucia nearest-neighbor parameters) instead of dot-product scores.
  • Epigenetic memory (\(O(TM)\)) provides persistent state across time steps; allosteric broadcast (\(O(Tk)\)) provides fast global context from \(k\) selected sites.
  • The Expression Folder converts the final representation into a phenotype that can be realized into text, code, structured data, or other modalities.
  • DOGMA is not a modified transformer but a fundamentally different organizational paradigm: genome-first, regulation-controlled, evolution-capable, with built-in redundancy through multiple Turing-complete paths.

Suggested Reading

  • Crick [1970]: The original Central Dogma, DOGMA’s biological inspiration.
  • Vaswani et al. [2017a]: The transformer architecture, for comparison.
  • Gu and Dao [2023]: State-space models, related to DOGMA’s ParallelScan path.
  • Zhang and Seelig [2011]: DNA strand displacement, the basis for DOGMA’s Strand Displacement path.
  • ENCODE Project Consortium [2012]: The ENCODE project on gene regulation and expression sparsity.
  • Chapters 811 of this book: detailed treatments of DOGMA’s subsystems.