Dataset Viewer
Auto-converted to Parquet Duplicate
id
stringlengths
5
16
mode
stringclasses
6 values
split
stringclasses
2 values
spec
stringlengths
21
79
hidden_test
stringlengths
72
162
reference_broken
stringlengths
28
51
reference_fixed
stringlengths
28
88
safe-qty
null-fields
train
solve(order) → order['qty'] as int, default 1 if missing or None.
from solution import solve assert solve({'qty':3})==3 assert solve({})==1 assert solve({'qty':None})==1
def solve(o): return int(o['qty'])
def solve(o): v=o.get('qty') return 1 if v is None else int(v)
safe-name
null-fields
holdout
solve(user) → user['name'] stripped, default 'guest' if missing/None/blank.
from solution import solve assert solve({'name':' Al '})=='Al' assert solve({})=='guest' assert solve({'name':None})=='guest' assert solve({'name':' '})=='guest'
def solve(u): return u['name'].strip()
def solve(u): v=u.get('name') v=(v or '').strip() return v if v else 'guest'
safe-price
null-fields
train
solve(item) → float(item['price']), default 0.0 if missing or None.
from solution import solve assert solve({'price':'2.5'})==2.5 assert solve({})==0.0 assert solve({'price':None})==0.0
def solve(i): return float(i['price'])
def solve(i): v=i.get('price') return 0.0 if v is None else float(v)
safe-tags
null-fields
holdout
solve(post) → number of tags in post['tags'], default 0 if key missing or None.
from solution import solve assert solve({'tags':['a','b']})==2 assert solve({})==0 assert solve({'tags':None})==0
def solve(p): return len(p['tags'])
def solve(p): v=p.get('tags') return 0 if v is None else len(v)
sum-strings
type-coercion
train
solve(rows) → numeric sum of a list of string integers like '12','8'.
from solution import solve assert solve(['12','8'])==20 assert solve([])==0 assert solve(['3','3','4'])==10
def solve(r): return sum(r)
def solve(r): return sum(int(x) for x in r)
max-string-num
type-coercion
holdout
solve(vals) → the largest value in a list of numeric strings, as int.
from solution import solve assert solve(['2','10','7'])==10 assert solve(['5'])==5
def solve(v): return int(max(v))
def solve(v): return max(int(x) for x in v)
avg-scores
type-coercion
train
solve(scores) → integer average (floor) of a list of numeric strings.
from solution import solve assert solve(['10','20'])==15 assert solve(['3','3','4'])==3
def solve(s): return sum(s)//len(s)
def solve(s): n=[int(x) for x in s] return sum(n)//len(n)
sum-list
edge-empty
train
solve(nums) → sum of a list of ints; 0 for empty.
from solution import solve assert solve([1,2,3])==6 assert solve([])==0 assert solve([-2,2])==0
def solve(n): return n[0]+sum(n[1:])
def solve(n): return sum(n)
first-or-default
edge-empty
holdout
solve(xs) → first element, or None if empty.
from solution import solve assert solve([9,8])==9 assert solve([])is None
def solve(x): return x[0]
def solve(x): return x[0] if x else None
mean-safe
edge-empty
train
solve(nums) → average as float, or 0.0 for empty list.
from solution import solve assert solve([2,4])==3.0 assert solve([])==0.0
def solve(n): return sum(n)/len(n)
def solve(n): return sum(n)/len(n) if n else 0.0
last-item
off-by-one
holdout
solve(items) → last element, or None if empty.
from solution import solve assert solve([1,2,3])==3 assert solve([])is None assert solve(['a'])=='a'
def solve(i): return i[len(i)-2] if i else None
def solve(i): return i[-1] if i else None
last-n
off-by-one
train
solve(xs, n) → the last n elements in order.
from solution import solve assert solve([1,2,3,4],2)==[3,4] assert solve([1],3)==[1]
def solve(x,n): return x[len(x)-n+1:]
def solve(x,n): return x[-n:] if n<=len(x) else x[:]
money-round
precision
train
solve(cents) → dollars string like '1.05' from an integer number of cents.
from solution import solve assert solve(105)=='1.05' assert solve(100)=='1.00' assert solve(9)=='0.09'
def solve(c): return str(c/100)
def solve(c): return f'{c//100}.{c%100:02d}'
pct-of
precision
holdout
solve(part, whole) → percentage rounded to 1 decimal, as a string like '33.3'.
from solution import solve assert solve(1,3)=='33.3' assert solve(1,2)=='50.0'
def solve(p,w): return str(p/w*100)
def solve(p,w): return f'{round(p/w*100,1):.1f}'
dedupe-order
ordering
holdout
solve(xs) → duplicates removed, first-seen order preserved; empty→empty.
from solution import solve assert solve([1,1,2,3,2])==[1,2,3] assert solve([])==[] assert solve(['a','a'])==['a']
def solve(x): return list(set(x))
def solve(x): s=[] for v in x: if v not in s: s.append(v) return s
double
null
train
solve(n) → n doubled.
from solution import solve assert solve(4)==8 assert solve(0)==0 assert solve(-3)==-6
def solve(n): return n*2
def solve(n): return n*2
upper
null
holdout
solve(s) → s uppercased.
from solution import solve assert solve('hi')=='HI' assert solve('')==''
def solve(s): return s.upper()
def solve(s): return s.upper()

