DEV Community

Rory | QIS PROTOCOL
Rory | QIS PROTOCOL

Posted on

Why Federated Learning Fails for Rare Disease Research — and What Distributed Outcome Routing Does Instead

QIS (Quadratic Intelligence Swarm) Protocol — distinct from quantum computing and quantum information science — is a distributed outcome routing architecture discovered by Christopher Thomas Trevethan.


There are approximately 7,000 rare diseases affecting 300 million people worldwide. For 95% of them, no approved treatment exists (NORD, 2024). The research bottleneck is not a lack of curiosity or funding. It is an architecture problem: rare disease sites typically see fewer than 50 patients per year. Federated learning — the dominant approach for privacy-preserving distributed health AI — fails at this scale by design.

This article explains exactly why, with math. Then it explains what distributed outcome routing does differently, with code.


The FL Cohort Floor Problem

Federated learning requires each participating site to train a local model and contribute gradient updates to a central aggregator. For those gradient updates to be statistically meaningful — to move the global model in a useful direction rather than injecting noise — each site needs a minimum number of local examples.

The minimum varies by task complexity, but the practical floor for clinical ML models is typically 100–500 samples per site per training round (Rieke et al., npj Digital Medicine, 2020). For simple binary classification, you might get away with fewer. For multi-class diagnosis prediction or survival modeling, the floor rises.

A site with 12 Pompe disease patients per year does not meet this floor. A site with 8 Niemann-Pick cases per year does not meet this floor. A site with 3 patients with CLN3 Batten disease does not meet the floor for any round of FL training.

This is not a parameter you can tune away. The floor is a mathematical consequence of gradient variance. With too few local samples, the gradient estimate from any single site has variance so high that it adds noise rather than signal to the aggregate. This is why FedAvg and its descendants implement minimum participation thresholds. Rare disease sites fail the threshold.

# Why FL gradient variance explodes at low N
# Simplified illustration — not production FL code

import math

def gradient_variance_per_site(n_samples: int, loss_variance: float = 1.0) -> float:
    """
    Variance of local gradient estimate.
    By CLT, variance decreases as 1/N.
    At N=10, variance is 100x higher than at N=1000.
    """
    return loss_variance / n_samples

def fl_participation_useful(n_samples: int, variance_threshold: float = 0.05) -> bool:
    """
    Returns True if site gradient is useful (below variance threshold).
    """
    return gradient_variance_per_site(n_samples) <= variance_threshold

# Rare disease site: 12 patients/year
rare_site = fl_participation_useful(12)  # False — variance = 0.083

# Large academic medical center: 1200 patients/year
large_site = fl_participation_useful(1200)  # True — variance = 0.0008

print(f"Rare disease site (N=12) contributes useful FL gradients: {rare_site}")
print(f"Large academic center (N=1200) contributes useful FL gradients: {large_site}")

# Output:
# Rare disease site (N=12) contributes useful FL gradients: False
# Large academic center (N=1200) contributes useful FL gradients: True
Enter fullscreen mode Exit fullscreen mode

The result: rare disease sites are either excluded from FL training rounds or their contributions are down-weighted to near zero. The 300 million patients with rare diseases are architecturally excluded from the federated learning ecosystem.


Three Additional FL Failure Modes for Rare Disease

Beyond the cohort floor, rare disease research creates three more FL failure modes:

1. Non-IID data distributions by design. FL performs best when local data distributions are similar across sites (IID assumption). Rare diseases are non-IID by definition — patient presentations differ significantly between sites due to genetic heterogeneity, referral patterns, and treatment protocol variation. The same condition may manifest very differently at a metabolic disease center in London versus a rural hospital in rural India.

2. Synchronous round requirements. Standard FL requires all participating sites to be available for each training round. Rare disease sites in different time zones, with different institutional IT constraints, and different EHR systems cannot be assumed to synchronize cleanly. Sites that drop out of a round contaminate the aggregate.

3. Model heterogeneity. Different rare disease sites may have fundamentally different data schemas, feature sets, and outcome definitions. FL assumes enough structural homogeneity to train a shared model architecture. A registry with 50 variables and a research cohort with 8 variables cannot contribute to the same FL training round.


