wordle-rl-gemma3-270m
Gemma 3 270M (instruction-tuned), fully fine-tuned to play Wordle through text. This is the final model of the paper Five Letters, 270M Parameters: How Far Can a Tiny Language Model Go at Wordle? (Aafi Khan Malek, 2026). Code, data and paper source: github.com/Aafimalek/wordle-rl.
Live demo (runs in your browser) · ONNX copy · DOI 10.5281/zenodo.24114970
All training ran on free Kaggle T4 GPUs. Training rounds: imitation of a solver that plays clue-consistent words, a balanced spelling drill, and one recovery round on the model's own rejected words (run sft-gemma270m-v10-s1, checkpoint chosen on the selection split).
Results
Scored once on held-back test sets, for a model declared before any test set was scored. Win rate in %; guesses per win in brackets.
| Set | Alone, strict rule | Alone, leaderboard rule (open-vocab) | Word-level decoding | Cited GPT-5 |
|---|---|---|---|---|
| WordleBench (100) | 87.0 | 94.0 | 97.0 [3.68] | 99 [3.59] |
| Jeffers Wordle-AI-Benchmark (50) | 74.0 | 88.0 | 96.0 [3.75] | 100 [3.58] |
| rare answers (500) | 42.2 | 51.4 | 76.6 [4.60] | – |
| TextArena Wordle-v0, adapted (500) | 85.8 | – | 98.6 [3.59] | – |
- Strict rule: a guess outside the 12,972-word Wordle dictionary gets no feedback and still uses a turn.
- Open-vocab: any five letters get feedback, as on the WordleBench and Jeffers leaderboards (neither checks a dictionary).
- Word-level decoding: the output is limited to dictionary words, ranked by the model's own log-probabilities; the clues are never used by the code. Implemented in
fiveletters/constrain.pyin the repository. - Cited scores come from other harnesses with other prompts and settings.
Prompt format
The model reads a board with spaced letters and answers with a state summary and a spaced guess. Use greedy decoding.
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "aafimalek2032/wordle-rl-gemma3-270m"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo)
prompt = (
"Guess the hidden 5-letter English word in at most 6 turns.\n"
"Feedback per letter: G = right letter, right spot. Y = in the word, wrong spot. X = not in the word.\n"
"Reply with <state>what you know</state> then <guess>C R A N E</guess>.\n"
"Turn 1: C R A T E -> X X Y Y X\n"
"Turns left: 5"
)
ids = tok.apply_chat_template([{"role": "user", "content": prompt}], add_generation_prompt=True, return_tensors="pt")
out = model.generate(ids, max_new_tokens=96, do_sample=False)
print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True))
# <state>fixed: _ _ _ _ _ | has: A(not 3) T(not 4) | out: C E R</state>
# <guess>T A I L S</guess>
A rejected guess appears on the board as Turn k: S A T O N -> INVALID (not in word list). To play full games, the evaluation rules and word-level decoding, use the repository: python -m fiveletters eval --policy hf --model <local folder> --split wordlebench --constrain wordle --constrain-mode word. fiveletters_format.json records the prompt format.
Limitations
- Trained for one game; it is not a general assistant.
- Rare answers (outside the classic Wordle answer list) are hard: 42% alone.
- Alone, about 10% of its turns on the 534-word selection set are non-words (17% on Jeffers, 22% on the rare answers); most remaining losses contain several non-words late in a game. Word-level decoding removes them.
- The spelling drill used common English words as targets, including words that are answers in the test sets (never as the answer of a training game). The paper discusses this.
Licence
This model is a derivative of Gemma 3 and is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms, including the Gemma Prohibited Use Policy. The training code is Apache-2.0.
Citation
@misc{malek2026fiveletters,
title = {Five Letters, 270M Parameters: How Far Can a Tiny Language Model Go at Wordle?},
author = {Malek, Aafi Khan},
year = {2026},
doi = {10.5281/zenodo.24116756},
url = {https://doi.org/10.5281/zenodo.24116756}
}
Code: 10.5281/zenodo.24114970 · Author ORCID: 0009-0008-3211-5028