Skip to main content

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.

PyPI Python C++ License: BSL 1.1

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

Honest cost (corrected 2026-10-21). An earlier version of this README claimed "~2000× faster at D=2048". That number does not reproduce, and the sign is wrong at the dimension it names. Measured against numpy.eigh on the same covariance:

D power iteration numpy eigh speedup
128 0.25 s 0.43 s 1.7×
384 7.4 s 8.9 s 1.2×
2048 399 s 34.7 s 0.09× (11× slower)

The cause is structural: max_candidates = D with up to 2000 iterations per component. At D=2048 the effective rank is ~1656, so the cost is 1656 × 2000 × O(D²) against a single O(D³) eigh.

What the method actually wins is the low-rank regime — a corpus whose effective rank is small relative to D. Measured on genuinely low-rank embeddings (rank 40, in D=512 and D=1024): 8.3× and 5.6× faster than eigh.

Recommendation. Use this operator when the manifold is known to be low-rank and you want a deterministic, dependency-free implementation. For D ≥ 2048 with a high effective rank, numpy.eigh — or a randomized SVD (Halko–Martinsson–Tropp) — is an order of magnitude faster and should be preferred.

The mathematical output is correct in every regime: the projector is idempotent (‖P²−P‖/‖P‖ = 3.3e-7), exactly symmetric, and the reported rank matches the true eigendecomposition. Only the performance claim was wrong.

The guarantee that does hold everywhere is determinism: fixed seed, fixed iteration count, same input → same basis.

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, .dim
  • expand_spectral(psi, d, D) — zero-pad + L2 normalize
  • embed_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):

Kaggle

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

Metadata

Release files for winnex-xfactor 1.0.8

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

Source distribution (sdist)

Source distribution for winnex-xfactor 1.0.8
File Size Uploaded Provenance
winnex_xfactor-1.0.8.tar.gz 20.7 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for winnex-xfactor 1.0.8
File
winnex_xfactor-1.0.8-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
winnex_xfactor-1.0.8-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
winnex_xfactor-1.0.8-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
winnex_xfactor-1.0.8-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
winnex_xfactor-1.0.8-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
winnex_xfactor-1.0.8-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
winnex_xfactor-1.0.8-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
winnex_xfactor-1.0.8-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
winnex_xfactor-1.0.8-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
winnex_xfactor-1.0.8-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
winnex_xfactor-1.0.8-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
winnex_xfactor-1.0.8-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details

Total release size: 1.4 MB

Release files / winnex_xfactor-1.0.8.tar.gz

Download URL winnex_xfactor-1.0.8.tar.gz
Size 20.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fc53bc49fa583e78a8fa934ba29bcadd282a054d3771adf0c8b2dfc4e988ed86
BLAKE2b-256 checksum
How to use checksums
d6377c6865786858d7890d58601d943ac09ba593acc8827782824de1919e6a93
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 Oct 22, 2026.

Transparency log

Release files / winnex_xfactor-1.0.8-cp313-cp313-win_amd64.whl

Download URL winnex_xfactor-1.0.8-cp313-cp313-win_amd64.whl
Size 117.0 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
5c20b6370f8d18c05c9a8b1ddedc8da8e6292bf2093dd1134e7a8b1088674e7f
BLAKE2b-256 checksum
How to use checksums
107c3f4cce0654961256d0d410681d3190425e736f67e133cee513c570f31ec7
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 Oct 22, 2026.

Transparency log

Release files / winnex_xfactor-1.0.8-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL winnex_xfactor-1.0.8-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 126.2 kB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
0f354bd5c0457741b86827dfaa3017d3b74bf5feba2501c017947a2259b9da9a
BLAKE2b-256 checksum
How to use checksums
7bb3fb6553f4441f91f42aee99307f9653a8415608889667f31e43258b987a88
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 Oct 22, 2026.

Transparency log

Release files / winnex_xfactor-1.0.8-cp313-cp313-macosx_11_0_arm64.whl

Download URL winnex_xfactor-1.0.8-cp313-cp313-macosx_11_0_arm64.whl
Size 102.4 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ad7cd69602169ed0580a8dba9b215f2562f7bf6c2103f78599c6a8f2cab239e4
BLAKE2b-256 checksum
How to use checksums
4ef59ce119dcf0242168b4dd7753141262d90151713cc56c6207c39b7100d177
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 Oct 22, 2026.

Transparency log

Release files / winnex_xfactor-1.0.8-cp312-cp312-win_amd64.whl

