explaingit

zhouzypaul/qgf

Analysis updated 2026-05-18

55PythonAudience · researcherComplexity · 5/5Setup · hard

TLDR

Research code for Q-Guided Flow, an offline reinforcement learning method that improves actions at test time using a separately trained critic.

Mindmap

mindmap
  root((QGF))
    What it does
      Offline RL policy
      Test time guidance
      Flow matching
    Tech stack
      Python
      JAX
    Use cases
      Train policy and critic
      Improve actions at inference
      Reproduce paper results
    Audience
      Researchers
      RL 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

What do people build with it?

USE CASE 1

Train a flow-matching policy and a critic separately on offline reinforcement learning data.

USE CASE 2

Improve a trained policy's actions at inference time without retraining or joint actor-critic training.

USE CASE 3

Reproduce the paper's experiments on OGBench robot manipulation benchmarks.

USE CASE 4

Generate SLURM batch scripts to run the full set of paper experiments on a compute cluster.

What is it built with?

PythonJAX

How does it compare?

zhouzypaul/qgfbhartiyashesh/purelymailcalendarbiao994/docpaws
Stars555555
LanguagePythonPythonPython
Setup difficultyhardmoderatemoderate
Complexity5/54/53/5
Audienceresearchergeneraldeveloper

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

How do you get it running?

Difficulty · hard Time to first run · 1day+

Requires GPU or TPU hardware, JAX, and downloading large OGBench datasets before running experiments.

The README does not state a license for this project.

In plain English

This repository is the research code for Q-Guided Flow (QGF), an algorithm in the field of reinforcement learning (RL), a branch of AI where a system learns to make decisions by receiving feedback on whether its actions achieve a goal. The problem QGF addresses is a common one in offline RL: you have a large dataset of recorded behavior, and you want to learn a policy (a decision-making system) that does better than what was recorded, without collecting additional experience by interacting with the environment. Most approaches to this combine training the policy and a critic (a system that estimates how good an action is) together in a loop, which can be unstable or slow. QGF separates these two concerns. During training, it independently trains a flow-matching policy using behavioral cloning (learning to imitate the recorded actions) and trains a critic using TD-learning (a standard technique for estimating action value). Flow-matching is a type of generative model that produces outputs by progressively refining a noisy starting point through a learned denoising process. At inference time, rather than retraining the policy, QGF uses gradients from the critic to steer the denoising process toward actions the critic rates more highly, achieving policy improvement at test time without any joint actor-critic training. The codebase is written in JAX, a Python library for fast numerical computation on GPUs and TPUs. Experiments use the OGBench benchmark, a suite of offline RL environments based on simulated robot manipulation tasks (cube stacking, scene arrangement, puzzle solving). The repository also includes implementations of several baseline RL algorithms for comparison, and scripts that generate SLURM batch jobs for running the full set of paper experiments on a compute cluster. The paper associated with this code is available on arXiv (2606.11087). The project does not have a license file mentioned in the README.

Copy-paste prompts

Prompt 1
Help me set up the environment and download OGBench datasets to run QGF.
Prompt 2
Explain how Q-Guided Flow separates policy training from critic-guided inference.
Prompt 3
Show me how to run a single QGF experiment with main.py and interpret the guidance weights.
Prompt 4
Walk me through the difference between the train-time and test-time baseline methods in this repo.

Frequently asked questions

What is qgf?

Research code for Q-Guided Flow, an offline reinforcement learning method that improves actions at test time using a separately trained critic.

What language is qgf written in?

Mainly Python. The stack also includes Python, JAX.

What license does qgf use?

The README does not state a license for this project.

How hard is qgf to set up?

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

Who is qgf for?

Mainly researcher.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.