PACIF v3.0
Predictive Alignment & Causal Information Flow
Measures statistical coupling between user behavior and system context, and assesses the reliability of that estimate.
Why PACIF exists
Modern recommendation systems are closed-loop controllers: user actions train the model, and the model shapes future exposure. These feedback loops can produce behavioral lock-in, filter bubbles, and algorithmic influence that is hard to observe from the outside.
Platforms, regulators, auditors, and researchers currently lack a transparent, statistically rigorous, and audit-ready metric that answers a simple question:
How tightly is user behavior coupled to the system’s recommendations — and can we trust that measurement?
Existing approaches suffer from finite-sample bias, provide no reliability diagnostics, and are frequently misinterpreted as causal claims. PACIF was built to close that gap.
What PACIF measures
PACIF quantifies predictive alignment between user actions (U) and system context / recommendations (S), with optional control for observed confounders (C).
It is deliberately not a measure of causality, user wellbeing, or “manipulation”. It is a production-ready diagnostic layer that tells you:
| Signal | What it tells you |
|---|---|
| Signal Strength (MI) | Intensity of statistical coupling (nats) |
| Reliability | Whether the estimate is statistically stable |
| Drift | Whether the relationship has shifted over time |
| Audit Report | Machine-readable YAML with anti-gaming flags |
Core capabilities
- Bias-corrected Mutual Information — Miller–Madow correction removes first-order finite-sample bias.
- Strict reliability diagnostics — automatically flags unstable estimates via confidence-interval width thresholds.
- Cumulative drift detection — CUSUM + Page-Hinkley for non-stationary shifts in the alignment signal.
- Regulator-ready audit reports — YAML output with exclusion-rate, category-inflation, skew, and drift flags (schema 1.2).
- Causal integration pattern — synthetic PACIF-like features reduce Doubly Robust (DR) estimator bias in an illustrative simulation; see
causal_integration.py(features are predictive by construction — not evidence on real data).
Performance (reference): >1,900 sessions/sec, p95 latency <1 ms (examples/benchmark_throughput.py).
Explicit boundaries (important)
PACIF measures statistical predictability, not causality and not wellbeing.
- High mutual information indicates strong association / coupling, not that the algorithm caused the behavior.
- Normative or causal claims require intervention data, experimental design, or stronger identification assumptions.
- The framework is designed to be honest about uncertainty: unreliable estimates are explicitly marked.
Full practitioner guide: docs/INTERPRETATION.md
Outreach one-pager: docs/POSITIONING.md
Quick start
Live demo (no install)
Install
pip install pacif-framework
From source (development):
git clone https://github.com/ppiiyo/pacif-framework.git
cd pacif-framework
pip install -e ".[demo,dev]"
pytest tests/ -v
Minimal usage
from pacif_core import estimate_alignment, DriftDetector, AuditReporter
import numpy as np
events = np.array([0, 1, 0, 2, 1, 0, 2, 1] * 20)
contexts = np.array([0, 1, 0, 1, 1, 0, 2, 1] * 20)
result = estimate_alignment(events, contexts)
if result["status"] == "success":
print(f"MI: {result['mi_estimate']:.3f} nats")
print(f"95% CI: {result['ci_95']}")
print(f"Reliable: {result['reliable']}")
See examples/basic_usage.py for multi-session + drift + audit.
Interpreting results
| Metric | Interpretation | Suggested action |
|---|---|---|
| Signal Strength (MI) | Intensity of coupling | > 0.8 nats → investigate lock-in risk |
| Reliability Ratio | % of sessions with statistically valid estimates | < 70% → increase sample size or window |
| Drift Status | Significant change in the relationship over time | Drift detected → consider model recalibration |
Deep dive: docs/INTERPRETATION.md
Who this is for
- Responsible AI / Trust & Safety teams — internal monitoring of recommendation influence and feedback loops.
- Platforms (social, e-commerce, content, news) — diagnostics for personalization strength and stability.
- Regulators & compliance — audit-ready, machine-readable reports with explicit reliability and anti-gaming signals.
- Researchers in algorithmic accountability, fairness, and causal inference — reproducible metric + integration path with DR estimators.
- Auditors & third-party assessors — independent quantification of human–algorithm coupling.
Project structure
pacif-framework/
├── pacif_core/
│ ├── estimator.py # Bias-corrected MI + reliability
│ ├── drift.py # CUSUM + Page-Hinkley detectors
│ └── audit.py # YAML audit reporter (schema 1.2)
├── tests/ # pytest suite
├── docs/
│ ├── INTERPRETATION.md
│ └── POSITIONING.md
├── examples/
│ ├── basic_usage.py
│ └── benchmark_throughput.py
├── app.py # Streamlit demo
├── causal_integration.py # DR estimator illustration (synthetic)
└── .github/workflows/ci.yml
Enterprise & audit integration
For production deployments, multi-tenant audit pipelines, custom connectors, or compliance reporting support, contact:
Contributing
We welcome contributions. Algorithmic transparency should be a public good.
- 🐛 Open an issue
- 💡 Pull requests are welcome (see CONTRIBUTING.md)
- 📜 Please follow the Code of Conduct
- 🔒 Security policy
Citation
If you use PACIF in research, audits, or product workflows, please cite:
@software{pacif_v3_2026,
author = {ppiiyo},
title = {PACIF v3.0: Predictive Alignment \& Causal Information Flow},
year = {2026},
url = {https://github.com/ppiiyo/pacif-framework},
doi = {10.5281/zenodo.19902776},
license = {Apache-2.0}
}
Also available as CITATION.cff.
Built for transparency, reproducibility, and algorithmic accountability.
© 2026 PACIF Framework Contributors
Metadata
Release files for pacif-framework 3.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pacif_framework-3.1.0.tar.gz | 21.4 kB | With provenance | Details for pacif_framework-3.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pacif_framework-3.1.0-py3-none-any.whl | Python 3 | none | any | Details for pacif_framework-3.1.0-py3-none-any.whl |
Total release size: 36.8 kB
Release files / pacif_framework-3.1.0.tar.gz
| Download URL | pacif_framework-3.1.0.tar.gz |
|---|---|
| Size | 21.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
36fda21840e4fac908045fa7117afe93616f363ffc32a51f3b20bc1be1fb8e19
|
|
BLAKE2b-256 checksum How to use checksums |
8703c69408e18756f6c84a2d9094567f838be864b572048bdb39aabe1bba2431
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logRelease files / pacif_framework-3.1.0-py3-none-any.whl
| Download URL | pacif_framework-3.1.0-py3-none-any.whl |
|---|---|
| Size | 15.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
87864dc823eaed612cd5217559e8b2462a1452362c7ffe302771609a6b41e6c4
|
|
BLAKE2b-256 checksum How to use checksums |
891c3c7e1fb9f13d65776a3805730ca8b4eef28c27a58c49348163cfe05ef811
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logSecurity for pacif-framework 3.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pacif_framework-3.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.