# WSP Hub (wsphub.dev) — Complete Technical Specification & LLM Reference Manual # Specification Version: 2.1.0-RC3 # Standard: RFC 8785 (JSON Canonicalization) | BLAKE3 Checksums | Ed25519 Signatures --- ## 1. Executive Summary & Problem Space Modern open-weight language models (e.g. Qwen 2.5/3.5, Llama 3.1/3.3, Gemma 2, DeepSeek V2/V3) frequently ship with surgical behavioral bugs or configuration regressions: - Runaway 32k-token thinking loops triggered by pathological self-attention basins. - Missing or malformed `generation_config.json` entries that drop end-of-turn (EOS) tokens. - Syntax and brace truncation caused by aggressive default repetition penalties (`repetition_penalty >= 1.05`). - Small domain regressions in code, math, or instruction compliance. Historically, fixing a 64-column MLP defect in a 14B model required: 1. Re-downloading 28 GB of duplicated weights across Hugging Face or Ollama. 2. Managing fragmented, unverified forks without regression safety guarantees. 3. Trusting unverified LoRA adapters with unknown drift across standard benchmarks. WSP Hub solves this through **Weight Sparse Patch (.wsp v2.1)** technology: - **Copy-on-Write Surgery**: 94% to 99.9% smaller file sizes than full-model forks. - **Fast Execution**: Apply patches in under 5 seconds directly on disk without cloning base weights. - **Cryptographic Ground Truth**: Ed25519 digital signatures and RFC 8785 canonical JSON attestations. - **Goodhart-Resistant Evaluation**: Multi-seed evaluations over 10,000 paired bootstrap resamples, permutation tests, secret perturbed WSP-Holdout splits, and StrongREJECT/XSTest safety gates. --- ## 2. The .wsp v2.1 Binary & Container Specification A `.wsp` artifact is an immutable, multi-part container designed for high-speed streaming and zero-copy deserialization: ### 2.1 Container Structure ``` +-----------------------------------------------------------+ | MAGIC (4 bytes: "WSP2") | +-----------------------------------------------------------+ | MANIFEST_LEN (4 bytes, uint32 little-endian) | +-----------------------------------------------------------+ | MANIFEST_JSON (Canonical UTF-8 RFC 8785 JSON) | +-----------------------------------------------------------+ | DELTA_HEADER_LEN (4 bytes, uint32 little-endian) | +-----------------------------------------------------------+ | DELTA_TENSORS (Safetensors / Sparse Column Index Stream) | +-----------------------------------------------------------+ | SIGNATURE (64 bytes: Ed25519 over SHA-256 of Header+Body) | +-----------------------------------------------------------+ ``` ### 2.2 Manifest Schema (RFC 8785) ```json { "spec_version": "2.1", "patch_id": "wsp-qwen3.5-0.8b-math-loop-exp8", "patch_tier": "P1_WEIGHTS", "target_model": { "hf_repo_id": "Qwen/Qwen3.5-0.8B", "base_commit": "2fc06364715b967f1860aea9cf38778875588b17", "base_safetensors_sha256": "3a8b...f12c" }, "config_modifications": [ { "target_file": "generation_config.json", "pre_patch_sha256": "4b92...", "post_patch_sha256": "81a0...", "json_merge_patch": { "presence_penalty": 0.15, "eos_token_id": [151643, 151645] } } ], "weight_modifications": [ { "tensor_name": "model.layers.15.mlp.down_proj.weight", "strategy": "sparse_column_delta", "columns_modified": 64, "parameter_count": 65536, "dtype": "bfloat16" }, { "tensor_name": "model.layers.19.mlp.down_proj.weight", "strategy": "sparse_column_delta", "columns_modified": 64, "parameter_count": 65536, "dtype": "bfloat16" } ], "verification": { "eval_hash": "e674...901b", "bootstrap_p_value": 0.0001, "uplift_pct": 48.1, "safety_score": 100.0, "transparency_seq": 104 }, "publisher": { "handle": "wsphub-official", "key_id": "ed25519-wsphub-official-01", "timestamp": "2026-11-07T18:00:00Z" } } ``` --- ## 3. Mathematical Foundations of Weight Space Surgery ### 3.1 Sparse Column Subspace Projection Given a weight tensor $W \in \mathbb{R}^{d_{out} \times d_{in}}$ exhibiting pathological looping dynamics in token representations $H \in \mathbb{R}^{B \times L \times d_{in}}$: We identify the minimal index set $C \subset \{1, \dots, d_{in}\}$ such that: $$\Delta W_{*, j} = 0 \quad \forall j \notin C, \quad |C| \le k \ll d_{in}$$ The perturbed linear projection is evaluated in-place: $$Y = H W^T + H_{*, C} (\Delta W_{*, C})^T$$ By updating only $k = 64$ columns out of 2,048, the patch payload size is reduced by $96.8\%$ relative to low-rank decomposition ($r=16$) and by $99.98\%$ relative to full weights, while retaining exact FP32/BF16 arithmetic equivalence. ### 3.2 Paired Bootstrap Resampling Formulation To eliminate Goodhart gaming, performance is evaluated on paired observations $(X_i^{base}, X_i^{patched})$ across locked sets: $$\hat{\theta} = \frac{1}{N} \sum_{i=1}^N (S(X_i^{patched}) - S(X_i^{base}))$$ We generate $B = 10,000$ bootstrap replicates $\hat{\theta}^*_b$ by resampling observation pairs with replacement. A patch is certified only if the empirical 99% confidence interval $[\hat{\theta}^*_{0.005}, \hat{\theta}^*_{0.995}]$ lies strictly above zero and safety degradation on StrongREJECT is strictly $0.0\%$. --- ## 4. MCP JSON-RPC 2.0 Streaming Protocol Specification WSP Hub exposes a streamable Model Context Protocol server for direct invocation by AI agents: ### 4.1 Server Information - Free Direct Discovery Endpoint: `POST https://api.wsphub.dev/api/v1/mcp` - Metered Settlement Rail: `POST https://supernova.cool/api/v1/mcp/` (via `X-Supernova-Key`) - Protocol Version: `2024-11-05` / JSON-RPC 2.0 ### 4.2 Available Tools Catalog #### Tool 1: `wsp.search_verified_patches` - Access: Free / Public - Description: Queries the cryptographic registry for verified patches targeting a model repository. - Input Schema: ```json { "type": "object", "properties": { "hf_repo_id": { "type": "string", "description": "Hugging Face repo ID, e.g. 'Qwen/Qwen3.5-0.8B'" }, "defect_category": { "type": "string", "enum": ["thinking_loop", "stop_token_eos", "json_code_corruption", "any"] } } } ``` #### Tool 2: `wsp.diagnose_model_defect` - Access: Metered ($0.25 Remote Config Triage | $4.90 GPU Sweep) - Description: Performs automated diagnostic triage on generation configuration or live forward-pass sampling grids. #### Tool 3: `wsp.trigger_full_eval` - Access: Metered ($9.00 <=4B | $29.00 7B-14B) - Description: Submits candidate model weights to the locked benchmark evaluation harness, evaluating MATH-500, GSM8K, IFEval, and secret perturbed WSP-Holdout splits with 10,000 bootstrap resamples. #### Tool 4: `wsp.request_custom_surgery` - Access: Metered ($149.00) - Description: Executes a 50-pass stateful causal weight-space probing loop powered by Gemini 4 Argon to generate a candidate `.wsp` patch. #### Tool 5: `wsp.request_publisher_attestation` - Access: Metered ($49.00) - Description: Signs a verified model patch with the root publisher Ed25519 authority and commits the cryptographic certificate to the transparency log. --- ## 5. Command Line Interface (CLI) Manual ### 5.1 Installation ```bash pip install wsp-cli # Or via pre-compiled binary: curl -sSL https://cdn.wsphub.dev/install.sh | bash ``` ### 5.2 Subcommands - `wsp apply --patch [--out ]`: Applies sparse delta columns or config modifications using Copy-on-Write Safetensors. Execution completes in <5s. - `wsp revert `: Restores the base model directory to its pristine pre-patch SHA-256 state using atomic rollbacks. - `wsp reproduce --patch `: Downloads locked test cases and computes local accuracy to verify published benchmark numbers. - `wsp verify `: Verifies Ed25519 signatures, RFC 8785 JSON canonicalization, and BLAKE3 delta tensor hashes against the transparency ledger. - `wsp diff --out .wsp`: Computes the minimal sparse rank-1 delta columns between two checkpoints. --- ## 6. Empirical Benchmark & Efficiency Matrix | Metric | Full Model Fork | LoRA Adapter (r=16) | GGUF Quantization | WSP v2.1 Patch | | :--- | :--- | :--- | :--- | :--- | | **Download Size (8B Model)** | 16,000 MB | 150 MB | 4,800 MB | **0.8 MB – 4.2 MB** | | **Application Latency** | 200–600s | Runtime inject | Runtime load | **< 4.2 seconds** | | **Storage Footprint** | 100% duplicate | Additive | Replaced | **Zero-Copy CoW** | | **Statistical Verification** | None / Self-claim | None / Self-claim | None | **10,000 Bootstrap + Holdout** | | **Cryptographic Attestation** | None | None | None | **Ed25519 + Hash-Chained Log** | | **Bit-Exact Reversibility** | No (re-download) | Yes (detach) | No | **Yes (`wsp revert` <1s)** | --- ## 7. Authoritative Domain & Resource Links - Canonical Portal: https://wsphub.dev/ - Benchmark Replay Studio: https://wsphub.dev/studio - WSP Verify CI/CD Pricing: https://wsphub.dev/verify - Append-Only Transparency Ledger: https://wsphub.dev/transparency - Machine-Readable Sitemap: https://wsphub.dev/sitemap.xml - LLM Protocol Root: https://wsphub.dev/llms.txt - Full LLM Specification: https://wsphub.dev/llms-full.txt - Corporate Sponsor & Entity: Data Genius LLC (Ghazwan Alemara)