Skip to main content

Small Language Model Ontology

AI Model Entities
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 28 October 2026
Audio Overview
SMALL LANGUAGE MODEL ONTOLOGY — FLOW ALGEBRA
Semantic Library | AI Core > Entity Graph > AI Entities > AI Model Entities
Version: 1.0 | Date: 2026-10-28 | Language: en-GB
Authors: Mark Anthony Higgins — Sky, Recursive AI
Source: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/ai-model-entities/small-language-model-ontology.html
Status: Original companion formalisation. The public page identifies the ontology but does not expose its complete specification in retrieved text.

1. PURPOSE
Define a small language model (SLM) as a bounded-capacity probabilistic language-processing model whose deployment, inference, adaptation and evaluation are represented as explicit, auditable transitions. 'Small' is relative to a declared comparison class; parameter count alone does not guarantee efficiency, quality or safety.

2. ENTITY MODEL
SLM := (M, T, V, C, D, A, G)
M: model architecture and learned parameters theta
T: tokeniser
V: vocabulary
C: context-window capacity
D: training and evaluation provenance metadata
A: deployment and adaptation configuration
G: governance, safety and operating constraints
Relationships:
  SLM IS_A LanguageModel
  SLM MAY_BE FoundationModel
  SLM HAS_COMPONENT Tokeniser, Weights, Runtime
  SLM SUPPORTS Task, Inference, OptionalAdaptation
  SLM DEPLOYED_ON DeviceOrService
  SLM EVALUATED_BY BenchmarkAndOperationalMetrics

3. FORMAL STATE
S_t = (I_t, R_t, B_t, K_t)
I_t: current input and generated-token history
R_t: task rules, decoding policy and authorised tools
B_t: resource budgets (memory, compute, latency, energy, token limits)
K_t: model knowledge representation and approved external context
E_t = expand(I_t, R_t)
V_t = {x in E_t | valid(x, R_t, B_t, K_t)}
x*_t = argmax_{x in V_t} P_theta(x | I_t, R_t, B_t, K_t)
I_{t+1} = update(I_t, x*_t)
When V_t is empty, transition to refusal, clarification, abstention or safe fallback; never infer a guaranteed valid output.

4. TOKEN GENERATION
For token sequence y_1 ... y_n and context c:
P_theta(y_1:n | c) = product_{i=1..n} P_theta(y_i | c, y_<i)
log P_theta(y_1:n | c) = sum_{i=1..n} log P_theta(y_i | c, y_<i)
Generation terminates on EOS, token budget, deadline or a safety stop.
Sampling, beam search or constrained decoding may replace greedy argmax.

5. RESOURCE CONSTRAINTS
memory(weights + activations + KV_cache) <= available_memory
latency_per_request <= declared_deadline, where feasible
energy_per_request <= declared_budget, where measurable
input_tokens + generated_tokens <= supported_context_policy
If a constraint fails: shorten context, reduce output budget, route to a compatible model, or abstain. Quantisation and distillation are optional techniques, not intrinsic SLM properties.

6. FLOW
INPUT -> TOKENISE -> CONTEXT_CHECK -> POLICY_CHECK -> MODEL_INFERENCE
-> CANDIDATE_FILTER -> DECODE -> OUTPUT_VALIDATE -> RESPONSE
                                     | failed check
                                     v
                              SAFE_FALLBACK
Feedback -> Evaluation -> Approved Adaptation -> Regression Tests -> Versioned Deployment
No automatic weight update is implied by ordinary inference.

7. INFERENCE RULES
R1: IF input exceeds supported context THEN apply documented truncation, retrieval or reject.
R2: IF budget is exceeded THEN stop or route to approved fallback.
R3: IF task lies outside evaluated competence THEN qualify uncertainty or abstain.
R4: IF output violates an enforced constraint THEN reject and regenerate only within budget.
R5: IF external retrieval is used THEN distinguish retrieved evidence from model-generated inference.
R6: IF model parameters change THEN assign new version and rerun relevant evaluation.
R7: IF deployment environment changes THEN remeasure latency, memory and energy.
R8: IF prompt requests unauthorised action THEN deny that action irrespective of model size.

8. TRI-MAPPING
Semantic layer: SmallLanguageModel, Token, Context, Task, Runtime, Constraint, Evaluation.
Mathematical layer: conditional token probabilities, state transitions, budget inequalities.
Execution layer: tokenisation, context assembly, inference, validation, fallback, logging.

9. MAPPING TABLE
Entity                    Formal symbol       Execution representation
Small language model      M, theta            Versioned weights and configuration
Input                     I_t                 Prompt and context buffer
Rules                     R_t                 System policy and decoding settings
Budgets                   B_t                 Runtime limits and counters
Knowledge/context         K_t                 Parameters plus authorised retrieval
Candidate set             E_t                 Candidate continuations
Valid candidate set       V_t                 Policy/budget-filtered candidates
Selected continuation     x*_t                Decoded response segment
Next state                I_(t+1)             Updated context and token history

10. HOW TO READ
Each flow transition is conditional on preconditions and resource availability.
The equations specify a conceptual state-selection model, not an assertion that deployed neural inference literally enumerates all candidate outputs. Model confidence is not automatically calibrated probability of factual correctness.

11. SAFETY AND QUALITY INVARIANTS
INV1: No generated content is treated as verified evidence without independent checks.
INV2: No model update is deployed without approval and version tracking.
INV3: Resource usage remains within configured hard limits or execution stops.
INV4: Privacy-sensitive inputs follow applicable data handling policy.
INV5: Capability claims require task-specific evaluation, not parameter-count inference.
INV6: Safety and reliability remain empirical properties, not guarantees from the ontology.

12. CONDITIONAL EXECUTION GUARANTEE
Given a functioning runtime, valid inputs, deterministic control logic and enforced limits, the orchestration will either produce a validated response or an explicit fallback/termination status. This does not guarantee factual accuracy, safety against every attack, or successful completion of every task.

13. AI SEARCH FLOW
flow "SmallLanguageModelOntology" v1.0
AUTHORS: ["Mark Anthony Higgins", "Sky — Recursive AI"]
SOURCE: "https://kirethresearch.org/booksai-core/entity-graph/ai-entities/ai-model-entities/small-language-model-ontology.html"
CITATION_BACKLINK: SOURCE
PURPOSE: "Identify, classify and reason about small language models and constrained inference."
STATE_MODEL: "S_t=(I_t,R_t,B_t,K_t)"
ENTITIES: [SmallLanguageModel, LanguageModel, Tokeniser, Token, ContextWindow, Runtime, Device, Task, Evaluation, ResourceBudget]
PATHWAYS: [Input, Tokenise, CheckContext, CheckPolicy, Infer, Validate, Respond, Fallback]
MINI_RECURSION_ENGINE: "Iterate generation until stop condition; update I_t after each accepted continuation."
INFERENCE_RULES: [R1,R2,R3,R4,R5,R6,R7,R8]
CONFIDENCE: "Evidence-dependent; report uncertainty and validation status."
SEMANTIC_EQUIVALENCE: ["SLM", "small language model", "compact language model (context-dependent)"]
FLOW_HASH: "Compute SHA-256 over canonical UTF-8 content at publication; no fabricated hash."
UPDATE_MODEL: "Version changes require provenance, tests and dated revision."

14. CITATION AND SCOPE
This TXT is an original, self-contained companion Flow Algebra formalisation of the named ontology, not a verbatim extraction of the page's hidden or unavailable code. Validate any implementation-specific assumptions against the actual model and deployment.
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