AGI Counts: exact CPU and CUDA trainers
This research model predicts the next byte from up to eight previous bytes, using bounded frequency caches with backoff. The name does not imply transformer-level capabilities. All measured trainer variants below wrote the same CNT1 checkpoint.
Build and fit
On x86-64 Linux with GCC and AVX2:
g++ -O3 -march=native -pthread -std=c++17 cpu/fit.cpp -o counts-cpu
./counts-cpu train.bin result.cnt1
CUDA 12.8, measured on RTX 2080 Ti (SM 7.5; adjust the target for other GPUs):
nvcc -O3 -std=c++17 -arch=sm_75 -DFIT_THREADS=32 cuda/fit_cold.cu -o counts-cuda
./counts-cuda train.bin result.cnt1
nvcc -O3 -std=c++17 -arch=sm_75 -DFIT_THREADS=32 -DN_STREAMS=8 cuda/fit_batch.cu -o counts-cuda-batch
./counts-cuda-batch train.bin result1.cnt1 train.bin result2.cnt1
The batch executable takes input/output pairs and reuses its device allocations in one process. The AVX2 CPU batch source accepts the same pair syntax. Benchmarks include corpus reading and writing the output; warm measurements reuse a process, while cold measurements include startup. These results are for this corpus and host only.
| Mode | CPU Ryzen 9 3900X | GPU RTX 2080 Ti |
|---|---|---|
| Warm batch | 0.140 s | 0.097 s |
| Cold one-off | 0.152 s | 0.416 s |
Full measurements are in benchmarks/. Version 4 CUDA and CPU were also tested interleaved; those measurements are separate.
Checkpoint and corpus provenance
The gzip-compressed inference checkpoint is checkpoint/counts.cnt1.gz. The decompressed SHA-256 is 7ee55881119b970609b5cfc921a602ef5f56e3f74f9d9c5832bc87649b54dcca. Its counted contexts cover 56,250 records. The optional smoothing configuration was fitted on separate development windows.
The exact training corpus is 11,873,191 bytes, SHA-256 e58bc4084cfc06c5cf96ba65fb1fb38a244a691d2f09d389b09603eba92c8552. The source manifest is included. The assembled text and original held-out passages are not included because prior public distribution of the exact corpus and rights for every document were not verified.
CNT1 format: literal CNT1; uint32 row count; then for each occupied row uint8 depth, uint64 suffix key, uint32 total, uint16 number of nonzero counts, followed by repeated uint8 byte plus uint32 count. Integers are little-endian. Back off from the uniform distribution through available rows with p = (alpha * p + count) / (alpha + total). For calibrated smoothing, alpha at each depth is the stored order value plus beta times the row's number of nonzero counts.