Skip to main content

PACIF v3.0

Predictive Alignment & Causal Information Flow

Measures how strongly algorithms shape user behavior — and whether that signal is reliable.

Streamlit Demo DOI License Python CI PyPI


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 reduces finite-sample bias by 40–65%.
  • Strict reliability diagnostics — automatically flags unstable estimates via confidence-interval width thresholds.
  • Cumulative drift detection — CUSUM + Page-Hinkley for non-stationary behavioral shifts.
  • Regulator-ready audit reports — YAML output with exclusion-rate, category-inflation, skew, and drift flags.
  • Causal integration pattern — PACIF features reduce Doubly Robust (DR) estimator bias by ~89% in controlled simulations.

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)

👉 Launch PACIF Demo

Install

pip install -e .                       # core
pip install -e ".[demo,causal,dev]"    # demo + causal example + tests

Or from the repository:

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-style drift detector
│   └── audit.py          # YAML audit reporter (schema 1.1)
├── 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
└── .github/workflows/ci.yml

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.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.0.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.0.1
File Size Uploaded Provenance Actions
pacif_framework-3.0.1.tar.gz 14.8 kB With provenance Details for pacif_framework-3.0.1.tar.gz

Built distribution (wheel)

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

Total release size: 27.5 kB

Release files / pacif_framework-3.0.1.tar.gz

Download URL pacif_framework-3.0.1.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a19d9ef1de02a19c258671dd81f8c661901c9890da7d4e4645c172a6a03894ba
BLAKE2b-256 checksum
How to use checksums
e994128f27c3271f1db8090eec12de61fd40237b766f695cde4a57e5048c4353
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 9, 2026.

Transparency log

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

Download URL pacif_framework-3.0.1-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9a813878478414217d4c766ac18f7819cd65cdf0e40a32fdb4e817ef589eae79
BLAKE2b-256 checksum
How to use checksums
d080aafd6f6bb93af19c2e3f087deba9589b67538d76f1336977232b8d7c6620
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 9, 2026.

Transparency log

Security for pacif-framework 3.0.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.0.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 9, 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