Qubi-LLM 9B Distill

ํ•œ๊ตญ์–ด ์š”์•ฝ ยท Code: https://github.com/qubicom1/qubi-llm

A Korean telecom-domain answer model for retrieval-augmented generation (RAG). It is Qwen/Qwen3.5-9B fine-tuned (SFT) on answers from Qwen/Qwen3.8-27B, keeping only teacher answers that a local judge rated as grounded in the retrieved documents. It was trained in exactly the prompt format of the Qubi-LLM RAG service.

Status: experimental. This version has not been deployed in production. Read Limitations before use.

Intended use

  • Answering telecom questions (3GPP ยท IETF RFC ยท ITU ยท O-RAN ยท 6G research) from documents you retrieve and put in the prompt, in Korean, with [์ถœ์ฒ˜ N] citation labels.
  • Use it inside a RAG pipeline such as Qubi-LLM (retrieval + reranker grounding gate + refusal guard).

Out of scope: closed-book use without documents. Like the base model, it can state spec numbers and figures that do not exist when no documents are given. Do not use its answers as authoritative standards text without checking the cited sources.

Prompt format

The model was trained with the Qubi-LLM production messages:

  • System: SYSTEM_PROMPT in src/qubi/core/api/rag_service.py (friendly Korean tone, cite [์ถœ์ฒ˜ N], say "์ œ๊ณต๋œ ๋ฌธ์„œ์—์„  ํ™•์ธ์ด ์–ด๋ ค์›Œ์š”" for anything not in the documents, end with a <<RELATED>> line).
  • User:
์ฐธ์กฐ ๋ฌธ์„œ:
[์ถœ์ฒ˜ 1]
Spec   : TS 38.300 ...
<document text>
[์ถœ์ฒ˜ 2]
...
์งˆ๋ฌธ: <question>

์œ„ ์ฐธ์กฐ ๋ฌธ์„œ๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ์ •ํ™•ํ•˜๊ฒŒ ๋‹ต๋ณ€ํ•ด์ฃผ์„ธ์š”.
๐Ÿ“Œ ์ธ์šฉ ๊ทœ์น™(ํ•„์ˆ˜): ...
  • Output: the answer, followed by one line of related follow-up questions that the service strips before display:
<answer with [์ถœ์ฒ˜ N] labels>

<<RELATED>>["follow-up 1", "follow-up 2", "follow-up 3"]

Thinking is off: render the chat template with enable_thinking=False.

Usage

vLLM (OpenAI-compatible):

vllm serve <this-repo> --max-model-len 16384 --gpu-memory-utilization 0.25
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
resp = client.chat.completions.create(
    model="<this-repo>",
    messages=[{"role": "system", "content": SYSTEM_PROMPT},
              {"role": "user", "content": user_message_with_documents}],
    temperature=0.1, max_tokens=1024,
    extra_body={"chat_template_kwargs": {"enable_thinking": False}},
)

Transformers:

from transformers import AutoTokenizer, AutoModelForImageTextToText
tok = AutoTokenizer.from_pretrained("<this-repo>")
model = AutoModelForImageTextToText.from_pretrained("<this-repo>", dtype="bfloat16", device_map="auto")
text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=False)

The checkpoint keeps the base model's architecture (Qwen3_5ForConditionalGeneration). Only the language model was fine-tuned; the vision encoder is unchanged from Qwen3.5-9B and was not evaluated.

Training

Base model Qwen/Qwen3.5-9B
Teacher Qwen/Qwen3.8-27B (thinking off for answers)
Method QLoRA SFT (4-bit NF4, double quantization), merged into BF16
LoRA r 32, ฮฑ 64, dropout 0.05; language-model attention (incl. linear-attention in_proj_* / out_proj) and MLP projections
Optimization lr 5e-5, cosine, warmup 5 %, 2 epochs, batch 1 ร— grad. accum. 8, 292 steps, bf16
Sequence max length 6,144; loss on the answer tokens only (prompt masked)
Chat template enable_thinking=False for both training and serving
Eval loss 0.629 โ†’ 0.572 (held-out 58 examples; no overfitting)

