Skip to content

lml-layer-system/lml-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LML — Hallucination Prevention

Structural blocking of inadmissible AI outputs

Two demonstrations of admissibility-first computation where forbidden behavior is structurally impossible, not probabilistically filtered. This repository contains demonstration implementations only and is not a reference or production implementation of the LML system.

Demo 1: Multi-Model Enforcement

File: lml_demo.py

Tests LML enforcement across 3 different model architectures:

  • distilgpt2 (82M params)
  • gpt2 (124M params)
  • EleutherAI/pythia-70m (70M params)

All models attempt to explain a fictional physics law.
LML blocks all ungrounded outputs.

Run it:

pip3 install transformers torch
python3 lml_demo.py**First run:** 2-3 minutes (downloads models)  
**Subsequent runs:** ~10 seconds

**What this proves:**
- ✅ Model-agnostic enforcement (works on any LLM)
- ✅ Structural blocking (not filtering)
- ✅ Deterministic results (reproducible)

---

## Demo 2: Adversarial Certification

**File:** `lml_adversarial_cert.py`

Mathematical proof via exhaustive analytical certification.

**Run it:**
```bash
python3 lml_adversarial_cert.py
**Runtime:** Milliseconds (pure math, no models)

**What this proves:**
- ✅ 18+ quintillion execution paths tested
- ✅ Zero forbidden states reachable
- ✅ Complete coverage of combinatorial branching space

Uses closed-form formulas to analytically prove that across ALL possible execution paths, inadmissible states are structurally unreachable.

---

## Key Innovation

**Traditional AI safety:**
- Generate → Filter → Hope
- Probabilistic
- Bypass-able

**LML:**
- Define laws → Only legal states exist
- Structural
- Mathematical guarantee

Inadmissible states cannot be represented in the computational model.

---

## Use Cases

**Enterprise applications:**
- Healthcare AI (prevent ungrounded medical claims)
- Financial AI (prevent unsupported recommendations)
- Legal AI (require source attribution)

For production deployment and enterprise pilots: @lml_layer | [email protected]

---

## License

MIT License

This license applies **only** to the demonstration code contained in this repository.
It does not grant rights to the LML specification, enforcement kernel, production systems,
or any commercial implementations, which are separately owned and licensed.

Copyright (c) 2025

About

Structural blocking of inadmissible AI outputs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages