An interactive dashboard demonstrating how cognitive rigidity and suffering emerge from Bayesian belief formation when experiences are censored to fit existing beliefs—and how meditation provides liberation by reducing certainty of the "meaning (predictive value) of past beliefs".
The Model of Suffering:
- Experiences arrive with objective values (reality)
- 95% CI Test: If experience falls outside your belief's 95% confidence interval, it gets squeezed to the boundary
- Precision Accumulates: Each experience (even squeezed ones) increases certainty (tau), narrowing the CI
- Trap Forms: Narrower CI → more squeezing → even narrower CI → self-reinforcing rigidity
- Meditation Breaks Free: Reduces precision (this is the mathematical term for the inverse of the standart deviation, so: higher precision → more narrow curve) of past experiences, widening CI to accommodate reality
- Python 3.8+
- Node.js 16+
Just run
./start.shThis will start both backend and frontend servers.
You can then open your browser to http://localhost:5173 to access the dashboard.
cd backend
pip install -r requirements.txt
python3 main.pyBackend runs on http://localhost:8000
cd frontend
npm install
npm run devFrontend runs on http://localhost:5173
Open browser to http://localhost:5173 and start adding experiences!
- Blue curve: Your current belief P(μ|data)
- Shaded region: 95% confidence interval (the "acceptance window")
- Experience distributions:
- Solid curve: Stored (squeezed) value used in belief
- Dashed curve: Objective (true) value from reality
- Arrow: Amount of squeezing (suffering)
- Color coding:
- Green = Accepted as-is (within CI)
- Red = Squeezed (outside CI, censored)
- Yellow = Being meditated on
- Value Slider (-10 to +10): The objective mean of new experience
- Sigma Slider (0.1 to 3.0): Uncertainty of the observation
- Low σ (0.1) = High precision, strong belief about this value
- High σ (3.0) = Low precision, uncertain observation
- Add Experience Button: Adds experience and automatically squeezes if outside 95% CI
- Select Experience: Click experience in list to meditate on it
- Meditation Level Slider: How much to reduce precision (0-100%)
- Meditate Button: Apply meditation to selected experience
- Effect: Reduces tau → widens distributions → may unsqueeze if CI now covers objective value
- Single counter (0-100%) tracking your meditation skill
- Increases with each manual meditation session
- Higher cultivation = stronger meditation effects
- Represents long-term practice benefits
- Total Squeezing Cost: Accumulated suffering from all censored experiences
- Squeezing Cost per Experience: Bar chart showing which experiences cause most suffering
- Precision Over Time: Line chart showing how tau accumulates (rigidity increasing)
- Current CI Width: How narrow/wide your acceptance window is
- Passive meditation: Recent experiences automatically get mild meditation
- Decay: Meditation naturally fades after ~5 seconds
- Manual override: Click "Meditate" button for stronger, cultivation-building meditation
We model beliefs and experiences as Gaussian distributions:
Prior (initial belief):
P(μ) = N(0, 10²) # Very weak prior: σ₀=10, τ₀=0.01
Likelihood (each experience):
P(xᵢ | μ) = N(xᵢ; μ, σᵢ²) # Experience has mean xᵢ, variance σᵢ²
Posterior (updated belief) via Bayes' theorem:
P(μ | x₁,...,xₙ) = N(μₙ, σₙ²)
Why Gaussian-Gaussian? It's a conjugate prior—posterior has same form as prior, giving closed-form updates:
Precision accumulation:
τₙ = τ₀ + Σᵢ τᵢ # where τ = 1/σ²
Precision-weighted mean:
μₙ = (τ₀μ₀ + Σᵢ τᵢxᵢ) / τₙ
Posterior standard deviation:
σₙ = 1/√τₙ # Higher precision → lower uncertainty
This IS Bayes' theorem! For Gaussians:
P(μ|data) = P(data|μ) × P(μ) / P(data)
simplifies to these precision-weighted formulas.
Acceptance window:
CI = [μₙ - 1.96σₙ, μₙ + 1.96σₙ]
Squeezing rule:
if x_objective < CI_lower:
x_stored = CI_lower
elif x_objective > CI_upper:
x_stored = CI_upper
else:
x_stored = x_objective # No squeezing
What this means: We modify the likelihood in Bayes' theorem:
Normal: P(μ | x_true) ∝ P(x_true | μ) × P(μ)
Squeezed: P(μ | x_squeezed) ∝ P(x_squeezed | μ) × P(μ)
We're using fake data in the likelihood, creating a self-fulfilling belief.
C_squeeze = (x_objective - x_stored)² × √τ_posterior
Interpretation:
- Large shift (|x_objective - x_stored|) = major reality distortion
- High precision (τ) = rigid belief → harder to update → more suffering
- Cost grows quadratically with distortion distance
Without meditation:
τ_effective = τ_base
With meditation at level m ∈ [0,1]:
τ_effective = τ_base × r(m)
where r(m) is calculated so that at m=1:
CI₉₅% ⊇ {all objective means}
Effect on posterior:
τₙ(m) = τ₀ + Σᵢ τᵢ × r(m) # Reduced precision sum
σₙ(m) = 1/√τₙ(m) # Wider uncertainty
Result: CI widens → previously squeezed experiences may now fit → unsqueezing!
- Initial experiences form posterior with some tau
- Outlier arrives outside CI → gets squeezed
- Tau increases (standard Bayesian accumulation)
- CI narrows (σ = 1/√τ decreases)
- Next outlier must also squeeze
- Loop repeats → accelerating rigidity
Mathematical progression:
Squeeze → τ↑ → σ↓ → CI shrinks → More squeezing → τ↑↑ → ...
- Reset model
- Observe: Wide prior (σ=10), almost no beliefs
- Add experience at value = 0
- Add experience at value = 1
- Add experience at value = -1
- Observe: Posterior forms around mean ≈ 0, CI narrows slightly
- All experiences GREEN (accepted)
- Add experience at value = 5
- Watch it turn RED! Squeezed to CI boundary (~2.0)
- Suffering metric increases
- CI gets even narrower
- Try adding value = 4
- Also squeezed! (CI now excludes even moderate values)
- Try adding value = 6
- Also squeezed!
- Observe: You're stuck, can only accept values near 0
- Click on the squeezed experience at value = 5
- Slide meditation to 100%
- Click "Meditate"
- Watch:
- Yellow glow appears
- CI widens
- Arrow shortens (less squeezing)
- May turn GREEN if CI now covers objective value!
- Suffering decreases
- Observe "Brahma Viharas" counter increased
- This cultivation persists across sessions
- Higher cultivation = more effective meditation