Datasets:
activations list | mask list | tokens list |
|---|---|---|
[-7.53125,-16.375,92.5,-8.6875,-36.0,88.5,33.75,-3.171875,-25.125,25.125,65.0,80.0,-28.125,-25.875,3(...TRUNCATED) | [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1(...TRUNCATED) | [2,8999,236772,826,236772,71049,236764,78929,568,46669,236768,2617,132055,18654,236764,2250,212054,5(...TRUNCATED) |
[-7.53125,-16.375,92.5,-8.6875,-36.0,88.5,33.75,-3.171875,-25.125,25.125,65.0,80.0,-28.125,-25.875,3(...TRUNCATED) | [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1(...TRUNCATED) | [2,43897,21844,529,1883,62692,29456,20239,22339,657,496,7073,28708,528,842,236761,11210,580,8224,236(...TRUNCATED) |
[-7.53125,-16.375,92.5,-8.6875,-36.0,88.5,33.75,-3.171875,-25.125,25.125,65.0,80.0,-28.125,-25.875,3(...TRUNCATED) | [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1(...TRUNCATED) | [2,818,19490,8977,684,4321,1954,659,910,1852,532,776,711,2754,506,8208,529,12258,31300,236761,854,23(...TRUNCATED) |
[-7.53125,-16.375,92.5,-8.6875,-36.0,88.5,33.75,-3.171875,-25.125,25.125,65.0,80.0,-28.125,-25.875,3(...TRUNCATED) | [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1(...TRUNCATED) | [2,107289,168376,563,886,529,1724,13906,20880,600,161775,5192,236761,1030,236858,236751,886,529,1724(...TRUNCATED) |
[-7.53125,-16.375,92.5,-8.6875,-36.0,88.5,33.75,-3.171875,-25.125,25.125,65.0,80.0,-28.125,-25.875,3(...TRUNCATED) | [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1(...TRUNCATED) | [2,59248,26052,10371,236888,564,1281,236761,2981,236858,236751,1144,611,236858,500,6420,1447,1492,23(...TRUNCATED) |
[-7.53125,-16.375,92.5,-8.6875,-36.0,88.5,33.75,-3.171875,-25.125,25.125,65.0,80.0,-28.125,-25.875,3(...TRUNCATED) | [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1(...TRUNCATED) | [2,236776,62526,50209,589,32057,529,200762,20329,54584,2342,37166,532,224257,153778,496,17708,880,53(...TRUNCATED) |
[-7.53125,-16.375,92.5,-8.6875,-36.0,88.5,33.75,-3.171875,-25.125,25.125,65.0,80.0,-28.125,-25.875,3(...TRUNCATED) | [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1(...TRUNCATED) | [2,237858,4943,25930,8634,6535,573,2141,236776,6156,19446,26228,183440,13536,840,3496,6544,2342,625,(...TRUNCATED) |
[-7.53125,-16.375,92.5,-8.6875,-36.0,88.5,33.75,-3.171875,-25.125,25.125,65.0,80.0,-28.125,-25.875,3(...TRUNCATED) | [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1(...TRUNCATED) | [2,17076,236764,31601,7735,3731,528,36285,236858,4106,529,10598,236764,618,1388,618,14146,3731,657,5(...TRUNCATED) |
[-7.53125,-16.375,92.5,-8.6875,-36.0,88.5,33.75,-3.171875,-25.125,25.125,65.0,80.0,-28.125,-25.875,3(...TRUNCATED) | [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1(...TRUNCATED) | [2,25907,21568,8575,13134,65342,1286,236761,9943,27873,965,7449,73280,108,25907,15400,21323,531,4304(...TRUNCATED) |
[-7.53125,-16.375,92.5,-8.6875,-36.0,88.5,33.75,-3.171875,-25.125,25.125,65.0,80.0,-28.125,-25.875,3(...TRUNCATED) | [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1(...TRUNCATED) | [2,1882,236858,560,2462,56594,130850,618,506,2033,529,52006,586,12158,25769,236764,20973,2198,4252,5(...TRUNCATED) |
OpenWebText — Gemma-3-1B Hidden State Activations (Layer 23)
Precomputed hidden state activations before layer 23 of Gemma-3-1B-IT for the OpenWebText dataset, tokenized with sequence length 1024.
Designed for training a Titans memory layer that replaces layer 23 of Gemma 3.
Dataset Structure
Each example contains the inputs to layer 23:
| Field | Shape | Dtype | Description |
|---|---|---|---|
activations |
(1024, 1152) |
float32 |
Hidden state activations (cast from bfloat16) |
mask |
(1024,) |
int32 |
Attention mask (1=real token, 0=pad) |
tokens |
(1024,) |
int32 |
Token IDs |
- Total examples: ~71,744
- Examples per NPY shard: 64
- Examples per Parquet file: 640 (10 NPY shards)
- Sequence length: 1024
- Hidden dimension: 1152 (Gemma-3-1B embed_dim)
- Source model:
google/gemma-3-1b-it - Source dataset:
veriga/openwebtext-gemma3-tokenized-1024
Files
| Format | Files | Location |
|---|---|---|
| Parquet (recommended) | 113 files | data/train-NNNNNN-NNNNNN.parquet |
| NPY (original) | 3363 files | shard_NNNNNN.npy, shard_NNNNNN_masks.npy, shard_NNNNNN_tokens.npy |
Parquet files use ZSTD compression (level 3) and store activations as a flat fixed_size_list<float32>[1179648] (reshape to 1024 × 1152 after loading).
How It Was Created
Activations were computed using a truncated forward pass through the first 23 Gemma 3 transformer layers:
- Load OpenWebText tokens from
veriga/openwebtext-gemma3-tokenized-1024 - Pad/truncate to 1024 tokens, generate attention masks
- Forward pass through layers 0–22 of Gemma-3-1B-IT
- Apply attention mask:
hidden * mask[:, :, None](zero out padding positions) - Save as
.npyshards inbfloat16
See the precomputation notebook for full details.
Parquet conversion: Convert_NPY_to_Parquet.ipynb
Loading the Dataset
Standard (loads Parquet)
from datasets import load_dataset
ds = load_dataset("veriga/openwebtext-gemma3-tokenized-1024-activations-layer23", split="train")
example = ds[0]
activations = example["activations"] # list of 1179648 floats
mask = example["mask"] # list of 1024 ints
tokens = example["tokens"] # list of 1024 ints
# Reshape activations
import numpy as np
act = np.array(activations, dtype=np.float32).reshape(1024, 1152)
Streaming (recommended — no download)
ds = load_dataset(
"veriga/openwebtext-gemma3-tokenized-1024-activations-layer23",
split="train",
streaming=True
)
import numpy as np
for example in ds:
act = np.array(example["activations"], dtype=np.float32).reshape(1024, 1152)
mask = np.array(example["mask"])
tokens = np.array(example["tokens"])
# Use for Titans training...
Direct Parquet access (no HF datasets)
import pyarrow.parquet as pq
import numpy as np
# From HuggingFace Hub
from huggingface_hub import hf_hub_download
path = hf_hub_download(
repo_id="veriga/openwebtext-gemma3-tokenized-1024-activations-layer23",
filename="data/train-000000-000009.parquet",
repo_type="dataset",
)
table = pq.read_table(path)
row = table.slice(0, 1).to_pydict()
act = np.array(row["activations"][0], dtype=np.float32).reshape(1024, 1152)
mask = np.array(row["mask"][0])
tokens = np.array(row["tokens"][0])
Original NPY files
import jax.numpy as jnp # or use ml_dtypes for np.load with bfloat16
import numpy as np
activations = np.array(jnp.load("shard_000000.npy"), dtype=np.float32) # (64, 1024, 1152)
mask = np.load("shard_000000_masks.npy") # (64, 1024)
tokens = np.load("shard_000000_tokens.npy") # (64, 1024)
Use Case: Titans Memory Layer
This dataset provides inputs for training a Titans long-term memory module that replaces layer 23 of Gemma 3. The precomputed activations allow training the memory layer independently without running the full model forward pass through the first 22 layers.
Notes
- Original activations stored in
bfloat16(NPY); Parquet cast tofloat32 - Padding positions in activations are zeroed out via attention mask multiplication
- The first token in each sequence is the BOS token (ID=2)
- Downloads last month
- 3,202