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
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,.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
Metadata
Release files for winnex-xfactor 1.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| winnex_xfactor-1.0.7.tar.gz | 19.8 kB | With provenance | Details |
Built distributions (wheels)
Total release size: 1.4 MB
Release files / winnex_xfactor-1.0.7.tar.gz
| Download URL | winnex_xfactor-1.0.7.tar.gz |
|---|---|
| Size | 19.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
492a93c6aaaba944e3b57770fcbfd90b7969f10134649a0ea3891321b0861a45
|
|
BLAKE2b-256 checksum How to use checksums |
52462a9b6a60dd5deba5a653d891232eaf815b37530f00ce9914546fcd0abd75
|
| 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 logRelease files / winnex_xfactor-1.0.7-cp313-cp313-win_amd64.whl
| Download URL | winnex_xfactor-1.0.7-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 116.9 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f3709fc9914b42776178383047d9e3037e52b1ce33096a8bcbdee6ad0006ca72
|
|
BLAKE2b-256 checksum How to use checksums |
cf4d565ad23a68b9a18ac3fe3b30dfa7ff77e5803c5949b2539b195897a117ca
|
| 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 logRelease files / winnex_xfactor-1.0.7-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | winnex_xfactor-1.0.7-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 124.9 kB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
d5cc3996f0c73df2692e7d1fd08d3bce7cc481a7cd7215ba4f835ad7ac798296
|
|
BLAKE2b-256 checksum How to use checksums |
bbed3a41ecf554c127cb9a8f16357f225865a21536ffbed95476cd4c34505092
|
| 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 logRelease files / winnex_xfactor-1.0.7-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | winnex_xfactor-1.0.7-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 102.2 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ac2e5b3812f337ce0406fd73f6b2fde9c6c0d65dcf986647e143c90f6a4aac95
|
|
BLAKE2b-256 checksum How to use checksums |
8b71e26e2a6eaffe5906deea767c57c4105504757edf56e4fc44bad8000059d5
|
| 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 logRelease files / winnex_xfactor-1.0.7-cp312-cp312-win_amd64.whl
| Download URL | winnex_xfactor-1.0.7-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 116.8 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
fa59ea2a58a019db8ed910c63f637f270f3f662b5cef41776488e97edd595645
|
|
BLAKE2b-256 checksum How to use checksums |
2c283d1195a49f8569102a5d03b8f2d0a375fe0f0167a41db5396948be651de5
|
| 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 logRelease files / winnex_xfactor-1.0.7-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | winnex_xfactor-1.0.7-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 124.9 kB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
b579f9626f080ff8e009fe14a6fbc825126df949fe93a466be798799a0f2ccee
|
|
BLAKE2b-256 checksum How to use checksums |
ca01ce46706add354260c7958b8d4143e81dfbe72395d587088ca0f652f91f90
|
| 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 logRelease files / winnex_xfactor-1.0.7-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | winnex_xfactor-1.0.7-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 102.2 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e94b3545c894599cfe818ee4f1eec37a2d466d8f509d6c0bff77791cede2614e
|
|
BLAKE2b-256 checksum How to use checksums |
b3177d9b5964d2c3786fed260ced7cd0ea2567b671f2decd6aebbc1f7b2a1223
|
| 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 logRelease files / winnex_xfactor-1.0.7-cp311-cp311-win_amd64.whl
| Download URL | winnex_xfactor-1.0.7-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 114.6 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
faa851cd736c7841a12683b9a291486320c945c7fd1dd3ec62fed726ec1b6d33
|
|
BLAKE2b-256 checksum How to use checksums |
32213990a7d0a1f867c7bcbe2ade49ac3c62bc595bed63ffdf0b6fac59673068
|
| 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 logRelease files / winnex_xfactor-1.0.7-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | winnex_xfactor-1.0.7-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 123.9 kB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
11debc50bc7e391e2fc63a8b0188fec16b7061309e5e1d2486e474517783bb33
|
|
BLAKE2b-256 checksum How to use checksums |
84d957e7d09f7094ac9e156837c655a28c7ae7ec1a1841f0651c34a96d108150
|
| 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 logRelease files / winnex_xfactor-1.0.7-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | winnex_xfactor-1.0.7-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 101.2 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
df22a417d9534f6e1ced3ba704fe7d06c7322d09fba11d73268774fbc8d9d2c3
|
|
BLAKE2b-256 checksum How to use checksums |
b1569776d83fa32e5196a3680313860c7683b83917f6968a15a6c026dab34851
|
| 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 logRelease files / winnex_xfactor-1.0.7-cp310-cp310-win_amd64.whl
| Download URL | winnex_xfactor-1.0.7-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 113.1 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
84af19736da9ec258f348ea7f6eb892dc119b956df437cf3fb4c9e764e42da31
|
|
BLAKE2b-256 checksum How to use checksums |
700574d5821dfd18f953154adc1e943c136becec9ee25221cd18f00875155787
|
| 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 logRelease files / winnex_xfactor-1.0.7-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | winnex_xfactor-1.0.7-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 122.3 kB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
264d9a144f7dee4bb8b5903ba11fd758b489976cb974c780c2cb12093d3beb13
|
|
BLAKE2b-256 checksum How to use checksums |
f085be8c8547d81a522ba88370182b3dd391c9299ae44a953a2ffa2e6520277e
|
| 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 logRelease files / winnex_xfactor-1.0.7-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | winnex_xfactor-1.0.7-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 100.2 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
657a3c330f6c858824ba6cab63764d0250ee797f5e744d8a6bec74327a393441
|
|
BLAKE2b-256 checksum How to use checksums |
1c8ce105e471cfa429f086c4e5e34e4e08f360830a96a606fd1ef7d4ac422484
|
| 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 logSecurity for winnex-xfactor 1.0.7
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.
Attestation for winnex_xfactor-1.0.7.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 logA 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.