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

~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, .dim
  • expand_spectral(psi, d, D) — zero-pad + L2 normalize
  • embed_spectral(psi, P) — full text→manifold projection

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

winnex_xfactor-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (120.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file winnex_xfactor-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for winnex_xfactor-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4d160074e671fa4099c0f8f16b4a3008685a7e5565ca39664d26c26087d636fe
MD5 c4b25e15d58314f06f18bf48a657f3eb
BLAKE2b-256 a2a631dec6ac3d23c0e283543a025783176c35265463a3e5a252b07bd299c826

See more details on using hashes here.

Provenance

The following attestation bundles were made for winnex_xfactor-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on winnex-ai/winnex-xfactor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.0.4

1 file

1.0.3

1 file

1.0.2

1 file

1.0.1

1 file

This release

1.0.0 This release

1 file

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