Fix Qwen3-Embedding-8B bf16 code-task results

#18
HAKARI-Bench org

Fix Qwen3-Embedding-8B code-task results with bf16 SentenceTransformers reruns

Summary

This PR replaces 10 Qwen/Qwen3-Embedding-8B task results that were affected by fp16 numerical instability.

The previous results were generated with dtype=fp16 through the TEI custom backend. Follow-up checks showed that Qwen/Qwen3-Embedding-8B produces NaN document embeddings on the affected code-oriented tasks when run in fp16. For NanoDS1000, all document embeddings became NaN and the top-100 retrieval list collapsed to corpus-id order for every query.

These replacement files were rerun with SentenceTransformers directly using dtype=bf16, flash_attention_2, and the model's query / document prompt names.

Replacement Files

Benchmark Task Old 8B New 8B bf16/ST 4B reference Best distance
NanoRTEB NanoDS1000 0.050168 0.846710 0.831132 dot
NanoRTEB NanoMBPP 0.127167 0.894907 0.898194 dot
NanoRTEB NanoHumanEval 0.316456 0.985156 0.981163 cosine
NanoRTEB NanoApps 0.317500 0.872072 0.869746 cosine
NanoRTEB NanoFreshStack 0.110894 0.478514 0.450492 dot
NanoCodeRAG NanoCodeRAGProgrammingSolutions 0.263605 0.870437 0.878626 cosine
NanoCoIR NanoApps 0.312500 0.872072 0.869746 cosine
NanoCoIR NanoCodeTransOceanDL 0.189886 0.538475 0.553990 dot
NanoRARb NanoRARbCode 0.446010 0.851631 0.936625 cosine
NanoBRIGHT NanoBrightLeetcode 0.180871 0.411045 0.400893 cosine

Scores are nDCG@10. Old 8B and 4B reference scores are from the latest leaderboard DuckDB used for this audit.

Validation Notes

  • Reproduced the bad NanoDS1000 behavior with SentenceTransformers direct loading under fp16: query embeddings were finite, but all 997 document embeddings contained NaN values with both flash_attention_2 and sdpa.
  • Re-ran the affected tasks with bf16; document embeddings were finite and retrieval rankings varied by query.
  • Checked additional low-scoring 8B tasks (NanoBrightPony, NanoSpartQA, NanoWinoGrande); bf16 did not materially improve them, so they are not included here.
  • Excluded NanoBrightTheoremQATheorems and lembpasskey from this PR because bf16 reruns did not materially improve those results.

Reproducibility

Field Value
Model Qwen/Qwen3-Embedding-8B
Model revision 1d8ad4ca9b3dd8059ad90a75d4983776a23d44af
Evaluation method dense
Backend SentenceTransformers
dtype bf16
attention implementation flash_attention_2
query prompt name query
document prompt name document
batch size 8
retrieval score device cuda
embedding variants disabled for these targeted replacement runs
candidate ranking reranking_hybrid
Python 3.12.11
torch 2.9.0
transformers 5.12.1
sentence-transformers 5.4.1
datasets 4.8.4
GPU NVIDIA RTX PRO 6000 Blackwell Max-Q Workstation Edition

Representative command shape:

CUDA_VISIBLE_DEVICES=0 uv run hakari-bench evaluate dense \
  --model Qwen/Qwen3-Embedding-8B \
  --model-revision 1d8ad4ca9b3dd8059ad90a75d4983776a23d44af \
  --dtype bf16 \
  --attn-implementation flash_attention_2 \
  --query-prompt-name query \
  --document-prompt-name document \
  --batch-size 8 \
  --retrieval-score-device cuda \
  --no-default-embedding-variants \
  --result-format json \
  --overwrite \
  --dataset NanoRTEB \
  --split NanoDS1000

The same options were used for the listed task groups, split across two GPUs.

Checklist

  • Result files are under hakari-results/Qwen__Qwen3-Embedding-8B/.
  • Result files are compressed .json.xz.
  • No DuckDB files, HTML reports, caches, or scratch artifacts are included.
  • JSON metadata records model revision, dataset revision, runtime configuration, and package versions.
hotchpotch changed pull request status to merged

Sign up or log in to comment