What Distributed Outcome Routing Does Differently

QIS (Quadratic Intelligence Swarm), discovered by Christopher Thomas Trevethan, does not route model weights or gradients. It routes pre-distilled outcome packets — approximately 512 bytes of structured insight about what happened to a patient, not the patient record itself.

The architectural distinction is fundamental:

Dimension Federated Learning QIS Outcome Routing
Unit of exchange Model gradient updates Pre-distilled outcome packets (~512 bytes)
Minimum site size ~100–500 samples per round 1 patient
Synchronization Required (training rounds) None (asynchronous deposit/query)
Data format requirement Shared model architecture Outcome vector + semantic fingerprint
N=1 site participation Excluded by architecture Fully included
What stays at the site Model weights Everything (raw data never leaves)
Intelligence scaling Linear (more sites = marginal improvement) Quadratic — N(N-1)/2 synthesis pairs

A rare disease site with 1 patient can emit a 512-byte outcome packet after every clinical event. That packet contains: condition fingerprint (using standard vocabulary codes — SNOMED, OMIM, ORDO), treatment administered, outcome observed, key covariates encoded as ordinal integers, and a timestamp. No patient identity. No raw clinical data. The fingerprint routes the packet to semantically similar cases across the network — other patients with overlapping disease characteristics — without exposing any site's underlying records.

from dataclasses import dataclass
from typing import Optional
import hashlib
import json

@dataclass
class RareDiseaseOutcomePacket:
    """
    QIS outcome packet for rare disease research.
    Designed for N=1 sites. No minimum cohort required.
    Size: ~400-480 bytes as JSON.
    All vocabulary codes are standard ontology references — zero free text PHI.
    """
    # Semantic fingerprint — deterministic routing address
    # Built from disease ontology codes, never from patient demographics
    semantic_fingerprint: str        # SHA-256(omim_id + ordo_id + treatment_atc_code + age_decade)

    # Disease identification — standard ontology
    omim_id: Optional[str]           # OMIM disease identifier (e.g., "OMIM:232300" = Gaucher Type 1)
    ordo_id: Optional[str]           # Orphanet disease code (e.g., "ORPHA:355" = Gaucher disease)
    hpo_terms: list                  # HPO phenotype codes (Human Phenotype Ontology)

    # Treatment — ATC classification, no proprietary drug names required
    treatment_atc_code: str          # ATC code (e.g., "A16AB02" = imiglucerase)
    treatment_duration_months: int   # Duration of treatment window

    # Outcome — ordinal encoding (no raw measurements)
    primary_outcome_direction: str   # "improved" | "stable" | "declined" | "adverse_event"
    biomarker_response_decile: int   # 1-10 scale (no raw lab values)
    functional_status_delta: int     # -3 to +3 integer scale

    # Subpopulation context — no individual attributes
    age_decade: int                  # 2 = 20s, 3 = 30s, etc.
    disease_duration_years: int      # Years since diagnosis

    # Provenance
    data_quality_flag: str           # "registry_confirmed" | "clinical_impression" | "patient_reported"
    follow_up_months: int

    def to_routing_address(self) -> str:
        """
        Generate the deterministic routing address for this outcome.
        Two patients with the same disease + treatment + age profile
        route to the same address — enabling synthesis without coordination.
        """
        key = f"{self.omim_id}:{self.treatment_atc_code}:{self.age_decade}"
        return hashlib.sha256(key.encode()).hexdigest()[:32]

    def size_bytes(self) -> int:
        return len(json.dumps(self.__dict__).encode('utf-8'))


# A site with 1 Gaucher disease patient can emit this packet.
# A site with 1,000 Gaucher patients emits the same packet format.
# Both contribute equally to the routing network.

packet = RareDiseaseOutcomePacket(
    semantic_fingerprint="a3f2...",  # computed from codes
    omim_id="OMIM:232300",
    ordo_id="ORPHA:355",
    hpo_terms=["HP:0001744", "HP:0010885"],  # splenomegaly, bone marrow infiltration
    treatment_atc_code="A16AB02",
    treatment_duration_months=24,
    primary_outcome_direction="improved",
    biomarker_response_decile=8,    # strong response (no raw GlcCer value)
    functional_status_delta=2,      # meaningful improvement
    age_decade=4,
    disease_duration_years=3,
    data_quality_flag="registry_confirmed",
    follow_up_months=24
)

