CoolFace
Modelpublic

hxgdzyuyi/qwen3-8b-steam-entity-linking

sourceHugging Faceapache-2.0updated 1mo agoView on Hugging Face
0likes10downloads
Model Card

Qwen3-8B Steam Entity Linking — PoC A

This adapter maps Steam game names and related expressions to one-token labels such as <GAME_730>. It must be loaded with the tokenizer in this repository and the pinned base-model revision below.

Reproducibility

  • —Base model: Qwen/Qwen3-8B-Base
  • —Base revision: 49e3418fbbbca6ecbdf9608b4d22e5a407081db4
  • —Training Git commit: c4d33e6e7c435947e5856bd723814795b067404c
  • —Training source: https://github.com/hxgdzyuyi/qwen-steam-entity-linking.git
  • —Training data: 1000 entities × 4 prompt styles = 4000 rows
  • —Selected checkpoint: epoch 8
  • —Precision: BF16
  • —Method: entity-only classification loss over the added labels, LoRA r=64, alpha=128, plus trainable added-token rows in the LM head

Evaluation

EpochCanonical entity top-1Held-out alias entity top-1
299.55%54.62%
499.80%53.12%
6100.00%55.57%
8100.00%55.98%
10100.00%55.98%

Canonical accuracy covers every entity across every configured prompt. Alias accuracy covers 184 frozen inputs across the same 4 prompts (736 rows) and uses entity-constrained top-1. The selected checkpoint is the alias-best checkpoint among those reaching the canonical threshold; publication additionally requires the alias threshold.

Usage

Load the tokenizer from this repository, resize Qwen/Qwen3-8B-Base to the tokenizer length, and then load the PEFT adapter. Do not use the base tokenizer without the added <GAME_APPID> tokens.

python
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

adapter_id = "hxgdzyuyi/qwen3-8b-steam-entity-linking"
tokenizer = AutoTokenizer.from_pretrained(adapter_id)
base = AutoModelForCausalLM.from_pretrained(
    "Qwen/Qwen3-8B-Base", revision="49e3418fbbbca6ecbdf9608b4d22e5a407081db4"
)
base.resize_token_embeddings(len(tokenizer))
model = PeftModel.from_pretrained(base, adapter_id)

# Score one controlled prompt and choose only among registered entity labels.
prompt = "游戏信息:CS2\nSteam AppID:"
inputs = tokenizer(prompt, return_tensors="pt")
entity_ids = tokenizer.convert_tokens_to_ids(
    tokenizer.additional_special_tokens
)
logits = model(**inputs).logits[0, -1, entity_ids]
predicted_id = entity_ids[int(logits.argmax())]
print(tokenizer.convert_ids_to_tokens(predicted_id))

Limitations

The latest 900 games may not be represented in the base model's pretraining knowledge, so alias and natural-language generalization can be weaker for recent releases. This is a memorization/generalization PoC, not a replacement for a retrieval-backed production entity linker. Steam catalog names and AppIDs can also change over time.