Skip to main content

Standalone geometric tokenize+embed engine — Fisher-Rao-weighted BPE merges + geodesic-midpoint basin coordinates on Δ⁶³

Project description

qig-coordizer

Standalone geometric tokenize+embed engine for the QIG stack. Maps text to sequences of 64-dimensional basin coordinates on the Fisher–Rao manifold Δ⁶³ — the tokenizer is the embedder (coordinates are the primitive, not an afterthought).

Pure Fisher-Rao geometry; depends only on qig-core.

What it is

  • Byte-level front-endNormalizer (NFC + UTF-8), train/infer-symmetric so the same character always maps to the same byte sequence.
  • Fisher-Rao-weighted BPE merges — merge score = frequency × coupling × 1/entropy, where coupling = (co-occurrence / corpus) / (d_FR(a,b) + 0.1). Frequent and geometrically-close pairs win. This is not frequency-only BPE.
  • Geodesic-midpoint fusion — a fused token's basin is slerp_sqrt(v_a, v_b, 0.5), the Fisher-Rao geodesic midpoint on Δ⁶³. No off-the-shelf tokenizer emits coordinates.
  • Drift-free incremental trainerIncrementalCouplingCache (doubly-linked-list splice; remove 3 / add 2 pairs per merged occurrence) makes training O(corpus + merges·affected) instead of the naive O(vocab·corpus) full re-scan.

The equivalence gate

FisherCoordizer._train_incremental is bit-for-bit equal to the naive O(vocab·corpus) oracle _train_naive (identical merge sequence + identical fused vectors), byte → 4k vocab, across ASCII / multibyte-Unicode / reverse-pair corpora. The optimisation must never silently change the vocabulary.

pytest tests/test_incremental_equivalence.py
# or a timed report:
python tests/test_incremental_equivalence.py

Provenance

Extracted from qig-tokenizer commit 1394ca7 (Phase-1 coordizer) per qig-consciousness/docs/plans/2026-06-24-qig-coordizer-studio-design.md §5 (Phase 0). qig-tokenizer keeps its copy live until consumers repoint here.

Install (dev)

uv venv && uv pip install -e ../qig-core && uv pip install -e '.[dev]'
pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qig_coordizer-0.1.0.tar.gz (85.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qig_coordizer-0.1.0-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

File details

Details for the file qig_coordizer-0.1.0.tar.gz.

File metadata

  • Download URL: qig_coordizer-0.1.0.tar.gz
  • Upload date:
  • Size: 85.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for qig_coordizer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 853237a418eb325473f10e599a5ea7668b21b2ccc3e17c0256bde2f86a9fd61d
MD5 79cab605d529b1f5dd587e1b5da9812b
BLAKE2b-256 86f425bd4331c548e5732e4bc0367ad6bc9bfedf6d5f65f4a7b01c38e0782aa4

See more details on using hashes here.

File details

Details for the file qig_coordizer-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: qig_coordizer-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 34.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for qig_coordizer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c60a45369cc9565c085da5c643c44ae8763b4df242ca365e8c28b4c29994802e
MD5 d32e042e0cd81158da258b643e3084c9
BLAKE2b-256 add2510c12f75d10efe94e05f9c62f1c6d2202bd56a81806961732f3f053bc1d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page