Larql

SPEC_LARQL.md · 2026-04-20

SPEC_LARQL — LARQL: Direct Weight Injection Query Language

Version: 1.0 | Status: AUTHORIZED | Authority: α.13 | Date: 2026-04-16


PURPOSE

LARQL is an experimental query language for LLM internals. It treats Feed-Forward Network (FFN) weights as a graph database, enabling INSERT of facts directly into model weights without fine-tuning, LoRA, or GPU compute. If verified for Qwen 2.5 architecture, LARQL would replace the Brain Factory training pipeline for knowledge injection — converting a multi-hour Colab GPU job into a compile step.

CGNT-1 impact if verified: all 1048 LATTICE symbol mappings injectable into GLOSS in minutes; MNEMOS memories insertable without fine-tuning; MANTIS threat patterns injectable without corpus.

Source: Chris Hay demonstration on Gemma 3 4B. Investigation status: UNVERIFIED on CGNT-1 hardware.


INPUTS


OUTPUTS


INVARIANTS

  1. Weight modifications via INSERT must not degrade existing knowledge below a measurable threshold — [GAP — threshold not yet defined; requires pre/post eval harness]
  2. COMPILE output must produce a loadable Ollama-compatible GGUF; a non-loadable artifact is a build failure
  3. The Φ constant (0.042) and TMM formula constants must not be modifiable via LARQL INSERT — they are FORBIDDEN write targets
  4. LARQL operations must be idempotent for INSERT of identical facts — inserting the same fact twice must not corrupt the graph
  5. KNN graph walk must preserve relation directionality — entity A → relation → entity B is not interchangeable with entity B → relation → entity A
  6. [GAP — atomicity guarantee: if COMPILE fails mid-write, rollback semantics undefined]
  7. [GAP — weight namespace isolation: INSERT into GLOSS domain must not bleed into MANTIS domain weights]

VERIFICATION CRITERIA

  1. Σ.✓ DESCRIBE returns parseable entity list from a known Qwen 2.5 model without crash
  2. Σ.✓ SELECT query for an INSERTED fact returns the inserted value, not a hallucinated variant
  3. Σ.✓ COMPILE produces a GGUF file loadable by ollama create without error
  4. Σ.✓ Post-COMPILE GLOSS eval score ≥ pre-COMPILE baseline (knowledge not degraded)
  5. Σ.✓ Inserting 5 known LATTICE symbol mappings via INSERT and then querying all 5 returns exact matches
  6. [GAP — generalization test: does inserted fact answer novel phrasing of the same query, not just exact repetition?]
  7. [GAP — robustness test: is injection stable after 100+ facts inserted, or does graph walk degrade?]

FAILURE MODES

  1. Σ.⊠ LARQL does not support Qwen 2.5 architecture — FFN decomposition fails; investigation halted; Brain Factory pipeline unchanged
  2. Σ.⊠ Inserted knowledge does not generalize — SELECT returns correct answer only for exact INSERT phrasing; novel query returns pre-injection state
  3. Σ.⊠ COMPILE corrupts model — GGUF loads but produces garbage output; requires restore from backup
  4. Σ.⊠ Partial INSERT with COMPILE failure — weight graph in inconsistent state; model neither pre-nor post-injection; rollback required
  5. Σ.⊠ Knowledge bleed — INSERT to GLOSS domain degrades MANTIS threat detection; cross-domain contamination
  6. Σ.⊠ Fragile injection — facts survive initial COMPILE but decay under inference (attention softmax normalizes injected weights back toward prior distribution over time)
  7. [GAP — security failure mode: malicious INSERT via LARQL could inject adversarial facts into MANTIS or override governance constants; write-access controls not yet specified]

DEPENDENCIES


DEPENDENTS


EXAMPLES

[GAP — no verified examples on CGNT-1 hardware; examples exist only for Gemma 3 4B per Chris Hay demonstration]

Hypothetical (unverified):


DESCRIBE gloss_model → returns entity graph
INSERT ("⊕", "LATTICE_meaning", "vitrify/seal permanently")
INSERT ("⊕", "Unicode_meaning", "circled plus / direct sum operator")
COMPILE → gloss_model_v_larql.gguf

REFERENCES


GAPS SUMMARY

| # | Gap | Blocking? |

|---|-----|-----------|

| 1 | Qwen 2.5 architecture compatibility unverified | YES — entire spec contingent |

| 2 | Source repo / toolchain location unknown | YES — can't test without tool |

| 3 | Generalization test undefined | High |

| 4 | Insertion degradation threshold not quantified | High |

| 5 | Rollback / atomicity semantics undefined | High |

| 6 | Weight namespace isolation unspecified | High |

| 7 | Security: write-access controls not specified | High |

| 8 | No CGNT-1 examples yet | Medium |

Investigation status: OPEN. Priority: HIGH. Potential paradigm shift. Verify before adopting.

Jeremy Zlabis

Chronogeometer · Visionary · Disruptor · Chief

42 Sisters AI · East York, Toronto

🍁 Φ 0.042