ThinkWhileThinking / README.md
realArceus's picture
Update README.md
76d7734 verified
|
Raw
History Blame Contribute Delete
3.68 kB
---
title: ThinkWhileThinking
emoji: 🧠
colorFrom: purple
colorTo: indigo
sdk: gradio
sdk_version: 5.33.0
app_file: app.py
pinned: true
license: mit
tags:
- build-small-hackathon
- thousand-token-wood
- tiny-titan
---
# 🧠 ThinkWhileThinking
> **Real-time reasoning failure detection in small language models via step-level process supervision**
## What is this?
Most interpretability research is **post-hoc** β€” you find out *why* a model was wrong *after* it's already wrong. **ThinkWhileThinking** flips this:
A fine-tuned **Step Probe** model watches a reasoner's chain-of-thought in real time, and predicts β€” at each reasoning step β€” whether the logic is about to go wrong, **before the final answer is revealed.**
## How it works
```
User inputs a math / logic problem
↓
Reasoner (Qwen2.5-1.5B-Instruct) generates chain-of-thought step by step
↓
Step Probe (fine-tuned Qwen2.5-0.5B) scores each step in real time
↓
UI highlights exactly where reasoning starts to break down
↓
Reasoning Health score computed across all steps
```
## The Research Contribution
**Research Question:** *Can a lightweight probe model, trained only on step-level correctness annotations, predict mid-reasoning whether the final answer will be correct β€” before seeing the answer?*
Unlike prior work on CoT monitoring (which focuses on safety, deception, or adversarial attacks), TWT addresses **correctness failure prediction at inference time** using lightweight process supervision β€” making real-time interpretability accessible without frontier-scale models.
## Models Used
| Role | Model | Parameters |
|------|-------|-----------|
| Reasoner | Qwen/Qwen2.5-1.5B-Instruct | 1.5B |
| Step Probe | realArceus/twt-probe | 0.5B |
| **Total** | | **2B ≀ 32B βœ…** |
## Training
The Step Probe (`realArceus/twt-probe`) is a fine-tuned `Qwen2.5-0.5B-Instruct` trained as a binary sequence classifier on **PRM800K** (trl-lib/prm800k) β€” OpenAI's process reward model dataset with step-level human correctness annotations.
| Detail | Value |
|--------|-------|
| Dataset | PRM800K (trl-lib/prm800k) |
| Samples | 40,000 step-level pairs |
| Task | Binary classification: correct vs. faulty step |
| Hardware | Modal A10G GPU |
| Epochs | 3 |
| **eval_accuracy** | **98.15%** |
| **eval_f1** | **99.05%** |
## How is this different from PRMs?
Process Reward Models (PRMs) assign quality scores to steps for **training signal**. TWT uses step-level supervision for **real-time inference-time interpretability** β€” a fundamentally different use case. We also demonstrate this works at 0.5B scale, far smaller than typical PRM deployments.
## Paper
*ThinkWhileThinking: Real-Time Reasoning Failure Detection in Small Language Models via Step-Level Process Supervision*
**Abstract:** We present ThinkWhileThinking (TWT), a lightweight framework for real-time reasoning failure detection in language models. Unlike post-hoc interpretability methods or safety-focused CoT monitors, TWT employs a small probe model fine-tuned on step-level process supervision signals to predict reasoning failures mid-chain-of-thought, before the final answer is produced. Our Step Probe β€” a 0.5B parameter classifier trained on PRM800K annotations β€” achieves 98.15% accuracy and 99.05% F1 on held-out step-level correctness prediction. We demonstrate that real-time correctness failure detection is both feasible and highly accurate at small model scales, opening a new direction for accessible, inference-time interpretability research.
## Built By
**realArceus** β€” Final year MLE student Β· HF Build Small Hackathon 2026
## License
MIT