Downloads · 30 days
0
jackyk02/qwen3-8b-dqa-head-302m-midtrained
qwen3-8b-dqa-head-302m-midtrained is a machine learning model from jackyk02. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Warm-started from the pre-trained 302M checkpoint and mid-trained on Gemini-generated hard negatives (K<=10 per pair, weight 1.0, doc-masked bidirectional InfoNCE), shard00 chunks 0000-0027, early-stopped on hard-nega…
Downloads · 30 days
0
Access
Public
Updated Sep 20, 2026
Repo size
1.2 GB
Likes
0
Public
Click a slice to open those files.
.pt1.2 GB · 100%
From the Hugging Face model README
| encoder | Qwen/Qwen3-8B, last-token pooled, L2-normalised (frozen) |
| head | two-tower GELU MLP, 4096 → 32768 → 512, no LayerNorm |
| parameters | 302.1M (both towers + learnable temperature) |
| stage | mid-trained on hard negatives |
| training data | 28 chunks of hard-negative-covered QA pairs |
| batch / LR | 4096 / 5.00e-04 const |
| general val loss / top-1 | 0.7447 / 71.6% |
| hard-neg val loss / top-1 | 1.1101 / 56.7% |
| best-of-10 selection acc | 67.2% |
| initialised from | run_bh623_w32768.pt |
| metric (held-out, shard_00/0028-0029 with negatives; general = shard_05/0083-0084) | before | after |
|---|---|---|
| general val loss | 0.7257 | 0.7447 |
| general top-1 | 73.5% | 71.6% |
| hard-neg val loss | 1.4536 | 1.1101 |
| hard-neg top-1 | 40.9% | 56.7% |
| best-of-10 selection | 46.4% | 67.2% |
Warm-started from the pre-trained 302M checkpoint and mid-trained on Gemini-generated hard negatives (K<=10 per pair, weight 1.0, doc-masked bidirectional InfoNCE), shard_00 chunks 0000-0027, early-stopped on hard-negative val loss (best at epoch 3, stopped at epoch 5). Deviation from the reference recipe: batch 4096 and LR 5e-4 instead of 16384 / 1e-3 -- a 302M head with 10 negatives per row does not fit a 40 GB GPU at the larger batch; all negatives were kept so the loss definition is unchanged. Cost: general val loss rose 0.726 -> 0.745 (+0.019) while best-of-10 selection rose 46.4% -> 67.2% (+20.8 pts).
best_head.pt — torch.save dict with state_head / action_head state dicts,
logit_scale, and the training cfg.import torch
ck = torch.load("best_head.pt", map_location="cpu", weights_only=False)
cfg = ck["cfg"] # width=32768, depth=2, layernorm=False
# build two heads with experiments/scaling_projection_head.make_head(width, gen, device, depth,
# 512, activation=cfg.get("activation","gelu"), layernorm=cfg.get("layernorm",False),
# residual=cfg.get("residual",False)) and load_state_dict each tower.
Inputs are Qwen3-8B last-token embeddings (4096-d, L2-normalised); the question side prepends the source document. Score = cosine(state_head(q), action_head(a)) × exp(logit_scale).
Code and training logs: https://github.com/jackyk02/contrastive_learning