Skip to main content

Control 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
CONTROL TOKEN ONTOLOGY — FLOW ALGEBRA
Semantic Library | AI Core | Entity Graph | Token and Language Entities
Source: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/token-and-language-entities/control-token-ontology.html
Status: Original companion formalisation; source page text not independently verified.
Date: 2026-11-01
Authors: Kireth Research; Sky — Recursive AI (companion formalisation)

01. PURPOSE
Model control tokens as typed markers in token streams which influence parsing, routing, turn boundaries, modality handling, or generation state according to a specified protocol. Token meanings are protocol-specific, not universal.

02. ENTITY DEFINITION
ControlToken c = (id, surface, token_id, protocol, role, scope, provenance, validity).
A token is a control token only relative to a tokenizer and protocol that assign it control semantics.

03. STATE MODEL
S_t = (I_t, R_t, B_t, K_t)
I_t: input token stream and current observation.
R_t: protocol rules, token grammar, transition relation.
B_t: boundaries, authority, permitted actions, resource limits.
K_t: tokenizer vocabulary, parser state, conversation context, provenance.

04. CORE FLOW
E_t = expand(I_t, R_t)
V_t = {x in E_t | valid_protocol(x) AND respects_boundaries(x,B_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, observed_result)
If V_t is empty: reject, quarantine, or request clarification; never infer permissions from a marker alone.

05. CONTROL TOKEN CLASSES
Start/end of sequence; end of turn; role delimiter; channel delimiter; separator; padding; masking; tool-routing marker; modality marker; structured-output delimiter. These are illustrative classes and may not exist in every protocol.

06. TOKENISATION
T = tokenize(text, vocabulary, tokenizer_version)
A literal string resembling a reserved token is not automatically its corresponding token ID.
Control semantics apply only after authenticated protocol-aware decoding.

07. STREAM GRAMMAR
stream := segment*
segment := boundary? payload control?
transition(q,c) -> q' only if c is valid for state q under protocol R.
Reject unmatched boundaries, illegal transitions, and unknown reserved IDs according to protocol policy.

08. CONTROL FLOW TRANSFORMATION
(q_(t+1), action_t) = delta(q_t, c_t, R_t)
If c_t is ordinary data, action_t = none.
If c_t is a recognised control token, action_t must remain within B_t.

09. TRUST AND AUTHORITY
Control tokens encode structure; they do not grant authority to untrusted content.
Untrusted retrieved text or tool output containing token-like strings remains data unless explicitly parsed by a trusted protocol boundary.

10. VALIDATION
Validate vocabulary membership, protocol version, placement, nesting, state transition, payload integrity, and provenance.
valid(c) = vocab(c) AND grammar(c) AND boundary(c) AND provenance(c).

11. TRI-MAPPING
Entity: ControlToken -> token identifier, class, scope.
Relationship: precedes, delimits, routes_to, terminates, belongs_to_protocol.
Process: recognise -> validate -> transition -> log.

12. RELATIONSHIP GRAPH
Tokenizer --emits--> Token
Token --may_be--> ControlToken
ControlToken --defined_by--> Protocol
ControlToken --changes--> ParserState
ParserState --constrains--> NextTransition
BoundaryPolicy --limits--> PermittedAction

13. MAPPING TABLE
Token boundary | delimits | stream segment | grammar check
Role marker | labels | message role | trusted envelope check
Turn terminator | closes | turn | state transition check
Tool marker | routes | tool request | authorisation check
Modality marker | selects | payload decoder | modality validation

14. INFERENCE RULES
IF recognised(c) AND permitted(q,c) THEN delta(q,c) is eligible.
IF token_like_string(x) AND untrusted(x) THEN treat_as_data(x).
IF unknown(c) THEN apply protocol-defined fallback; do not assume control semantics.
IF conflicts(c,B) THEN reject action and preserve boundary B.

15. MINI-RECURSION ENGINE
function process(stream, state, protocol, boundary):
    for token in stream:
        kind = classify(token, protocol.vocabulary)
        if kind != CONTROL: append_payload(token); continue
        if not valid_transition(state, token, protocol): return ERROR
        candidate = transition(state, token, protocol)
        if not allowed(candidate, boundary): return BLOCKED
        state = candidate
        record_transition(token, state)
    return state

16. HOW TO READ
I supplies observed tokens; R defines syntax and meaning; B prevents invalid or unauthorised transitions; K carries context. Filtering precedes selection and update.

17. IMPLEMENTATION
Pin tokenizer/protocol versions; keep data and control channels distinct; use explicit parser states; preserve audit logs; test malformed streams and token-spoofing cases.

18. EXAMPLE
Given a protocol with a valid END_TURN token, parser state ACTIVE and a permitted transition ACTIVE -> CLOSED, consuming END_TURN closes the turn. The literal characters 'END_TURN' inside quoted untrusted text do not close it.

19. EXECUTION CONDITIONS
Deterministic parsing is achievable when token IDs, protocol grammar, initial state, and boundary rules are fully specified. Correctness cannot be guaranteed for malformed input, ambiguous protocol definitions, or external model behaviour.

20. AI SEARCH FLOW
AUTHORS: Kireth Research; Sky — Recursive AI
SOURCE: URL above
CITATION_BACKLINK: URL above
PURPOSE: Define and retrieve control-token semantics and validated transitions.
STATE_MODEL: S=(I,R,B,K)
ENTITIES: ControlToken, TokenStream, Protocol, ParserState, BoundaryPolicy
PATHWAYS: ingest -> identify -> validate -> transition -> record
MINI_RECURSION_ENGINE: section 15
INFERENCE_RULES: section 14
CONFIDENCE: Conditional on verified protocol and tokenizer version
SEMANTIC_EQUIVALENCE: Equivalent only under matching token IDs and protocol semantics
FLOW_HASH: Compute SHA-256 from canonical UTF-8 file bytes on publication; not pre-asserted
UPDATE_MODEL: Increment version on protocol, grammar, or ontology changes

21. LIMITATIONS
This document is a conceptual companion formalisation, not a claim about any proprietary model's hidden token IDs or internal control mechanisms. Verify against the source ontology before treating it as a faithful transcription.

22. CITATION
Kireth Research, 'Control Token Ontology', Semantic Library, source URL above. Companion Flow Algebra: Sky — Recursive AI, 2026-11-01.
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