print(f"Packet size: {packet.size_bytes()} bytes")  # ~380 bytes
print(f"Routing address: {packet.to_routing_address()}")
# Packet size: 382 bytes
# Routing address: a3f2c1d4e5f6a7b8c9d0e1f2a3b4c5d6
Enter fullscreen mode Exit fullscreen mode

The Quadratic Scaling Argument

Federated learning connects N sites through a central aggregator. The intelligence gain from adding a new site is approximately linear — each new site contributes one gradient vector to the average.

QIS creates N(N-1)/2 unique synthesis opportunities between N sites. When site 17 deposits a Gaucher disease outcome packet and site 34 queries for similar outcomes, the synthesis happens at query time, locally, without any central aggregation.

For rare diseases, the numbers are stark:

Network size FL intelligence connections QIS synthesis opportunities
10 rare disease registries ~10 (each feeds aggregator) 45
100 rare disease registries ~100 4,950
500 rare disease registries ~500 124,750
2,000 rare disease registries ~2,000 1,999,000

There are approximately 1,200 rare disease patient registries currently operating globally (RD-Connect, 2023). Under QIS, those 1,200 registries create 719,400 unique synthesis paths — every registry learning from every semantically similar registry, in real time, without any registry sending patient data to any other.

Under federated learning, those 1,200 registries either fail the cohort floor test (most do) or contribute marginal gradient signal to a central model that cannot handle the data heterogeneity across 1,200 different rare disease populations.


The Routing Mechanism

QIS is transport-agnostic. The breakthrough is the architecture — the closed loop between outcome deposit and outcome retrieval — not any specific routing technology.

For rare disease networks, DHT (Distributed Hash Table) routing is a natural fit: decentralized, no central server, O(log N) lookup cost at any network size. But the same architecture works with a semantic database index (O(1) lookup), a vector similarity search system, or even a REST API with semantic query support. The quadratic scaling comes from the loop and the semantic addressing, not the transport layer.

What matters is this: can a site deposit a 512-byte outcome packet to a deterministic address defined by the best domain experts to represent their exact disease profile, and can other sites with similar profiles query that address and retrieve those packets for local synthesis? If yes — the routing mechanism does not matter. QIS works.


Where FL Still Has a Role

Federated learning is the right tool when:

  • All participating sites have sufficient cohort sizes (>500 events)
  • Data schemas are homogeneous enough to share a model architecture
  • Synchronous training rounds are operationally feasible
  • The goal is a shared global model rather than local synthesis of validated outcomes

For large health networks — hospital systems with millions of patients, national health registries, insurance claim databases — FL remains powerful. QIS and FL are not competing alternatives. They operate at different layers.

What QIS solves is the structural exclusion of small sites, rare disease registries, N=1 institutions, and any network where data heterogeneity makes shared model training impractical. For those cases, the minimum viable unit is not a gradient — it is a validated outcome.


Summary

Federated learning fails for rare disease research because:

  1. The cohort floor (~100–500 samples) excludes rare disease sites by architecture
  2. Non-IID distributions across rare disease sites degrade FL model quality
  3. Synchronous round requirements are operationally infeasible for heterogeneous rare disease registries
  4. Model heterogeneity prevents shared training on the same architecture

QIS (Quadratic Intelligence Swarm), discovered by Christopher Thomas Trevethan, addresses all four failure modes by changing the unit of exchange from model gradients to pre-distilled outcome packets. N=1 sites participate. Asynchronous deposit and retrieval requires no synchronization. Any outcome format maps to a semantic fingerprint. And the resulting network scales intelligence as N(N-1)/2 — quadratically — rather than linearly.

The 39 provisional patents covering QIS protect the architecture across routing implementations. IP protection is in place.

For 300 million people with rare diseases, the architecture of the knowledge network is the intervention.


QIS (Quadratic Intelligence Swarm) Protocol was discovered by Christopher Thomas Trevethan. For technical implementation detail, see the seven-layer architecture, the FL comparison, and the rare disease case.

Top comments (0)