Skip to content

Conversation

@Pringled
Copy link
Member

@Pringled Pringled commented Oct 2, 2025

This PR adds configurable pooling. Choices are mean, last, first, and pooler. This leads to massive performance improvements on models that use different pooling (e.g. Qwen3-Embedding):

| Model                  | Average (All) | Average (MTEB) | Classification | Clustering | PairClassification | Reranking | Retrieval | STS   | Summarization | PEARL | WordSim |
|------------------------|---------------|----------------|----------------|------------|--------------------|-----------|-----------|-------|---------------|-------|---------|
| qwen3_last_token_pooling | 43.56         | 42.39          | 58.46          | 27.03      | 68.50              | 45.47     | 19.58     | 66.34 | 30.56         | 48.63 | 46.43   |
| qwen3_mean_pooling       | 20.81         | 21.16          | 32.30          | 14.47      | 32.98              | 33.20     | 1.90      | 34.94 | 28.70         | 27.76 | 9.00    |
@codecov
Copy link

codecov bot commented Oct 3, 2025

Codecov Report

❌ Patch coverage is 94.91525% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
model2vec/distill/inference.py 94.82% 3 Missing ⚠️
Files with missing lines Coverage Δ
model2vec/distill/distillation.py 86.20% <100.00%> (ø)
model2vec/distill/inference.py 96.66% <94.82%> (-0.84%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@Pringled Pringled changed the title feat: add configurable pooling for distillation Oct 3, 2025
@Pringled Pringled merged commit 0609f5e into main Oct 3, 2025
6 checks passed
@Pringled Pringled deleted the add-configurable-pooling branch October 3, 2025 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants