Downloads · 30 days
0
chayuto/gemma-4-e2b-klondike-orpo-research
gemma-4-e2b-klondike-orpo-research is a machine learning model from chayuto. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for mlx. The card lists the license as apache-2.0.
This is a research checkpoint, not a usable Solitaire player. It is published to accompany the klondike-llm-decisions dataset and a study of whether preference optimization can fix a behavioral failure that imitation…
Downloads · 30 days
0
Access
Public
Updated Jun 8, 2026
Repo size
50.9 MB
Likes
0
Public
Click a slice to open those files.
.safetensors50.9 MB · 100%
From the Hugging Face model README
This is a research checkpoint, not a usable Solitaire player. It is published to accompany the klondike-llm-decisions dataset and a study of whether preference optimization can fix a behavioral failure that imitation distillation cannot. On favorable deals it plays meaningfully better than the untuned base, but it still loops on many deals and does not win games. Do not deploy it as an advisor.
A LoRA adapter for mlx-community/Gemma4-E2B-IT-Text-int4 (Gemma 4 E2B,
text-only, int4), trained with ORPO (odds-ratio preference optimization) on
"move-contrast" preference pairs mined from real Gemma-4-31B teacher games. Each
pair holds the board state fixed and differs only in the final move: the
chosen move advances the game (plays a card to a foundation, or reveals a
face-down card), the rejected move is a no-progress tableau shuffle, often the
exact move that perpetuates a loop.
LoRA: rank 16, scale 2.0, dropout 0.05, applied to all attention and MLP projections over 16 layers. This is the iteration-300 checkpoint, selected by full-game play rather than validation loss (see Limitations).
A 31B teacher plays Klondike but frequently falls into doom-loops: it oscillates a movable run between two columns for hundreds of turns instead of progressing. Distilling that teacher into a small student by supervised fine-tuning (SFT) reproduces the loop verbatim. On a canonical winnable deal, the untuned base and an SFT checkpoint are byte-identical failures, 300 of 300 moves are the same back-and-forth shuffle with zero foundation progress. SFT cannot teach "do not loop," because the behavior is present in the teacher's own (even winning) demonstrations and imitation has no contrastive gradient against it. ORPO supplies that missing gradient: the rejected side of every pair is the loop/shuffle move.
Full-game self-play on solver-confirmed winnable deals, scored by foundation
cards reached (fc, out of 52 to win):
| deal seed | this checkpoint (max fc) | untuned / SFT base (max fc) |
|---|---|---|
| 2853966634 | 8 (genuine multi-step play) | 2 (then loops) |
| 2967897202 | 3 | 2 |
| 3263196305 | 0 (loops) | 0 (loops) |
On favorable deals it reaches roughly 4x the progress ceiling of the base with real multi-step tableau play. But it does not cure looping: it makes more progress before looping where progress moves are available, and on deals where the model must first create its own opportunities it loops at fc=0 like the base.
The honest summary: move-contrast ORPO raises the achievable progress ceiling where progress moves exist; it does not confer the multi-step planning needed to escape loops in general.
The int4 Gemma 4 base needs a small loader patch (sanitize() for the KV-shared
layers) before mlx_lm.load. The 15-line gemma4_text_patch.py is included in
this repo.
import gemma4_text_patch # applies the KV-shared sanitize fix on import
from mlx_lm import load, generate
model, tok = load(
"mlx-community/Gemma4-E2B-IT-Text-int4",
adapter_path="path/to/this/adapter",
)
The model expects a Klondike state prompt (board, legal moves, recent moves) and
emits a JSON decision containing a move_index. See the dataset card for the
prompt format.
8C_to_9H into the integer move field, producing invalid JSON. This early checkpoint is the play-best.mlx-community/Gemma4-E2B-IT-Text-int4 (Gemma 4 E2B text, int4).chayuto/klondike-llm-decisions (Gemma-4-31B teacher games).Released under apache-2.0 to match the int4 text-only base used here. Verify the base model's terms before redistribution.