config_sentence_transformers.json: empty "query" prompt (400M/150M/68M have "[query]: ")

#1
by kprzyb - opened

Hi,

thanks for releasing the PolDense family!

It looks like config_sentence_transformers.json in PolDense-1B is missing the query prompt that the README and the smaller models use:

model prompts in config_sentence_transformers.json
PolDense-1B {"query": "", "document": ""}
PolDense-400M {"query": "[query]: ", "document": ""}
PolDense-150M {"query": "[query]: ", "document": ""}
PolDense-68M {"query": "[query]: ", "document": ""}

The README says retrieval queries should be prefixed with "[query]: ". With the current 1B config, anything that relies on the configured prompt silently embeds queries without the prefix. That covers model.encode(..., prompt_name="query"), encode_query() in sentence-transformers and tools that read the prompts from the config, such as MTEB.

Minimal check:

from sentence_transformers import SentenceTransformer
m = SentenceTransformer("OPI-PIB/PolDense-1B")
print(m.prompts)  # {'query': '', 'document': ''}

Impact in our tests: on a PolQA sample, hit@1 was 0.52 without the prefix vs 0.81 with "[query]: " added manually. On our own Polish notes, the correct note reached the top 5 in 6/25 queries vs 18/25. The result was the same in fp32/fp16/bf16, on ROCm and CUDA, and in a GGUF conversion with llama.cpp, so the issue is only the missing prefix.

Suggested fix: set "query": "[query]: " in config_sentence_transformers.json (and possibly add "sts": "[sts]: " as described in the README).

National Information Processing Institute org

Thanks for noticing, fixed.

sdadas changed discussion status to closed

Thanks for the quick fix!

FYI, in case it's useful: I published GGUF conversions of the whole PolDense family for llama.cpp
(F16 and Q8_0): https://huggingface.co/kprzyb/PolDense-1B-GGUF
(17M, 32M, 68M, 150M and 400M are under the same naming).

Each file was checked against sentence-transformers (fp32). Cosine similarity is ≥ 0.9996 for F16
and ≥ 0.9985 for Q8_0, including a 3k-token input. The cards cover two pitfalls for llama.cpp users:
the [query]: prefix has to be added manually, and the whole input must fit in one micro-batch (-ub).
Feel free to link them from your model cards, and let me know if you'd rather publish official GGUFs yourselves.

Sign up or log in to comment