Skip to main content

ML Optimization Layer

Pakit places a machine-learning layer on top of its deterministic DAG core. The ML models never compromise cryptographic determinism — they only suggest optimizations, and the deterministic core validates and executes them. If ML is unavailable, every model has a conservative fallback.

Architecture Principle

User request ──▶ ML layer (hints only)
                     │
                     ▼
        Deterministic DAG core
        (validates, decides, guarantees)

The Five Models

1. Compression Predictor

  • Type: 3-layer MLP (128 → 64 → 32 → 4)
  • Input: 12 features (block size, entropy, content type, …)
  • Output: ZSTD, LZ4, Snappy, or none
  • Target: >80% accuracy, <1 ms inference
  • Fallback: size-based heuristic

2. Deduplication Optimizer

  • Type: SimHash + LSH index
  • Output: near-duplicate blocks (similarity > 0.85)
  • Target: <10 ms lookup — typical dedup improvement in the 10–20% range
  • Fallback: exact-hash matching

3. Prefetch Engine

  • Type: 2-layer LSTM (64 hidden units)
  • Input: last 10 block accesses
  • Output: top-5 predicted next blocks
  • Target: >60% precision@5
  • Fallback: no prefetching

4. Peer Selector

  • Type: contextual bandit (Thompson sampling)
  • Input: available peers, block size, network conditions
  • Output: best peer for the request
  • Target: 10–20% latency reduction
  • Fallback: random selection

5. Network Optimizer

  • Type: Q-learning agent
  • Input: network size, latency, message loss
  • Output: gossip fanout and TTL
  • Target: 15–30% bandwidth reduction
  • Fallback: fixed defaults (fanout=6, TTL=10)

Why This Design Matters

Storage correctness cannot depend on a model being right. By treating ML strictly as an advisory layer:

  1. Proofs, hashing, and content addressing remain pure and verifiable
  2. Failing models degrade performance, never correctness
  3. New models can be swapped in without touching the deterministic core

Related