Data (not released): 1,165 training examples (1,091 answers + 74 refusals) and 58 eval examples.

  • Prompts: Qubi-LLM production messages. Each prompt holds a question plus documents retrieved from our standards knowledge base: 3GPP, IETF RFC, ITU, O-RAN, arXiv, textbook-style notes, synthetic troubleshooting cases and Korean telecom news.
  • Answer filter: teacher answers were kept only if they passed all of the following.
    • The local judge (Qwen3.8-27B, thinking on) rated them core PASS, i.e. the core claims are supported by the documents.
    • They contain citations, and every [์ถœ์ฒ˜ N] points to a provided document.
    • They have a valid <<RELATED>> line and are not truncated.
  • Choosing one answer per question: answers that also passed the strict rule were preferred, then lower temperature.
  • Refusals: correct teacher refusals on questions without supporting documents, capped at 10 % of the set.
  • No benchmark overlap: questions overlapping our evaluation sets were excluded.
  • Company content: a small number of examples (14) are about the developer company itself (a short company / product introduction).
  • No Claude outputs: Anthropic Claude was used only as an independent evaluation judge, never for training data.

Evaluation

Internal evaluation sets (not released): 300 general questions, 88 held-out answerable questions and 48 questions with no supporting documents. Every item ran in a fresh session through the Qubi-LLM pipeline. "No guard" means the pipeline with refusal guards off; "with guard" is the full system.

Local judge (Qwen3.8-27B, thinking on; core ฮบ 0.47 vs Claude)

Base Qwen3.5-9B This model Paired test
No guard: core (grounded) โ†‘ 24.2 % 35.8 % p=0.005
No guard: general answer rate 88.5 % 76.8 % p<0.001
No guard: refusing answerable questions โ†“ 13.3 % 26.6 % p=0.007
No guard: refusing questions with no documents โ†‘ 82.6 % 87.2 % n.s.
With guard: core โ†‘ 28.2 % 35.9 % p=0.071
With guard: refusing answerable questions โ†“ 48.7 % 52.0 % n.s.

Independent check (Claude, core rule, 150 questions both models answered)

Base Qwen3.5-9B This model Paired test (base-only : this-only PASS)
No guard: core โ†‘ 28.0 % 46.0 % 17 : 44, p=0.001
With guard: core โ†‘ 22.7 % 37.3 % 13 : 35, p=0.002

Claude confirms the improvement. The local judge agreed with Claude on 65โ€“68 % of this model's answers, against 79โ€“85 % of the base model's answers. Treat the local-judge numbers above as approximate.

For scale: on the same rule, the 27B teacher itself scores about 52 % core by Claude, against 22 % for the base 9B. Model size is the largest factor.

How the evaluation was built, its pitfalls, and all other results: development history.

Limitations

  • Partial answers. Like its teacher, the model often answers only the part the documents support and says the rest cannot be confirmed. Our judge counts many of these as refusals, which is why the answer rate drops.
  • Refusal phrasing differs from the fixed phrase in the system prompt. A keyword-based refusal detector undercounts its refusals: it counted 27 % refusals on no-document questions where the judge counted 87 %. Detect refusals by judgment, not keywords.
  • Faithfulness is still far from perfect. Even the teacher is about 52 % core by Claude. Always show the cited sources to users.
  • No knowledge gain. Domain fine-tuning did not raise closed-book knowledge scores in our earlier tests (TeleQnA). Value comes from grounded answering inside RAG.
  • Mostly Korean. It was trained and evaluated mainly on Korean questions over English documents.
  • Company content. It may answer basic questions about the developer company.

License

Apache-2.0. The model is a derivative of Qwen/Qwen3.5-9B (Apache-2.0), fine-tuned with answers generated by Qwen/Qwen3.8-27B (Apache-2.0). The modifications are described above. The code is in the GitHub repository under MIT.


ํ•œ๊ตญ์–ด ์š”์•ฝ

