Muninn-small

Muninn-small is a 47M-parameter multilingual retriever for natural-language-query → code-function retrieval, with an 8,192-token context and 384-dimensional embeddings.

It is the efficient Muninn tier, trained from ibm-granite/granite-embedding-small-english-r2 with a ModernBERT encoder.

Usage

from sentence_transformers import SentenceTransformer

model = SentenceTransformer("BrokkAI/Muninn-small")
model.max_seq_length = 8192

queries = ["Where is retry backoff calculated for failed HTTP requests?"]
documents = [
    "src/net/client.py/HttpClient/retry_delay\n"
    "class HttpClient:def retry_delay(self, attempt):\n"
    "    return min(60, 2 ** attempt)"
]

query_embeddings = model.encode(queries, prompt_name="query", normalize_embeddings=True)
document_embeddings = model.encode(
    documents, prompt_name="document", normalize_embeddings=True
)
scores = model.similarity(query_embeddings, document_embeddings)
print(scores)

The exact prompts used during training and evaluation are:

query:    Given a GitHub issue, retrieve code that must be changed to fix it.
          Query: 
document: Passage: Code chunk from repository.

The query prompt literally says “GitHub issue” because that is the trained prefix. Quarry queries are synthetic natural-language behavioral descriptions, not raw issue text. Keep the prefix unchanged at inference time even when the input is another kind of natural- language code-search query.

Document format

Quarry results use the header format produced by swerank_document_text() before the document prompt is applied. For a free function:

{path}/{function_name}
{source}

For a class method:

{path}/{ClassName}/{function_name}
class {ClassName}:{source}

The worked usage example above is therefore the exact representation of a method named HttpClient.retry_delay in src/net/client.py.

Quarry results

Quarry contains 6,525 synthetic behavioral queries over real repository revisions. The metric is strict all-gold micro recall@k: for each query, |gold ∩ top-k| / |gold|, followed by a flat mean over queries. Models use their native dimensions and the header document format above.

We measured every row ourselves with the Quarry harness. At 47M parameters, Muninn-small beats its own base by 4.6 points at recall@5 and matches SweRank-Small (137M, Python-only training) at recall@20 while running at roughly a third of its size.

Model Params recall@5 recall@20 recall@50
Muninn 346M 61.4 82.6 90.7
voyage-code-3 API 59.1 81.8 90.4
voyage-4 API 59.0 80.8 90.0
SweRank-Large 7B 58.5 80.6 89.6
Nemotron-3-Embed-1B 1B 58.3 79.9 88.7
bge-code-v1 1.5B 58.2 79.8 88.7
voyage-4-nano (Muninn base) 346M 57.5 79.7 89.0
voyage-4-lite API 57.3 79.6 89.0
Qwen3-Embedding-8B 8B 56.0 78.2 88.1
SweRank-Small 137M 53.5 74.6 83.9
Muninn-small 47M 52.3 74.6 84.7
text-embedding-3-large API 51.7 74.3 85.0
Qwen3-Embedding-0.6B 0.6B 50.9 72.8 83.8
granite-embedding-small-english-r2 (base) 47M 47.7 69.7 80.5

Other benchmarks

† marks published numbers (SweRank paper for the localization benchmarks; the CoIR leaderboard and the Qwen3-Embedding paper elsewhere). Unmarked rows are our measurements on the same protocol as the corresponding published numbers.

SWE-Bench-Lite localization — 274 Python issues, function-level accuracy:

Model Acc@5 Acc@10
Muninn (346M) 73.4 79.6
SweRank-Large (7B)† 71.9 82.1
SweRank-Small (137M)† 63.1 74.5
Muninn-small (47M) 48.5 61.0

LocBench — 560 Python issues, function-level accuracy:

Model Acc@10 Acc@15
SweRank-Large (7B)† 63.2 67.3
Muninn (346M) 60.2 65.7
SweRank-Small (137M)† 58.6 63.4
Muninn-small (47M) 46.4 51.6

CoIR text-to-code — NDCG@10:

Model APPS CosQA
bge-code-v1 (1.5B)† 98.1 46.7
voyage-code-3 (API)† 93.6 34.5
Qwen3-Embedding-8B† 91.1 38.0
Muninn (346M) 77.4 31.3
Qwen3-Embedding-0.6B† 75.3 36.5
Muninn-small (47M) 12.4 35.1

CodeSearchNet — mean NDCG@10 over six languages (Python, JavaScript, Go, Ruby, Java, PHP; 1,000 queries per language):

Model Mean NDCG@10
Qwen3-Embedding-8B† 92.7
Qwen3-Embedding-0.6B† 91.0
Muninn (346M) 90.1
SweRank-Small (137M) 87.9
SweRank-Large (7B) 85.0
Muninn-small (47M) 77.8

Muninn-small is specialized for repository-scale function retrieval; the APPS number shows it is not a general text-to-code model for competitive-programming-style queries.

Languages

C, C++, C#, Go, Java, JavaScript, PHP, Python, Rust, Scala, and TypeScript.

License and attribution

Muninn-small is released under the Apache License 2.0. It is derived from ibm-granite/granite-embedding-small-english-r2, also released under Apache-2.0. See LICENSE for the full license text.

Downloads last month
17
Safetensors
Model size
47.7M params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for brokkai/Muninn-small

Finetuned
(2)
this model