<!-- Canonical page: https://reversedwithai.com/p/ps2-decomp-assist-sly-cooper-gemma-local-model -->
Canonical page: https://reversedwithai.com/p/ps2-decomp-assist-sly-cooper-gemma-local-model

# A local fine-tuned model that proposes matching C++ for PS2 functions, trained on the Sly Cooper games

> A small Gemma model proposes C++ for short PS2 functions and a compiler check keeps only byte-identical matches.

The model proposes C++ for PS2 functions of at most 400 bytes and each proposal is rebuilt with the decompilation project's own compiler. The README reports exact matches for part of 150 held-out functions.

## Key facts

- Target: Sly Cooper and the Thievius Raccoonus and Sly 2 (PS2)
- Category: Games and mods
- Platform: PS2 (MIPS R5900), Apple silicon
- Models: Gemma 4 E2B (fine-tuned), Claude Sonnet 5.5
- Tools: MLX, LoRA, Matching decompilation
- Outcome: Partial
- Checks: Source available: yes; Repro steps: not reported; Real hardware: not reported; Verified by others: not reported
- Author: [Blightwidow](https://github.com/Blightwidow)
- Added: 2026-11-20
- Updated: 2026-11-20
- Sources reviewed: 2026-11-20 (automated reviewer)

## What was done

ps2-decomp-assist is a fine-tuned Gemma 4 E2B model (LoRA adapters, MLX, Apple silicon) that proposes C++ for small PS2 functions written in MIPS R5900 assembly, at most 400 bytes each. Each proposal is checked with the decompilation project's own compiler and comparer, and only a candidate that rebuilds byte-identical and passes the project's rule checks is reported as a match. It was trained and measured on Sly Cooper and the Thievius Raccoonus and on Sly 2 (NTSC-U).

### How it was done

The README says training pairs came from assembly generated from discs the authors own and from the authors' own decompiled source. It says no disc data, assembly, dataset, compiler or SDK file is in the repository, and a guard test checks for this. A Claude Code skill lets an agent call the command line tool, and Claude Sonnet 5.5 co-author trailers appear on the commits.

### Results

On 150 held-out functions the README gives exact-match rates for the adapters against a few-shot baseline, and says functions up to 100 bytes reach 48.6 percent at 8 samples while almost nothing matches above 200 bytes. It also reports that zero-shot Claude Haiku matched more functions than the local model in a 20-function comparison.

## Sources

- [Repository](https://github.com/Blightwidow/ps2-decomp-assist)

Figures are reported by the author and not measured by this site, except the commit history. Entry drafted with AI from the linked sources and checked against them.

Cite as: Blightwidow (2026). A local fine-tuned model that proposes matching C++ for PS2 functions, trained on the Sly Cooper games. Reversed with AI. https://reversedwithai.com/p/ps2-decomp-assist-sly-cooper-gemma-local-model
