CoolFace
Modelpublic

steffen-negabo/ngnn-general-encoder-v1

sourceHugging Facemitupdated 7d agoView on Hugging Face
0likes46downloads
Model Card

NGNN general encoder v1

This repository distributes the fixed NGNN compressor used by steffen-negabo/ngnn-general-encoder-v1. The complete encoder calls the user's OpenAI text-embedding-3-large API, normalizes each 3072-dimensional base vector, and independently compresses it to 512 float32 values. It accepts previously unseen text and runs the compressor locally on CPU.

The compressor weights and inference library are MIT licensed. OpenAI's base weights are not distributed; API access and its terms remain the caller's responsibility. This is not a fully open-weight embedding model. The NGNN training algorithm, optimizer and training data are not part of this release.

Inference

Install the versioned ngnn-encoder library from PyPI:

bash
python -m pip install ngnn-encoder==0.1.0

The public inference repository contains source, usage and release evidence. The library's NgnnGeneralEncoder.from_pretrained(repo_id, revision=commit_sha) method downloads config.json and model.npz at a full immutable Hub commit, checks the configuration and artifact SHA-256, then creates the provider. The library requires CPU inference with PyTorch 2.11.0 to preserve top-k tie behavior. Load the published immutable artifact commit:

python
from ngnn_encoder import NgnnGeneralEncoder

repo_id = "steffen-negabo/ngnn-general-encoder-v1"
hub_commit = "bab7d30011438e52f22be540067c73ca37f462eb"
model = NgnnGeneralEncoder.from_pretrained(repo_id, revision=hub_commit)
vectors = model.encode(["A previously unseen sentence.", "Another sentence."])
assert vectors.shape == (2, 512)

This Hub commit pins the distributed files. It is separate from the canonical MTEB revision below. Configuration and weight checks reject a different model.

Set OPENAI_API_KEY locally through the environment. Calls to encode make billable OpenAI embedding requests. Keep credentials out of model kwargs: MTEB serializes those kwargs into experiment metadata.

Empty or whitespace-only strings return local zero vectors. Nonempty inputs are limited to 8,191 cl100k_base tokens. The encoder enforces both request item and total token limits. No cached benchmark texts or vectors are needed for inference.

Artifact and model identity

PropertyValue
Canonical MTEB modelsteffen-negabo/ngnn-general-encoder-v1
Canonical MTEB revisiond6969c26400944d4f5200ebddfdc04a083fd7b75
Original evaluation labelngnn_general_encoder_singleton_e55ba679_20260906
Artifact SHA-256e55ba67998039ba7cb4837798b0464e06e5939245d3275802cbbd6f0aa3fcb6a
Artifact bytes5,843,713
Dictionary shape3072 by 512
Additional parameters512 unit channel scales; no bias
Output512 float32 values; top-256 selection

The Hub commit is a distribution coordinate. It does not replace the canonical MTEB revision or change the evaluated model. The original public weights and weights in this repository have the same SHA-256. The revision mapping connects the evaluation label to the canonical submission revision.

Training provenance and limitations

The local compressor was fit on an archived FineWeb calibration split. Evaluation texts were used as exclusion inputs, not as compressor fitting data. The OpenAI base model's training data are unknown; no claim of an empty training dataset or known total parameter count is made.

The local weights and transform are fixed, but the externally managed OpenAI model alias is not an immutable provider snapshot. Future provider changes can affect embeddings. These results cover four English tasks; no global MTEB aggregate or general multilingual performance is claimed.

Evaluation

Evaluation used native MTEB 2.20.10 at upstream commit ed47a25455157433b458db2625e72960468597ab on September 6, 2026.

Task / main metricNGNN 512DRaw 3072DProvider-native 512D
SciFact / nDCG@100.6351700.7771200.750040
STSBenchmark / cosine Spearman0.8248950.8357250.828178
Banking77Classification.v2 / accuracy0.8325750.8582570.845579
NFCorpus / nDCG@100.3119200.4210900.398100

NGNN scores below both controls on all four tasks. Both 512D variants use 2,048 float32 bytes per vector, compared with 12,288 bytes for raw 3072D. These measurements do not show an advantage over the provider's native dimensionality reduction. Archived raw responses and fresh native512 responses were obtained at different times under the provider alias. Original STSBenchmark retains its evaluated identity despite its v2 successor.

The evaluation manifest and exact results record task, data, source and result hashes. The historical cache-only ngnn-sparse-v1-api study is a separate model; its scores do not describe this general encoder.

The model implementation PR and four-task results PR are submissions for review. Publishing this artifact does not establish official MTEB acceptance.