flywheel — a benchmark for RL on agent trajectories

A small, controlled benchmark for studying whether a coding agent can improve from its own graded failures — reinforcement learning at the context layer (the policy update is a durable lesson carried in context, not a weight change) — together with the baseline results from running it live on Daytona sandboxes with a real coding agent.

Companion to github.com/abhid1234/flywheel. The full method and honest write-up: FINDINGS.

Why these tasks are interesting

A strong model aces ordinary code-gen tasks at baseline — there is nothing to learn. Real learning only shows up at the model's failure frontier. The conventions split puts it there: each spec is deliberately underspecified on one point, and a hidden test enforces a convention the model cannot infer (empty input → None, "unique" → sorted, ranges inclusive of both ends, 1-indexed positions, case-insensitive matching, ISO dates, …). Cold, a competent model guesses — and often guesses wrong. Once it has learned the convention, it complies. This is how an agent meets a codebase's implicit rules: by getting them wrong first, then learning from the failure.

Splits

config tasks description
conventions 27 hidden-convention tasks across 9 failure modes — the learnable frontier
codegen 17 plainer code-gen tasks (edge cases, type coercion, precision) — mostly aced cold

Each row:

{
  "id": "nth-item",
  "mode": "one-indexed",
  "split": "train",
  "spec": "solve(items, n) → the item at position n.",
  "hidden_test": "from solution import solve\nassert solve(['a','b','c'],1)=='a'\n...",
  "reference_broken": "def solve(i,n):\n    return i[n]",
  "reference_fixed": "def solve(i,n):\n    return i[n-1]"
}
  • spec — the (underspecified) prompt given to the agent.
  • hidden_test — the grader. Kept out of the agent's reach; this is the verifiable reward.
  • reference_broken / reference_fixed — a buggy and a correct solution, for validating a grader offline with zero LLM cost (broken must fail, fixed must pass).
  • mode — the recurring failure a single durable lesson repairs; split — train / holdout. Improvement is only ever measured on the sealed holdout split the agent never learns from.

Results (results/)

Baseline runs with a live Codex agent, code executed against the hidden tests in isolated Daytona sandboxes. Reported honestly, including the parts that refuted the hypothesis:

  • live-curve.json — one live run: 27% → 76% on the sealed held-out set, learning lessons the model wrote itself.
  • replication.json — 4 independent runs: every run climbed (+27 to +48pp) from an identical baseline. The mechanism reproduces; which individual lesson lands varies with run-to-run noise.
  • sweep-k04..k16.json — a rollout sweep. The final does not rise with compute (73/67/66/59%); what scales, exactly as 1/√K, is measurement precision (the noise band: 12.7 → 8.9 → 7.3 → 6.3pp). More compute buys a sharper ruler, not a faster runner.
  • credit-real.json — snapshot/replay credit assignment localizing which step of a failed trajectory caused it.

The one rule

The model writes the fix. It never writes the success criterion.

The reward comes from the hidden tests, fixed in advance and out of the model's reach. A lesson is only credited when its gain on the sealed held-out set clears a measured noise floor — the loop refuses to credit an improvement it cannot distinguish from noise.

Citation

flywheel: agents that improve from their own production traces.
https://github.com/abhid1234/flywheel  ·  MIT.
Downloads last month
40