winnex-xfactor
Deterministic manifold embedding for native LLM inference.
The X-Factor is a training-free operator that embeds text into a pretrained
model's latent space — computed structurally from embed_tokens, never by
running the model.
What it is
For any model, the X-Factor is the orthonormal basis of the manifold where its token embeddings live:
Ē = E − mean(E) (center)
C = ĒᵀĒ / V (D×D covariance)
C = U Λ Uᵀ (eigh, Λ descending)
r = min{r : cumsum(Λ₁..r)/ΣΛ ≥ τ} (effective rank)
X = U[:, :r] (the X factor: D×r manifold basis)
P = X·Xᵀ (orthogonal projector)
The projector is idempotent (P²=P) and symmetric (Pᵀ=P) — the orthogonal projection onto the model's embedding manifold.
Why it is fast
The eigendecomposition uses power iteration with deflation:
O(D²·r·iters) vs O(D³) for a full Jacobi/eigh
~2000× faster at D=2048, with the same deterministic guarantee (the Madhava philosophy: bound-guided selection, provable operators, no black boxes).
Install
pip install winnex-xfactor
Requires Python ≥ 3.8 and NumPy. The C++ core ships pre-built in the wheel.
Quick start
import numpy as np
import winnex_xfactor
# 1. Compute the X-Factor from a model's embed_tokens (a sample is enough).
E = np.random.randn(5000, 2048).astype(np.float32)
P, rank, variance = winnex_xfactor.compute_xfactor(E, 5000, 2048, tau=0.95)
print(f"rank={rank}, variance captured={variance:.3f}")
# 2. Embed a spectral token into the model's manifold.
psi = np.ones(64, dtype=np.float32)
h = winnex_xfactor.embed_spectral(psi, P) # length 2048, on the manifold
API
compute_xfactor(embed_tokens, vocab, dim, tau=0.95) -> (P, rank, variance)XFactor(embed_tokens, vocab, dim, tau)— object with.project,.project_batch,.projector,.basis,.rank,.variance_captured,.dimexpand_spectral(psi, d, D)— zero-pad + L2 normalizeembed_spectral(psi, P)— full text→manifold projection
Benchmark
Run the benchmark on Kaggle — installs winnex-xfactor (and winnex-nano for
the safetensors loader) from PyPI and computes the X-Factor from real
embeddings of a Qwen model (Kaggle qwen-lm/qwen):
Result: effective rank 118 (D=128, τ=0.95, variance captured 0.954), compute 0.03s — power iteration with deflation (O(D²·r)) on real embeddings.
License
BSL 1.1 | pay@winnex.ai | (c) Winnex Brasil Soluções Empresariais LTDA-ME
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file winnex_xfactor-1.0.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: winnex_xfactor-1.0.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 126.3 kB
- Tags: CPython 3.12, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9d1e50167a7f5c45bda19dfe416185186258a4e7c2e1cfdf2f23131c522fd1b
|
|
| MD5 |
065154309986928852adbab49927f59c
|
|
| BLAKE2b-256 |
e4324669c2b823ba1023dc9bbc44bb853f4f2627594762133309da00edd43be2
|
Provenance
The following attestation bundles were made for winnex_xfactor-1.0.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
publish.yml on winnex-ai/winnex-xfactor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
winnex_xfactor-1.0.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
e9d1e50167a7f5c45bda19dfe416185186258a4e7c2e1cfdf2f23131c522fd1b - Sigstore transparency entry: 2616927771
- Sigstore integration time:
-
Permalink:
winnex-ai/winnex-xfactor@b7419224f5fc188f448f57e213992d7df0c94540 -
Branch / Tag:
refs/tags/v1.0.4 - Owner: https://github.com/winnex-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b7419224f5fc188f448f57e213992d7df0c94540 -
Trigger Event:
push
-
Statement type: