Update README.md
Browse files
README.md
CHANGED
|
@@ -25,7 +25,7 @@ MotifChord-Base is a 172 M parameter decoder-only causal language model built ar
|
|
| 25 |
| :--- | :--- |
|
| 26 |
| Architecture | Decoder-only causal LM, hybrid gated delta-net + chord attention, intra-block attention residual |
|
| 27 |
| Embedding | 40,960 × 768, tied to the output head |
|
| 28 |
-
| Layers | 4
|
| 29 |
| Attention heads | 12 query heads / 3 kv heads (GQA); key head dim 64 for the gated delta-net, value expansion 2 |
|
| 30 |
| Context | Trained in stages from 1024 up to 4096 tokens; the inference cache has no fixed limit |
|
| 31 |
| License | Apache-2.0 |
|
|
@@ -33,11 +33,11 @@ MotifChord-Base is a 172 M parameter decoder-only causal language model built ar
|
|
| 33 |
|
| 34 |
## Architecture
|
| 35 |
|
| 36 |
-
The stack is an embedding, four
|
| 37 |
|
| 38 |
-
- **Gated delta-net**
|
| 39 |
-
- **Chord attention**
|
| 40 |
-
- **Intra-block attention residual**
|
| 41 |
|
| 42 |
The architecture follows Gated DeltaNet (Yang et al., 2025), Attention Residuals (Kimi Team, 2026), the Bayesian Attention Mechanism (Bianchessi et al., 2026) and the Qwen3 hybrid-attention recipe.
|
| 43 |
|
|
@@ -46,7 +46,7 @@ The architecture follows Gated DeltaNet (Yang et al., 2025), Attention Residuals
|
|
| 46 |
- **Primary**: text completion and continuation with the base weights; research on hybrid attention, linear-attention recurrence and attention residuals; a small local model for CPU or single-GPU experiments.
|
| 47 |
- **Out of scope**: instruction following, chat, tool use, retrieval, safety-critical or production decisions, and any use that treats the output as factual. The weights have had **no** instruction tuning and **no** alignment; the model continues text, which includes continuing it badly.
|
| 48 |
|
| 49 |
-
|
| 50 |
|
| 51 |
## How to use
|
| 52 |
|
|
@@ -71,7 +71,7 @@ generation = TextGeneration(
|
|
| 71 |
print(generation.run().text)
|
| 72 |
```
|
| 73 |
|
| 74 |
-
`from_pretrained` accepts a safetensors file or shard directory (with an optional `config.json` sidecar), a bare
|
| 75 |
|
| 76 |
### Sampling
|
| 77 |
|
|
@@ -89,7 +89,6 @@ The base weights were trained on raw text, so a plain prefix is the right prompt
|
|
| 89 |
| Steps | 4,042,962 (the last checkpoint records `step = 4042960`) |
|
| 90 |
| Sequence length | 1024 → 2048 → 4096, progressive |
|
| 91 |
| Hardware | one 32 GB consumer GPU |
|
| 92 |
-
| Precision | bfloat16, with float32 paths for the residual reads |
|
| 93 |
| Final loss | cross-entropy ≈ 2.9 on the pretraining mixture |
|
| 94 |
|
| 95 |
The stages the published curve marks with dashed lines:
|
|
|
|
| 25 |
| :--- | :--- |
|
| 26 |
| Architecture | Decoder-only causal LM, hybrid gated delta-net + chord attention, intra-block attention residual |
|
| 27 |
| Embedding | 40,960 × 768, tied to the output head |
|
| 28 |
+
| Layers | 4 blocks × 4 sub-layers = 16 layers; each block holds 3 gated delta-net layers and 1 chord layer |
|
| 29 |
| Attention heads | 12 query heads / 3 kv heads (GQA); key head dim 64 for the gated delta-net, value expansion 2 |
|
| 30 |
| Context | Trained in stages from 1024 up to 4096 tokens; the inference cache has no fixed limit |
|
| 31 |
| License | Apache-2.0 |
|
|
|
|
| 33 |
|
| 34 |
## Architecture
|
| 35 |
|
| 36 |
+
The stack is an embedding, four blocks and a final RMSNorm + LM head. Inside a block, four sub-layers run in sequence; each one is a parallel attention-and-MLP residual, `x = x + attn(norm(x)) + mlp(norm(x))`, 768 wide, with a SwiGLU MLP.
|
| 37 |
|
| 38 |
+
- **Gated delta-net** carries three of the four sub-layers with a linear-time chunked recurrence. Its state is a fixed-size matrix, so the memory a long sequence costs does not grow with its length. A short causal convolution (Conv1d + SiLU) sits in front of q, k and v.
|
| 39 |
+
- **Chord attention** is exact softmax attention whose scores carry a gated geometric-decay bias, `-alpha * (|d - mu| + eps) ** beta`, with `alpha`, `beta` and `mu` learnable per head (`mu` is frozen). This stands in for RoPE — a Bayesian positional prior at the cost of a few parameters per head, and no position table to extend.
|
| 40 |
+
- **Intra-block attention residual** makes each sub-layer read the outputs of the earlier sub-layers in the same block through a learnable query vector and an RMSNorm, instead of the fixed `x + f(x)`. It is the lightweight intra-block form of Attention Residuals (Kimi Team), not a global aggregation across blocks. A fused Triton kernel implements the read, with an eager fallback when a call does not qualify. In the figure, `w` marks an RMSNorm, `s` a sigmoid gate and `a` an attn-res read.
|
| 41 |
|
| 42 |
The architecture follows Gated DeltaNet (Yang et al., 2025), Attention Residuals (Kimi Team, 2026), the Bayesian Attention Mechanism (Bianchessi et al., 2026) and the Qwen3 hybrid-attention recipe.
|
| 43 |
|
|
|
|
| 46 |
- **Primary**: text completion and continuation with the base weights; research on hybrid attention, linear-attention recurrence and attention residuals; a small local model for CPU or single-GPU experiments.
|
| 47 |
- **Out of scope**: instruction following, chat, tool use, retrieval, safety-critical or production decisions, and any use that treats the output as factual. The weights have had **no** instruction tuning and **no** alignment; the model continues text, which includes continuing it badly.
|
| 48 |
|
| 49 |
+
Post-training and a chat template exist for development, but no chat checkpoint is released. With these weights, use plain text completion.
|
| 50 |
|
| 51 |
## How to use
|
| 52 |
|
|
|
|
| 71 |
print(generation.run().text)
|
| 72 |
```
|
| 73 |
|
| 74 |
+
`from_pretrained` accepts a safetensors file or shard directory (with an optional `config.json` sidecar), a bare PyTorch state dict, and the training checkpoints written by this project's pipelines. When a file carries no config, the hyper-parameters are recovered from the tensor shapes.
|
| 75 |
|
| 76 |
### Sampling
|
| 77 |
|
|
|
|
| 89 |
| Steps | 4,042,962 (the last checkpoint records `step = 4042960`) |
|
| 90 |
| Sequence length | 1024 → 2048 → 4096, progressive |
|
| 91 |
| Hardware | one 32 GB consumer GPU |
|
|
|
|
| 92 |
| Final loss | cross-entropy ≈ 2.9 on the pretraining mixture |
|
| 93 |
|
| 94 |
The stages the published curve marks with dashed lines:
|