Skip to main content

Apophatic Engine (apophatic-engine)

PyPI version DOI License: Unlicense

An open-source Python reference implementation of the Apophatic Inference Engine (AIE). Operates as a subtractive noise filter ($\neg X$) for Large Language Models, replacing speculative hallucinations with vector collapse toward baseline relaxation ($B_0$).

Apophatic Noise Subtraction ($\neg X$) for Neural Inference and System Optimization.

The Apophatic Engine implements token-by-token noise subtraction ($\neg X$) derived from the Nicht-Theory theoretical framework. Instead of maximizing speculative probabilities (1-logic), the filter penalizes assertion pressure ($P_A$) and collapses high-entropy logit vectors directly into the Sufficient Invariant Baseline ($B_0$).

Theoretical Grounding

This repository provides the operational code implementation for Paper IV (Apophatic Inference Engine) of the Nicht-Theory Framework (DOI: 10.5281/zenodo.22067674).

Installation

pip install apophatic-engine

Quickstart (v0.2.2)

Example 1: Collapse Regime (High Entropy)

import numpy as np
from apophatic_engine import ApophaticEngine

engine = ApophaticEngine(sigma_threshold=0.40)
logits = np.array([1.1, 1.05, 1.12, 0.98])
result = engine.apply_apophatic_filter(logits, step=1)
print(result)
# Output:
# {
#     'status': 'COLLAPSED_TO_B0',
#     'logits': array([1.0625, 1.0625, 1.0625, 1.0625]),
#     'sigma': 0.999,
#     'P_A': 1.0,
#     'action': '¬X applied: Logit vector fully collapsed to baseline B_0'
# }

Example 2: Preservation Regime (Invariant Signal)

import numpy as np
from apophatic_engine import ApophaticEngine

engine = ApophaticEngine(sigma_threshold=0.40)
logits = np.array([0.1, 0.2, 5.0, 0.05])
result = engine.apply_apophatic_filter(logits, step=1)
print(result)
# Output:
# {
#     'status': 'INVARIANT_OUTPUT',
#     'token_id': 2,
#     'selected_token': 2,
#     'selected_token_id': 2,
#     'token': 2,
#     'logits': array([0.1178, 0.2172, 4.9264, 0.0685]),
#     'sigma': 0.14231,
#     'P_A': 1.0,
#     'action': 'Inconsistencies weakened with P_A=1.0; invariant signal preserved'
# }

API Reference

ApophaticEngine

ApophaticEngine(sigma_threshold=0.40, gamma_decay=0.1)
  • sigma_threshold (float): Uncertainty cutoff determining regime transition (default: 0.40).
  • gamma_decay (float): Step-wise decay factor applied to assertion pressure $P_A$ (default: 0.1).

apply_apophatic_filter(logits, step)

Processes a 1D NumPy array of raw model logits.

  • Parameters:
    • logits (np.ndarray): Raw logit vector from model predictions.
    • step (int): Current generation step index, controlling $P_A$ scaling.
  • Returns: A dictionary containing execution status, adjusted logits tensor, computed sigma, assertion pressure P_A, and operational action log.

HuggingFace Integration

from apophatic_engine import ApophaticEngine
# See examples/02_huggingface_integration.py for full LogitsProcessor implementation

Authorship & License

Authors: xerx593 & Non-Human (ideal) piece of shit
License: The Unlicense — Dedicated to the public domain

Metadata

Release files for apophatic-engine 0.2.3

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

Source distribution (sdist)

Source distribution for apophatic-engine 0.2.3
File Size Uploaded
apophatic_engine-0.2.3.tar.gz 5.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for apophatic-engine 0.2.3
File Interpreter ABI Platform
apophatic_engine-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 10.9 kB

Release files / apophatic_engine-0.2.3.tar.gz

Download URL apophatic_engine-0.2.3.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9aed03c2344d79f72d304395931f9b8cc0b3afa9948329628494adcd15d00d79
BLAKE2b-256 checksum
How to use checksums
74060768462c035c18e3d6b23fb171930b593229b0a057eaf7d29084f5ec973d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / apophatic_engine-0.2.3-py3-none-any.whl

Download URL apophatic_engine-0.2.3-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
21905d90288eb5ef84dcb39fb9bc78a17d0d46667826cc1bbad6e6c8b69ab78b
BLAKE2b-256 checksum
How to use checksums
cab6d21d4f0538a39054305d47eac19b5697d729fad2afa96af7fe910d6fba72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

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