CoolFace
Modelpublic

adriandj3/LFM2.5-to-Llama8B-LLM2Vec-Kimodo

sourceHugging Faceapache-2.0updated 1d agoView on Hugging Face
0likes
Model Card

LFM2.5 → Llama-8B LLM2Vec bridge — expanded v2

This release maps calibrated 1024-dimensional LFM document embeddings to approximate 4096-dimensional LLM2Vec vectors. It provides a NumPy mapper, not the text encoders or a generic Transformers/SentenceTransformers model.

The expanded inventory covers 55,085 exact English caption rows. The mapper trains on 40,232 eligible pairs: 39,063 English and 1,169 Italian. Protected motion/caption components and unselected duplicates remain outside training. Full coverage does not mean training on every corpus row.

The mapper combines ridge regression with an RBF residual; see the detailed model card, inference guide, recorded experiment report, and Kimodo integration/optimization notes. The optimization notes distinguish proposals from measured results.

Training and validation selection

The selected candidate is itmix, using weighted_regularized_least_squares. Its relative Italian row weight is 5.234222, with 13.54% of normalized training weight assigned to the existing 1,169 Italian pairs. There are 2048 training-only anchors: 1771 English and 277 Italian. Weighting does not add Italian examples; centering uses the shared, unweighted training means.

A predeclared policy allowed at most one Italian-weighted alternative after an English/Italian validation check. The selected candidate and compression were fixed before test evaluation. The table lists only candidates actually evaluated on validation; the macro score gives English and Italian equal weight. Policy SHA-256: 0c0774a90349c77642f85564a315b5cc8b2eed5025a37b5a354967ab4a1ee8ca.

CandidateValidation ENValidation ITValidation macro
default0.8637190.6663760.765047
itmix0.8584290.7146240.786526

Recorded embedding evaluation

All models use the same expanded training target mean for these metrics. The earlier local candidate (frozen_v2 in reports) was not the remotely published v1. The expanded ridge uses the same new training pairs. These protected holdouts were already reported during earlier work; they are not a new blind test. Intervals resample motion/caption components.

SubsetReferenceReference centered cosineExpanded v2Paired delta95% component-bootstrap interval
test_en (999)Earlier local candidate0.8330820.852584+0.019502[0.018105, 0.020996]
test_en (999)Expanded ridge0.8234750.852584+0.029110[0.027758, 0.030272]
test_it (200)Earlier local candidate0.7200520.729607+0.009554[0.006505, 0.012302]
test_it (200)Expanded ridge0.7054020.729607+0.024205[0.021173, 0.027244]

These are embedding comparisons, not a general motion-semantic score. No new expanded-model motion test is included; prior local-candidate results are not evidence for this release.

Download and use

python
from pathlib import Path
import importlib.util
import numpy as np
from huggingface_hub import snapshot_download

root = Path(snapshot_download(
    "adriandj3/LFM2.5-to-Llama8B-LLM2Vec-Kimodo", revision="main",  # Pin a published commit for reproducibility.
    allow_patterns=["v2/*"],
))
package = root / "v2"
spec = importlib.util.spec_from_file_location("kimodo_bridge", package / "bridge.py")
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
mapper = module.Bridge(package)
x = np.load("lfm_document_embeddings.npy", allow_pickle=False)
y = mapper.transform(x, batch_size=128)  # float32, (N, 4096)

The source embeddings must follow the frozen numerical recipe. Generic fresh SentenceTransformers batches can differ. The working example requires an explicit local model directory, checks the checkpoint identity and records fixed per-row padding. Changing the complete input list can change the padding plan and vectors; no input-independent padding behavior is promised. Only the mapper is NumPy-only; the optional source encoder requires a compatible CUDA/PyTorch environment.

v1 compatibility

The existing root map_W_ridge.npy, map_mu_x.npy, map_mu_y.npy and map_config.json remain unchanged. Existing filename-based downloads keep providing v1. Its original card is archived verbatim; revision a43f1c659576 pins the original release. Historical v1 figures use an earlier protocol and should not be directly compared with the clean, common-anchor table above.

Scope, integrity and licenses

No caption corpus, holdout row lists, embedding caches, teacher weights or LFM checkpoint are distributed here. The mapper includes fitted RBF anchor parameters. SHA256SUMS verifies the eight-file mapper package. Provenance is the immutable packaging report; its local_unpublished_complete status records the successful local build before this Hub publication.

The bridge retains the existing Apache-2.0 declaration; see LICENSE. It does not relicense upstream LFM2.5, Llama/LLM2Vec, Kimodo or HumanML3D. Their respective terms and attribution remain separate. Credits and fuller limitations are in the detailed card.