Live Visualisation
Tip: tweak density, reseed the field, or toggle layers. Use the buttons atop each code block to copy examples.
1 · Motivation
While the photonic model captures flow and interference in Spw parsing, a complementary framework is needed to quantify how meaning evolves across document space (position) and reader time (traversal). Semantic Gradients provide a scalar–vector field for local cohesion and global drift, facilitating adaptive highlighting, context-window optimization, link re-ranking, and entropy-aware reading paths.
2 · Gradient Definition
Symbol | Description | Units | Example |
---|---|---|---|
\(\phi(x)\) | Semantic potential at position \(x\) | bits / token | High in dense concepts |
\(\nabla\phi\) | Semantic gradient (vector) | bits / token / char | Steepest change |
\(\lVert\nabla\phi\rVert\) | Cohesion magnitude | bits / token / char | Low → cohesive |
\(\Delta\phi\) | Drift along a path | bits / token | Traversal integral |
^model[semantic.gradient]{
potential φ : entropy-reduced meaning density,
gradient ∇φ : ∂φ/∂xᵢ across document axes,
cohesion : ‖∇φ‖⁻¹ // high cohesion → low gradient
}
3 · Mathematical Formalism
3.1 Semantic Potential
\(\phi(x) = -\sum_{i} p_i(x)\log_2 p_i(x)\), where \(p_i(x)\) comes from local concept distributions (embeddings/co-occurrence windows).
3.2 Gradient Operator
∇φ = ⟨ ∂φ/∂x_sem , ∂φ/∂x_syn , ∂φ/∂x_prag ⟩
∂φ/∂x ≈ [φ(x+δ) - φ(x-δ)] / 2δ
3.3 Drift Integral
Δφ = ∫₍x₀→x₁₎ ∇φ · d𝓁 // shift along reader traversal
3.4 Divergence & Curl
Use \(\nabla\cdot\nabla\phi\) to find semantic sources/sinks; \(\nabla\times\nabla\phi\) to flag rotational inconsistencies.
4 · Integration with Parsing & Physics
n(x) = n₀ · [ 1 + κ · ‖∇φ(x)‖ ] // turbulence → refractive index
// Couple to beam-weight lattice θ to bias precedence in high-drift zones.
5 · Experiments & Validation
^experiment[grad.validate]{
input : <doc_set>,
compute : ∇φ,
correlate: <comprehension_scores>,
output : r²
}
6 · Future Directions
- Validate cohesion–comprehension correlation (retention, eye-tracking).
- Temporal decay: \(\phi(x,t)=\phi(x)\,e^{-\lambda t}\).
- RL-guided navigation over low-drift paths.
- Inter-document gradients for knowledge-graph expansion.
- Hardware acceleration (FPGA/AR overlays).