/ Модель

Характеристики

Контекст
262 144 токена
Лицензия
Apache 2.0
Архитектура
gemma4_unified · dense
Базовая модель
gemma-4-12b-it
Библиотека
transformers
Опубликована
12 июн 2026

mafia-gemma-4-12B-it

Генерация текстаТекст → текст3 профессии

Дообученная Gemma 4 12B для управления игровым агентом в Mafia и Werewolf: выбора роли-зависимых действий, обсуждения и голосования.

23скачиваний за 30 дней0лайковвеса обновлены15 июн 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Mafia Gemma 4 12B IT — специализированная диалоговая модель, разработанная для игровых агентов Mafia и Werewolf. Это дообученная методом LoRA SFT модель unsloth/gemma-4-12b-it, доступная в репозитории в виде объединённых весов Transformers; метаданные указывают формат safetensors. По карточке, обучение ориентировано на партии с семью игроками и ролями мафии, детектива, доктора и мирных жителей. Контекст обучения — 4096 токенов.

Модель формирует допустимые игровые действия и краткие сообщения для обсуждений, обвинений, защиты, заявлений о роли и голосования. Она также обучена учитывать подозрения, утверждения игроков и сведения о роли, а также выбирать ночные действия. Предназначена для игрового агента с проверкой действий игровым движком, разделением публичной и приватной информации и управлением ходами модератором. Лицензия — Apache-2.0.

Карточка приводит результаты 24 полных партий, поэтому показатели относятся к небольшому игровому тестированию и не являются общей оценкой рассуждений. Для качественной работы нужны структурированные запросы и проверка допустимости действий; модель не обеспечивает секретность ролей самостоятельно и рассчитана на игровую, в том числе обманную, коммуникацию.

Сценарии применения

  • выбор ночного убийства за мафию
  • выбор цели для проверки детективом
  • выбор игрока для защиты доктором
  • обсуждение подозрений и защита своей позиции за столом
  • выбор игрока для голосования в партии Mafia
  • генерация допустимых JSON-действий игрового агента

Ограничения

Оценка основана на небольшом специализированном тесте из 24 партий и не характеризует общие способности к рассуждению. Секретность ролей должен обеспечивать игровой движок, а допустимость действий — проверять внешняя система.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

[!NOTE] Mafia Gemma 4 12B IT is a role-conditioned social-deduction fine-tune of unsloth/gemma-4-12b-it. It is designed for seven-player Mafia / Werewolf style games where an agent may be assigned Mafia, Detective, Doctor, or Villager at random and must produce legal game actions plus concise public table messages.

Model Overview

This repository contains the merged Transformers model for mafia-gemma-4-12B-it. The model is intended to be used as the player policy inside a Mafia game agent. In our production game, it is paired with the HOLY GRAIL agent architecture and a separate Time-to-Talk moderator.

The model was trained to improve:

  • legal JSON/action formatting;
  • role-conditioned choices for Mafia, Detective, Doctor, and Villager;
  • public discussion, accusation, defense, claim, and vote behavior;
  • belief, claim, suspicion, and deception tracking;
  • night actions such as Mafia kills, Doctor protects, and Detective checks;
  • compatibility with moderated multi-day Mafia games using classic win conditions.

Training Data

Fine-tuning used the unified Alfaxad/mafia-dataset, a canonical event-log corpus built for social-deduction agents. The dataset combines converted and normalized examples from:

  • Mini-Mafia style action primitives and role-conditioned decisions;
  • LLMafia / Time-to-Talk style communication and timing data;
  • Bayesian Social Deduction / GRAIL belief and role-count examples;
  • Werewolf / Wolf-Enhance style debate traces after conversion to the Mafia schema;
  • WOLF-inspired deception, suspicion, claim, and voting labels where available;
  • our seven-player harness logs with 2 Mafia, 1 Detective, 1 Doctor, and 3 Villagers.

The schema separates public transcript, private role information, legal action sets, hidden state, votes, night actions, claims, and outcome labels. Hidden information is intentionally represented in the training rows only where the acting role is allowed to see it.

Fine-Tuning Recipe

  • Base model: unsloth/gemma-4-12b-it
  • Method: LoRA SFT with Unsloth and TRL
  • LoRA: rank 32, alpha 64
  • Context length: 4096 tokens
  • Training sample: 60k train rows
  • Validation/test sample: 2k validation rows, 2k test rows
  • Optimizer steps: 1000
  • Final eval loss: 0.57703
  • Final train loss: 0.04144
  • Deployment formats: merged Transformers weights and Q8_0 GGUF

How to Run

Install recent Transformers support for Gemma 4:

pip install -U "transformers>=5.11.0" accelerate torch sentencepiece protobuf

