Transformers
grt
geometric-rotation-transformer
tokenizer
polar-embedding
phase-angle-embedding
rotational-transformer
qwen3
matterwave
Instructions to use MatterWaveAI/grt-30m-tokenizer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MatterWaveAI/grt-30m-tokenizer with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("MatterWaveAI/grt-30m-tokenizer", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Release MatterWaveAI/grt-30m-tokenizer (BPE tokenizer + 19.57M shared polar phase-angle embedding bank)
Browse files- .gitattributes +1 -0
- README.md +84 -0
- SHA256SUMS +5 -0
- config.json +12 -0
- polar_embedding.safetensors +3 -0
- tokenizer.json +3 -0
- tokenizer_config.json +30 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: transformers
|
| 4 |
+
tags:
|
| 5 |
+
- grt
|
| 6 |
+
- geometric-rotation-transformer
|
| 7 |
+
- tokenizer
|
| 8 |
+
- polar-embedding
|
| 9 |
+
- phase-angle-embedding
|
| 10 |
+
- rotational-transformer
|
| 11 |
+
- qwen3
|
| 12 |
+
- matterwave
|
| 13 |
+
base_model: MatterWaveAI/grt-30m
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# GRT-30M-Tokenizer (`MatterWaveAI/grt-30m-tokenizer`)
|
| 17 |
+
|
| 18 |
+
Canonical **BPE Tokenizer (`151,669` tokens)** and shared **Polar Phase-Angle Token Embedding Bank (`19,565,302` parameters, `0 nn.Linear` layers)** for the **GRT-30M Research Suite**:
|
| 19 |
+
- [`MatterWaveAI/grt-30m`](https://huggingface.co/MatterWaveAI/grt-30m) (Base Causal LM)
|
| 20 |
+
- [`MatterWaveAI/grt-30m-chat`](https://huggingface.co/MatterWaveAI/grt-30m-chat) (ChatML Conversational SFT)
|
| 21 |
+
- [`MatterWaveAI/grt-30m-mor`](https://huggingface.co/MatterWaveAI/grt-30m-mor) (4-Expert Mixture-of-Rotations Causal LM)
|
| 22 |
+
- [`MatterWaveAI/grt-30m-embedding`](https://huggingface.co/MatterWaveAI/grt-30m-embedding) (Circular-Pooled Bi-Encoder)
|
| 23 |
+
- [`MatterWaveAI/grt-30m-reranker`](https://huggingface.co/MatterWaveAI/grt-30m-reranker) (Rotational Cross-Encoder Reranker)
|
| 24 |
+
- [`MatterWaveAI/grt-30m-vl`](https://huggingface.co/MatterWaveAI/grt-30m-vl) (100% Rotational Vision-Language Model)
|
| 25 |
+
|
| 26 |
+
---
|
| 27 |
+
|
| 28 |
+
## What Is Included
|
| 29 |
+
|
| 30 |
+
| File | Size | Contents |
|
| 31 |
+
| :--- | :---: | :--- |
|
| 32 |
+
| `tokenizer.json` | `11.4 MB` | Rust `PreTrainedTokenizerFast` BPE vocabulary (`151,669` tokens, Qwen 3 compatible + ChatML special tokens) |
|
| 33 |
+
| `tokenizer_config.json` | `1.2 KB` | Tokenizer configuration including the ChatML `chat_template` (`<|im_start|>` / `<|im_end|>`) |
|
| 34 |
+
| `polar_embedding.safetensors` | `78.3 MB` | Shared polar phase-angle embedding table & tied cosine head scale (`19,565,302` FP32 parameters) |
|
| 35 |
+
| `config.json` | `310 B` | Polar embedding geometry metadata (`vocab_size = 151669`, `hidden_size = 256`, `n_pairs = 128`) |
|
| 36 |
+
|
| 37 |
+
### Polar Embedding Tensors (`polar_embedding.safetensors`)
|
| 38 |
+
|
| 39 |
+
In the Geometric Rotation Transformer (`GRT`), token embeddings live in polar coordinates on `128` orthogonal `2D` planes (`hidden_size = 256`) rather than an unstructured Euclidean matrix:
|
| 40 |
+
```text
|
| 41 |
+
e(token_id)[2p] = exp(log_magnitude[token_id]) · cos(phase_angles[token_id, p])
|
| 42 |
+
e(token_id)[2p+1] = exp(log_magnitude[token_id]) · sin(phase_angles[token_id, p])
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
| Tensor Name | Shape | Parameters | Role |
|
| 46 |
+
| :--- | :---: | :---: | :--- |
|
| 47 |
+
| `embedding.phase_angles` | `[151669, 128]` | `19,413,632` | Per-token phase angles `θ` on the 128-torus `(S¹)^128` (tied between input embedding and output `GRTCosineHead`) |
|
| 48 |
+
| `embedding.log_magnitude` | `[151669]` | `151,669` | Per-token radial log-magnitude offset |
|
| 49 |
+
| `lm_head.output_scale` | `[]` (scalar) | `1` | Raw softplus temperature scale for the tied polar cosine language modeling head |
|
| 50 |
+
| **Total** | — | **`19,565,302`** | **`66.8%` of `grt-30m` total parameters (shared identically across all 6 `grt-30m*` models)** |
|
| 51 |
+
|
| 52 |
+
---
|
| 53 |
+
|
| 54 |
+
## Quickstart
|
| 55 |
+
|
| 56 |
+
### 1. Load the Tokenizer (`transformers` / `vLLM`)
|
| 57 |
+
|
| 58 |
+
```python
|
| 59 |
+
from transformers import AutoTokenizer
|
| 60 |
+
|
| 61 |
+
tokenizer = AutoTokenizer.from_pretrained("MatterWaveAI/grt-30m-tokenizer")
|
| 62 |
+
tokens = tokenizer("The Givens Rotational Transformer replaces dense matrices with")
|
| 63 |
+
print(tokens["input_ids"])
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
### 2. Load the Shared Polar Embedding Table (`safetensors`)
|
| 67 |
+
|
| 68 |
+
```python
|
| 69 |
+
import torch
|
| 70 |
+
from huggingface_hub import hf_hub_download
|
| 71 |
+
from safetensors.torch import load_file
|
| 72 |
+
|
| 73 |
+
path = hf_hub_download("MatterWaveAI/grt-30m-tokenizer", "polar_embedding.safetensors")
|
| 74 |
+
polar_bank = load_file(path)
|
| 75 |
+
|
| 76 |
+
phase_angles = polar_bank["embedding.phase_angles"] # [151669, 128]
|
| 77 |
+
log_magnitude = polar_bank["embedding.log_magnitude"] # [151669]
|
| 78 |
+
output_scale = polar_bank["lm_head.output_scale"] # []
|
| 79 |
+
print(phase_angles.shape, log_magnitude.shape, output_scale.shape)
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
### 3. Harmonic Upcycling to Larger `d_model` (`256 → 512` or `1024`)
|
| 83 |
+
|
| 84 |
+
When scaling a new GRT backbone to a wider `d_model = 256 · k` (`n_pairs = 128 · k`), tile `embedding.phase_angles` by `k` along dim `-1` (`phase_angles.repeat(1, k)`) to preserve all pairwise token cosine similarities at initialization.
|
SHA256SUMS
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
4c7ed24fcbaf5b1c62ec160296e682eb7b700ea19d88f0a8e01e363b125d505f config.json
|
| 2 |
+
ffb11d3b6b961df2d916e158137d6f0aa93d6ae8b6c98630f781ec9a6fa9877b polar_embedding.safetensors
|
| 3 |
+
393ae1ae75bce22d1d3fce5b51ac74232b8893a1f4e8dc873d46a3a6052c4c6b README.md
|
| 4 |
+
be75606093db2094d7cd20f3c2f385c212750648bd6ea4fb2bf507a6a4c55506 tokenizer.json
|
| 5 |
+
b0b05688d53eec97348d23f9a203772fa28f12bdc8a0f6f5401f41568ec6ca31 tokenizer_config.json
|
config.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "grt",
|
| 3 |
+
"vocab_size": 151669,
|
| 4 |
+
"hidden_size": 256,
|
| 5 |
+
"n_pairs": 128,
|
| 6 |
+
"bos_token_id": 151643,
|
| 7 |
+
"eos_token_id": 151643,
|
| 8 |
+
"pad_token_id": 151643,
|
| 9 |
+
"output_scale_init": 30.0,
|
| 10 |
+
"polar_embedding_parameters": 19565302,
|
| 11 |
+
"polar_embedding_file": "polar_embedding.safetensors"
|
| 12 |
+
}
|
polar_embedding.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ffb11d3b6b961df2d916e158137d6f0aa93d6ae8b6c98630f781ec9a6fa9877b
|
| 3 |
+
size 78261488
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:be75606093db2094d7cd20f3c2f385c212750648bd6ea4fb2bf507a6a4c55506
|
| 3 |
+
size 11422650
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": null,
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eos_token": "<|endoftext|>",
|
| 7 |
+
"errors": "replace",
|
| 8 |
+
"extra_special_tokens": [
|
| 9 |
+
"<|im_start|>",
|
| 10 |
+
"<|im_end|>",
|
| 11 |
+
"<|object_ref_start|>",
|
| 12 |
+
"<|object_ref_end|>",
|
| 13 |
+
"<|box_start|>",
|
| 14 |
+
"<|box_end|>",
|
| 15 |
+
"<|quad_start|>",
|
| 16 |
+
"<|quad_end|>",
|
| 17 |
+
"<|vision_start|>",
|
| 18 |
+
"<|vision_end|>",
|
| 19 |
+
"<|vision_pad|>",
|
| 20 |
+
"<|image_pad|>",
|
| 21 |
+
"<|video_pad|>"
|
| 22 |
+
],
|
| 23 |
+
"is_local": true,
|
| 24 |
+
"local_files_only": false,
|
| 25 |
+
"model_max_length": 131072,
|
| 26 |
+
"pad_token": "<|endoftext|>",
|
| 27 |
+
"split_special_tokens": false,
|
| 28 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 29 |
+
"unk_token": null
|
| 30 |
+
}
|