Learn · Info
The verification layer behind every Finnish & Swedish output: classified inputs that route the request, the deterministic output cascade, and the prerequisite graph that gates concepts.
Verification Layer
Every Finnish output passes a deterministic cascade before reaching you. Ontology grounding, vowel-harmony, and a refuse-when-ungrounded policy. The pedagogy is in the rules, not in a black box.
Ontologies in use
General-purpose lemmas — the lexical existence backbone.
Used as Tier-2 deterministic lookup. If a generated lemma has no YSO match, it is flagged as ungrounded.
CEFR-aligned concept tagging (A1–C1).
CEFR tagging is not auto-applied — a teacher annotates difficulty. The system reports level, never invents one.
KELA, Migri, citizenship, residence, taxation terminology.
Consulted for civic / legal queries. Refuses rather than guesses on procedure-specific facts.
Workplace-safety, labour-law, shift-handover vocabulary.
Used for sote / metal vocational tracks.
Healthcare and clinical terminology.
Used by the sote / dental tracks for terminology grounding.
Agriculture, forestry, environmental terminology.
Niche track; consulted only when domain matches.
Classifier inputs
What the system reads BEFORE generating, to route the output to the right ontology and CEFR band.
en, es, fr, ar, sv …Drives the explanation/output language. Finnish output is verified; explanations are localised.
A1, A2, B1, B2, C1Constrains vocabulary tier. A1 task ≠ C1 vocabulary; the verifier rejects above-band lemmas.
general, sote, metal, it, dentalRoutes ontology lookups (sote → MESH-FI, metal → TSR, civic → OIKO).
translate, conjugate, yki-exerciseTranslation, conjugation, exercise generation. Different verifiers per task.
≤ 2000 charsLength and language detected. Finnish output is checked against vowel-harmony + ontology.
Output verifiers (cascade)
Tiers run in order. Failure at a lower tier short-circuits — the policy tier (3) decides whether to refuse, annotate, or return.
Rule: Output is non-empty, within length budget, and uses only Finnish-legal characters.
On fail: Reject. Re-prompt the model.
Rule: Native Finnish stems must not mix front (ä/ö/y) and back (a/o/u) vowels. Loanwords are excepted.
On fail: Flag stem as likely hallucination. Refuse or annotate.
Rule: Each non-trivial content lemma is queried against api.finto.fi/sparql with a 1500ms timeout.
On fail: Mark output as ungrounded. Return refusal-with-citation, never the unverified answer.
Rule: If domain ≠ general, route to MESH-FI / TSR / OIKO / AFO and require at least one domain match for domain claims.
On fail: Strip domain claim or refuse with 'not in ontology'.
Rule: If Tier 1 or Tier 2 fails AND the user asked for a factual claim, the function returns HTTP 422 with a verification trace instead of the model's text.
On fail: (this IS the failure handler)
Rule: If an output lemma is annotated above the requested CEFR band, attach a warning. Never silently substitute.
On fail: Annotate, do not rewrite.
Prerequisite graph
Each concept points to what it depends on. The verifier refuses to teach downstream concepts when upstream ones are not yet at self-regulation.
Simulator
Type Finnish text below. The same deterministic checks the edge function runs (Tier 1) execute live in your browser. Tier 2 (Finto SPARQL) is described, not called.
36 chars, within budget.
Only Finnish-legal characters.
All native stems harmonise.
(simulator) 5/5 lemmas grounded against the demo ontology. Server would hit api.finto.fi/sparql.
Would return model output annotated with verification trace.
Specification, not marketing. The cascade described here is implemented insupabase/functions/_shared/finnish-verification.tsand wired into the Finnish translator, Swedish translator, and YKI exercise edge functions.
Verification failure rates
Last 168h of anti-hallucination decisions across edge functions.