Skip to content
Back to skills

Compute Optimal Embedding Eval

ASecurity

Evaluates the compute-optimal fine-tuning recipe for repurposing decoder-only LLMs into text embedding models. It measures how different computational budgets and fine-tuning methods affect both training contrastive loss and downstream retrieval/similarity performance. Use when the user wants to benchmark on BAAI BGE, MTEB, or asks about evaluating this task. Reports contrastive loss.

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 11, 2026
ai-agentspythongoperformance

Security analysis

A100/100

Scanned September 11, 2026

npx -y skills add qhjqhj00/research-skills-pool --skill compute-optimal-embedding-eval --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Compute Optimal Embedding Eval?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Compute Optimal Embedding Eval
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/qhjqhj00-compute-optimal-embedding-eval/badge)](https://www.skillsdirectory.com/skills/qhjqhj00-compute-optimal-embedding-eval)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: compute-optimal-embedding-eval
description: Evaluates the compute-optimal fine-tuning recipe for repurposing decoder-only LLMs into text embedding models. It measures how different computational budgets and fine-tuning methods affect both training contrastive loss and downstream retrieval/similarity performance. Use when the user wants to benchmark on BAAI BGE, MTEB, or asks about evaluating this task. Reports contrastive loss.
metadata:
  skill_kind: dataset_eval
  source_arxiv: 2406.04165
  bibtex_key: [REDACTED]
  confidence: high
---

# compute-optimal-embedding-eval

> Repurposing Language Models into Embedding Models: Finding the Compute-Optimal Recipe — Ziarko et al. (2024) (arXiv:2406.04165, 2024)

## What this evaluates

Evaluates the compute-optimal fine-tuning recipe for repurposing decoder-only LLMs into text embedding models. It measures how different computational budgets and fine-tuning methods affect both training contrastive loss and downstream retrieval/similarity performance.

## Datasets

- **BAAI BGE** — total 200000000; splits: train (200000000)
- **MTEB** — total ?; splits: test (-1)

## Metrics

- `contrastive loss` **(primary)** — range: other
  - The final training loss from the contrastive objective computed over (query, value) pairs.
- `MTEB downstream score` — range: [0, 1]
  - Average performance across 8 selected tasks (one per category) from the MTEB benchmark, using standard task-specific metrics.

## Input / output format

**Input**: Semantically related (query, value) text pairs.

**Output**: Dense vector embeddings for each text, used to compute contrastive loss and downstream task scores.

## Scoring recipe

```python
model = load_pythia_model(size)
optimizer = AdamW(model)
scheduler = CosineLR(optimizer, warmup_frac=0.1)
for batch in BAAI_BGE_loader(batch_size=1024, ctx_len=75):
    loss = contrastive_loss(model(batch.query), model(batch.value))
    loss.backward()
    optimizer.step()
final_loss = loss.item()
mteb_scores = []
for task in MTEB_subset[8_tasks]:
    preds = model.encode(task.test_queries)
    gold = task.test_labels
    score = compute_mteb_metric(preds, gold)
    mteb_scores.append(score)
avg_mteb = sum(mteb_scores) / len(mteb_scores)
```

## Common pitfalls

- Training for more than one epoch on BAAI BGE causes diminishing returns; the protocol explicitly uses <1 epoch.
- LoRA rank selection is highly sensitive; ranks of 8 or 2048 are suboptimal, while 32 or 128 yield the best loss.
- In block freezing, token-embedding parameters are always frozen, unlike standard transformer block freezing.

## Evidence (verbatim from paper)

> In addition to controlling the final training contrastive loss achieved by the models, we also measure downstream performance by evaluating the models on a representative subset of the MTEB benchmark*(Muennighoff et al., [2023b])*. The benchmark defines eight categories of tasks in total (e.g., retrieval, semantic text similarity). We select one task from each category by determining which ones are the most correlated with the performance for the whole category (see Appendix[B] for details).

## Citation

```bibtex
@misc{ziarko2024repurposing,
  title={Repurposing Language Models into Embedding Models: Finding the Compute-Optimal Recipe},
  author={Ziarko et al. (2024)},
  year={2024},
  note={arXiv:2406.04165}
}
```

- arXiv: 2406.04165

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.