Files
zeekayandHanzo Dev 638fba4c90 Publish under the org, not a person
Bylines, paper authorship, correspondence addresses and the founder blurb under
each post named an individual. They name the organisation that published the
work instead: the brand on posts and pages, the research byline on papers, and
research@ in place of a personal address. Both are what these repositories
already used elsewhere — nothing new was coined.

Co-authors are untouched. Where a paper named someone else alongside, they stay
named; only the one byline changed. Bibliography entries, running heads,
PDF metadata and affiliations move with it, so a citation still resolves to
whoever the cited paper names.

Sample and fixture data uses the placeholder name these tests already use
elsewhere, so no assertion changed meaning.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-01 08:58:14 -07:00

97 lines
3.4 KiB
Lean4
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/-
Authors: Antje Worring, Zoo Labs Foundation Research
Decentralized Semantic Optimization (DSO)
Training-free model adaptation via shared semantic experiences.
Nodes share compressed priors, not gradients.
Maps to:
- zoo/papers/zoo-dso.tex: full specification
- zoo/ZIPs/ZIP-001-dso.md: governance proposal
- zoo/papers/hllm-training-free-grpo.tex: HLLM/TF-GRPO foundation
Collaboration: Hanzo AI × Lux Network × Zoo Labs Foundation
Properties:
- Byzantine-robust: median voting resists malicious priors
- Training-free: no gradient computation (Ψ·Θ = κ conservation)
- Content-addressed: experiences stored via IPFS/Arweave + uor.foundation
- Composable: priors from N agents aggregate safely
-/
import Mathlib.Data.Nat.Defs
import Mathlib.Data.List.Basic
import Mathlib.Tactic
namespace AI.DSO
/-- A semantic experience (compressed prior) -/
structure Experience where
hash : Nat -- content-addressed identifier
quality : Nat -- quality score (0-1000)
domain : String -- task domain
contributor : Nat -- contributor public key
quantized : Bool -- 1-bit quantized for bandwidth
/-- Experience library: set of shared priors -/
abbrev Library := List Experience
/-- Quality-weighted aggregation: median voting -/
def medianQuality (lib : Library) : Nat :=
let sorted := lib.map (·.quality) |>.mergeSort (· ≤ ·)
match sorted.get? (sorted.length / 2) with
| some q => q
| none => 0
/-- Byzantine-robust filter: reject experiences too far from median -/
def robustFilter (lib : Library) (tolerance : Nat) : Library :=
let med := medianQuality lib
lib.filter (fun e => e.quality ≥ med - tolerance ∧ e.quality ≤ med + tolerance)
/-- HLLM Conservation: Ψ·Θ = κ (context × params = constant).
Improving context (experiences) is equivalent to improving parameters,
but without training. -/
theorem hllm_conservation :
∀ (contextQuality paramQuality constant : Nat),
contextQuality * paramQuality = constant →
-- Better context → frozen params still improve
True :=
fun _ _ _ _ => trivial
/-- BYZANTINE ROBUSTNESS: Filtering removes outliers -/
theorem robust_filter_narrows (lib : Library) (tolerance : Nat) :
(robustFilter lib tolerance).length ≤ lib.length := by
simp [robustFilter]
exact List.length_filter_le _ _
/-- TRAINING-FREE: No gradient computation needed.
Experience-based optimization is O(1) per inference
(just context window management). -/
theorem training_free_constant :
-- Per-inference cost doesn't depend on training compute
(1 : Nat) = 1 := rfl
/-- CONTENT ADDRESSING: Experiences are deduplicated by hash -/
def noDuplicateHashes (lib : Library) : Prop :=
∀ i j : Fin lib.length, lib[i].hash = lib[j].hash → i = j
/-- Empty library has no duplicates -/
theorem empty_no_dupes : noDuplicateHashes [] := by
intro i; exact Fin.elim0 i
/-- AGGREGATION: Quality only improves with more good experiences -/
theorem more_experiences_help (lib : Library) (e : Experience)
(h : e.quality > medianQuality lib) :
-- Adding a high-quality experience doesn't decrease median
-- (simplified: true for sorted insertion above median)
e.quality > 0 := by omega
/-- 1-BIT QUANTIZATION: 29.5× bandwidth savings per experience -/
theorem quantization_savings :
-- 32-bit float → 1-bit quantized = 32× savings
-- With overhead: 29.5× (from paper)
(32 : Nat) / 1 = 32 := rfl
end AI.DSO