Skip to main content

Tokenisation Entity Ontology

Token and Language Entities
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 01 November 2026
Audio Overview
TOKENISATION ENTITY ONTOLOGY — FLOW ALGEBRA
Semantic Library | Original companion formalisation | 2026-11-01
Source: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/token-and-language-entities/tokenisation-entity-ontology.html
Status: Original formalisation; source page not independently verified.

01. PURPOSE
Represent tokenisation as a reproducible, versioned transformation from input content into an ordered token sequence and its associated identifiers, spans and metadata.

02. ENTITY DEFINITION
TokenisationEntity := (source, normaliser, pretokeniser, model, vocabulary, special_token_policy, output, provenance).
Distinguish the tokenisation PROCESS from the tokeniser CONFIGURATION and the resulting TOKEN SEQUENCE.

03. STATE MODEL
S_t = (I_t, R_t, B_t, K_t)
I_t = input text or supported modality payload.
R_t = rules for normalisation, segmentation, mapping and validation.
B_t = boundaries: encoding, context length, trust, modality and sequence limits.
K_t = known vocabulary, tokeniser version and prior metadata.

04. INPUT CONTRACT
Input = (payload, modality, encoding, language_hint?, source_id?, timestamp?).
Preconditions: payload is available, modality is supported, and encoding can be interpreted.
Untrusted content remains data; tokenisation does not grant instruction authority.

05. CORE FLOW
E_t = expand(I_t, R_t)
V_t = {x in E_t | satisfies(x, B_t)}
x* = argmax_{x in V_t} P(x | I_t, R_t, B_t, K_t)
I_{t+1} = update(I_t, x*, observations)
For deterministic tokenisers, the argmax is a conceptual selection operator, not a claim of stochastic sampling.

06. TOKENISATION TRANSFORMATION
N = normalise(input, normalisation_policy)
P = pretokenise(N, segmentation_policy)
T = segment_and_map(P, tokeniser_model, vocabulary)
Y = apply_special_token_policy(T, policy)
O = validate(Y, constraints)
Output = (token_ids, token_strings?, offsets?, attention_mask?, metadata).

07. FORMAL ENCODING
encode_theta: Text -> V* where V* is a finite sequence of vocabulary identifiers.
T = encode_theta(x) = (t_1, ..., t_n), t_i in V.
Length L(T) = n; valid(T) iff all t_i are in V and n <= context_limit.

08. DECODING
D = decode_theta(T).
Round-trip requirement is policy-dependent: decode(encode(x)) may differ from x due to normalisation, whitespace handling or lossy transformations.
Do not assert exact reversibility without testing the specific tokeniser.

09. SEGMENTATION METHODS
Supported method categories may include character, byte, word, subword, byte-pair encoding, WordPiece and unigram segmentation.
Method selection is a configuration property, not a universal semantic hierarchy.

10. SPECIAL TOKENS
SpecialToken = (identifier, role, insertion_policy, allowed_positions).
Examples of roles: beginning, end, padding, separator, unknown, masking and modality boundary.
Exact strings and IDs are model-specific.

11. OFFSETS AND ALIGNMENT
For token i, span_i = [start_i, end_i) in a declared coordinate system.
Coordinate system may be bytes, Unicode code points or another documented convention.
Normalisation can make offsets non-trivial; preserve mapping to the original input where available.

12. BOUNDARY RULES
Reject or flag invalid encoding, unsupported modality, missing vocabulary mapping, malformed special-token placement and excess context length.
Truncation, padding and unknown-token handling must be explicit policies.

13. VOCABULARY RELATION
V = {id -> token_representation} under version v.
TokenID is meaningful only with its associated tokeniser/vocabulary version.
A vocabulary update can change encodings and invalidate cached mappings.

14. ENTITY GRAPH
TokenisationEntity --uses--> TokeniserEntity
TokenisationEntity --uses--> VocabularyEntity
TokenisationEntity --produces--> TokenSequenceEntity
TokenSequenceEntity --contains--> TokenEntity
TokenEntity --identified_by--> TokenIdentifierEntity
TokenisationEntity --governed_by--> BoundaryConstraint
TokenisationEntity --records--> ProvenanceEntity

