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.1.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.1-py3-none-any.whl (34.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qig_coordizer-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 5763b8e0ab9f94b556a1e9187783a7a05bfced9d4887546b9f1122dadd197136
MD5 42415503cbb7d58790f8ec59457cd88c
BLAKE2b-256 10ce19e43144690fe9322c8cc1b00e3122ae98e995a4e7463b5870902c621ece

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qig_coordizer-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 34.4 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5e965c14e880acd464e30504d545f9be94d5d1aaf904679c1c8cab66c7d012d9
MD5 8639189030047b3b4170d78cf39797a4
BLAKE2b-256 dceb664d52df6b6b54dd5f9cefaafbc3154da6ce7f9fe2b21739d7c50851ac1f

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