Repo2Mini

Repo2Mini asks a model to rebuild a small standalone version of a real library subsystem, following the original's conventions, and scores the result with hidden tests. The main thing that changes between runs is how much of the original repository the model sees and how it gets it.

Code and implementation details: https://github.com/omkar-334/repo2mini. Built for Build with Beam. The subject model is Beam 1.0 (Beam-1.0-501B-A23B) through the Reflection API. Three OpenAI models ran on the same grid for comparison: gpt-4.1 (no reasoning), gpt-5.2 and gpt-6-astra (both at low reasoning effort).

Tasks

Task Library What the model builds Oracle
gpt2_forward Transformers GPT-2 forward pass Logits and loss compared with the installed Hugging Face model
gpt2_generate Transformers KV cache and greedy generation Generated tokens compared with the installed Hugging Face model
sortedlist_core python-sortedcontainers SortedList Random operation sequences compared with the installed package, plus its internal layout
sortedlist_key python-sortedcontainers SortedList with key functions Same, including SortedKeyList
numpy_quantile NumPy quantile and percentile with all 13 interpolation methods Values, shapes and dtypes compared with the installed np.quantile
pandas_cut pandas The binning logic of pd.cut Codes and label strings compared with the installed pd.cut
sort_tracker Roboflow trackers The SORT multi object tracker Tracker ids compared with the installed SORTTracker on random scenes

Settings, all scored by the same hidden tests (parity, behavior, API compatibility) after up to two revision rounds against public tests:

A solution that imports, calls or executes the original library is disqualified and scores 0. The check reads the code's syntax tree, so mentioning a library in a comment or docstring is fine.

Results

Mean hidden pass rate, and the share of runs that pass every hidden test (low or default reasoning effort, 2 to 3 samples per cell, 1 for long context):

Setting gpt-6-astra gpt-5.2 Beam gpt-4.1
Write from scratch (L0, L2, L5) 0.967 (88%) 0.802 (31%) 0.735 (20%) 0.670 (15%)
Agentic, tools only 1.000 (100%) 0.891 (27%) 0.388 (0%) 0.589 (0%)
Bug fix 1.000 (100%) 0.942 (79%) 0.960 (79%) 0.941 (66%)
Long context (about 240K tokens, Beam also 600K) 1.000 (100%) 0.867 (57%) 0.862 (7%) 0.597 (0%)

Where Beam does well

Where Beam does not

Cost

Cost uses list prices on the logged tokens, with cached input at the cached rate. OpenAI rates are from its pricing page (per 1M tokens, input / cached / output): gpt-6-astra $10 / $1 / $50 (above 272K input tokens $20 / $2 / $75), gpt-5.2 $1.75 / $0.175 / $14, gpt-4.1 $2 / $0.50 / $8. Beam is $0.25 in and $1 out per 1M tokens from its OpenRouter listing, which is an estimate: the direct Reflection API was a free beta and nothing was billed.

Setting Metric Beam gpt-4.1 gpt-5.2 gpt-6-astra
Write from scratch Cost per run $0.022 $0.098 $0.116 $0.344
Write from scratch Cost per fully passing run $0.107 $0.661 $0.375 $0.390
Bug fix Cost per run $0.007 $0.043 $0.055 $0.183
Bug fix Cost per fully passing run $0.009 $0.066 $0.070 $0.183
Agentic Cost per run $0.012 $0.135 $0.156 $0.230
Long context (240K) Cost per run $0.145 $0.647 $0.490 $2.440

The cheapest in each row is in bold.

Quality per dollar

Pass rate points per dollar is the sum of hidden pass rates over all runs divided by total list price spend (higher is better). Cost per fully passing run is total spend divided by runs that passed every hidden test (lower is better). Read both: points per dollar rewards cheap and mediocre models (Beam agentic scores 33 with zero fully passing runs), while cost per fully passing run ignores partial credit.

Setting Metric Beam gpt-4.1 gpt-5.2 gpt-6-astra Best
Write from scratch Points per dollar 33.7 6.8 6.9 2.8 Beam
Write from scratch $ per fully passing run $0.107 $0.661 $0.375 $0.390 Beam
Bug fix Points per dollar 135.0 21.7 17.0 5.5 Beam
Bug fix $ per fully passing run $0.009 $0.066 $0.070 $0.183 Beam
Agentic Points per dollar 33.5 4.4 5.7 4.3 Beam (but 0 of 15 runs fully passed)
Agentic $ per fully passing run n/a (0 of 15 passed) n/a (0 of 15 passed) $0.587 (4 of 15) $0.230 (15 of 15) gpt-6-astra
Long context (240K) Points per dollar 6.0 0.9 1.8 0.4 Beam
Long context (240K) $ per fully passing run $2.03 (1 of 14) n/a (0 of 7 passed) $0.86 (4 of 7) $2.44 (7 of 7) gpt-5.2

When given the repository text, Beam is the cheapest model to get a fully correct answer from. With the relevant files in the prompt (L2 and L5 write tasks) a fully passing run costs $0.10 with Beam, $0.33 with gpt-5.2, $0.45 with gpt-6-astra and $0.57 with gpt-4.1. For bug fixes at L2 it is $0.012, $0.073, $0.085 and $0.253. The one setting with context where Beam is not cheapest per passing run is 240K token long context.

Cost per fully passing run is total spend divided by the runs that passed every hidden test, so it is undefined (n/a) when no run passed. That is the case for Beam and gpt-4.1 in the agentic setting and for gpt-4.1 at long context. The best value in each row is in bold.

Beam is the best on points per dollar in all four settings (5x to 8x over the nearest model in three of them) and on cost per fully passing run in two (write from scratch and bug fix). It is not the best where full correctness matters and it rarely achieves it: agentic (no fully passing run) and long context (1 of 14 runs). Caveats: Beam's price is an OpenRouter list price estimate and nothing was billed, Beam cached input is billed at the full input rate (so its cost is if anything overstated), and quality per dollar says nothing about whether a cheap answer is good enough for your use.

Corrections made during the project

Limits

One run per configuration and 2 to 3 samples per cell (1 for long context), so many differences between models are within noise. gpt-6-astra and gpt-5.2 have 2 samples per cell, Beam and gpt-4.1 3 on the first four tasks. Only low reasoning effort for the OpenAI reasoning models. The 600K token test ran for Beam only: gpt-4.1 was rejected by a 500K tokens per minute limit on my organization, and the other two models were not run there to limit cost. My own scoring thresholds (the 700 line compactness check, the 20 turn tool budget). The repository slices come from main branches while the installed packages (for example NumPy 2.5.4, pandas 3.1.0, trackers 2.6.1) were the oracles, so small version drift is possible. Hidden tests are not published, to limit leakage. Familiarity is confounded: gpt-6-astra solves sortedcontainers from memory with no context, so sort_tracker is the cleaner test of context use.

Pass rate by context level

Each model is shown at its best variant: for every task and level, the reasoning effort with the highest mean pass rate. Only Beam was run at two efforts (low and medium, medium on 4 tasks), so this can only lift Beam slightly.

Best variant pass rate versus context level

Models compared per task

Each cell is the mean hidden pass rate of the best variant, with the number of runs that passed every hidden test out of the runs. The best model in each row has a teal frame. Bug fix pools the two injected bug variants of the task.

All tasks pooled

Mean over tasks, runs weighted. Bold with a teal frame is the best model in that row.

SettingBeamGPT-4.1GPT-5.2GPT-6 Astra
L0 write, no repo text0.630/15 full0.550/18 full0.742/14 full0.909/14 full
L2 write, relevant files0.825/16 full0.724/18 full0.856/14 full1.0014/14 full
L5 write, broad slice0.796/15 full0.744/18 full0.825/14 full1.0014/14 full
Agentic, tools only0.390/15 full0.590/15 full0.894/15 full1.0015/15 full
Bug fix, L00.9420/28 full0.9116/28 full0.9121/28 full1.0028/28 full
Bug fix, L20.9824/28 full0.9721/28 full0.9723/28 full1.0028/28 full
Long context, 240K0.821/7 full0.600/7 full0.874/7 full1.007/7 full
Long context, 600K0.910/7 fullnot runnot runnot run

gpt2_forward

SettingBeamGPT-4.1GPT-5.2GPT-6 Astra
L0 write, no repo text0.870/2 full0.470/3 full0.931/2 full1.002/2 full
L2 write, relevant files0.961/3 full0.821/3 full1.002/2 full1.002/2 full
L5 write, broad slice1.002/2 full0.821/3 full1.002/2 full1.002/2 full
Agentic, tools only0.900/2 full0.670/2 full0.971/2 full1.002/2 full
Bug fix, L00.973/4 full0.932/4 full1.004/4 full1.004/4 full
Bug fix, L21.004/4 full1.004/4 full1.004/4 full1.004/4 full
Long context, 240K0.870/1 full0.600/1 full1.001/1 full1.001/1 full
Long context, 600K0.930/1 fullnot runnot runnot run

gpt2_generate

SettingBeamGPT-4.1GPT-5.2GPT-6 Astra
L0 write, no repo text0.590/2 full0.580/3 full0.971/2 full1.002/2 full
L2 write, relevant files0.940/2 full0.620/3 full0.940/2 full1.002/2 full
L5 write, broad slice0.910/2 full0.560/3 full0.840/2 full1.002/2 full
Agentic, tools only0.690/2 full0.660/2 full0.941/2 full1.002/2 full
Bug fix, L01.004/4 full1.004/4 full1.004/4 full1.004/4 full
Bug fix, L21.004/4 full0.983/4 full1.004/4 full1.004/4 full
Long context, 240K0.940/1 full0.560/1 full1.001/1 full1.001/1 full
Long context, 600K0.940/1 fullnot runnot runnot run

numpy_quantile

SettingBeamGPT-4.1GPT-5.2GPT-6 Astra
L0 write, no repo text0.380/2 full0.270/2 full0.520/2 full0.940/2 full
L2 write, relevant files0.480/2 full0.310/2 full0.440/2 full1.002/2 full
L5 write, broad slice0.440/2 full0.310/2 full0.380/2 full1.002/2 full
Agentic, tools only0.150/2 full0.270/2 full0.920/2 full1.002/2 full
Bug fix, L01.004/4 full0.971/4 full1.004/4 full1.004/4 full
Bug fix, L21.004/4 full0.993/4 full1.004/4 full1.004/4 full
Long context, 240K0.330/1 full0.330/1 full0.580/1 full1.001/1 full
Long context, 600K0.960/1 fullnot runnot runnot run

pandas_cut

SettingBeamGPT-4.1GPT-5.2GPT-6 Astra
L0 write, no repo text0.470/2 full0.430/2 full0.600/2 full0.901/2 full
L2 write, relevant files0.270/2 full0.470/2 full0.630/2 full1.002/2 full
L5 write, broad slice0.330/2 full0.530/2 full0.570/2 full1.002/2 full
Agentic, tools only0.500/2 full0.430/2 full0.670/2 full1.002/2 full
Bug fix, L00.782/4 full0.631/4 full0.681/4 full1.004/4 full
Bug fix, L21.004/4 full0.923/4 full0.923/4 full1.004/4 full
Long context, 240K0.670/1 full0.400/1 full0.530/1 full1.001/1 full
Long context, 600K0.670/1 fullnot runnot runnot run

sort_tracker

SettingBeamGPT-4.1GPT-5.2GPT-6 Astra
L0 write, no repo text0.440/2 full0.440/2 full0.470/2 full0.470/2 full
L2 write, relevant files1.002/2 full0.791/2 full1.002/2 full1.002/2 full
L5 write, broad slice0.791/2 full1.002/2 full0.971/2 full1.002/2 full
Agentic, tools only0.450/3 full0.490/3 full0.982/3 full1.003/3 full
Bug fix, L00.913/4 full0.943/4 full0.762/4 full1.004/4 full
Bug fix, L21.004/4 full1.004/4 full1.004/4 full1.004/4 full
Long context, 240K1.001/1 full0.650/1 full1.001/1 full1.001/1 full
Long context, 600K0.940/1 fullnot runnot runnot run

sortedlist_core

SettingBeamGPT-4.1GPT-5.2GPT-6 Astra
L0 write, no repo text0.880/2 full0.730/3 full0.880/2 full1.002/2 full
L2 write, relevant files1.002/2 full0.892/3 full1.002/2 full1.002/2 full
L5 write, broad slice1.003/3 full0.921/3 full1.002/2 full1.002/2 full
Agentic, tools only0.000/2 full0.840/2 full0.860/2 full1.002/2 full
Bug fix, L01.004/4 full1.004/4 full1.004/4 full1.004/4 full
Bug fix, L21.004/4 full1.004/4 full1.004/4 full1.004/4 full
Long context, 240K0.960/1 full0.680/1 full1.001/1 full1.001/1 full
Long context, 600K0.960/1 fullnot runnot runnot run

sortedlist_key

SettingBeamGPT-4.1GPT-5.2GPT-6 Astra
L0 write, no repo text0.740/3 full0.730/3 full0.800/2 full1.002/2 full
L2 write, relevant files0.950/3 full0.950/3 full0.950/2 full1.002/2 full
L5 write, broad slice0.950/2 full0.910/3 full0.950/2 full1.002/2 full
Agentic, tools only0.000/2 full0.820/2 full0.860/2 full1.002/2 full
Bug fix, L00.890/4 full0.921/4 full0.942/4 full1.004/4 full
Bug fix, L20.890/4 full0.890/4 full0.890/4 full1.004/4 full
Long context, 240K0.950/1 full0.950/1 full0.950/1 full1.001/1 full
Long context, 600K0.950/1 fullnot runnot runnot run

Data: omkar334/repo2mini-results