gitwtfhub

wtf is antidoom?

liquid4all/antidoom — explained in plain English

Analysis updated 2026-05-18

328PythonAudience · researcherComplexity · 4/5

TL;DR

A tool that trains a small model adapter to stop AI language models from getting stuck repeating the same words, called a doom loop, without retraining the whole model.

Mindmap

mindmap
  root((antidoom))
    What it does
      Stops repetition loops
      Targets first loop token
      Trains LoRA adapter
    Tech stack
      Python
      PyTorch and vLLM
      CUDA or ROCm GPU
    Use cases
      Fix looping checkpoints
      Build preference training pairs
      Lightweight adapter training
    Audience
      ML researchers
      Model fine tuners
    Notes
      Needs a GPU
      Uses companion prompt dataset
      Tunable regularisation settings

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Fix a language model checkpoint that gets stuck in repetitive reasoning loops

REASON 2

Generate training pairs that teach a model to avoid specific loop-starting words

REASON 3

Train a lightweight LoRA adapter instead of retraining an entire model

REASON 4

Experiment with settings that balance how aggressively repeated words are suppressed

What's in the stack?

PythonPyTorchvLLMCUDAROCm

How it stacks up

liquid4all/antidoomanil-matcha/seedance-2-apiquantumbyteoss/quantumbyte
Stars328333333
LanguagePythonPythonPython
Last pushed2026-07-13
MaintenanceActive
Setup difficultymoderatehard
Complexity4/52/54/5
Audienceresearcherdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

Wtf does this do

Antidoom is a tool that fixes a specific problem some AI language models run into called a doom loop, where the model gets stuck repeating the same words or phrases over and over instead of continuing to reason toward an answer. This tends to happen with certain reasoning words like Wait, So, But, or Alternatively, which can become overused after heavy training, especially when the model is set to produce very predictable, low-randomness output and once it starts repeating itself there is nothing pulling it back on track. Instead of retraining a model on entire correct answers, Antidoom works at the exact point where a repeat begins. It generates sample answers from a model, scans them to find where a repeated section starts, and marks that specific word as the wrong choice. It then picks other reasonable words the model could have chosen instead at that same spot. These paired examples, one rejected word and one or more better alternatives, become training data. That training data is used to train a small add-on called a LoRA adapter, using a method called Final Token Preference Optimization, which nudges the model away from the specific words that tend to trigger repetition, without changing everything else about how the model behaves. The result is meant to be a model that loops less often while still reasoning normally. To use it, someone clones the repository, installs dependencies, and edits a configuration file to point at the model checkpoint they want to fix. Running the tool then generates example completions, builds the training pairs, trains the adapter, and merges it into the model, all inside one command. It relies on a GPU, with the default setup built for NVIDIA and CUDA, and a separate setup path provided for AMD's ROCm hardware. The project ships with a companion prompt dataset built specifically for this pipeline, and a configuration file with settings a user can adjust, such as how many training examples to use and how strongly to prevent overused words from dominating the results. The README includes practical starting values for these settings based on the maintainers' own experiments.

Yoink these prompts

Prompt 1
Explain what a doom loop is and why this tool targets the first repeated token
Prompt 2
Walk me through setting up Antidoom to fix repetition in my own model checkpoint
Prompt 3
What do the max_train_examples and learning_rate settings control in this config
Prompt 4
Help me choose starting hyperparameters for training a LoRA adapter with this tool

Frequently asked questions

wtf is antidoom?

A tool that trains a small model adapter to stop AI language models from getting stuck repeating the same words, called a doom loop, without retraining the whole model.

What language is antidoom written in?

Mainly Python. The stack also includes Python, PyTorch, vLLM.

Who is antidoom for?

Mainly researcher.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.