Centroid Adapter β€” mpnet

Lightweight BottleneckResidualAdapter trained on top of mpnet embeddings to produce representation-invariant table embeddings.

Architecture

z = e + Ξ± Β· Up( Dropout( GELU( Down( LN(e) ) ) ) )
Hyperparameter Value
Embedding dim d 768
Bottleneck rank r 512
Residual scale Ξ± 0.01
Use bias True

Trained on: NQ, WTQ, WIKISQL

Usage

import torch
from huggingface_hub import hf_hub_download
import json

# --- option A: use the from_pretrained helper in this repo ---
# (copy BottleneckResidualAdapter + from_pretrained from push_to_hub.py)
adapter = BottleneckResidualAdapter.from_pretrained("KBhandari11/centroid-adapter-mpnet")
e = torch.randn(1, 768)   # your backbone embedding
z = adapter(e)                    # representation-invariant embedding

# --- option B: hf_hub_download one-liner ---
from safetensors.torch import load_file
weights_path = hf_hub_download("KBhandari11/centroid-adapter-mpnet", "model.safetensors")
cfg_path     = hf_hub_download("KBhandari11/centroid-adapter-mpnet", "config.json")
with open(cfg_path) as f:
    cfg = json.load(f)
adapter = BottleneckResidualAdapter(**cfg)
adapter.load_state_dict(load_file(weights_path))
adapter.eval()

Research Paper

Improving Robustness of Tabular Retrieval via Representational Stability

Downloads last month
10
Safetensors
Model size
789k params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Collection including KBhandari11/centroid-adapter-mpnet

Paper for KBhandari11/centroid-adapter-mpnet