Run a text-only Mafia action prompt:

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

repo_id = "Alfaxad/mafia-gemma-4-12B-it"

tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForCausalLM.from_pretrained(
    repo_id,
    torch_dtype=torch.bfloat16,
    device_map="auto",
)

messages = [
    {
        "role": "system",
        "content": (
            "You are a Mafia game agent. Use only legal public information, "
            "respect your private role, and return compact JSON."
        ),
    },
    {
        "role": "user",
        "content": (
            "Role: Detective. Alive players: Ada, Blake, Casey, Devon, Emery. "
            "Night 2 action: choose one player to investigate."
        ),
    },
]

inputs = tokenizer.apply_chat_template(
    messages,
    tokenize=True,
    return_tensors="pt",
    return_dict=True,
    add_generation_prompt=True,
)
device = next(model.parameters()).device
inputs = {key: value.to(device) for key, value in inputs.items()}

with torch.no_grad():
    output = model.generate(
        **inputs,
        max_new_tokens=256,
        do_sample=True,
        temperature=1.0,
        top_p=0.95,
        top_k=64,
    )

print(tokenizer.decode(output[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))

For the lightweight local runtime, use the GGUF repository: Alfaxad/mafia-gemma-4-12B-it-gguf.

Full-Game Evaluation

The table below combines the merged BF16 and GGUF Q8_0 results as one model family, mafia-gemma-4-12B-it. Results come from 24 full seven-player games, with every player using HOLY GRAIL agent architecture and the non-player moderator fixed to base Gemma 4 12B BF16 using a Time-to-Talk scheduler plus generator. The benchmark included 20 pairwise local-vs-frontier games and 4 mixed all-star games. Total API/player/moderator errors: 0.

Overall Slot Scoreboard

ModelPlayer slotsTeam win rateAlive finalAvg messagesAvg votes castAvg votes receivedFalse claim rate
mafia-gemma-4-12B-it780.6150.5381.3331.9361.7560.013
GPT-5 medium180.6110.7221.1671.7781.2220.056
GPT-5-mini180.4440.3891.4441.9442.2220.000
Claude Opus 4.8180.6110.4441.5002.1672.5560.000
Claude Sonnet 4.6180.1110.3331.2781.6672.6670.000
Gemini 2.5 Pro OSV180.8890.5561.5002.2221.8890.000

Pairwise Local-vs-Frontier Results

mafia-gemma-4-12B-it combines BF16 and Q8_0 rows. Each opponent has four local-side trials: two with Mafia Gemma controlling Mafia and two with Mafia Gemma controlling Good.

OpponentLocal wins overallLocal as MafiaLocal as Good
GPT-5 medium1/41/20/2
GPT-5-mini3/41/22/2
Claude Opus 4.82/40/22/2
Claude Sonnet 4.64/42/22/2
Gemini 2.5 Pro OSV1/40/21/2

Role Diagnostics

RoleSlotsTeam win rateAlive finalVote accuracyAvg messagesAvg claimsFalse claims
Mafia210.3810.3811.0001.4760.0480.048
Detective100.7000.5000.5881.1000.9000.000
Doctor140.7140.6430.7001.3570.8570.000
Villager330.6970.6060.6611.3030.0000.000

Runtime Call Metrics

Latency is runtime and provider dependent, so use this as an operational reference rather than a pure capability ranking.

ModelCallsAvg latency secMax latency secAvg output charsFailed calls
mafia-gemma-4-12B-it1045.926103.935218.20
GPT-5 medium2131.484102.330229.80
GPT-5-mini265.88820.425225.30
Claude Opus 4.8273.2286.578249.70
Claude Sonnet 4.6232.8353.746240.60
Gemini 2.5 Pro OSV2719.449138.644143.70

Intended Use

This model is intended for game agents, research harnesses, and AI-native social-deduction experiences. It works best when paired with:

  • an authoritative game engine that enforces legal actions;
  • strict public/private view isolation;
  • role-specific prompts;
  • an external memory/ledger layer such as HOLY GRAIL;
  • a moderator that controls turn timing and table flow.

Limitations

  • The full-game benchmark is small and game-specific. It should not be treated as a broad general reasoning benchmark.
  • The model is not a security boundary. Hidden-role secrecy must be enforced by the engine and prompt construction.
  • The model is tuned for Mafia-style game behavior, including in-game deception. Do not use it for real-world deception, impersonation, or misinformation.
  • Best behavior depends on structured prompts and legal-action validation.

License

This model is distributed under the Apache 2.0 license, following the base Gemma 4 license information provided by the upstream model card.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
Gemma4UnifiedForConditionalGeneration
Ревизия весов
7dc4077

0 моделей