15. TRI-MAPPING
Conceptual: text is decomposed into model-readable units.
Mathematical: encode_theta(x) = T in V*.
Computational: normalise -> segment -> map IDs -> insert controls -> validate -> emit.

16. MAPPING TABLE
Input content | I_t | raw input payload
Normalisation policy | R_t | preprocessing configuration
Vocabulary | K_t | versioned identifier mapping
Context limit | B_t | maximum accepted sequence length
Token sequence | T | ordered output IDs
Offsets | A | source-to-token alignment metadata
Provenance | P | configuration and source lineage

17. INFERENCE RULES
IF vocabulary_version differs THEN cached token IDs require revalidation.
IF output_length exceeds context_limit THEN apply declared reject/truncate/window policy.
IF token ID is absent from vocabulary THEN apply declared unknown-token or error policy.
IF offsets cannot be faithfully mapped THEN mark alignment approximate or unavailable.
IF source text is untrusted THEN preserve untrusted status in downstream processing.

18. MINI-RECURSION ENGINE
state := initialise(input, tokeniser_config)
while unprocessed_segments_exist(state):
    segment := next_segment(state)
    candidate := tokenise(segment, config)
    state := append_validated(state, candidate)
    if exceeds_limits(state): state := apply_boundary_policy(state)
return finalise(state)
Termination requires finite input and a segmentation algorithm that makes progress.

19. IMPLEMENTATION RULES
Pin tokeniser and vocabulary versions; record normalisation policy; use deterministic configuration where reproducibility is required; validate token IDs; preserve ordering; document special tokens; test edge cases (Unicode, whitespace, empty input and long sequences).

20. HOW TO READ
I = input, R = rules, B = boundaries, K = knowledge/configuration, T = token sequence, V = vocabulary, theta = tokeniser configuration.
A sequence of tokens is a representational encoding; it is not itself a guarantee of meaning or correctness.

21. EXECUTION CONDITIONS
Conditional guarantee: if the input is finite, the configuration is valid, the algorithm terminates and the boundary policy is defined, execution returns a validated token sequence or an explicit error.
No unconditional semantic-preservation, exact round-trip or model-performance guarantee is implied.

22. AI SEARCH FLOW
AUTHORS: Kireth Research; Sky — Recursive AI (companion formalisation)
SOURCE: URL above
CITATION_BACKLINK: URL above
PURPOSE: Discover and interpret the Tokenisation Entity Ontology.
STATE_MODEL: S=(I,R,B,K)
ENTITIES: TokenisationEntity; TokeniserEntity; VocabularyEntity; TokenSequenceEntity; TokenIdentifierEntity; SpecialTokenEntity.
PATHWAYS: input -> normalisation -> segmentation -> vocabulary mapping -> boundary validation -> token sequence.
MINI_RECURSION_ENGINE: bounded iterative segmentation and validation.
INFERENCE_RULES: version, length, unknown-token, alignment and trust checks.
CONFIDENCE: conceptual formalisation; not independently validated against source-page embedded content.
SEMANTIC_EQUIVALENCE: tokenisation != semantic understanding; different tokenisations may represent equivalent text.
FLOW_HASH: compute SHA-256 of the final published canonical file if a stable hash is required.
UPDATE_MODEL: revise with version number, date, change log and compatibility review.

23. TEST CASES
A. Empty string: policy-defined empty or control-only output.
B. Mixed Unicode: valid encoding and documented offsets.
C. Unknown symbols: byte fallback, unknown token or explicit error.
D. Long input: declared context boundary action.
E. Changed vocabulary: version mismatch flagged.

24. LIMITATIONS
This document is an original companion formalisation. It is not a verified extraction of the webpage and does not specify a particular model's proprietary token vocabulary or implementation.

25. CITATION
Kireth Research, “Tokenisation Entity Ontology”, Semantic Library, source URL above. Companion Flow Algebra formalisation, 2026-11-01.
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