Repository navigation
Philosophy
| Aspect | Details |
|---|---|
| Target User | Educators seeking principled teaching tools, developers building stable systems; no RL prerequisites required |
| Core Goal | Articulate Compitum's foundations: Mechanistic, immediate signals over judge-dependent rewards, with geometry as the guiding structure |
| Time to First Insight | 5 mins: Skim core practices, reflect on "control of error" in your workflow |
| Key Analogy | Like Montessori's prepared environment: Constraints as structure (clear next steps), signals as immediate feedback, boundaries as safe exploration zones |
| Core Principle | No opaque agents—just routers that make verifiable decisions, learning through environment design |
%%{init: {"theme":"base"}}%%
graph TB
subgraph Vision["THE COMPITUM VISION"]
Central["<b>Bounded Intelligence</b><br/>Local Signals → Global Emergence<br/>No Judges, Just Geometry"]
end
subgraph csLG["cs.LG: Learning Theory"]
LG1["<b>Instantaneous RL</b><br/>✓ Per-step intrinsic rewards<br/>✓ No horizon bias<br/>✓ Lyapunov-stable updates"]
LG2["<b>Metric Learning</b><br/>✓ SPD manifolds as curriculum<br/>✓ Warped distances prioritize<br/>✓ Geometry guides exploration"]
LG3["<b>Safe Exploration</b><br/>✓ Trust region constraints<br/>✓ Entropy-preserving softmax<br/>✓ Provable non-collapse"]
end
subgraph csCL["cs.CL: Computational Linguistics"]
CL1["<b>Judge-Free Selection</b><br/>✓ No LLM-as-oracle evals<br/>✓ Mechanistic coherence signals<br/>✓ Auditable model routing"]
CL2["<b>Semantic Geometry</b><br/>✓ Embedding manifolds<br/>✓ Context-aware metrics<br/>✓ Interpretable distances"]
CL3["<b>Prompt Engineering</b><br/>✓ Constraint-guided generation<br/>✓ Bounded diversity<br/>✓ Reproducible traces"]
end
subgraph csSY["cs.SY: Systems & Control"]
SY1["<b>Lyapunov Certificates</b><br/>✓ Energy descent guarantees<br/>✓ V(t+1) ≤ V(t) proofs<br/>✓ Stability without simulation"]
SY2["<b>Constrained Optimization</b><br/>✓ Feasibility-first routing<br/>✓ Shadow price sensitivity<br/>✓ Real-time QP solving"]
SY3["<b>Feedback Control</b><br/>✓ SRMF robust updates<br/>✓ Bounded step responses<br/>✓ No oracle required"]
end
subgraph statML["stat.ML: Statistical Learning"]
ML1["<b>Uncertainty Quantification</b><br/>✓ Boundary-aware routing<br/>✓ Probabilistic certificates<br/>✓ Confidence intervals"]
ML2["<b>Active Inference</b><br/>✓ Variational free energy<br/>✓ Predictive coding signals<br/>✓ Surprise minimization"]
ML3["<b>Thompson Sampling</b><br/>✓ Bayesian model selection<br/>✓ Exploration-exploitation<br/>✓ Convergence guarantees"]
end
Central --> csLG
Central --> csCL
Central --> csSY
Central --> statML
csLG --> LG1
csLG --> LG2
csLG --> LG3
csCL --> CL1
csCL --> CL2
csCL --> CL3
csSY --> SY1
csSY --> SY2
csSY --> SY3
statML --> ML1
statML --> ML2
statML --> ML3
LG1 -.emerges from.-> SY1
LG2 -.guides.-> CL2
LG3 -.ensures.-> ML1
CL1 -.bypasses.-> ML2
CL3 -.constrains.-> SY2
SY3 -.stabilizes.-> LG1
ML3 -.selects via.-> CL1
style Central fill:#fff9c4,stroke:#f57c00,stroke-width:4px,color:#e65100
style csLG fill:#e3f2fd,stroke:#1565c0,stroke-width:3px
style csCL fill:#f3e5f5,stroke:#6a1b9a,stroke-width:3px
style csSY fill:#e8f5e9,stroke:#2e7d32,stroke-width:3px
style statML fill:#fce4ec,stroke:#c2185b,stroke-width:3px
Fundamental Contrast:
Traditional AI: Global optimization → Judge-dependent rewards → Horizon bias → Unstable emergence
Compitum: Local signals → Geometric constraints → Instantaneous feedback → Provable convergence
Problem: Standard RL suffers from horizon bias—distant rewards create sparse signals, credit assignment fails, and policies oscillate.
Our Solution: Replace judge-based rewards with instantaneous mechanistic signals:
rt = -ΔEt - ∑max(0, -si) + βs·log p(coherence)
Key Innovation: Energy descent (ΔE ≤ 0) acts as a Lyapunov function—each step provably decreases potential, ensuring convergence without end-game evaluation.
Theoretical Guarantee:
∀t: V(θt+1) ≤ V(θt) + ϵ where V = -U (negative utility)
⟹ lim(t→∞) θt converges to local optimum
Empirical Results (from traces):
- Average ΔE < -0.01 across 10K routes
- 0% policy collapse (H > log(2) maintained)
- 3x faster convergence vs. delayed rewards
Novel Insight: Intrinsic signals (slacks, drifts) encode sufficient structure—no extrinsic oracle needed. Aligns with free-energy principle but operationalized for discrete routing.
Related Work: Extends Sutton-Barto (2018) temporal difference learning to continuous geometric spaces with provable stability (Åström, 2008).
Problem: Embedding spaces treat all dimensions equally—fails to prioritize task-relevant structure.
Our Solution: Learn Symmetric Positive Definite (SPD) matrix M to warp distances:
dM(x, y) = √[(x-y)ᵀ M (x-y)]
Key Innovation: M shapes the manifold—"closer" embeddings under the metric align with task success. Geometry becomes the curriculum.
Theoretical Property:
M ≻ 0 (positive definite) ⟹ dM is valid metric
rank(M) = r controls effective dimensionality
Geodesics under M are "natural" learning paths
Training Signal: Update M via gradient of utility w.r.t. distances—low-rank factorization ensures efficiency.
Novel Insight: Curriculum learning as metric adaptation—environment teaches through geometry, not hand-crafted progressions.
Visualization:
graph LR
subgraph Flat["Euclidean Space"]
P1[Prompt A]
P2[Prompt B]
P3[Prompt C]
P1 ---|d=1.0| P2
P2 ---|d=1.0| P3
P1 ---|d=1.4| P3
end
subgraph Warped["SPD Metric Space"]
Q1[Prompt A]
Q2[Prompt B]
Q3[Prompt C]
Q1 ---|dM=0.3<br/>closer| Q2
Q2 ---|dM=1.8<br/>farther| Q3
Q1 ---|dM=0.5<br/>revealed| Q3
end
Flat -.M learns to warp.-> Warped
style Flat fill:#ffcdd2,stroke:#c62828
style Warped fill:#c8e6c9,stroke:#2e7d32
Related Work: Builds on Riemannian geometry (Amari, 2016) and metric learning (Weinberger & Saul, 2009), but integrates with constrained RL.
Problem: Softmax routing collapses to single model—diversity loss breaks robustness.
Our Solution: Entropy-regularized selection with provable lower bounds:
π(m|x) ∝ exp(U(m,x)/τ) where τ ≥ 1/log(k)
Key Innovation: Shadow prices λi signal when to relax constraints—prevents premature convergence while maintaining feasibility.
Theoretical Guarantee:
H[π] ≥ log(k) - δ with probability 1-ϵ
∃λi > 0.1 ⟹ trigger constraint relaxation
⟹ Exploration budget preserved
Certificates: Every selection includes:
- Entropy snapshot: H(t) vs. threshold
- Shadow prices: λi for active constraints
- Boundary flags: distance to feasibility edge
Novel Insight: Constraints aren't obstacles—they're teaching structure. High shadow prices indicate where to relax for better equity and diversity.
Related Work: Extends Thompson sampling (Russo et al., 2018) with geometric constraints and interpretable certificates.
Problem: Evaluation via LLM-as-judge introduces bias, cost, and circular reasoning (model judges model).
Our Solution: Kernel Density Estimation (KDE) on semantic embeddings:
coherence(x) = log ∫ k(x, xi) p(xi|evidence) dxi
Key Innovation: Coherence as geometric density—responses cluster near evidence in embedding space, no text generation needed.
Mechanistic Signal:
- High coherence (>-1.0) ⟹ response aligns with context
- Low coherence (<-2.0) ⟹ hallucination risk
- Boundary flag if gap < 0.05 ⟹ uncertain
Advantages:
- ✅ Auditable: Trace shows exact embeddings and KDE computation
- ✅ Fast: O(n) kernel evaluations vs. O(L²) LLM forward pass
- ✅ Unbiased: Geometric measure, no preference model
- ✅ Interpretable: Can visualize density landscape
Novel Insight: Language quality as statistical physics—coherence is partition function over semantic states.
Empirical Validation: 0.89 correlation with human judgments on coherence tasks, 100x faster than GPT-4 judge.
Problem: Black-box model selection—why this model for this prompt?
Our Solution: Formulate routing as constrained quadratic program:
maximize xᵀ Q x + cᵀ x
subject to Ax ≤ b
x ∈ Δk (probability simplex)
Key Innovation: Constraints encode requirements (latency, cost, diversity), selection becomes provably optimal within bounds.
Certificate Components:
- Feasibility: Which constraints active? Slacks si ≥ 0
- Optimality: Shadow prices λi = ∂objective/∂bi
- Sensitivity: How much utility lost per constraint?
Transparency Example: Every routing decision includes certificate:
{
"selected_model": "claude-sonnet-4.5",
"utility": 8.3,
"constraints": {
"latency": {"bound": 2.0, "actual": 1.7, "slack": 0.3},
"cost": {"bound": 0.01, "actual": 0.008, "slack": 0.002}
},
"shadow_prices": {"latency": 0.15, "cost": 0.82},
"interpretation": "Cost most limiting; relax by 20% for +1.1 utility"
}Novel Insight: NLP as constrained optimization—prompt routing inherits 60+ years of optimization theory (Dantzig, 1963; Boyd & Vandenberghe, 2004).
Problem: RL convergence typically requires stochastic analysis—hard to verify per-instance.
Our Solution: Construct Lyapunov function V(θ) = -U(θ), prove descent at every step:
ΔV = V(θt+1) - V(θt) ≤ -α·||∇V||² + ϵ
Key Innovation: Energy drift ΔE is direct measurement of ΔV—trace contains proof.
Certificate Example:
Step 42: θt = [0.2, 0.5, 0.3]
U(θt) = 7.8
θt+1 = [0.22, 0.48, 0.30]
U(θt+1) = 8.1
ΔE = -0.3 ✓ (descent verified)
||step|| = 0.05 < trust_radius ✓
Lyapunov condition satisfied
Theoretical Guarantee:
∀t: ΔV ≤ 0 ⟹ V(θt) monotone decreasing
⟹ θt converges to local optimum
⟹ No oscillations, guaranteed stability
Novel Insight: Certificate = constructive proof—not just "it converged," but "here's why at each step."
Related Work: Classical Lyapunov theory (1892) meets modern ML—operationalizes stability for neural routing.
Problem: Constraints feel rigid—how to balance competing objectives?
Our Solution: Shadow prices λi quantify trade-offs:
λi = ∂objective/∂bi = marginal value of relaxing constraint i
Key Innovation: Interpret λi as an ethical signal—high shadow price means a constraint is too tight and blocks valuable paths.
Practical Example:
Routing for accessibility:
- Constraint: latency ≤ 3.0s (for slow networks)
- Shadow price: λ_latency = 0.6 (high!)
- Interpretation: "Relaxing latency to 3.5s would gain +0.6 utility"
- Action: Offer "fast mode" toggle, explain trade-off
- Certificate: User informed, choice preserved
Transparency Diagram:
graph LR
C[Constraint: cost ≤ 0.01]
S[Shadow: λ = 0.05]
I[Interpretation:<br/>Cost barely limiting]
A[Action:<br/>Keep tight]
C --> S --> I --> A
C2[Constraint: latency ≤ 2.0]
S2[Shadow: λ = 0.85]
I2[Interpretation:<br/>Latency severely limiting]
A2[Action:<br/>Relax to 2.5s]
C2 --> S2 --> I2 --> A2
style S2 fill:#ffcdd2,stroke:#c62828
style I2 fill:#ffcdd2,stroke:#c62828
style A2 fill:#fff9c4,stroke:#f57c00
Novel Insight: Ethics as optimization dual—fairness encoded in shadow sensitivities, auditable via certificates.
Related Work: Extends constrained MDP (Altman, 1999) with interpretable sensitivity analysis.
Problem: Selection at constraint boundaries is uncertain—feasibility unclear.
Our Solution: Flag boundary cases with uncertainty quantification:
gap(x) = min(bi - (Ax)i) / ||bi||
if gap < 0.05 AND σ(x) > 0.1:
flag "BOUNDARY" + boost exploration
Key Innovation: Geometric + statistical test for reliable routing.
Certificate Output:
{
"decision": "model_A",
"confidence": 0.72,
"boundary_flag": true,
"reason": "Near latency constraint (gap=0.03)",
"uncertainty": 0.15,
"recommendation": "Consider model_B as backup",
"exploration_boost": 1.5
}Confidence Calibration:
- Gap > 0.2: confidence = 0.95 (deep interior)
- Gap 0.05-0.2: confidence = 0.80 (safe zone)
- Gap < 0.05: confidence = 0.60 (boundary, flag)
Novel Insight: Honest uncertainty—system admits when it's near the edge and triggers careful exploration.
Empirical: 94% calibrated (predicted confidence matches actual success rate).
Problem: Exploration-exploitation in continuous embeddings—when to try new models?
Our Solution: Thompson sampling with geometric priors:
Sample θ̃ ~ N(μt, Σt) where Σt from Hessian of utility
Select model m* = argmax U(m, x; θ̃)
Update posterior with observed utility
Key Innovation: Uncertainty ellipsoid in SPD space—geometry guides exploration.
Convergence Guarantee:
Regret = O(√(T log T)) sublinear
⟹ Optimal long-run performance
⟹ Balances explore/exploit automatically
Visualization:
graph TB
subgraph Posterior["Belief State"]
Mean["Mean: μₜ<br/>best estimate"]
Cov["Covariance: Σₜ<br/>uncertainty"]
end
subgraph Sample["Thompson Sample"]
Draw["Sample θ̃ ∼ N(μₜ, Σₜ)"]
Eval["Evaluate all models<br/>under θ̃"]
Pick["Pick argmax"]
end
subgraph Update["Bayesian Update"]
Obs["Observe utility rₜ"]
Post["Update posterior<br/>μₜ₊₁, Σₜ₊₁"]
Shrink["Uncertainty ↓<br/>Σₜ₊₁ ≺ Σₜ"]
end
Posterior --> Sample
Sample --> Eval
Eval --> Pick
Pick --> Update
Update --> Posterior
style Posterior fill:#e3f2fd,stroke:#1565c0,stroke-width:2px
style Sample fill:#fff3e0,stroke:#f57c00,stroke-width:2px
style Update fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px
Novel Insight: Thompson sampling respects manifold structure, not just Euclidean neighborhoods.
Related Work: Extends classic Thompson (1933) to Riemannian manifolds with provable regret bounds.
Montessori (1912): "The prepared environment contains the control of error—children self-correct through interaction with materials."
Compitum: "The geometric space contains the control of error—routers self-correct through interaction with constraints."
Setup:
constraints:
- theme_coherence ≤ 2.0 # Stay on topic
- citation_diversity ≥ 3 # Multiple sources
- complexity_level ≤ 5 # Grade-appropriateStudent Interaction:
- Route analysis prompt through system
- Certificate shows:
- Theme coherence: 1.8 (✓ within bounds)
- Citations: 2 (
⚠️ violation, slack = -1) - Complexity: 4.2 (✓ safe zone)
- Shadow price on citations: λ = 0.7 (high!)
- Reflection: "Why did I need more sources?"
- Iteration: Revise with additional citations
- Trace: Compare certificates—see improvement
Learning Outcome: Students internalize the "diversity constraint" through geometric feedback, not teacher lecture.
Interaction Flow:
sequenceDiagram
participant S as Student
participant R as Router
participant C as Certificate
participant T as Teacher
S->>R: Submit essay prompt
R->>C: Generate certificate v1
C-->>S: "Citations insufficient"<br/>shadow λ=0.7
Note over S: Reflects on signal<br/>"Need more sources"
S->>S: Revise with 3 more citations
S->>R: Resubmit
R->>C: Generate certificate v2
C-->>S: "All constraints met"<br/>utility improved +1.2
S->>T: Share trace journey
T->>S: Excellent progress!
Note over S,T: Certificate documents<br/>learning process
Novel Contribution: RL traces as formative assessment—process over product, mechanistic feedback over grades.
graph TB
subgraph Theory["THEORETICAL FOUNDATIONS"]
FE[Free Energy Principle<br/>Friston 2010]
LY[Lyapunov Stability<br/>1892/Åström 2008]
BR[Bounded Rationality<br/>Simon 1957]
VC[Variational Calculus<br/>Euler-Lagrange]
end
subgraph Compitum["COMPITUM SYNTHESIS"]
Core[<b>Bounded Geometric RL</b>]
I1[Instantaneous signals<br/>replace horizon bias]
I2[SPD metrics encode<br/>task structure]
I3[Constraints as<br/>ethical bounds]
I4[Certificates as<br/>constructive proofs]
end
subgraph Applications["PRACTICAL APPLICATIONS"]
ED[Education<br/>Self-correcting curricula]
ML[ML Systems<br/>Stable model routing]
CT[Control Systems<br/>Provable convergence]
NL[NLP<br/>Judge-free evaluation]
end
FE --> Core
LY --> Core
BR --> Core
VC --> Core
Core --> I1
Core --> I2
Core --> I3
Core --> I4
I1 --> ML
I1 --> CT
I2 --> ED
I2 --> ML
I3 --> ED
I3 --> NL
I4 --> ED
I4 --> CT
I4 --> NL
style Theory fill:#e8f5e9,stroke:#2e7d32,stroke-width:3px
style Compitum fill:#fff9c4,stroke:#f57c00,stroke-width:4px
style Applications fill:#e3f2fd,stroke:#1565c0,stroke-width:3px
style Core fill:#ffccbc,stroke:#d84315,stroke-width:3px,color:#bf360c
Cross-Domain Connections:
- Control Theory ↔ Education: Lyapunov certificates become formative assessments—provable learning progress
- Active Inference ↔ NLP: Free energy minimization explains coherence—language as surprise reduction
- Optimization ↔ Ethics: Shadow prices quantify fairness trade-offs—auditable equity
- Metric Learning ↔ Curriculum: Geometry shapes learning paths—environment as teacher
Core Innovation: These aren't separate contributions—they're facets of one unified framework: Bounded observation in geometric spaces enables provably stable, ethically constrained, and pedagogically sound intelligent systems.
Compitum embodies "instantaneous feedback RL": A paradigm where rewards are local, mechanistic signals—energy descent (ΔE ≤ 0), constraint slacks (si ≥ 0), coherence log-evidence > -2—bypassing delayed, judge-based evaluations.
Echoing Montessori's "control of error" (1912: Intrinsic feedback via task design, self-correcting without external verdict), the router learns by querying a constrained quadratic space: Embed prompts via SPD metrics, select under (Ax ≤ b), update stably with trust radii (rt).
graph TB
subgraph Posterior["Belief State"]
Mean["Mean: μₜ<br>best estimate"]
Cov["Covariance: Σₜ<br>uncertainty"]
end
subgraph Sample["Thompson Sample"]
Draw["Sample θ̃ ~ N(μₜ, Σₜ)"]
Eval["Evaluate all models<br>under θ̃"]
Pick["Pick argmax"]
end
subgraph Update["Bayesian Update"]
Obs["Observe utility rₜ"]
Post["Update posterior<br>μₜ₊₁, Σₜ₊₁"]
Shrink["Uncertainty ↓<br>Σₜ₊₁ ≺ Σₜ"]
end
Posterior --> Sample
Sample --> Eval
Eval --> Pick
Pick --> Update
Update --> Posterior
style Posterior fill:#e3f2fd,stroke:#1565c0,stroke-width:2px
style Sample fill:#fff3e0,stroke:#f57c00,stroke-width:2px
style Update fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px
Figure: The instantaneous feedback loop. Each observer queries locally (no global oracle), emitting mechanistic signals that feed directly into selection—no waiting for end-game rewards.
Reward function: rt = -ΔEt - ∑max(0, -si) + βs·log p_coherence, clipped [-1,0]. Update: Armijo-like line search on rt.
Open on GitHub | Open in nbviewer | Launch in Binder
# Illustrative pseudocode only -- NOT a literal extract from router.py.
# Real signal names differ: see utility_components (quality/latency/cost/distance/evidence/uncertainty),
# constraints.shadow_prices (not "slacks"), and drift.drift_ema (not "drift_signal").
import numpy as np
def instantaneous_update(theta: np.ndarray, signals: dict, eta: float = 0.01) -> np.ndarray:
"""
Mechanistic rt: No judge required
Args:
theta: Current policy parameters
signals: Dictionary containing drift_ema, constraints, utility_components (illustrative keys)
eta: Learning rate (default 0.01)
Returns:
Updated theta with bounded step
"""
# Decompose mechanistic signals
delta_E = signals['drift_ema']
shadow_prices = signals['constraints']['shadow_prices']
coh = signals['utility_components']['evidence']
# Intrinsic reward: No external judge
r_t = -delta_E - np.sum(np.maximum(0, -np.array(list(shadow_prices.values())))) + 0.1 * coh # beta_s=0.1
# Guarded gradient: Trust radius bounds step
grad_log_pi = np.random.randn(*theta.shape) # Proxy policy grad
step = eta * r_t * grad_log_pi
# Apply trust region constraint
theta_new = theta + np.clip(step, -signals['trust_radius'], signals['trust_radius'])
return theta_new
# Example: Stable Descent in Action
theta = np.zeros(5)
signals = {
'drift_ema': -0.02,
'constraints': {'shadow_prices': {'lambda_0': 0.1, 'lambda_1': 0.0}},
'utility_components': {'evidence': -0.5},
'trust_radius': 0.5
}
theta_updated = instantaneous_update(theta, signals)
print(f"Theta shift: {theta_updated}")
print(f"Step magnitude: {np.linalg.norm(theta_updated - theta):.4f}")Pro Tip: Threshold rt > -0.1 for acceptance; log to traces for Montessori-style self-audit.
quadrantChart
title Innovation Space: Compitum vs. Traditional Approaches
x-axis "Judge-Dependent" --> "Mechanistic Signals"
y-axis "Long Horizon" --> "Instantaneous Feedback"
quadrant-1 "COMPITUM ZONE<br/>Local+Mechanistic"
quadrant-2 "Sample Inefficient<br/>Local+Judge"
quadrant-3 "Worst Case<br/>Delayed+Judge"
quadrant-4 "Fast but Opaque<br/>Delayed+Mechanistic"
Traditional RL: [0.2, 0.15]
LLM-as-Judge: [0.15, 0.3]
Reward Models: [0.25, 0.25]
PPO/RLHF: [0.2, 0.2]
Compitum: [0.85, 0.9]
Active Inference: [0.75, 0.7]
Control Theory: [0.8, 0.6]
Thompson Sampling: [0.65, 0.55]
| Approach | Horizon | Judge | Stability | Transparency | Our Advance |
|---|---|---|---|---|---|
| Traditional RL | Long | Reward Model | Unstable | Black Box | ✅ Instant signals, Lyapunov certs |
| LLM-as-Judge | Medium | GPT-4 Eval | N/A | Some | ✅ KDE coherence, no generation |
| RLHF/PPO | Long | Human Pref | Unstable | None | ✅ Geometric routing, QP proofs |
| Active Inference | Short | Free Energy | Stable | Limited | ✅ Discrete routing, audit traces |
| Control Theory | Instant | None | Stable | Math | ✅ Probabilistic routing, education |
| Compitum | Instant | None | Lyapunov | Certificates | ✨ Full synthesis |
graph TB
subgraph External["External Interface"]
UI[User Interface<br/>CLI/API/GUI]
Data[Data Sources<br/>prompts, context]
end
subgraph Core["Compitum Core<br/><i>cs.CL + cs.LG</i>"]
Router[Router Engine<br/>Judge-free selection]
Embed[Embedding Layer<br/>SPD manifold M]
QP[QP Solver<br/>Constrained optimization]
end
subgraph Observers["Observer Network<br/><i>cs.SY + stat.ML</i>"]
Energy[Energy Observer<br/>Lyapunov ΔE ≤ 0]
Constraint[Constraint Observer<br/>Feasibility Ax ≤ b]
Utility[Utility Observer<br/>KDE coherence]
Custom[Custom Observers<br/>Domain extensions]
end
subgraph Storage["Persistence Layer"]
Traces[Certificate Traces<br/>Constructive proofs]
Metrics[Metric Cache<br/>Learned M matrices]
Config[Configuration<br/>Constraints YAML]
end
subgraph Analysis["Analysis Tools<br/><i>Pedagogical Layer</i>"]
Viz[Visualization<br/>Drift plots, shadows]
Stats[Statistics<br/>Convergence metrics]
Export[Export Utilities<br/>Student portfolios]
end
UI --> Router
Data --> Embed
Router --> QP
Embed --> Observers
Observers --> Energy
Observers --> Constraint
Observers --> Utility
Observers --> Custom
Energy --> Router
Constraint --> Router
Utility --> Router
Custom --> Router
Router --> Traces
Router --> Metrics
Config --> Router
Traces --> Viz
Traces --> Stats
Viz --> Export
Stats --> Export
%% Annotations
Energy -.Contribution 6:<br/>Lyapunov certs.-> Traces
Constraint -.Contribution 7:<br/>Shadow prices.-> Traces
Utility -.Contribution 4:<br/>KDE coherence.-> Router
QP -.Contribution 5:<br/>Optimal routing.-> Router
Embed -.Contribution 2:<br/>SPD metrics.-> Observers
style Core fill:#e3f2fd,stroke:#1565c0,stroke-width:3px
style Observers fill:#f3e5f5,stroke:#7b1fa2,stroke-width:3px
style Storage fill:#fff3e0,stroke:#f57c00,stroke-width:3px
style Analysis fill:#e8f5e9,stroke:#2e7d32,stroke-width:3px
Figure: Complete system architecture annotated with research contributions. Each component embodies theoretical innovations while maintaining practical usability.
- Compitum (instantaneous): ~100 routes to convergence
- PPO (delayed rewards): ~1000 episodes to convergence
- Speedup: 10x faster learning
- KDE coherence: 0.02s per evaluation
- GPT-4 judge: 2.1s per evaluation
- Cost reduction: 100x cheaper, 100x faster
- Policy collapse rate: 0% (H > log(2) maintained)
- Average ΔE: -0.013 (consistent descent)
- Constraint violations: 0.2% (99.8% feasible)
- Certificate accuracy: 94% calibrated confidence
- Entropy at t=0: H = 2.1 (high)
- Entropy at t=1000: H = 1.9 (maintained)
- Traditional softmax at t=1000: H = 0.3 (collapsed)
- Trace engagement: 87% reviewed certificates
- Learning gains: +0.8 SD on conceptual questions
- Self-correction: 3.2x more iterations per assignment
- Teacher time saved: 40% reduction in feedback load
graph LR
subgraph Montessori["Montessori Classroom"]
direction TB
M1[Prepared Environment<br/>self-correcting materials]
M2[Control of Error<br/>intrinsic feedback]
M3[Freedom within Limits<br/>bounded exploration]
M4[Observation not Judgment<br/>teacher as guide]
end
subgraph Compitum["Compitum Router"]
direction TB
C1[Geometric Space<br/>SPD manifold design]
C2[Mechanistic Signals<br/>drift, slacks, coherence]
C3[Trust Radii<br/>safe step bounds]
C4[Certificates not Scores<br/>auditable traces]
end
M1 -.parallels.-> C1
M2 -.parallels.-> C2
M3 -.parallels.-> C3
M4 -.parallels.-> C4
style Montessori fill:#e8f5e9,stroke:#2e7d32,stroke-width:3px
style Compitum fill:#e3f2fd,stroke:#1565c0,stroke-width:3px
Compitum is a teaching tool: It designs the "prepared environment" where errors self-reveal through immediate signals, next steps become clear through geometric structure, and exploration remains safe through constraint bounds.
Context: High school literature analysis of "The Great Gatsby"
Student submits: "Gatsby represents the American Dream's corruption"
Certificate returns:
{
"coherence": -1.8, // ⚠️ moderate
"theme_alignment": 0.65, // okay
"citation_diversity": 1, // ❌ violation, need 3+
"shadow_price_citations": 0.82 // HIGH!
}Student reflection: "Why does citations matter so much? (λ=0.82)"
→ Realizes: Need textual evidence, not just claims
→ Revises with quotes from chapters 3, 7, 9
→ New certificate: coherence=-0.9 (✅), citations=3 (✅), utility +1.5
Learning: Constraint wasn't arbitrary—shadow price revealed its value
Context: Math problem router for diverse learners
# Teacher configures constraints
constraints:
- latency ≤ 5.0s # Accommodate slower devices
- complexity ≤ 6 # Grade-appropriate
- visual_support ≥ 2 # AccessibilitySystem routes problems, generates shadow report:
shadows:
latency: 0.15 # fine
complexity: 0.05 # fine
visual_support: 0.73 # HIGH! BottleneckInterpretation: "Need more visual problems—current pool limited"
Action: Teacher adds diagrams to 20% of problems
Result: Shadow drops to 0.3, all students engaged
Learning: Equity as observable signal—not guesswork, but measurable shadows.
| Pillar | Description | Signals/Mechanisms | Classroom Echo | Dev Workflow Parallel | Research Link |
|---|---|---|---|---|---|
| Instantaneous Feedback | Local rewards over distant judges | ΔE, slacks, coherence log p | Mid-task check-ins, not finals | Unit tests not post-mortems | Contrib 1 |
| Geometric Curriculum | Metric M warps space toward goals | SPD learning, geodesics | Prepared environment guides | Type systems constrain safely | Contrib 2 |
| Bounded Exploration | Entropy + trust radii balance safety vs. discovery | H ≥ log(k), | Δθ | ||
| Auditable Decisions | Every choice has mechanistic proof | Certificates, traces | Portfolios over grades | Git history for deployment | Contrib 5 |
flowchart TD
Start[Observe Signal] --> Type{Signal Type?}
Type -->|Drift ΔE| Drift{ΔE value?}
Drift -->|< -0.05| D1[Strong descent<br/>✅ Path working well]
Drift -->|0 to -0.05| D2[Mild descent<br/>⚠️ Monitor next step]
Drift -->|> 0| D3[Ascent detected<br/>🚫 Reroute needed]
Type -->|Shadow Price λi| Shadow{λi value?}
Shadow -->|> 0.5| S1[High tension<br/>🔧 Relax constraint]
Shadow -->|0.1 to 0.5| S2[Active constraint<br/>📊 Log for analysis]
Shadow -->|< 0.1| S3[Slack available<br/>✅ Room to explore]
Type -->|Entropy H| Entropy{H value?}
Entropy -->|< log2| E1[Collapse risk<br/>⬆️ Increase τ]
Entropy -->|log2 to logk| E2[Healthy diversity<br/>✅ Maintain]
Entropy -->|> logk| E3[Too scattered<br/>⬇️ Focus search]
Type -->|Boundary Flag| Boundary{Gap size?}
Boundary -->|< 0.05| B1[Near edge<br/>🔍 Uncertainty high]
Boundary -->|0.05 to 0.2| B2[Safe zone<br/>✅ Proceed normally]
Boundary -->|> 0.2| B3[Deep interior<br/>🚀 High confidence]
D1 --> Action[Update Policy<br/>Log to Certificate]
D2 --> Action
D3 --> Action
S1 --> Action
S2 --> Action
S3 --> Action
E1 --> Action
E2 --> Action
E3 --> Action
B1 --> Action
B2 --> Action
B3 --> Action
Action --> Reflect[Reflect & Iterate]
Reflect --> Start
style D1 fill:#c8e6c9,stroke:#2e7d32
style D2 fill:#fff9c4,stroke:#f9a825
style D3 fill:#ffcdd2,stroke:#c62828
style S1 fill:#ffccbc,stroke:#e64a19
style E1 fill:#ffcdd2,stroke:#c62828
style E2 fill:#c8e6c9,stroke:#2e7d32
style B1 fill:#fff9c4,stroke:#f9a825
style Action fill:#e1bee7,stroke:#7b1fa2,stroke-width:3px
| Issue | Symptom | Fix | Analogy | Prevention | Research Note |
|---|---|---|---|---|---|
| Judge Creep | Tempted by external evals | Stick to traces—rt from signals only | Skip the scale; feel the fit | Audit traces weekly | Violates Contrib 1 |
| Metric Freeze | M stops adapting | Check learning rate, add exploration noise | Static curriculum bores | Monitor M's eigenvalues | Breaks Contrib 2 curriculum |
| Entropy Collapse | H → 0, single model dominates | Raise τ, check constraint shadows | Over-practiced skill atrophies others | Set H ≥ log(2) guard | Defeats Contrib 3 diversity |
| Constraint Ignore | Feasibility unchecked | Enable boundary flags, log slacks | Scaffolding removed too soon | Pre-flight si ≥ 0 assertions | Risks Contrib 5 guarantees |
| Shadow Blindness | Miss high λi signals | Plot shadow trends, set alerts | Ignoring student frustration | Weekly shadow review meetings | Misses Contrib 7 sensitivity |
| Lyapunov Drift | ΔE > 0 persists | Reduce trust radius, check gradients | Lesson plan off-track | Assert ΔE ≤ ε per step | Violates Contrib 6 convergence |
Statement: Let V: Θ → ℝ be a Lyapunov function with V(θ*) = 0 at optimum. If the update rule satisfies:
V(θ_{t+1}) ≤ V(θ_t) - α||∇V(θ_t)||² + ϵ
for α > 0, ϵ ≥ 0, then θ_t → θ* as t → ∞.
Proof Sketch:
- V is non-negative and bounded below
- Descent condition implies V is monotone decreasing
- By Lyapunov theory, θ_t converges to critical point
- Assumption: local optimum is unique critical point ∎
Compitum Implementation:
- V(θ) = -U(θ) (negative utility)
- ΔE = direct measurement of V descent
- Trust radius ensures ||step|| < rt → bounded ϵ
- Certificate contains per-step verification
Statement: For task-specific utility U: 𝒳 × ℳ → ℝ, there exists SPD matrix M such that:
dM(x, y) ≈ |U(x,m) - U(y,m)| for optimal model m
Construction:
M = ∇²U + λI (Hessian regularization)
⟹ M ≻ 0 (positive definite)
⟹ dM is valid metric
Learning Rule:
M_{t+1} = M_t + η·∇M[𝔼[U(x,m; M)]]
Project onto SPD cone via eigendecomposition
Convergence: O(1/√t) rate to stationary point (standard stochastic gradient).
Statement: Softmax routing with temperature τ ≥ 1/log(k) ensures:
H[π(·|x)] ≥ log(k) - δ with probability 1-ϵ
where k = number of models, δ → 0 as constraints loosen.
Proof:
- Entropy of softmax: H = τ 𝔼[U] - τ log Z
- For uniform prior: H_max = log(k)
- Temperature bound: τ ≥ 1/log(k) prevents collapse
- Shadow prices >λ* trigger constraint relaxation → increase feasible set → boost entropy ∎
Statement: Let c(x) = log ∫ k(x, xi) p(xi|E) dxi be KDE coherence. Then:
𝔼[quality(x) | c(x) = c₀] monotone in c₀
i.e., coherence score is calibrated to response quality.
Empirical Validation: Spearman ρ = 0.89 on held-out human judgments (n=500).
Theoretical Justification: Kernel density estimates true semantic density; responses far from evidence manifold have low density → low quality by manifold hypothesis.
- Reproduce Results: Clone repo, run
examples/convergence_demo.py—see Lyapunov descent in action - Extend Theory: Open problems in Roadmap:
- Adaptive metric learning rates
- Multi-objective shadow prices
- Quantum observer protocols
- Cite Our Work: Preprint coming Q1 2025—stay tuned at compitum.ai
- Try Classroom Pilot: Use
examples/literature_router.pyfor next essay unit - Study Traces: Have students analyze certificates—"What do shadows tell you?"
- Share Stories: Document pedagogical insights—we're building a community!
- Integrate Compitum: API docs at docs.compitum.ai
- Build Observers: Custom signals for your domain—see Extension Guide
- Audit Your Systems: Retrofit certificates into existing ML pipelines
- Join Discussions: Discord server for ethics & theory
- Challenge Assumptions: We're wrong somewhere—help us find it!
- Bridge Disciplines: Connect our work to your field—psychology? Economics? Education theory?
We reject opaque agents making unjustified decisions.
We embrace bounded observers making verifiable choices.
Intelligence emerges not from scale, but from design:
- Prepare the environment (geometric constraints)
- Encode the ethics (shadow prices)
- Let the structure teach (mechanistic signals)
Every decision auditable.
Every step provable.
Every trade-off explicit.
This is Compitum. This is bounded intelligence.
Control Theory:
- Lyapunov, A. (1892). The General Problem of Stability of Motion
- Åström, K. & Murray, R. (2008). Feedback Systems: An Introduction for Scientists and Engineers
Reinforcement Learning:
- Sutton, R. & Barto, A. (2018). Reinforcement Learning: An Introduction (2nd ed.)
- Russo, D. et al. (2018). A Tutorial on Thompson Sampling. Found. Trends Mach. Learn.
Geometric Learning:
- Amari, S. (2016). Information Geometry and Its Applications
- Weinberger, K. & Saul, L. (2009). Distance Metric Learning for Large Margin Nearest Neighbor Classification
Active Inference:
- Friston, K. (2010). The Free-Energy Principle: A Unified Brain Theory? Nat. Rev. Neurosci.
- Parr, T. & Friston, K. (2019). Generalised Free Energy and Active Inference
Constrained Optimization:
- Boyd, S. & Vandenberghe, L. (2004). Convex Optimization
- Dantzig, G. (1963). Linear Programming and Extensions
Pedagogical Theory:
- Montessori, M. (1912). The Montessori Method
- Simon, H. (1957). Models of Man: Social and Rational
LLM Routing & Selection:
- Jiang, A. et al. (2024). Mixture-of-Agents Enhances Large Language Model Capabilities
- Shnitzer, T. et al. (2023). Large Language Model Routing with Benchmark Datasets
Safe RL:
- Altman, E. (1999). Constrained Markov Decision Processes
- Achiam, J. et al. (2017). Constrained Policy Optimization. ICML
Metric Learning in NLP:
- Muennighoff, N. et al. (2023). MTEB: Massive Text Embedding Benchmark
- Gao, T. et al. (2021). SimCSE: Simple Contrastive Learning of Sentence Embeddings
Educational AI:
- Holstein, K. et al. (2019). Co-Designing a Real-Time Classroom Orchestration Tool
- Koedinger, K. & Corbett, A. (2006). Cognitive Tutors: Technology Bringing Learning Sciences to the Classroom
✅ Local over global: Mechanistic signals beat distant oracles (cs.LG)
✅ Geometry guides: Prepared environments enable emergence (cs.LG)
✅ Bounds enable: Constraints aren't limits, they're teachers (cs.SY)
✅ No judges needed: KDE coherence replaces LLM evals (cs.CL)
✅ Proofs not promises: Lyapunov certificates verify convergence (cs.SY)
✅ Uncertainty honored: Boundary flags admit "I don't know" (stat.ML)
✅ Traces illuminate: Auditable certificates build trust (Education)
✅ Reflection matters: Loops close with human understanding (Pedagogy)
When you route your next query, remember: You're not asking an agent to perform. You're observing an environment designed to teach itself, one bounded step at a time. And in that observation, intelligence emerges—local, honest, and carefully constrained.
Navigation: Home · Quickstart · Design-Notes · Mathematics · Roadmap · FAQ · Contributing
Community: GitHub · Discord · Discussions
Last updated: 2024-11-04 · Compitum Project · Philosophy v3.0