Skip to main content

PACIF v3.1

Predictive Alignment & Causal Information Flow

Measures statistical coupling between user behavior and system context, and assesses the reliability of that estimate.

Streamlit Demo PyPI DOI License Python CI


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 (nats; observed joint cells).
  • Cardinality guard — high unique-label / small-N regimes return unreliable instead of overconfident MI.
  • Strict reliability diagnostics — CI width thresholds; zero/degenerate variance forces reliable=False.
  • Drift detection — CUSUM and Page–Hinkley with pre-drift baseline and rebaselining window.
  • Regulator-ready audit reports — YAML schema 1.2 with parameters block, exclusion-rate, category-inflation, skew, and drift flags.
  • Causal integration pattern — synthetic PACIF-like features in an illustrative DR simulation; see causal_integration.py (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
Release process: docs/RELEASING.md


Quick start

Live demo (no install)

👉 Launch PACIF Demo

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
mypy pacif_core

Minimal usage

from pacif_core import estimate_alignment, DriftDetector, PageHinkleyDetector, 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, max_events=None)

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/
│   ├── _version.py       # single version source (3.1.x)
│   ├── estimator.py      # Bias-corrected MI + reliability
│   ├── drift.py          # CUSUM + Page-Hinkley detectors
│   └── audit.py          # YAML audit reporter (schema 1.2)
├── tests/
├── docs/
│   ├── INTERPRETATION.md
│   ├── POSITIONING.md
│   └── RELEASING.md
├── examples/
├── app.py
├── causal_integration.py
└── .github/workflows/
    ├── ci.yml            # ruff + mypy + pytest-cov (3.9–3.12)
    └── publish.yml       # tag v* → GitHub Release + PyPI

Releasing

Version lives in pacif_core/_version.py. Tag must match:

git tag -a v3.1.0 -m "PACIF v3.1.0"
git push origin v3.1.0

Details: docs/RELEASING.md.

Note: Numeric MI outputs differ from 3.0.x (Miller–Madow units, cardinality guard, sampling). Re-baseline thresholds calibrated on 3.0.x.


Enterprise & audit integration

For production deployments, multi-tenant audit pipelines, custom connectors, or compliance reporting support, contact:

for.smirnov.maks@gmail.com


Contributing

We welcome contributions. Algorithmic transparency should be a public good.


Citation

If you use PACIF in research, audits, or product workflows, please cite:

@software{pacif_v3_2026,
  author       = {ppiiyo},
  title        = {PACIF v3.1: 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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pacif-framework 3.1.1
File Size Uploaded Provenance Actions
pacif_framework-3.1.1.tar.gz 22.8 kB With provenance Details for pacif_framework-3.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pacif-framework 3.1.1
File Interpreter ABI Platform Actions
pacif_framework-3.1.1-py3-none-any.whl Python 3 none any Details for pacif_framework-3.1.1-py3-none-any.whl

Total release size: 39.1 kB

Release files / pacif_framework-3.1.1.tar.gz

Download URL pacif_framework-3.1.1.tar.gz
Size 22.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a0f64c8f68c2cd917c6298e626b01f0c00c9659124226e8f955aeecf1f31d1aa
BLAKE2b-256 checksum
How to use checksums
8b07d25bb2e68c78c39aa21d4e1a8e7146f871908bda05016d0abce93da97a03
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 17, 2026.

Transparency log

Release files / pacif_framework-3.1.1-py3-none-any.whl

Download URL pacif_framework-3.1.1-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea954c93dbd3f59e500769843b9a9d80cdeb2dd3d078e55176ed31d268cfec93
BLAKE2b-256 checksum
How to use checksums
2faae9aeefda74c13d766f4731ebc401b66a7acaa8f725e6eca2b72cbd3e94c6
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 17, 2026.

Transparency log

Security for pacif-framework 3.1.1

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.

Select from 2 files

Attestation for pacif_framework-3.1.1.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 17, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page