Download URL winnex_xfactor-1.0.8-cp312-cp312-win_amd64.whl
Size 117.0 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
cbba39a71ea89b7e4ca5478cbe2e9103553049057556b571b7f99dbd5636f65b
BLAKE2b-256 checksum
How to use checksums
7e1f52f52605c8ba82b4c65fb77ff9d4d5cf0d34e5e96a9dcf8cad3e337b2177
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 Oct 22, 2026.

Transparency log

Release files / winnex_xfactor-1.0.8-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL winnex_xfactor-1.0.8-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 126.2 kB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
712c3304e262897694217ac80a167da555b1feed9ef53ccfaf9bbb65c87eebb8
BLAKE2b-256 checksum
How to use checksums
44652c1eaa49ef8fa8d1bbe786ad9e9c6c856f517e2113545a6db0542c27efe8
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 Oct 22, 2026.

Transparency log

Release files / winnex_xfactor-1.0.8-cp312-cp312-macosx_11_0_arm64.whl

Download URL winnex_xfactor-1.0.8-cp312-cp312-macosx_11_0_arm64.whl
Size 102.3 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b1db11cb9825526df048b7e0325692d2cc4fb653df0e63942f41e32e6d8dcf61
BLAKE2b-256 checksum
How to use checksums
2372bcaf7211d1c4819e79e2f8c50b736880b014c9ac77c5395dd0f95cd31148
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 Oct 22, 2026.

Transparency log

Release files / winnex_xfactor-1.0.8-cp311-cp311-win_amd64.whl

Download URL winnex_xfactor-1.0.8-cp311-cp311-win_amd64.whl
Size 114.8 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
9c4b81ef56815b41d66e2bbc43357bcd07c46f3e56288564fc2963e699068988
BLAKE2b-256 checksum
How to use checksums
c7f709eca798aef7654e8cf4ff4487db774b4ffff8135c050f2a806a20b2d824
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 Oct 22, 2026.

Transparency log

Release files / winnex_xfactor-1.0.8-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL winnex_xfactor-1.0.8-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 125.1 kB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
502dae8ce211bd42668bef8d28e16b25a7d8512bae2ad3bc5be77deb99c14963
BLAKE2b-256 checksum
How to use checksums
3c20d39d5b563a3b5eaae3bb67a64e91c42878126f7ee984aee57e8ba42b8964
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 Oct 22, 2026.

Transparency log

Release files / winnex_xfactor-1.0.8-cp311-cp311-macosx_11_0_arm64.whl

Download URL winnex_xfactor-1.0.8-cp311-cp311-macosx_11_0_arm64.whl
Size 101.4 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9e5240167953171973d64d51aa1e9f48eb1e9f00bfaad0e19962f0d87d7373a9
BLAKE2b-256 checksum
How to use checksums
a29cbf30b78a10fefb18ec0329e87f5676a9a6e38d32e032fe1a6287c0f28856
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 Oct 22, 2026.

Transparency log

Release files / winnex_xfactor-1.0.8-cp310-cp310-win_amd64.whl

Download URL winnex_xfactor-1.0.8-cp310-cp310-win_amd64.whl
Size 113.3 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
fb35ce2ce50067579693d1cac0d8eb64b07c944442c1e6d01bcdcd2b459853f7
BLAKE2b-256 checksum
How to use checksums
b40390ee6d44b0351e8388af8808b0ee5f57a53959b55e815613023ce9a803de
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 Oct 22, 2026.

Transparency log

Release files / winnex_xfactor-1.0.8-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL winnex_xfactor-1.0.8-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 123.6 kB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9d2fcfe108e74c27e1303509a7494d9225519529fc6ffccad276aa8ce17da04d
BLAKE2b-256 checksum
How to use checksums
f236e97f3966f40dd8d09761d68184498fb3dee520fa45660018389e2055ae5e
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 Oct 22, 2026.

Transparency log

Release files / winnex_xfactor-1.0.8-cp310-cp310-macosx_11_0_arm64.whl

Download URL winnex_xfactor-1.0.8-cp310-cp310-macosx_11_0_arm64.whl
Size 100.5 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c75d453f25f29d5789420a1ac5eb30c640f5e23c524f6b8954fc5d54890b9d44
BLAKE2b-256 checksum
How to use checksums
ed77445f9990fa8aef42155a1ae530a30b40c10dfa0a481f80b6643c6bf183cc
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 Oct 22, 2026.

Transparency log

Security for winnex-xfactor 1.0.8

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

All 13 files in this release have been uploaded with provenance metadata.

Select from 13 files

Attestation for winnex_xfactor-1.0.8.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 Oct 22, 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