3.9 KiB
Methodology
Approach
Organ Architecture treats trained AI models as biological organisms with transplantable parts. Instead of retraining from scratch (costs billions), we perform post-training surgery: extract, measure, graft, reassemble.
Step 1: Extraction (organ_extract.py)
Parse GGUF binary format directly:
- Read magic number, version, metadata, tensor info
- Classify each tensor by name pattern into anatomical types
- Extract each tensor as independent .bin file with header
- Generate manifest.json mapping the full anatomy
Classification rules:
attn_q,attn_k,attn_v,attn_output→ skeletonffn_gate,ffn_up,ffn_down→ organtoken_embd,output.weight→ embed*_norm→ normlora_*→ adapter
Step 2: Measurement (organ_measure.py)
Z-measure: Z = dI/d(log s) * exp(i*theta)
For each tensor, sample up to 100,000 values and compute:
-
Entropy (information density):
- Histogram-based Shannon entropy
- Normalized to [0, 1] against maximum entropy
- High entropy (>0.95) = uniform = noise
- Moderate entropy (0.3-0.7) = structured information
-
Kurtosis (structure):
- Fourth standardized moment minus 3
- High absolute kurtosis = sharp peaks = organized structure
- Near-zero = Gaussian-like = less organization
-
Scale coherence (CV of sorted diffs):
- Sort sampled values, compute differences
- Coefficient of variation of these differences
- High CV = non-uniform spacing = structured signal
- Low CV = uniform spacing = noise
Combined score → theta in [0, 90] degrees.
Step 3: Purification (organ_purify_v2.py)
Fractal signal extraction via Haar wavelets:
- Pad tensor to power-of-2 length
- Haar wavelet decomposition across N scales
- At each scale: approximation + detail coefficients
- Cross-scale coherence check:
- Compare energy at scale s with energy at scale 2s
- High coherence (pattern exists at both scales) = fractal = signal
- Low coherence (pattern at one scale only) = noise
- Attenuate incoherent components (noise)
- Reconstruct from coherent components (signal)
- Restore original scale (mean/std preservation)
This directly implements dI/d(log s): information that persists across logarithmic scales is the signal. Everything else is training artifact.
Step 4: Grafting (organ_graft.py, transplant_935.py)
Two methods:
Via .bin intermediaries (organ_graft.py)
- Extract both source and target models to organ directories
- Match tensors by layer number and type suffix
- Verify dimensional compatibility
- Copy matching .bin files from donor to recipient directory
- Update manifest
Direct GGUF-to-GGUF (transplant_935.py)
- Parse both GGUF headers to get tensor name/offset/size maps
- Copy base GGUF entirely as starting point
- For each FFN tensor in base that has a matching donor tensor:
- Verify exact byte size match
- Seek to donor tensor data, read
- Seek to base tensor offset in output, overwrite
- Result: valid GGUF with patched FFN layers
Direct method is faster and avoids header format issues.
Step 5: Assembly (organ_assemble.py)
Reconstruct GGUF from organ directory:
- Read manifest for metadata and tensor ordering
- Write GGUF header (magic, version, n_tensors, n_metadata)
- Write metadata key-value pairs
- Write tensor info (name, dims, dtype, offset) with 32-byte alignment
- Write tensor data with padding
- Result: standard GGUF loadable by any compatible runtime
Step 6: Validation
Run chimera through InferenceX:
- Load GGUF, validate all tensors
- Initialize transformer (attention, KV cache, kernel dispatch)
- Run inference with chat template
- Verify coherent output
Key Finding
Graft success depends on architectural proximity:
- Same family (Qwen2 base) + same scale (14B) = coherent output
- Same family + different scale (7B) = PAD token failure
- The latent space alignment is implicit in shared training lineage
Signature
935