BanhTrangPhoi-L20-GGUF
Q8_0 GGUF of EVOKA/BanhTrangPhoi-L20, a 20-layer, 125k-vocabulary distilled student of BAAI/bge-m3. The base repo has the full description, training summary, other formats and the complete gate tables; this card covers only the GGUF file.
Status and honest limits
- Inherited from the L20 student: the tier-1 release gate against the original bge-m3 was NOT passed (13 cells outside non-inferiority for this file: Chinese/Korean cross-lingual MKQA cells with n = 250, dense Korean ALL recall@50 -1.72, dense Vietnamese ALL recall@50 -0.40). Tier 2 (ar/es/fr/hi/id/ru/th) is within limits in all four modes (
allmean delta -0.95). Details:GATE.md. - Against the L20 fp16 student the Q8_0 file is almost lossless: every tier-1 ALL cell is within 0.4 points (worst: Vietnamese dense recall@20 -0.35), Korean ALL recall@20 in
allmode +0.00 (CI [-0.53, +0.53]), tier-2 mean delta vs fp16 -0.04. - GPU and CPU runs of the same file give the same ranking on the cross-check pool we ran on both (95 queries, 8,097 documents): recall@20/50 identical in all four modes, nDCG@10 differences <= 0.3 points (one query).
- Not measured: texts longer than 512 tokens (all gates use max_len 512), other quantisations.
Tier 1, ALL cells, mode all, recall@20 in %, bge-m3 -> this model: vi 94.6 -> 95.1, ja 100 -> 100, en 98.9 -> 100, zh 91.1 -> 90.4, ko 89.9 -> 89.7.
Files
| file | content |
|---|---|
BanhTrangPhoi-L20-Q8_0.gguf |
the model (architecture bert, 20 blocks, vocab 125,000, Q8_0, 441 MB). The embedded general.name reads "Gpu Fp16"; this is only a label from the conversion. |
heads/ |
sparse_linear.pt, colbert_linear.pt (bge-m3 sparse and ColBERT heads), tokenizer.json, id_map_new2old.json / id_map_old2new.json (pruned id <-> original bge-m3 id), PRUNE_INFO.json |
GATE.md |
gate tables |
How we run it (verified)
llama.cpp returns the transformer hidden states; the three bge-m3 outputs are computed client-side from them (dense = L2(CLS), sparse = relu(Linear(h)) per token, ColBERT = L2(Linear(h[1:]))):
llama-server -m BanhTrangPhoi-L20-Q8_0.gguf --embedding --pooling none \
-c 8192 -ub 8192 -b 8192 --port 18099 --no-webui # add -ngl 99 for GPU builds
import numpy as np, requests, torch
from tokenizers import Tokenizer
heads = "heads"
tk = Tokenizer.from_file(f"{heads}/tokenizer.json"); tk.enable_truncation(512)
sp = torch.load(f"{heads}/sparse_linear.pt", map_location="cpu", weights_only=True)
cb = torch.load(f"{heads}/colbert_linear.pt", map_location="cpu", weights_only=True)
sw, sb = sp["weight"].float().numpy(), sp["bias"].float().numpy()
cw, cbias = cb["weight"].float().numpy(), cb["bias"].float().numpy()
l2 = lambda x: x / np.linalg.norm(x, axis=-1, keepdims=True)
def encode(text, url="http://127.0.0.1:18099"):
ids = tk.encode(text).ids # includes <s> ... </s>; pruned vocabulary
r = requests.post(f"{url}/embedding", json={"content": ids}).json()
h = np.asarray((r[0] if isinstance(r, list) else r)["embedding"], dtype=np.float32) # (len(ids), 1024)
assert h.shape[0] == len(ids)
dense = l2(h[0]) # CLS vector
sparse_w = np.maximum(h @ sw.T + sb, 0.0)[:, 0] # one weight per token (skip ids 0,1,2,3 and weights <= 0 when building the lexical dict)
colbert = l2(h[1:] @ cw.T + cbias) # (len-1, 1024)
return dense, ids, sparse_w, colbert
Send token ids from the included tokenizer (the vocabulary is pruned, so ids differ from bge-m3's) and check that the number of returned vectors equals the number of ids. We tested a CPU build and a CUDA build of llama.cpp (exact commit not recorded); any build that loads the bert architecture with --pooling none should work.
For a dense + BM25 setup you only need dense. If you only want dense vectors, the ONNX variants in the base repo are simpler to deploy.
Speed and memory (CPU, indicative)
Same box and caveats as the base card (aarch64 Cortex-X925/A725, 16 threads for the base-repo ONNX runs; llama-server with 4 slots and 16 threads here; other jobs running, load average about 12). All three heads computed; b1 = batch-1 latency p50 in ms, b64 = throughput in texts/s (64 concurrent texts), RSS includes the server process.
| input | b1 p50 / p95 | b64 | RSS |
|---|---|---|---|
| query, 32 tokens | 118 / 132 ms | 12.1 | 1.4 GB |
| passage, 256 tokens | 401 / 435 ms | 3.1 | 1.6 GB |
| passage, 512 tokens | 739 / 766 ms | 1.7 | 1.9 GB |
On this machine the llama.cpp CPU path is slower than the ONNX int8 variant (84.9 / 12.0 / 5.5 texts/s for the same inputs); the main reasons to use GGUF are the small file, low RAM and GPU offload. In our gate runs on the cross-check pool, document encoding took 2,864 s on CPU (one request at a time) and 815 s on GPU (-ngl 99, 16 parallel slots, concurrent requests).
Training data and license
MIT (the teacher, BAAI/bge-m3, is MIT-licensed); credit the teacher when you use this model. Training data includes FineWeb-2 (ODC-By 1.0), C4 (ODC-By 1.0), Aya (Apache-2.0), OASST1 (Apache-2.0), TyDi QA questions (Apache-2.0), Wikidata (CC0). MIRACL, MKQA and MLDR were used for evaluation only. The licences of the individual sources apply to those sources; no claim is made here about the licence status of any other data.