Larql
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
- A compiled Qwen 2.5 model (or other FFN-based architecture)
- LARQL query string using one of four commands: DESCRIBE, SELECT, INSERT, COMPILE
- Target fact(s) represented as entity–relation–feature triples
- Source model weights accessible for read/write
OUTPUTS
- DESCRIBE: inspection report of model internals (entities, relations, features decoded from FFN weights)
- SELECT: query response — facts retrieved from weight-graph via KNN walk
- INSERT: updated weight graph with new fact(s) injected
- COMPILE: modified model file with baked-in changes; ready for inference
INVARIANTS
- Weight modifications via INSERT must not degrade existing knowledge below a measurable threshold — [GAP — threshold not yet defined; requires pre/post eval harness]
- COMPILE output must produce a loadable Ollama-compatible GGUF; a non-loadable artifact is a build failure
- The Φ constant (0.042) and TMM formula constants must not be modifiable via LARQL INSERT — they are FORBIDDEN write targets
- LARQL operations must be idempotent for INSERT of identical facts — inserting the same fact twice must not corrupt the graph
- KNN graph walk must preserve relation directionality — entity A → relation → entity B is not interchangeable with entity B → relation → entity A
- [GAP — atomicity guarantee: if COMPILE fails mid-write, rollback semantics undefined]
- [GAP — weight namespace isolation: INSERT into GLOSS domain must not bleed into MANTIS domain weights]
VERIFICATION CRITERIA
- Σ.✓ DESCRIBE returns parseable entity list from a known Qwen 2.5 model without crash
- Σ.✓ SELECT query for an INSERTED fact returns the inserted value, not a hallucinated variant
- Σ.✓ COMPILE produces a GGUF file loadable by
ollama createwithout error - Σ.✓ Post-COMPILE GLOSS eval score ≥ pre-COMPILE baseline (knowledge not degraded)
- Σ.✓ Inserting 5 known LATTICE symbol mappings via INSERT and then querying all 5 returns exact matches
- [GAP — generalization test: does inserted fact answer novel phrasing of the same query, not just exact repetition?]
- [GAP — robustness test: is injection stable after 100+ facts inserted, or does graph walk degrade?]
FAILURE MODES
- Σ.⊠ LARQL does not support Qwen 2.5 architecture — FFN decomposition fails; investigation halted; Brain Factory pipeline unchanged
- Σ.⊠ Inserted knowledge does not generalize — SELECT returns correct answer only for exact INSERT phrasing; novel query returns pre-injection state
- Σ.⊠ COMPILE corrupts model — GGUF loads but produces garbage output; requires restore from backup
- Σ.⊠ Partial INSERT with COMPILE failure — weight graph in inconsistent state; model neither pre-nor post-injection; rollback required
- Σ.⊠ Knowledge bleed — INSERT to GLOSS domain degrades MANTIS threat detection; cross-domain contamination
- Σ.⊠ Fragile injection — facts survive initial COMPILE but decay under inference (attention softmax normalizes injected weights back toward prior distribution over time)
- [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
- Qwen 2.5 base model (architecture compatibility unverified)
- LARQL toolchain / Chris Hay implementation (source repo location: [GAP — not yet located])
- FFN weight decomposition library (KNN graph walker: [GAP — dependency name unknown])
- Ollama GGUF pipeline for COMPILE output ingestion
DEPENDENTS
- Brain Factory Pipeline (SPEC_BRAIN_FACTORY_PIPELINE.md) — if LARQL verified, it replaces the fine-tuning stage for knowledge injection
- GLOSS brain (all versions post-verification) — symbol mapping injection
- MNEMOS — memory injection without fine-tuning
- MANTIS — threat pattern injection
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
- Source investigation:
/home/nous/memories/LARQL_INVESTIGATION.md - Brain Factory Pipeline:
/home/nous/memories/SPEC_BRAIN_FACTORY_PIPELINE.md - GLOSS eval spec:
/home/nous/memories/SPEC_GLOSS_EVAL_v2.md - Priority: after GLOSS v9 graduation (now complete) — investigation is OPEN
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