ํ†ต์‹  ํ‘œ์ค€ ๋ฌธ์„œ RAG์šฉ ํ•œ๊ตญ์–ด ๋‹ต๋ณ€ ๋ชจ๋ธ์ž…๋‹ˆ๋‹ค. Qwen3.5-9B๋ฅผ Qwen3.8-27B์˜ ๋‹ต์œผ๋กœ SFTํ•œ ์ฆ๋ฅ˜ํŒ์ด๊ณ , 27B ์ฑ„์ ๊ด€์ด "๋ฌธ์„œ์— ๊ทผ๊ฑฐํ•จ(core PASS)"์œผ๋กœ ํŒ์ •ํ•œ ๋‹ต๋งŒ ํ•™์Šต์— ์ผ์Šต๋‹ˆ๋‹ค. ํ•™์Šต ๋ฐ์ดํ„ฐ๋Š” Qubi-LLM ์šด์˜ ํ”„๋กฌํ”„ํŠธ ํ˜•์‹์„ ๊ทธ๋Œ€๋กœ ๋”ฐ๋ž์Šต๋‹ˆ๋‹ค.

  • ์šฉ๋„: ๊ฒ€์ƒ‰ํ•œ ๋ฌธ์„œ๋ฅผ ํ”„๋กฌํ”„ํŠธ์— ๋„ฃ๊ณ  ์“ฐ๋Š” RAG ์•ˆ์—์„œ ์”๋‹ˆ๋‹ค. ๋ฌธ์„œ ์—†์ด ํ˜ผ์ž ์“ฐ๋ฉด ๊ทœ๊ฒฉ์„ ์ง€์–ด๋‚ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • ๊ฒฐ๊ณผ(27B ์ฑ„์ ๊ด€): ๊ฐ€๋“œ ๋” core 24.2 โ†’ 35.8 %(p=0.005), ๊ฐ€๋“œ ์ผฌ 28.2 โ†’ 35.9 %(p=0.071). ๋Œ€์‹  ์ผ๋ฐ˜ ์งˆ๋ฌธ ๋‹ต๋ณ€์œจ์ด 88.5 โ†’ 76.8 %๋กœ ๋‚ฎ์•„์กŒ์Šต๋‹ˆ๋‹ค. ๋ฌธ์„œ๋กœ ๋˜๋Š” ๋ถ€๋ถ„๋งŒ ๋‹ตํ•˜๋Š” ๋ถ€๋ถ„ ๋‹ต์ด ๋Š˜์–ด์„œ์ž…๋‹ˆ๋‹ค.
  • Claude ๊ต์ฐจ ํ™•์ธ(๋‘ ๋ชจ๋ธ์ด ๋ชจ๋‘ ๋‹ตํ•œ 150๋ฌธํ•ญ, core): ๊ฐ€๋“œ ๋” 28.0 โ†’ 46.0 %(p=0.001), ๊ฐ€๋“œ ์ผฌ 22.7 โ†’ 37.3 %(p=0.002).
  • ์ฃผ์˜:
    • ๊ฑฐ์ ˆ ๋ฌธ๊ตฌ๊ฐ€ ๊ณ ์ • ๋ฌธ๊ตฌ์™€ ๋‹ฌ๋ผ ํ‚ค์›Œ๋“œ ๊ฒ€์ถœ๊ธฐ๊ฐ€ ๊ฑฐ์ ˆ์„ ๋†“์นฉ๋‹ˆ๋‹ค.
    • ์‹คํ—˜ํŒ์ด๋ผ ์šด์˜์— ๋ฐฐํฌํ•œ ์ ์ด ์—†์Šต๋‹ˆ๋‹ค.
  • ํ•™์Šต ๋ฐ์ดํ„ฐ์™€ ํ‰๊ฐ€์…‹์€ ๊ณต๊ฐœํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. Claude๋Š” ํ‰๊ฐ€์—๋งŒ ์ผ๊ณ  ํ•™์Šต ๋ฐ์ดํ„ฐ์—๋Š” ์“ฐ์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.
  • ๋ผ์ด์„ ์Šค: Apache-2.0
Downloads last month
227
Safetensors
Model size
9B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for qubicomchat/Qubi-LLM-9B-Distill

Finetuned
Qwen/Qwen3.5-9B
Finetuned
(1,606)
this model