Elffuss BraidHub

kikocis/utopia public

262af8b3828a · 6.7 KiBSourceRawPermalink

0007 · Counting decides what becomes a relation

The problem

A new knowledge base started with 10 seed relations. Most relations the model produced were not among them and degraded to related_to, a predicate that says nothing: 49.8% of facts on the ai-timeline corpus (15 Wikipedia articles on AI companies, 348 chunks). bootstrap_ontology existed for exactly this and worked badly, for six independent reasons:

  1. Exact-string matching discarded vocabulary already in the ontology: produced_by | ChatGPT → OpenAI missed produces. Fix: predicate_match (spelling, inflection, and a trailing by that swaps subject and object).
  2. If the last document failed, the KB stuck forever: auto-extension was enqueued on the success path only. Fix: enqueue on both paths.
  3. The ≥ 2 documents threshold only gated the LLM run; build_proposals re-queried the unfiltered set, so 86.7% of the phrasings shown to the model came from one document.
  4. doc_count counted leftovers still on the fallback predicate, so a KB fed one document at a time never reached two. Fix: prevalence counts all evidence.
  5. "Ignore" was a one-way door: record_miss skipped dismissed phrasings, so counts froze at 1 while twenty later documents used them. Fix: count everything; list dismissed apart, undoable.
  6. Undated facts claimed day precision (valid_precision NOT NULL DEFAULT 'day'; 728 and 843 live rows). Fix: nullable, CHECK-tied to a date (facts.valid_from_precision).

Decisions

  1. Counting decides adoption. The model is not asked: the data answers "which phrasings deserve to become relations", and the model got it wrong: it skipped runs_on (8 documents, 13 facts) and adopted a single-document pledged_capital. Three deterministic steps: group by inflectional base (predicate_match::merge_key: sued and sues are one), take the union of documents per group (never a sum), pass MIN_DOCS = 2; the group is named by its most frequent phrasing. From 10 seeds, related_to went 55.5% with auto-extension off, 39.1% with LLM adoption (17 relations), 25.8% with counted adoption (104).
  2. The model keeps the question that needs meaning: synonym merging (is collaborates_with the same as partnered_with), reversible with unadopt.
  3. Deterministic adoption is the most valuable side effect: the same corpus produces the same ontology, so the bench can compare this stage at all.
  4. _by is the only inverse marker worth handling (#109): 31 forms (founded_by 42 facts), nearly all coexisting with an active form (produces 265). Before adopting, PredicateIndex is consulted; an existing equivalent, _by inverse included, is rewritten to with subject and object swapped. has_X/X_of had two pairs, not enough evidence.

Caveats: differences between LLM groups are within run variance (25 vs 18 entities on the same input); only the deterministic part is certain (single-document adoptions 5 → 0). The related_to share is no quality metric, since adopting everything lowers it fastest, and the corpus is dense in training data.

Dead ends

Revisions

Open questions