# Sly Cooper and the Thievius Raccoonus and Sly 2 (PS2): A local fine-tuned model that proposes matching C++ for PS2 functions, trained on the Sly Cooper games

> Source: <https://reversedwithai.com/p/ps2-decomp-assist-sly-cooper-gemma-local-model>
> Published: 2026-11-20 10:44:22+00:00

**Recommendation:** Verify decompilation proposals by rebuilding them with the project's own compiler and counting only byte-identical matches, and benchmark against a frontier zero-shot model before trusting a small fine-tune.
More in the playbook "Evals and testing for LLM apps": <https://wpnews.pro/playbooks/evals-testing>

## What was done

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.

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.

## Discussion

[Your library](https://reversedwithai.com/library)

## Sources

Sources reviewed · Added

An AI model drafted this entry from the sources above. An automated check matched its claims against them on 20 Nov 2026. The figures are the author's. [How entries are checked.](https://reversedwithai.com/about#method) [Something wrong? Tell me.](https://reversedwithai.com/policy#takedown)
