Skip to content

Instantly share code, notes, and snippets.

@morpheuslord
Created February 15, 2026 16:11
Show Gist options
  • Select an option

  • Save morpheuslord/bae0482afdff98f937e4d818d0d0cf20 to your computer and use it in GitHub Desktop.

Select an option

Save morpheuslord/bae0482afdff98f937e4d818d0d0cf20 to your computer and use it in GitHub Desktop.

First: what your ontology really is

Your file turns the insurance form into a connected map of things:

  • Each box in the form is a thing (a node)
  • Each rule like “affects”, “depends on”, “controls”, “must add to 100”, “date constrains validity” is a connection (an edge)

So instead of random numbers in a table, you have:

“this field changes that field” “this date limits those values” “this checkbox turns other fields on and off”

That is a graph.


1. How to use this graph inside the model (graph-based knowledge)

Think like this:

A normal model looks at each box alone.

Your graph-based model looks at boxes and how they are connected.

What the model learns

Instead of:

“this value is wrong”

It learns:

“this value is wrong because it breaks a rule with another value”

Examples from your ontology:

  • Market percentages must add up together
  • Dates control whether data is valid
  • Some fields only work if a checkbox is on
  • Some fields affect others

How it works simply

  1. Each field becomes a dot (node)
  2. Each relationship becomes a line (connection)
  3. The model passes information along these lines

So knowledge flows like:

Field → Rule → Other Field → Decision

This teaches the model real regulatory structure, not just patterns.


2. How this helps concept bottleneck models (CBMs)

CBMs work in two steps:

Step 1: predict simple ideas (concepts) Step 2: use those ideas to make the final decision

Your ontology already defines these simple ideas.

Examples of concepts from your ontology

  • Is the date valid?
  • Do percentages add correctly?
  • Are required fields filled when enabled?
  • Are dependent fields consistent?
  • Are validation rules satisfied?

These are much easier to understand than raw numbers.


Why interventions become better

Instead of fixing random inputs, you fix clear rules.

For example:

If the model sees:

“checkbox is on but required fields are empty”

It can directly say:

“This rule is broken — fill these fields”

If it sees:

“percentages don’t sum to 100”

It can say:

“adjust these values”

So you don’t guess what went wrong. You correct the exact regulatory problem.


In one simple picture (in words)

Your ontology:

connects fields with rules

Graph model:

learns using those connections

Concept bottleneck model:

checks simple rule-based ideas

Interventions:

fix broken rules instead of random numbers


Very simple summary

Your ontology lets the model:

• learn how form fields depend on each other (graph learning) • think in clear rule concepts like “valid date” or “correct total” (CBMs) • fix specific regulatory mistakes instead of guessing


One clean sentence you can use

Your ontology turns the filing process into a structured graph of fields and rules, which allows graph-based models to learn regulatory relationships directly, while also defining clear, interpretable concepts that concept bottleneck models can use for precise rule-based interventions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment