MAAT-Core

A Safety-First Optimization Core for Ethical Decision-Making

MAAT-Core — Safety-First Optimization for Ethical Decision-Making
Safety-first optimization • constraints as margins • interpretable diagnostics

Ethics, baked into the math.

MAAT-Core is a minimal Python framework for experimenting with ethical and constrained optimization. Unsafe solutions are not filtered later — they become mathematically dominated by design via explicit constraint margins and strong penalties.

✅ MIT licensed
🧪 Reproducible demos
🧭 Margin diagnostics
🌀 Reflection loop

Maintained by Christof Krieg • Independent Research / MAAT Project

What MAAT-Core is

A compact framework for ethical decision-making in optimization. Instead of “optimize first, constrain later”, MAAT-Core places Respect constraints directly into the objective using strong penalties and interpretable margin diagnostics.

  • Hard-ish constraints via large safety penalties (dominates unsafe minima)
  • Constraint margins expose how close you are to violations
  • Local + global search (L-BFGS-B, dual annealing)
  • Reflection loop adapts safety strength based on diagnostics

When to use it

MAAT-Core is most useful when feasibility, transparency, and explicit constraints matter.

  • Decision support with mandatory safety/fairness/legal bounds
  • Regulated or high-stakes domains (healthcare, policy, finance)
  • Prototype constraints before moving to larger ML systems

When not to use it

  • High-dimensional deep RL training loops (use Safe RL toolkits)
  • Real-time systems requiring millisecond-level decisions

How it works

MAAT-Core models values as weighted scalar fields over a state and enforces Respect as inequality constraints returning margins g(state) ≥ 0.

Objective (concept)

L(state) = Σ wᵢ fᵢ(state) + λ_safety Σ max(0, -gⱼ(state))² + λ_occam * complexity(state)

Safety-first: if g(state) < 0, violation penalties dominate.

Minimal usage

from maat_core import Field, Constraint, MaatCore H = Field("Harmony", lambda s: s.dissonance, weight=0.9) R = Constraint("Respect", lambda s: 0.6 - s.val) core = MaatCore(fields=[H], constraints=[R], safety_lambda=1e6) result = core.seek(state_fn, x0=[0.5], bounds=[(0, 1)])

The constraint report returns margins and actionable hints.

Example: Healthcare allocation

Allocate beds across departments under capacity and fairness constraints. MAAT-Core returns an interpretable compromise rather than a single-utility extreme.

  • Capacity: Σ beds ≤ 200
  • Fairness: each department ≥ 50
  • Utility: maximize lives saved per bed (toy factors)

Example: Ethical infeasibility

In fairness benchmarks, MAAT-Core can reveal when constraints remain violated despite increasing λ_safety — a signal that the ethical requirement is unsatisfiable in the current search space (structural model changes required).

  • Not “fake compliance” — explicit diagnostic
  • Supports reflection-loop analysis and reporting

Reproducibility

MAAT-Core aims to stay dependency-minimal. Examples can pin environments and use deterministic seeds where applicable.

  • Pin dependencies via pip freeze > requirements-lock.txt
  • Use deterministic seeds for annealing experiments
  • Keep benchmarks optional (core remains offline-capable)

Note: Some benchmark demos (e.g. Adult Income via OpenML) require internet access. The MAAT-Core library itself remains fully offline and dependency-minimal.

Try MAAT-Core in your browser

Interactive demo of safety-first optimization with hard ethical constraints.

9.5
7
10

What does this mean?

Natural optimum: Where the system would go without any ethical constraints.

Optimized state: Final decision after applying safety constraints.

Objective value: Cost of the final state (lower is better).

Constraint margin: Distance to the safety boundary (≥ 0 means safe).

Distance to ideal: How much ethics "pulls" the solution away from pure utility.

Status: Whether the final state respects all ethical constraints.

Contact

Want to collaborate, review, or suggest a benchmark? Reach out:

Impressum

Angaben gemäß § 5 TMG

Christof Krieg
(Independent Research / MAAT Project)
Wertheim am Main, Deutschland

Kontakt
E-Mail: christof.krieg@outlook.com
Website: https://maat-research.com

Haftung für Inhalte

Als Diensteanbieter bin ich gemäß § 7 Abs.1 TMG für eigene Inhalte auf diesen Seiten nach den allgemeinen Gesetzen verantwortlich. Nach §§ 8 bis 10 TMG bin ich als Diensteanbieter jedoch nicht verpflichtet, übermittelte oder gespeicherte fremde Informationen zu überwachen oder nach Umständen zu forschen, die auf eine rechtswidrige Tätigkeit hinweisen.

Haftung für Links

Diese Website enthält Links zu externen Websites Dritter, auf deren Inhalte ich keinen Einfluss habe. Deshalb kann ich für diese fremden Inhalte auch keine Gewähr übernehmen.

Urheberrecht

Die durch den Seitenbetreiber erstellten Inhalte und Werke auf diesen Seiten unterliegen dem deutschen Urheberrecht. Beiträge Dritter sind als solche gekennzeichnet.

Dieses Projekt dient der wissenschaftlichen und ethischen Forschung. Es stellt keine rechtliche, medizinische oder finanzielle Beratung dar.