---
title: 'QueST: Hard Problem Generation Framework'
url: https://www.emergentmind.com/topics/quest-e37cf45c-e1e4-4f70-a46a-2c81f04406c0
type: topic
---

# QueST: Hard Problem Generation Framework

QueST is a two-stage framework for training a large language model problem generator that specializes in producing challenging coding problems and, by extension, more general reasoning problems. It was introduced to address two constraints in contemporary reasoning-model training: scalability limits imposed by human-labeled datasets, and the lack of large-scale, difficult coding-problem corpora. Existing competitive coding datasets contain only thousands to tens of thousands of problems, and prior synthetic-data pipelines typically either augment instruction datasets or select challenging examples from human-written data. QueST instead directly optimizes specialized generators through difficulty-aware graph sampling and difficulty-aware rejection fine-tuning, then uses the resulting synthetic problems for chain-of-thought distillation or reinforcement learning [2510.17715].

## 1. Problem formulation and overall design

QueST is organized as a two-stage training procedure for an LLM “problem generator.” In the first stage, it constructs a graph whose nodes are “concepts” extracted from a seed problem set, and whose edges encode both co-occurrence frequency and human-annotated difficulty. Random walks on this graph produce concept sets that are turned into prompts. In the second stage, the generator produces multiple candidate problems for each prompt; each candidate is scored by an explicit difficulty proxy based on self-consistency among multiple model solutions; only the hardest candidate is retained for fine-tuning [2510.17715].

This design differs from synthetic-data methods that depend primarily on augmenting existing instruction corpora or mining difficult problems from human-labeled sources. In QueST, the generator itself is specialized to create difficult problems. The paper’s central claim is that alternating graph-based prompt sampling with rejection fine-tuning on the hardest generated candidates produces a generator that outperforms even GPT-4o at creating difficult, downstream-useful problems [2510.17715].

The seed data are taken from TACO, with \(Q_{\text{seed}}=\) TACO containing \(25\text{K}\) problems and human difficulty labels. Concepts \(C\) are extracted via LLM prompts, and the resulting graph is used to sample \(100\text{K}\) concept prompts. These prompts support large-scale synthesis without relying on new human annotation [2510.17715].

## 2. Difficulty-aware graph sampling

The graph-sampling stage begins with an undirected graph \(G=(C,E)\), where \(C\) is the set of concepts extracted from the seed corpus. For each edge \((u,v)\), QueST defines a weight that combines concept co-occurrence and human difficulty:

\[
w(u,v)
=\log\bigl(\alpha\cdot\mathrm{freq}(u,v)+(1-\alpha)\cdot\mathrm{diff}(u,v)+\varepsilon\bigr),
\]

where \(\mathrm{freq}(u,v)\) is the number of co-occurrences of \(u\) and \(v\) in \(Q_{\text{seed}}\), \(\mathrm{diff}(u,v)\) is the average human difficulty over problems containing both concepts, \(\alpha\in[0,1]\) balances frequency versus difficulty, and \(\varepsilon\) is a small constant for numerical stability. In the reported experiments, \(\alpha=0.2\) [2510.17715].

The pairwise difficulty term is defined over the subset \(Q_{u,v}=\{q\in Q_{\text{seed}}\mid u,v\in q\}\) as

\[
\mathrm{diff}(u,v)=\frac{1}{|Q_{u,v}|}\sum_{q\in Q_{u,v}} d_{\mathrm{human}}(q),
\]

with \(d_{\mathrm{human}}(q)\in\{1,\ldots,5\}\). This gives the graph a mixed statistical and pedagogical structure: frequently co-occurring concept pairs are preserved, but hard concept pairs receive additional weight [2510.17715].

Concept prompts are obtained through random walks of up to \(L=6\) steps. From node \(u\), the one-step transition probability to a neighbor \(v\in N(u)\) is

\[
p_{u\to v}
=\frac{\exp\bigl(w(u,v)\bigr)}{\sum_{v'\in N(u)}\exp\bigl(w(u,v')\bigr)}.
\]

The resulting sampled concept sequence \(s\) is instantiated as a prompt \(p(s)\). This mechanism biases prompt construction toward concept combinations that are both common enough to be learnable and difficult enough to be valuable for hard-problem generation. A plausible implication is that the graph functions as a structured curriculum over concept combinations rather than as a flat sampling distribution.

## 3. Difficulty estimation and rejection fine-tuning

For each sampled prompt \(p(s)\), the generator produces \(K\) candidate problems, with \(K=8\) in the reported data-generation pipeline. The core selection mechanism is a model-based difficulty estimate \(\delta(q)\) defined through self-consistency among multiple solutions [2510.17715].

Given a generated problem \(q\), QueST estimates difficulty by generating \(T\) test inputs with GPT-4o, generating \(M\) solution candidates with GPT-4o, executing each solution on each test input, and measuring disagreement among the resulting outputs. If \(O_t\) is the set of outputs obtained on test input \(i_t\), and \(o_t\) is the majority-voted output, then

\[
\delta(q)
=1-\frac{1}{T}\sum_{t=1}^{T}\frac{\bigl|\{x\in O_t:x=o_t\}\bigr|}{M}.
\]

A higher \(\delta(q)\in[0,1]\) indicates greater disagreement among solutions and therefore greater estimated difficulty [2510.17715].

Difficulty-aware rejection fine-tuning then selects the hardest candidate. If \(M_\theta\) is the generator with parameters \(\theta\), and \(\{q_k\}_{k=1}^K\sim M_\theta(p)\), the retained problem is

\[
q^*=\arg\max_{k=1\ldots K}\delta(q_k).
\]

The pair \((p,q^*)\) is added to the hard training set \(D_{\mathrm{hard}}\), and the generator is fine-tuned by maximizing the likelihood of \(q^*\) given \(p\), equivalently minimizing cross-entropy:

\[
\mathcal{L}(\theta)
=-\sum_{(p,q^*)\in D_{\mathrm{hard}}}\log P_\theta(q^*\mid p).
\]

This procedure makes the rejection criterion explicitly difficulty-sensitive rather than quality-sensitive in a generic sense. The paper’s interpretation is that QueST directly optimizes generators to create challenging coding problems, rather than merely plausible or stylistically correct ones [2510.17715].

## 4. Models, training protocol, and large-scale synthesis

The reported generator base checkpoint is Qwen2.5-14B-Instruct, with experiments also probing GPT-4o; after rejection fine-tuning, the specialized generator is approximately \(14\text{B}\). For downstream distillation, the student model is Qwen3-8B-Base and the teacher is Qwen3-235B-A22B. Inference uses vLLM with \(\text{temperature}=0.6\). Supervised fine-tuning uses \(\text{batch\_size}=128\) and \(\text{learning\_rate}=5\mathrm{e}{-5}\). Reinforcement learning uses the GRPO algorithm in VeRL with \(\text{rollout\_batch}=128\), \(\text{minibatch}=64\), and \(\text{sample}=16\) [2510.17715].

The synthesis pipeline proceeds from TACO as the seed corpus. Concepts are extracted, the difficulty-aware graph is built, and \(100\text{K}\) concept prompts are sampled. For each prompt, \(K=8\) candidate problems are generated, difficulty is measured via \(\delta(q)\), and only the hardest candidate is kept. Generated problems are then filtered to remove any \(q\) for which more than \(50\%\) of test executions fail [2510.17715].

Two downstream uses are emphasized. In chain-of-thought distillation, each synthetic \(q^*\) is paired with a long chain-of-thought solution from Qwen3-235B-A22B, producing \(100\text{K}\) \((q^*,\mathrm{CoT})\) pairs for supervised fine-tuning of Qwen3-8B-Base. In reinforcement learning, Qwen3-8B itself is used to majority-vote pseudo-labels on test cases, invalid test cases are discarded, and GRPO is applied to fine-tune Qwen2.5-7B on \(6\text{K}\) QuEST synthetic problems versus baselines [2510.17715].

