xmiao/causal-odyssey
Causal Odyssey — Rare Disease Diagnosis
Gemma 4 Good Hackathon submission — Health & Sciences · Main · Ollama tracks.
A locally-hosted diagnostic reasoner that runs entirely through Gemma 4. No cloud calls, no API keys. Patient phenotypes never leave the machine.
What's running here
The demo combines:
- Structural retrieval — gene-rescue + missing-pathognomonic penalty
- Per-patient FCI causal edges (iGFCI-style individualized framework) — bidirected HPO pairs from patient-specific FCI
- Gemma 4 reranking with per-patient FCI edges and Reactome pathway evidence in chain-of-thought
- Chain-closure audit — deterministic Mondo bridge check; 21.6% tight closure rate on 1,122 patients
- Verifier — flags top-1 when a pathognomonic HPO is missing; P(correct | confirm) = 32% vs P(correct | refute) = 10% (3.3× rejection-signal discrimination)
- Interrogator — proposes the most-discriminating next HPO with Gemma-generated clinical rationale
- Closed loop — answer, re-rank, watch rank trajectory update (novel ΔR@10 metric: +11.2pp pooled / +38.2pp verified)
HF Spaces build — important
HF free CPU tier can't run Gemma 4 26B. This Space ships with pre-computed Gemma outputs for curated showcase patients from our 1,122-patient benchmark evaluation run. Toggle Use Gemma 4 reranker to load the cached reasoning + chain-closure audit for those cases.
For live Gemma runs on arbitrary HPO inputs, clone the repository and run locally:
git clone https://github.com/xueerchen1990/CausalOdyssey
cd CausalOdyssey
# 1. Install Python dependencies (pre-requirements first, then runtime deps)
pip install -r pre-requirements.txt
pip install -r requirements.txt
# 2. Fetch the two large public datasets the demo needs (~115 MB)
bash scripts/download_data.sh
# 3. Start Ollama and pull Gemma 4 26B (~16 GB)
ollama serve &
ollama pull gemma4:26b
# 4. Run the demo
streamlit run app.pyNote on `pre-requirements.txt`: HF Spaces installs this file before requirements.txt automatically. For local installs, run both files in order as shown above — the pre-reqs pin modern pip/setuptools/wheel/numpy so that causal-learn and other scientific packages build cleanly.
Headline result
On 1,122 RareBench patients across four benchmarks (FullMA — full 4-agent stack):
- Pooled R@1 +8.4pp (McNemar p = 1.4×10⁻¹⁴)
- RAMEDIS R@1 +13.3pp (in-domain)
- MME R@5 +12.5pp
- HMS R@1 +2.3pp
Primary method contribution: individual-patient FCI causal edges supplied as Gemma chain-of-thought context, with a Verifier that calibrates rejection at the top of the differential.
What the showcase cases demonstrate
Disclosures
- Quechua audio (referenced in the video): best-effort MMS-TTS synthesis from approximate Cusco Quechua, not native-speaker translation.
- RareBench data (HPO + disease labels) is public; no proprietary biobank or clinical records used.
- Gemma 4 26B (quantized) is the default model; pipeline is model-agnostic.
- Not FDA-cleared. Decision support, not decision.
Repro
Full benchmark code and deployment configs used to compute the headline numbers are not released in this repository — a preprint with the evaluation details is forthcoming. This repo and the Space contain the method implementation and cached Gemma outputs for the curated showcase patients.
