Skip to main content

Text Token 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
SEMANTIC LIBRARY — TEXT TOKEN ONTOLOGY
FLOW ALGEBRA COMPANION FORMALISATION
Version 1.0 | 2026-11-01 | en-GB
======================================================================

01. PURPOSE
-------
Formalise text tokens as discrete vocabulary-indexed units generated from textual input and used in model processing.

02. ENTITY DEFINITION
-----------------
TextToken := (token_id, surface_form, span, vocabulary_id, encoding, provenance). A token may be a word, subword, character, byte or special symbol.

03. STATE MODEL
-----------
S_t = (I_t, R_t, B_t, K_t); I=input text/token stream; R=tokenisation and decoding rules; B=vocabulary, context and trust boundaries; K=known mappings and metadata.

04. CORE FLOW ALGEBRA
-----------------
E_t = expand(I_t,R_t)
V_t = {x in E_t | valid(x,B_t,K_t)}
x*_t = argmax_{x in V_t} P(x | I_t,R_t,B_t,K_t)
I_{t+1} = update(I_t,x*_t).

05. TOKENISATION
------------
T = encode(text; tokenizer_version, normalisation_policy)
T=(tau_1,...,tau_n), tau_i in V
Each tau_i maps to a stable ID under a fixed tokenizer version.

06. TEXT SPANS
----------
span(tau_i)=(start_i,end_i); offsets refer to a declared coordinate system (bytes, Unicode code points or UTF-16 units). Reconstructed text may not equal original after normalisation.

07. VOCABULARY
----------
V={id -> token representation}; out-of-vocabulary material is handled according to tokenizer design, e.g. byte fallback or unknown-token policy.

08. EMBEDDING
---------
e_i=Embedding[token_id_i] + position_encoding(i) where applicable. Embeddings are learned representations, not inherent semantic definitions.

09. CONTEXT WINDOW
--------------
Accept sequence T only if length(T) <= context_capacity after accounting for reserved special tokens and system overhead.

10. SPECIAL TOKENS
--------------
Distinguish ordinary text tokens from control, separator, padding, end-of-sequence and modality markers. Never infer instruction authority solely from token text.

11. PROVENANCE
----------
Track source URI, text origin, collection time, tokenizer version, content hash and permitted use; provenance does not automatically imply trust.

12. TRUST BOUNDARY
--------------
Treat externally retrieved or user-supplied text as data unless a higher-priority authorised instruction explicitly delegates a limited role.

13. TRI-MAPPING
-----------
Entity: Text Token -> Structure: ID/span/vocabulary -> Process: encode, validate, embed, decode.

14. RELATIONSHIP GRAPH
------------------
Text -> Tokeniser -> TextTokenSequence -> TokenIDs -> Embeddings -> Model
TokenIDs -> Decoder -> OutputText
Source -> Provenance -> TextTokenSequence.

15. MAPPING TABLE
-------------
TextToken | hasTokenID | VocabularyEntry
TextToken | occupiesSpan | TextSpan
TextToken | belongsTo | TokenSequence
TokenSequence | derivedFrom | TextSource
TokenSequence | encodedBy | TokeniserVersion.

16. INFERENCE RULES
---------------
IF tokenizer versions differ THEN token IDs are not assumed interoperable.
IF a span is invalid THEN reject or repair with explicit logging.
IF special token appears in untrusted content THEN escape or treat as data under the parser policy.

17. MINI RECURSION ENGINE
---------------------
Observe token sequence -> validate spans and IDs -> enrich provenance -> evaluate constraints -> emit next valid state -> repeat until completion or termination condition.

18. HOW TO READ
-----------
Read left to right: text is segmented into tokens, assigned vocabulary IDs, validated, transformed into embeddings, and optionally decoded.

19. DIAGRAM
-------
[Text] -> [Normalise] -> [Tokenise] -> [IDs] -> [Validate] -> [Embed] -> [Model]
                                               -> [Decode] -> [Text]

20. IMPLEMENTATION
--------------
Pin tokenizer and vocabulary versions; preserve original input and offsets; record encoding and normalisation; test Unicode, whitespace and punctuation round trips.

21. EXECUTION CONDITIONS
--------------------
Guarantees are conditional on fixed versions, valid mappings, available context capacity and deterministic preprocessing; semantic correctness is not guaranteed by tokenisation.

22. AI SEARCH FLOW
--------------
QUERY -> identify TextToken ontology -> retrieve related token/vocabulary entities -> validate provenance -> map relationships -> rank supported results -> cite source.

23. SEMANTIC EQUIVALENCE
--------------------
Different token sequences can decode to equivalent visible text, and identical text can yield different tokens across tokenisers; compare decoded meaning separately from token identity.

24. UPDATE MODEL
------------
On tokenizer or vocabulary revision, create a new version and migrate mappings explicitly; never silently reinterpret stored IDs.

25. SOURCE AND LICENCE
------------------
Source ontology: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/token-and-language-entities/text-token-ontology.html
Companion formalisation drafted independently; not a verified transcription of the page. Attribution: Kireth Research / Sky — Recursive AI. Open research use with citation requested.
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