vibethinker

package module
v0.0.0-...-7c73ace Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 0 Imported by: 0

README

mlx-go-vibethinker

A Go reproduction of the VibeThinker post-training pipeline, built on the mlx-go stack.

VibeThinker (Weibo) is a family of small dense reasoning models — 1.5B and 3B — that reach frontier-level scores on verifiable math and coding benchmarks at a fraction of the usual parameter count and training cost. Their method, the Spectrum-to-Signal Principle (SSP), runs supervised fine-tuning to build a diverse spectrum of solutions (maximizing Pass@K), then reinforcement learning to amplify the correct signal with MaxEnt-Guided Policy Optimization (MGPO).

This module reproduces the method described in the two technical reports. It does not redistribute the released weights, and it does not pretend to perform steps that require resources we cannot supply — frontier teacher models, the original proprietary corpora, and full-scale GPU compute are exposed as explicit, pluggable seams.

Source papers:

  • VibeThinker-1.5B — "Tiny Model, Big Logic", arXiv 2511.06221 (base Qwen2.5-Math-1.5B).
  • VibeThinker-3B — "Exploring the Frontier of Verifiable Reasoning", arXiv 2606.16140 (base Qwen2.5-Coder-3B).

What it implements

  • Spectrum (SFT): Diversity-Exploring Distillation — Domain-Aware Diversity Probing (per-subdomain Pass@K specialist selection) and Expert Model Fusion (weighted parameter average). 3B adds two-stage curriculum SFT.
  • Signal (RL): MGPO — GRPO with a max-entropy-deviation advantage weight w_ME = exp(-λ·D_ME(p_c‖0.5)). 3B adds multi-domain RL (math→code→STEM), a single 64K context, and Long2Short token-efficiency RL.
  • 3B consolidation: offline self-distillation (learning-potential filtering) and Instruct RL (rule + rubric rewards).
  • Evaluation: Pass@1 over k samples with vLLM-equivalent sampling, plus CLR (Claim-Level Reliability) test-time scaling.
  • Data: 10-gram decontamination, quality filtering, and synthesis seams.

Status

Implemented. Every stage in DESIGN.md is built on the mlx-go stack, every §5 correctness invariant has a passing property test, and the full 1.5B and 3B recipes run end to end on a toy config (a tiny 2-layer Qwen2) without NaNs, emitting a merged, RL-updated, and distilled checkpoint with provenance. DESIGN.md remains the contract this reproduction is held to.

Run the toy pipeline (the synthetic model registry is behind the modelir build tag):

go test -tags modelir ./...                       # all invariants, -race
go run  -tags modelir ./cmd/vibethinker-train -size 1.5b
go run  -tags modelir ./cmd/vibethinker-train -size 3b
go run  ./cmd/vibethinker-eval -mode pass1        # Pass@1 over a fake sampler
go run  ./cmd/vibethinker-eval -mode clr          # CLR reliability selection
Gates (not run locally; explicit seams with in-repo fakes)
  • Teacher (teacher) — multi-path traces, pseudo-labels, CLR claim extraction/self-verification need a frontier model. Supply a real Teacher; the in-repo Fake drives tests.
  • Code sandbox (reward/sandbox) — the local ExecRunner is fail-closed; a real run supplies an isolated Runner.
  • Rubric reward model (reward/rubric) — a gated Scorer interface with a fake; a real run supplies a judge model.
  • Full-scale compute — the multi-step weight optimizer (TrainFullFineTune) and GPU-scale training are documented compute gates; the toy stages exercise the loss graphs and every algorithmic transform, not a full optimizer loop.
  • Original corpora — datasets are pluggable Loader/Synthesizer seams.

License

MIT.

Documentation

Overview

Package vibethinker reproduces the VibeThinker post-training pipeline in Go on top of the mlx-go stack.

VibeThinker is a family of small dense reasoning models (1.5B, 3B) post-trained under the Spectrum-to-Signal Principle (SSP): supervised fine-tuning builds a diverse "spectrum" of solutions (maximizing Pass@K), then reinforcement learning amplifies the correct "signal" with MaxEnt-Guided Policy Optimization (MGPO). This module implements the method described in the two technical reports (arXiv 2511.06221 for the 1.5B, arXiv 2606.16140 for the 3B); it does not redistribute the released weights.