A central practical feature is that the difficulty proxy is execution-based and therefore verifiable. This matters because the framework does not treat hardness as a purely stylistic judgment; it ties hardness to disagreement under executable solution attempts.

## 5. Distillation, reinforcement learning, and quantitative performance

The distillation results on LiveCodeBench-V5 and USACO show that QueST-generated synthetic data can improve a smaller reasoning model beyond its base checkpoint and beyond a human-repeat baseline [2510.17715].

| Model | LCB-Avg | USACO-Avg |
|---|---:|---:|
| Qwen3-8B (base) | 58.7 | 43.5 |
| OCR-8B (112K human repeats) | 56.5 | 41.3 |
| QueST-100K-8B (100K synth) | 59.4 | 43.5 |
| QueST-8B (100K + 112K) | **65.2** | **49.9** |
| DeepSeek-R1-671B (closed) | 65.6 | 56.2 |

After fine-tuning Qwen3-8B-Base on \(100\text{K}\) difficult problems generated by QueST, the model surpasses the performance of the original Qwen3-8B on LiveCodeBench. With an additional \(112\text{K}\) examples, described as \(28\text{K}\) human-written problems paired with multiple synthetic solutions, the resulting 8B model matches the performance of DeepSeek-R1-671B on LiveCodeBench [2510.17715].

The hard–medium–easy breakdown further indicates that gains are concentrated at higher difficulty levels. QueST-8B attains \(97.6\%\) on Easy, \(81.0\%\) on Medium, and \(36.6\%\) on Hard, compared with the base Qwen3-8B at \(94.0/74.1/28.9\). This suggests that the synthetic problems are not merely increasing volume; they are shifting the learned competence profile toward harder instances [2510.17715].

In RLVR, QuEST synthetic data also outperforms alternative synthetic or seed-data sources. Qwen2.5-7B-Instruct scores \(14.3\) LCB-Avg, rising to \(17.3\) with RL on TACO, \(17.6\) with RL on MathScale synth, and \(18.6\) with RL on QuEST synth. The reported conclusion is that QueST-generated problems are effective in both supervised distillation and reinforcement learning settings [2510.17715].

## 6. Ablations, interpretation, and broader significance

Ablation studies isolate the contributions of the two main components. A baseline generator with a uniform graph achieves \(34.9\) LCB-Avg. Adding the difficulty-aware graph raises this to \(37.5\), and adding rejection fine-tuning yields the full QueST score of \(37.9\). The quantitative gap is modest between the latter two settings, but both components contribute measurably, and the complete framework performs best [2510.17715].

These ablations help clarify a common misconception about synthetic hard-problem generation: difficulty is not obtained solely by post hoc filtering of outputs. In QueST, prompt construction is itself difficulty-aware through the concept graph, and output selection is difficulty-aware through rejection fine-tuning. The framework therefore modifies both the prompt distribution and the generator parameters.

The paper also emphasizes broader applicability. QueST can be used to generate arbitrarily large, curriculum-tuned problem sets for new reasoning modalities such as math or logical puzzles by swapping the seed set and the difficulty metric. Because \(\delta(q)\) is verifiable through execution, the approach extends naturally to tasks with an automatic checker. The authors further suggest that, by replacing supervised fine-tuning teachers or integrating real-time difficulty rewards, QueST could support continual learning pipelines that keep “raising the bar” as models improve [2510.17715].

In that sense, QueST is best understood not simply as a data-generation heuristic, but as a training framework for specialized hard-problem generators. Its significance lies in reframing synthetic data creation as an optimization problem over difficulty, with direct downstream consequences for competitive coding and reasoning models.

Source: https://www.emergentmind.com/topics/quest-e37cf45c-e1e4-4f70-a46a-2c81f04406c0