gitwtfhub

wtf is deco-g?

haikangdeng/deco-g — explained in plain English

Analysis updated 2026-05-18

1PythonAudience · researcherComplexity · 4/5Setup · hard

TL;DR

Research code from an academic paper that separates an AI model's task solving from its output formatting using a Format Estimation Module.

Mindmap

mindmap
  root((Deco-G))
    What it does
      Separates task solving from formatting
      Uses a Format Estimation Module
      Reproduces GSM8K and SummEval results
    Tech stack
      Python
      PyTorch
      CUDA
      FAISS
    Use cases
      Reproduce the paper's benchmark results
      Study constrained LLM generation
      Experiment with HMM based formatting
    Audience
      Researchers
      ML engineers

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

Reproduce the Deco-G paper's results on the GSM8K math benchmark or the SummEval summarization benchmark.

REASON 2

Study how a Format Estimation Module can guide a language model's output shape after task solving.

REASON 3

Experiment with constrained decoding techniques adapted from the earlier Ctrl-G project.

REASON 4

Run HMM distillation experiments to build a custom format estimation model.

What's in the stack?

PythonPyTorchCUDAFAISSHugging Face

How it stacks up

haikangdeng/deco-g0xustaz/streamgatea-bissell/unleash-lite
Stars111
LanguagePythonPythonPython
Setup difficultyhardhardhard
Complexity4/54/54/5
Audienceresearcherdeveloperresearcher

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

How do you spin it up?

Difficulty · hard Time to first run · 1h+

Requires a GPU, CUDA-matched PyTorch, and for distillation, GPU-enabled FAISS.

License terms are not described in the shown README, check the repository's license file for exact terms.

Wtf does this do

Deco-G is the research code released alongside an academic paper about how large language models generate text. The paper's idea is to separate two things that are normally tangled together when a model writes a response: figuring out the actual answer to a task, and formatting that answer into a specific required shape, such as a particular structure or style. Deco-G lets the model first focus purely on solving the task, and then a separate piece called the Format Estimation Module steps in afterward to guide the generation so it fits whatever output format the task demands. The code is organized into a few clear pieces. The core logic for loading models, applying constraints, and running generation lives in one folder, while the experiment scripts that reproduce results on two benchmark tasks, GSM8K and SummEval, live in another. There are also folders for evaluation scripts, helper utilities for building datasets and prompts, and an optional set of scripts for a more advanced technique called HMM distillation. Some of the formatting components were adapted from an earlier project called Ctrl-G, with credit given directly in the relevant files. To run this project you need a GPU and a Python environment set up through conda, installing PyTorch along with a matching CUDA version, or alternatively a plain pip installation if you already have a compatible PyTorch and CUDA setup on your machine. The distillation feature additionally needs FAISS with GPU support. The benchmark datasets are downloaded automatically from Hugging Face, and pretrained model checkpoints for the format estimation step are also pulled from a public Hugging Face repository by default. Running an experiment means calling one of the provided shell scripts with a chosen model name, such as a Llama or Qwen variant, and it produces generation output files that can then be scored with separate evaluation scripts. This is an academic research codebase rather than a polished consumer tool, so it assumes familiarity with Python, machine learning environments, and GPU setup.

Yoink these prompts

Prompt 1
Walk me through setting up the conda environment needed to run Deco-G on a GPU.
Prompt 2
Explain how the Format Estimation Module separates task solving from output formatting in this codebase.
Prompt 3
Help me run the GSM8K experiment script with a Qwen model using this repo.
Prompt 4
Show me how to evaluate generated outputs using the eval scripts included here.

Frequently asked questions

wtf is deco-g?

Research code from an academic paper that separates an AI model's task solving from its output formatting using a Format Estimation Module.

What language is deco-g written in?

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

What license does deco-g use?

License terms are not described in the shown README, check the repository's license file for exact terms.

How hard is deco-g to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is deco-g for?

Mainly researcher.

View the repo → Decode another repo

This repo across BitVibe Labs

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