The pipeline decomposes into composable stages, each in its own package:

  • spectrum/probe — Domain-Aware Diversity Probing (per-subdomain Pass@K specialist selection).
  • spectrum/fuse — Expert Model Fusion (weighted parameter average).
  • spectrum/sft — curriculum supervised fine-tuning (3B two-stage).
  • signal/mgpo — MGPO: GRPO modulated by a max-entropy-deviation weight.
  • signal/long2short — zero-sum length-aware reward reshaping (3B).
  • signal/multidomain — sequential math, code, STEM RL (3B).
  • distill — offline self-distillation with learning-potential filtering (3B).
  • instruct — Instruct RL with rule-based and rubric rewards (3B).
  • reward — verifiable reward sources (math-verify, code sandbox, rubric).
  • data — dataset loading, synthesis seams, and 10-gram decontamination.
  • eval — Pass@1 over k samples and CLR test-time scaling (3B).

Dependencies that cannot run locally — frontier teacher models, the original proprietary corpora, and full-scale GPU compute — are exposed as explicit, pluggable seams rather than performed silently. See DESIGN.md for the full specification and the faithfulness/realizability contract.

Directories

Path Synopsis
cmd
vibethinker-eval command
Command vibethinker-eval runs VibeThinker's evaluation harness: Pass@1 over k samples and CLR (Claim-Level Reliability) test-time scaling.
Command vibethinker-eval runs VibeThinker's evaluation harness: Pass@1 over k samples and CLR (Claim-Level Reliability) test-time scaling.
vibethinker-methodcompare command
Command vibethinker-methodcompare runs the post-GRPO method-comparison harness (eval/methodcompare) and prints a comparable table plus, with -json, a machine-readable report.
Command vibethinker-methodcompare runs the post-GRPO method-comparison harness (eval/methodcompare) and prints a comparable table plus, with -json, a machine-readable report.
vibethinker-realmodel command
Command vibethinker-realmodel runs the real-model mechanism smoke test (eval/realmodel): it loads the real Qwen2.5-Math-1.5B, runs each post-GRPO method (DESIGN_RL_UPGRADE.md) through a short real GRPO loop on real logits, and prints a comparison table plus, with -json, a machine-readable report.
Command vibethinker-realmodel runs the real-model mechanism smoke test (eval/realmodel): it loads the real Qwen2.5-Math-1.5B, runs each post-GRPO method (DESIGN_RL_UPGRADE.md) through a short real GRPO loop on real logits, and prints a comparison table plus, with -json, a machine-readable report.
vibethinker-train command
Command vibethinker-train drives a VibeThinker Spectrum-to-Signal training run from a config.
Command vibethinker-train drives a VibeThinker Spectrum-to-Signal training run from a config.
Package data provides VibeThinker's dataset loading, synthesis seams, and local quality control (DESIGN §4.6, §5.7).
Package data provides VibeThinker's dataset loading, synthesis seams, and local quality control (DESIGN §4.6, §5.7).
decontam
Package decontam removes train samples that overlap an evaluation set by a shared 10-gram, the contamination test VibeThinker applies before training (DESIGN §4.6, §5.7).
Package decontam removes train samples that overlap an evaluation set by a shared 10-gram, the contamination test VibeThinker applies before training (DESIGN §4.6, §5.7).
Package distill implements VibeThinker's Offline Self-Distillation for the 3B model.
Package distill implements VibeThinker's Offline Self-Distillation for the 3B model.
Package eval implements VibeThinker's Pass@1 benchmark harness (DESIGN §4.7).
Package eval implements VibeThinker's Pass@1 benchmark harness (DESIGN §4.7).
clr
Package clr implements VibeThinker's Claim-Level Reliability (CLR) test-time scaling for the 3B model (DESIGN §4.7, §5.6).
Package clr implements VibeThinker's Claim-Level Reliability (CLR) test-time scaling for the 3B model (DESIGN §4.7, §5.6).
methodcompare
Package methodcompare is a method-comparison harness for the post-GRPO upgrades in signal/mgpo (DESIGN_RL_UPGRADE.md).
Package methodcompare is a method-comparison harness for the post-GRPO upgrades in signal/mgpo (DESIGN_RL_UPGRADE.md).
realmodel
Package realmodel is a real-model mechanism smoke test for the post-GRPO upgrades in signal/mgpo (DESIGN_RL_UPGRADE.md).
Package realmodel is a real-model mechanism smoke test for the post-GRPO upgrades in signal/mgpo (DESIGN_RL_UPGRADE.md).
Package instruct implements VibeThinker's Instruct RL stage for the 3B model: on-policy RL on mixed instruction data that improves controllability without sacrificing reasoning (DESIGN §4.4).
Package instruct implements VibeThinker's Instruct RL stage for the 3B model: on-policy RL on mixed instruction data that improves controllability without sacrificing reasoning (DESIGN §4.4).
internal
recipe
Package recipe assembles the VibeThinker 1.5B and 3B training recipes as ssp pipelines over the toy model, so the whole Spectrum-to-Signal flow runs end to end on CPU.
Package recipe assembles the VibeThinker 1.5B and 3B training recipes as ssp pipelines over the toy model, so the whole Spectrum-to-Signal flow runs end to end on CPU.
toymodel
Package toymodel provides a tiny Qwen2 model and tokenizer used to drive the VibeThinker pipeline end to end in tests, without GPU-scale compute.
Package toymodel provides a tiny Qwen2 model and tokenizer used to drive the VibeThinker pipeline end to end in tests, without GPU-scale compute.
reward
mathverify
Package mathverify implements VibeThinker's rule-based final-answer equivalence reward (DESIGN §4.5: "mathverify — rule-based final-answer equivalence (local)").
Package mathverify implements VibeThinker's rule-based final-answer equivalence reward (DESIGN §4.5: "mathverify — rule-based final-answer equivalence (local)").
rubric
Package rubric implements VibeThinker's rubric-based reward model (DESIGN §4.4/§4.5: open-ended Instruct-RL prompts are scored by a "rubric-based reward model" — a gated interface).
Package rubric implements VibeThinker's rubric-based reward model (DESIGN §4.4/§4.5: open-ended Instruct-RL prompts are scored by a "rubric-based reward model" — a gated interface).
sandbox
Package sandbox implements VibeThinker's code-execution reward (DESIGN §4.5: "sandbox — execute generated code against tests; Environment via EnvFromVerifyFunc.
Package sandbox implements VibeThinker's code-execution reward (DESIGN §4.5: "sandbox — execute generated code against tests; Environment via EnvFromVerifyFunc.
signal
long2short
Package long2short implements VibeThinker's Long2Short math-RL reward reshaping: a second math-RL stage that rewards brevity among correct traces without changing the group's reward baseline.
Package long2short implements VibeThinker's Long2Short math-RL reward reshaping: a second math-RL stage that rewards brevity among correct traces without changing the group's reward baseline.
mgpo
Package mgpo implements MaxEnt-Guided Policy Optimization, the Signal-phase RL objective of VibeThinker.
Package mgpo implements MaxEnt-Guided Policy Optimization, the Signal-phase RL objective of VibeThinker.
multidomain
Package multidomain drives VibeThinker's 3B multi-domain RL: a sequence of MGPO runs over Math, then Code, then STEM (DESIGN §4.2).
Package multidomain drives VibeThinker's 3B multi-domain RL: a sequence of MGPO runs over Math, then Code, then STEM (DESIGN §4.2).
spectrum
fuse
Package fuse implements Expert Model Fusion: the Expert Model Fusion step of VibeThinker's Diversity-Exploring Distillation.
Package fuse implements Expert Model Fusion: the Expert Model Fusion step of VibeThinker's Diversity-Exploring Distillation.
probe
Package probe implements VibeThinker's Domain-Aware Diversity Probing: the first step of Diversity-Exploring Distillation in the Spectrum (SFT) phase (DESIGN §4.1; correctness property 5 in DESIGN §5).
Package probe implements VibeThinker's Domain-Aware Diversity Probing: the first step of Diversity-Exploring Distillation in the Spectrum (SFT) phase (DESIGN §4.1; correctness property 5 in DESIGN §5).
sft
Package sft drives VibeThinker's curriculum supervised fine-tuning and provides the sequence packing that the mlx-go-lm training loop does not.
Package sft drives VibeThinker's curriculum supervised fine-tuning and provides the sequence packing that the mlx-go-lm training loop does not.
Package ssp is the Spectrum-to-Signal orchestration spine for the VibeThinker reproduction.
Package ssp is the Spectrum-to-Signal orchestration spine for the VibeThinker reproduction.
Package teacher defines the Teacher gate: the strong-model dependency that VibeThinker's Diversity-Exploring Distillation and pseudo-labeling require but that this reproduction cannot bundle.
Package teacher defines the Teacher gate: the strong-model dependency that VibeThinker's Diversity-Exploring Distillation and pseudo-labeling require but that this reproduction cannot bundle.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL