Instructions to use Sentovara/qwen2.5-7b-first-time-player with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Sentovara/qwen2.5-7b-first-time-player with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Sentovara/qwen2.5-7b-first-time-player") model = AutoModelForCausalLM.from_pretrained("Sentovara/qwen2.5-7b-first-time-player", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Qwen2.5-7B First Time Player
Sentovara, Mission 006 "First Time Player".
This is Qwen2.5-7B-Instruct after it taught itself to play 10 small text games it had never seen before, purely from practice. Nobody gave it rules or examples. It only saw the screen, the buttons, and its score going up or down.
The learned changes (about 0.1% of the weights) have been folded back into the model, so this is a single, normal model. Nothing is attached to it.
What it can do
Each game shows a short text screen and a few buttons (for example left, right, A). The model picks a button and the game returns a new screen and a score. Each round lasts 60 moves.
Average score per round over 50 test layouts the model never practised on:
| Game | Base model (untrained) | Small learner from scratchยน | Frozen model + small learnerยน | This method (4-run average)ยฒ | This modelยณ |
|---|---|---|---|---|---|
| Cargo | 0.1 | 0.1 | 0.0 | 0.0 | 0.0 |
| Shelter | โ35.4 | โ21.9 | โ5.4 | โ17.7 | โ13.0 |
| Crossing | โ3.2 | 5.2 | 3.4 | 1.5 | โ0.7 |
| Weave | โ7.2 | 22.9 | 48.8 | 46.5 | 46.2 |
| Pulse | โ54.5 | 0.4 | โ0.1 | 14.9 | 50.4 |
| Echo | 11.2 | 8.4 | 10.8 | 9.4 | 7.8 |
| Pressure | โ7.0 | 49.9 | 106.7 | 108.7 | 101.3 |
| Parcel | โ17.2 | 9.1 | 37.2 | 105.8 | 105.6 |
| Ledger | 7.5 | 64.5 | 78.2 | 73.8 | 89.1 |
| Tether | โ21.2 | โ3.4 | 3.3 | 0.2 | 4.2 |
| Mean | โ12.7 | 13.5 | 28.3 | 34.3 | 39.1 |
ยน Earlier approaches from the same mission, 2,000 practice moves per game, average of 3 runs. ยฒ Average over 4 independent training runs (31.3, 38.3, 31.1, 36.6). ยณ The checkpoint released here: run "seed 1", averaged copy, scored right after learning each game. Pressing random buttons averages โ5.4.
With 4,000 practice moves per game, this method averaged 34.3 across 4 runs, above both earlier approaches, which had 2,000 moves (13.5 and 28.3). At an equal budget of 2,000 moves it roughly ties the frozen-model approach (29.4 vs 28.3 over 3 matched seeds). Its clear advantage is on Parcel, a game where reading the screen's words matters, where it scores 87 to 106 against 37.
Forgetting: the games are learned one after another. After all 10, this model keeps most of what it learned: Parcel 107, Pressure 103, Ledger 89, Weave 40. Shelter and Echo also hold up.
How it was trained
- Base: Qwen/Qwen2.5-7B-Instruct, bf16.
- What changes: a LoRA slice (rank 16 on q, k, v and o projections, about 10M parameters), later merged into the weights.
- Learning rule: double Q-learning. The model's own output for each button number (
1,2,3โฆ) is read as "how many points this button is worth here". - Practice: 4,000 moves per game, played as 16 copies at once on new layouts each round.
- Exploring: all random at first, fading to 1 in 20 random moves by move 900.
- Replay: it practises on a store of past moves, half from the current game and half from earlier games, to limit forgetting.
- Averaged copy: the released weights are an averaged copy kept during practice, with each update moving the copy 1% towards the current weights.
- Training settings: learning rate 1e-4, discount 0.95, batch 32, target copy synced every 25 updates.
- Hardware: one NVIDIA A10G (AWS
ml.g5.2xlarge), about 4.3 hours per full run of 10 games.
How to use it
It is meant to be used as a scorer of buttons, not as a chatbot.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
name = "Sentovara/qwen2.5-7b-first-time-player"
tok = AutoTokenizer.from_pretrained(name)
model = AutoModelForCausalLM.from_pretrained(name, torch_dtype=torch.bfloat16, device_map="auto")
SYSTEM = ("You are playing a game you have never seen before. You get no rules. Read the screen "
"and choose the button you think will raise your score. Reply with the button number only.")
def choose(screen: str, buttons: list[str]) -> int:
user = ("Screen:\n" + screen + "\n\nButtons:\n" +
"\n".join(f"{i+1}. {b}" for i, b in enumerate(buttons)) +
"\n\nWhich button? Reply with the number only.")
text = tok.apply_chat_template([{"role": "system", "content": SYSTEM},
{"role": "user", "content": user}],
tokenize=False, add_generation_prompt=True)
ids = tok(text, return_tensors="pt").to(model.device)
with torch.no_grad():
logits = model(**ids).logits[0, -1]
digits = [tok.convert_tokens_to_ids(str(i + 1)) for i in range(len(buttons))]
return int(torch.argmax(logits[digits])) # index of the chosen button
Pick the button whose number has the highest score, as above. Letting the model generate free text works less reliably.
Limits
- It was trained and tested only on 10 small text games built for this mission. It is not a general game-playing model, and how well it carries over to other games is untested.
- This is one checkpoint from one training run. Scores vary from run to run (run averages ranged from 31 to 39).
- Some games stay hard: it scores about 0 on Cargo, like every approach tested.
- At the same practice budget as the earlier approaches, it does not beat them overall. It is ahead on Parcel and behind on most other games. It pulls ahead only with more practice.
- Its general chat ability was not tested after training and may have changed.
License
Released under Apache-2.0, the same licence as the base model, Qwen/Qwen2.5-7B-Instruct.
Made by
Sentovara (sentovara.com). Mission 006 was designed and run by Jonathan Harriss, with the training work done with Claude (Anthropic).
- Downloads last month
- 17