---
title: SynthSmith Framework for Code LLMs
url: https://www.emergentmind.com/topics/synthsmith-framework
type: topic
---

# SynthSmith Framework for Code LLMs

SynthSmith is a fully synthetic data-generation framework designed to train large language models (LLMs) for code reasoning in competitive programming, independently of human-written corpora. Its architecture procedurally constructs novel problem statements, synthesizes matching solutions, and generates rigorous test suites through an explicitly feature-driven pipeline. SynthSmith demonstrates that high-capacity code LLMs can be developed using exclusively synthetic supervised fine-tuning (SFT) and reinforcement learning (RL) datasets—enabling greater scaling, diversity, and verifiability than possible with real-world competitive programming data. Empirical results show these synthetic datasets are sufficient to achieve state-of-the-art performance on standard code reasoning benchmarks, surpassing models trained on larger real-world corpora [2601.06953].

## 1. Motivation and Design Rationale

Competitive programming tasks require deep algorithmic reasoning, complex solution chains, and robustness to adversarial cases. Real-world benchmarks such as APPS, CodeContests, and TACO are constrained by scale and locked to historic contest distributions, inhibiting further generalization gains. SynthSmith addresses these limitations by:

- **Generating novel tasks** via explicit feature evolution, rather than repurposing existing problems.
- **Ensuring solution quality** with a dual-verification protocol that cross-examines LLM-generated code against automatically constructed and semantically weighted test suites.
- **Enabling dataset scaling** by generating modular SFT and RL corpora whose properties obey empirical scaling laws, and whose scale/diversity can be systematically tuned [2601.06953].

This approach unbinds code reasoning LLMs from the finite pool of real competitive programming tasks, creating an extensible foundation for continual progress.

## 2. Feature-Based Synthesis Pipeline

SynthSmith operates in four primary stages, detailed in the following table and expanded upon subsequently:

| Stage                  | Key Technique                                | Output                      |
|------------------------|----------------------------------------------|-----------------------------|
| Task Generation        | Feature tree sampling & prompt-based mapping | Code-style statements       |
| Test-Case Generation   | Prompting-based and tool-based generation    | Reproducible test inputs    |
| Solution Sampling      | Long-CoT via multiple LLMs                   | Candidate code solutions    |
| Dual Verification      | Majority voting & weighted evaluation        | Golden solution, test suite |

### Task Generation via Feature Trees

The feature tree is synthesized by parsing 10,000 TACO competition snippets, with GPT-4-labeled leaves representing concepts such as “Dijkstra’s algorithm,” “segment tree,” or “boundary conditions.” The tree is evolved in breadth (e.g., adding “heap sort” alongside “merge sort”) and depth (e.g., “prefix sum” ↦ “Fenwick tree”), resulting in approximately 100,000 discrete features. A consistent subtree is extracted—one whose features can realistically co-occur in a task—and mapped, through a prompt-driven process, to a structured JSON with:

- `feature_roles_tree`—feature leaves tagged as “potential_use,”
- `selected_features_tree`—a minimal coherent subset,
- `integration_strategy`—a natural language formulation for task design.

This representation is rendered to Codeforces, LeetCode, or AtCoder styles via templates. Decoupling feature selection from narrative formulation demonstrably increases task difficulty by ~5 avg@4 points, measured via ablation.

### Test-Case Generation

Without ground-truth test sets, SynthSmith synthesizes $n$ input cases $x_1, ..., x_n$ by:

- **Prompting-based generation:** LLMs suggest normal, edge, and stress cases.
- **Tool-based generation:** Deterministic generators from the CYaRon library (graphs, trees, polygons) are used with fixed seeds for reproducibility.

### Solution Sampling

For each task $q$, $m$ advanced code-reasoning models (e.g., DeepSeek-R1, Qwen3-Thorough) generate candidate chain-of-thought solutions $A_1, ..., A_m$. Static filtering rejects any with AST check failures or incomplete explanations.

### Dual Verification

SynthSmith employs a two-step cross-verification protocol:

- **Test-output labeling by voting:** For test input $x_i$, each solution $A_j$ is executed to yield outputs $y_{ij}$. The provisional ground truth $y_i$ is assigned via plurality vote. Each $(x_i, y_i)$ receives a semantic weight $w_i \in \{1,\ldots,4\}$ based on input difficulty. The candidate test suite $T_\mathrm{cand} = \{(x_i, y_i, w_i)\}$ is thus established.
- **Golden solution selection:** $T_\mathrm{cand}$ is split into weighted ($T_\mathrm{gold}$) and hold-out ($T_\mathrm{val}$) sets. Each $A_j$’s score is $S_j = \sum_{(x,y,w) \in T_\mathrm{gold}} w \cdot 1(A_j(x) = y)$. The highest-scoring solution on $T_\mathrm{gold}$ is verified for maximal accuracy on $T_\mathrm{val}$; if confirmed, it is retained as the golden solution $A_\mathrm{golden}$ along with $T_\mathrm{gold}$. Otherwise the task $q$ is discarded.

Empirically, using $m=8$ candidates, the false-positive rate of test-output labeling is $<5.3\%$, and the error rate of golden solutions on held-out real tasks is $\approx7.9\%$.

## 3. Dataset Construction and Training Protocols

Post-verification, SynthSmith materializes:

- **SFT Corpus:** $(q, A_\mathrm{golden})$ pairs, encompassing 200,000 tasks ($3.38$B tokens), trained for 8 epochs.
- **RL Corpus:** $(q, T_\mathrm{gold})$ instances on 40,000 tasks, supporting $n=8$ rollouts per task with 270 PPO/GRPO optimization updates.

Supervised fine-tuning minimizes
$$
J_{\mathrm{SFT}}(\theta) = -\mathbb{E}_{(x, y) \sim D} \sum_{t=1}^{|y|} \log p_\theta(y_t \mid y_{<t}, x)
$$
while reinforcement learning employs Group Relative Policy Optimization (GRPO) with
$$
J_{\mathrm{GRPO}}(\theta) = \frac{1}{G} \sum_{g=1}^G \sum_{t=1}^{|a^{(g)}|} \min \Bigl ( r_{g,t}A_{g,t},\,\mathrm{clip}(r_{g,t},1-\epsilon,1+\epsilon)A_{g,t} \Bigr )
\;-\;\beta\,\mathrm{KL}\bigl(\pi_\theta\,\|\,\pi_{\mathrm{ref}}\bigr)
$$
where $r_{g,t}$ is the importance ratio, $A_{g,t}$ is the estimated advantage, and $R$ (rollout reward) is continuous and defined as:

- $0$ if no code or compile error,
- $-2$ if compiles but fails all tests,
- $5 \cdot |\{\text{passed}\}|/|\{\text{tests}\}|$ for partial correctness.

## 4. Scaling Laws and Ablative Analysis

SynthSmith-driven training reveals scaling phenomena along two SFT dimensions: number of unique tasks $T$ and solutions per task $S$. For a fixed compute budget:

- Larger $T$ (e.g., $32$K to $200$K tasks $\times 1$ solution) improves avg@8 from $43.7 \rightarrow 62.7$ on LiveCodeBench.
- For equivalent size, increased task diversity ($64$K$\times$1) outperforms increased solution count per task ($16$K$\times$4 or $8$K$\times$8), indicating that generalization is more strongly driven by problem diversity.

Ablation studies identify:

- Dual verification yields $+8$ points over naïve use of raw solutions.
- Long chain-of-thought (Long-CoT) completions (DeepSeek-R1) give $+17$ points at v5 compared to Short-CoT.
- Codeforces-style task rendering (70% of data) yields up to $2$-point advantage over alternative formats.
- Tool-based CYaRon test inputs result in $87.9\%$ pass rate for golden solutions, versus $77.4\%$ for prompting-based inputs.

## 5. Training Configurations and Empirical Performance

Key SFT hyperparameters: learning rate $5\times10^{-5}$, batch size $128$, $8$ epochs, training on $128 \times \text{H200}$ GPUs ($96$GB each) over $220$ hours.

RL fine-tuning: batch size $128$, learning rate $7 \times 10^{-5}$, rollout temperature $1.0$, $G=8$ rollouts, $270$ GRPO/PPO updates on $32 \times \text{H200}$ GPUs for $7$ days.

On LiveCodeBench v5 and v6,

- **SFT only:** $60.3 \pm 2.5$ avg@8 (v5), $53.5 \pm 1.7$ (v6)
- **SFT+RL:** $62.9 \pm 1.8$ avg@8 (v5), $55.8 \pm 1.9$ (v6)

This surpasses larger real-data models such as DeepCoder‐14B and AReal-boba2-14B (avg@32$\approx58$) while requiring fewer rollouts at test time (8$\times$ fewer than Qwen3-8B for equivalent pass@$k$).

## 6. Implications and Significance

SynthSmith establishes a reproducible methodology for generating high-quality, challenging, and verifiable synthetic data for competitive programming code LLMs. Its feature-based, dual-verified pipeline supplies datasets with tunable scale and granularity, facilitating the systematic study of scaling laws and dataset composition effects in code reasoning. When used to train models such as X-Coder-7B, SynthSmith enables code reasoning performance on par with, or exceeding, substantially larger models trained on real or mixed datasets—without any reliance on human-written programming tasks or tests [2601.06953].

A plausible implication is that fully synthetic pipelines such as SynthSmith may become foundational for benchmarking and advancing code-centric LLMs, especially as the utility of existing real-world datasets plateaus or as new competitive programming paradigms emerge. The ability to procedurally generate and validate vast, diverse, and high-difficulty task corpora will likely remain essential for future developments in code reasoning research.

Source: https://www.emergentmind.com/topics/synthsmith-framework