The dataset viewer is not available for this split.
Error code: StreamingRowsError
Exception: TypeError
Message: Couldn't cast array of type
struct<1: struct<records: int64, rows: int64, seconds: double, total_count: double>, 2: struct<missing_parent: int64, records: int64, rows: int64, seconds: double>, 3: struct<missing_parent: int64, records: int64, rows: int64, seconds: double>, 4: struct<missing_parent: int64, records: int64, rows: int64, seconds: double>, 5: struct<missing_parent: int64, records: int64, rows: int64, seconds: double>, 6: struct<missing_parent: int64, records: int64, rows: int64, seconds: double>, 7: struct<missing_parent: int64, records: int64, rows: int64, seconds: double>>
to
{'1': {'records': Value('int64'), 'rows': Value('int64'), 'seconds': Value('float64'), 'total_count': Value('float64')}, '2': {'missing_parent': Value('int64'), 'records': Value('int64'), 'rows': Value('int64'), 'seconds': Value('float64')}, '3': {'missing_parent': Value('int64'), 'records': Value('int64'), 'rows': Value('int64'), 'seconds': Value('float64')}, '4': {'missing_parent': Value('int64'), 'records': Value('int64'), 'rows': Value('int64'), 'seconds': Value('float64')}, '5': {'missing_parent': Value('int64'), 'records': Value('int64'), 'rows': Value('int64'), 'seconds': Value('float64')}, '6': {'missing_parent': Value('int64'), 'records': Value('int64'), 'rows': Value('int64'), 'seconds': Value('float64')}}
Traceback: Traceback (most recent call last):
File "/src/services/worker/src/worker/utils.py", line 147, in get_rows_or_raise
return get_rows(
dataset=dataset,
...<4 lines>...
column_names=column_names,
)
File "/src/libs/libcommon/src/libcommon/utils.py", line 272, in decorator
return func(*args, **kwargs)
File "/src/services/worker/src/worker/utils.py", line 127, in get_rows
rows_plus_one = list(itertools.islice(safe_iter(ds, dataset=dataset), rows_max_number + 1))
File "/src/services/worker/src/worker/utils.py", line 483, in safe_iter
yield from ds.decode(False) if ds.features else ds
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2951, in __iter__
for key, example in ex_iterable:
^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2461, in __iter__
for key, pa_table in self._iter_arrow():
~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2486, in _iter_arrow
for key, pa_table in self.ex_iterable._iter_arrow():
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 547, in _iter_arrow
for key, pa_table in iterator:
^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 430, in _iter_arrow
for key, pa_table in self.generate_tables_fn(**gen_kwags):
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 343, in _generate_tables
self._cast_table(pa_table, json_field_paths=json_field_paths),
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 132, in _cast_table
pa_table = table_cast(pa_table, self.info.features.arrow_schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2378, in table_cast
return cast_table_to_schema(table, schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2312, in cast_table_to_schema
cast_array_to_feature(
~~~~~~~~~~~~~~~~~~~~~^
table[name] if name in table_column_names else pa.array([None] * len(table), type=schema.field(name).type),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
feature,
^^^^^^^^
)
^
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 1861, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2068, in cast_array_to_feature
_c(array.field(name) if name in array_fields else null_array, subfeature)
~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 1863, in wrapper
return func(array, *args, **kwargs)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2068, in cast_array_to_feature
_c(array.field(name) if name in array_fields else null_array, subfeature)
~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 1863, in wrapper
return func(array, *args, **kwargs)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2158, in cast_array_to_feature
raise TypeError(f"Couldn't cast array of type\n{_short_str(array.type)}\nto\n{_short_str(feature)}")
TypeError: Couldn't cast array of type
struct<1: struct<records: int64, rows: int64, seconds: double, total_count: double>, 2: struct<missing_parent: int64, records: int64, rows: int64, seconds: double>, 3: struct<missing_parent: int64, records: int64, rows: int64, seconds: double>, 4: struct<missing_parent: int64, records: int64, rows: int64, seconds: double>, 5: struct<missing_parent: int64, records: int64, rows: int64, seconds: double>, 6: struct<missing_parent: int64, records: int64, rows: int64, seconds: double>, 7: struct<missing_parent: int64, records: int64, rows: int64, seconds: double>>
to
{'1': {'records': Value('int64'), 'rows': Value('int64'), 'seconds': Value('float64'), 'total_count': Value('float64')}, '2': {'missing_parent': Value('int64'), 'records': Value('int64'), 'rows': Value('int64'), 'seconds': Value('float64')}, '3': {'missing_parent': Value('int64'), 'records': Value('int64'), 'rows': Value('int64'), 'seconds': Value('float64')}, '4': {'missing_parent': Value('int64'), 'records': Value('int64'), 'rows': Value('int64'), 'seconds': Value('float64')}, '5': {'missing_parent': Value('int64'), 'records': Value('int64'), 'rows': Value('int64'), 'seconds': Value('float64')}, '6': {'missing_parent': Value('int64'), 'records': Value('int64'), 'rows': Value('int64'), 'seconds': Value('float64')}}Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
COUNT n-gram tables
Packed n-gram tables for The COUNT: Counting N-grams Unlocks Scaling on Host Memory and Training-Free Adaptation (paper, code).
Each table maps every stored n-gram history (up to five tokens of context, so n-grams through order six) to its 32 most frequent next tokens and their stupid-backoff scores. Stupid backoff scores a next token by its count after the longest matching history, divided by that history's count, and multiplies by 0.4 for each step back to a shorter history. COUNT reads these tables from CPU RAM during training and inference; nothing in them is learned.
Tables
| Directory | Size | Corpus | Use in the paper |
|---|---|---|---|
tables/general-797gb |
797.5 GB | Dolma 3 pretraining corpus | Training the 370M–1B COUNT models |
tables/general-142gb |
142.0 GB | Dolma 3 pretraining corpus | Smaller table swapped in at inference |
tables/general-17gb |
17.1 GB | Dolma 3 pretraining corpus | Training the 60M–190M COUNT models; smallest swap-in table |
tables/math-83gb |
83.4 GB | Dolmino Math subset of the Dolma 3 Dolmino pool (10.66B tokens) | Math domain swap |
tables/biomedical-82gb |
81.7 GB | Health topic split of Dolma 3's olmOCR science-PDF source (95.39B tokens) | Biomedical domain swap |
tables/law-80gb |
80.2 GB | Crime-and-law topic split of Dolma 3's olmOCR science-PDF source (12.34B tokens) | Law domain swap |
All tables use the Dolma 2 tokenizer (allenai/dolma2-tokenizer, vocabulary 100,278), n-gram
orders 1–6, and 32 next tokens per history. The general tables differ in how many histories they
keep: a history is stored only if it occurs at least this many times in the corpus. Order 1 has a
single row, the empty history, whose next tokens are the most frequent tokens overall; order 2 has one
row per single-token history.
| Table | Minimum history count | Histories stored, orders 1 / 2 / 3 / 4 / 5 / 6 |
|---|---|---|
general-797gb |
265 | 1 / 100K / 213M / 1.04B / 1.66B / 1.52B |
general-142gb |
1,536 | 1 / 100K / 73M / 242M / 281M / 197M |
general-17gb |
12,319 | 1 / 99.7K / 18M / 35M / 28M / 15M |
math-83gb |
4 | 1 / 86K / 15M / 78M / 158M / 210M |
biomedical-82gb |
45 | 1 / 84K / 28M / 120M / 166M / 141M |
law-80gb |
8 | 1 / 83K / 25M / 108M / 161M / 151M |
build_manifest.json in each directory records the full construction settings and per-order row
counts. The paper's appendix describes the count extraction, including the pruning of rare n-grams
applied before scoring.
Files
Each table directory holds:
forward_index_topk.bin: the packed table. Per order, it stores the histories sorted for binary search, their 32 next-token IDs, one 8-bit score code per candidate (scores quantized linearly per order between the smallest stored score and zero), and a mask marking empty candidate slots.build_manifest.json: construction settings, per-order sizes, and the table's SHA-256.SHA256SUMS: checksums for every file.
The 797 GB table is larger than a single Hugging Face file allows, so it is split into four parts. Reassemble it after downloading (this needs about 800 GB of free disk):
cat forward_index_topk.bin.part-* > forward_index_topk.bin
sha256sum -c SHA256SUMS
Usage
The COUNT code reads a table directory with
olmo_core.data.count_table.CountLookup and takes it in training and evaluation as
--count-table-dir. Lookups are fastest with the table on a RAM filesystem such as /dev/shm.
To evaluate a trained COUNT model with a different table, pass that table's directory to
eval-checkpoint; --count-mix-table-dir and --count-mix-lambda interpolate two tables' scores,
which is how the paper mixes a domain table 1:3 with the general one.
hf download IanMagnusson/count-ngram-tables --repo-type dataset \
--include "tables/general-17gb/*" --local-dir /dev/shm/count-tables
Model checkpoints that use these tables: COUNT · learned n-gram embeddings · standard transformer.
License
The tables are derived from Dolma 3 and are released under the same ODC-By license. Counts over rare contexts can reveal short fragments of the source documents.
Citation
@article{magnusson2026count,
title = {The {COUNT}: Counting N-grams Unlocks Scaling on Host Memory and Training-Free Adaptation},
author = {Magnusson, Ian and Smith, Noah A. and Koh, Pang Wei},
journal = {arXiv preprint arXiv:2610.20456},
year = {2026}
}
- Downloads last month
- 18