lsjpre-qwen3-8b-tiebreak

LoRA adapter that fine-tunes Qwen/Qwen3-8B as a tie-breaker for the lsjpre OV (OCR-voted) canonical-text pipeline. When the existing per-row vote across Tesseract / Qwen / Claude / GCV / Gemini / Logeion / lsj.txt / lsj.gr leaves a candidate tie or near-tie, the live pipeline POSTs a multi-letter MCQ to this model: {"prompt": "Row context: '<left>[?]<right>'\n\nCandidates for [?]:\nA) <c0>\nB) <c1>\nC) <c2>\n\nAnswer:", ...} and the model returns one capital letter naming the most plausible reading.

Versions

Tag Description
adapter_v1 Original adapter trained on synthetic distractors (Latin mojibake / punct-drop / near-miss).
main (= v2) Augmented training set adds 5,000 script-confusion hard negatives (e.g. Latin Od. vs Greek-omicron Οd.). Fixes the v1 regression of preferring Greek glyphs in Latin citation tokens.

To restore v1 weights: huggingface-cli download ciscoriordan/lsjpre-qwen3-8b-tiebreak --revision adapter_v1 --local-dir <dir>.

Training (v2)

  • Base: Qwen/Qwen3-8B, 4-bit NF4 via bitsandbytes
  • Targets all 7 linear layers (q/k/v/o_proj, gate/up/down_proj)
  • LoRA rank 16, alpha 16, dropout 0.05
  • 1 epoch on 45,001 training examples (40,001 v1 + 5,000 hard-neg)
  • Best val_acc on hard-neg val: 1.0000 (at step 1000 of 2812)
  • Best val_acc on original val: 0.9580
  • Training time: ~37 min to reach best (step 1000) on a single RTX 4090; interrupted at step 1535 since val_acc had plateaued.

Evaluation

Adapter Original val_acc (500-row cap) Script-confusion val_acc (500 rows)
v1 0.9420 0.2360
v2 0.9580 1.0000

The hard-negative val set is in this repo as script_confusion_eval.json. Each row is a 3-way MCQ where the correct answer is a Latin-script citation token (e.g. Od., Hdt., Th.6.59) and one distractor is the same token with all uppercase Latin letters folded to their Greek visually-identical lookalikes (Οd., Ηdt., Τh.6.59). The third distractor is a longest-common-substring near-miss from the corpus.

Pipeline integration

The live pipeline gates Qwen calls behind:

  • LSJPRE_QWEN_TIEBREAK=1 master enable.
  • LSJPRE_QWEN_TIEBREAK_MARGIN near-tie margin threshold (default 1.0 = strict-tie only; recommended near-tie value is 1.2). Higher values consult Qwen on more rows; the v2 adapter is calibrated for this near-tie expansion.

Three runtime gates apply when MARGIN > 1.0:

  1. Margin gate: skip Qwen if winner-vs-runner-up weight ratio exceeds the margin threshold.
  2. Content-shape gate: skip Qwen if the winning candidate has no low-confidence shape signal (script-mix, Greek-Latin confusable lookalike, mid-word punctuation).
  3. Response-confidence gate: only accept Qwen replies whose first non-whitespace alpha char is a single letter; reject hedging replies like "I think A or B", "Hmm, A maybe".

See scripts/qwen_tiebreak.py in the lsjpre repo for the full client implementation.

Downloads last month
7
GGUF
Model size
8B params
Architecture
qwen3
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for ciscoriordan/lsjpre-qwen3-8b-tiebreak

Finetuned
Qwen/Qwen3-8B
Adapter
(2050)
this model