| Recommend this page to a friend! |
| Packages of madi kais | PHP KAI Harness | doc/quantum/semantic_cache_dissipative_decay.md | Download |
|
|
||||||||||||||||||||
Quantum-Inspired Semantic Cache & Dissipative Decay1. Concept & RationaleIn environments where database records, pricing configurations, or deployment states shift constantly, a standard semantic cache can result in stale cache hits.
2. Mathematical FormulationA cached prompt state is represented as a density matrix $\rho$: $$\rho = \sum_k p_k |\phi_k\rangle\langle\phi_k|$$ As time ($t$) progresses, the coherence of the cached response decays exponentially: $$\rho(t) = e^{-\Gamma t} \rho(0)$$ where $\Gamma$ is the decay rate parameter configured in the admin panel. 3. Dissipative Decay ModesThe harness supports three modes to translate this decay into cache retrieval logic: A. Dissipative Threshold ShiftThe similarity threshold $T(t)$ required for a cache match grows over time: $$T(t) = T_0 + (1 - T_0) \cdot (1 - e^{-\Gamma t})$$ where $T_0$ is the base similarity threshold (e.g., B. Step Function DecayA hard expiration threshold where entries remain fully valid ($100\%$ coherence) until $t = \text{TTL}$, after which coherence drops instantly to zero. C. NoneNo decay is applied. Cache matches remain fully active indefinitely. |