DemoARA Lab

Hill-Climbing Chip Design with a Self-Improving Loop

We pointed our self-improving loop at a hardware hill-climbing task: make an arithmetic unit smaller and faster while keeping it exactly correct. Here is what happened.

PrincipleThe customer's flow grades every design. The loop learns from the grades.
Variants where the loop led
6 / 6

against the best of Codex Astra and Claude Code Fable

Best score, bf16 exp
29.9

vs 21.0 for the strongest frontier agent

Inputs checked per design
65,536

bit-exact on the synthesized netlist

The task

Softmax sits inside every attention layer, and its one transcendental is the exponential. An accelerator team needs that unit small, because an accelerator replicates it many times. So we asked the loop to design a bfloat16 exponential, y = e^x, at the smallest area that still meets the clock.

FUNCTION y = ex  —  the only transcendental in a softmax stage FORMAT · IN in_x [15:0] bfloat16 — 1 sign · 8 exp · 7 mantissa bf16_exp ex FORMAT · OUT out_y [15:0] bfloat16, correctly rounded LATENCY at most 2 register stages, in to result CLOCK  routed fmax ≥ 80 MHz THROUGHPUT one result per cycle, in order
Figure 1. The contract. A 16-bit bfloat16 input enters, a correctly rounded bfloat16 result leaves, one per cycle, through at most two register stages, at 80 MHz or faster.

The rules are strict, and the flow enforces all of them:

  • Correct on every input. All 65,536 encodings are simulated on the synthesized netlist: normals, subnormals, both zeros, both infinities and all 254 NaNs. The answer must be correctly rounded (0 ULP error), with ties to even.
  • Inside the envelope. At most 4,000 LUT4 equivalents, 16 DSP blocks and 2 block RAMs on a Lattice ECP5, built with yosys, nextpnr and verilator.
  • Gated, then scored. A design that misses the clock, latency or area gate scores zero. Among designs that pass, smaller and faster scores higher.
area = lut4_eq + ff + 3000·dsp + 1152·ebrscore = 10000 / area × min(fmax / 80, 1.2)

A DSP block costs as much area as 3,000 LUTs, so the score pushes hard against hard multipliers. The task comes in six variants that change the clock, latency, accuracy and resource limits.

Why a coding agent alone falls short

A frontier coding agent can write Verilog and run the tools. Left alone, it still tends to stop at the first design that passes. Each run starts from zero, so what one attempt learns about cheap encodings or where to put a register is lost before the next attempt. The know-how that closes the gap lives in senior designers’ heads, and in the tool reports the agent read once and forgot.

How the loop works

Our loop wraps the same agents and tools in four parts. Each part answers one question that a good design team asks every day.

IDEA EXPERIMENT RESULTS KNOW-HOW WHAT WE ALREADY KNOW AGENT INFRA Agents equipped with EDA tools, licenses and compute RUNS EVERY EXPERIMENT 01 THE BRAIN Search Planner Payoff predictor Exploration map Budget scheduler Idea queue 02 THE METHOD Experiment Controller Hypothesis → experiment Ablations Scheduler Evaluation 03 THE MEMORY Research Ledger Tried Works Verified Open 04 THE LIBRARY Knowledge Base Design flows EDA tool docs Timing & DV rules Past projects
Figure 2. The inner loop. The planner picks an idea, the controller turns it into an experiment, agents with EDA tools run it, and the flow grades it. The ledger records the result and feeds the next idea.
  1. Search planner. Picks the idea most likely to pay off, and spends the next hour of compute where the map is still blank.
  2. Experiment controller. Turns an idea into a run with a baseline, and checks whether a gain is real or noise.
  3. Research ledger. Records what was tried, what worked, and which tool report proves it. A claim counts only when a tool run backs it.
  4. Knowledge base. Supplies design flows, tool documentation, timing rules and lessons from past projects.

A second, slower loop runs on top. The graded runs become training data for an open-weight model, and the stronger model plugs back into the loop.

Results

Every system got the same task, the same tools, and the same grader. On all six variants, the loop reached a higher score than both frontier agents, and usually got there sooner.

Six panels of best score so far against workload time. Our loop leads on every variant.
Figure 3. Best score so far against workload time, one panel per variant. Blue is our loop, orange is Codex Astra, green is Claude Code Fable. Faint dots are individual graded designs.
VariantOur loopCodex AstraClaude Code FableLead
a3-bf16-exp29.921.016.1+42%
a3v-bf16-exp245.735.625.9+28%
a3v-bf16-lat336.614.319.4+89%
a3v-bf16-negdom26.522.418.0+18%
a3v-bf16-ulp29.923.119.5+29%
a3v-dsp300-lut1k-f12021.711.2no pass+94%

The first variant shows the shape of the gap most clearly. The loop reached 29.9 at minute 23. Codex Astra needed about 42 minutes to reach 21.0. We also ran an open-weight model post-trained on the loop’s graded runs: it reached 22.1, ahead of both frontier agents, though still behind the loop.

0102030 01020304050 min CODEX ASTRA ALONE · 21.0 CLAUDE CODE FABLE ALONE · 16.1 TRAINED MODEL 22.1 OUR LOOP 29.9
Figure 4. The bf16 exponential (a3-bf16-exp) on one clock. Grey lines are the frontier agents alone. The dashed line is the post-trained open-weight model. The solid line is our loop.

What the loop built

The winning design uses no multiplier and no hard block at all. It is 377 LUT4s and 24 flip-flops, 401 area units in total, and it runs at 95.95 MHz with one register stage of its own. It is correctly rounded on every one of the 65,536 inputs.

exp(x) = 2^t, t = x·log₂e = k + f y = (k+127)·128 + seg/2 − d[seg] + (lo ≥ th[seg]) · one carry chain does all four Our RSI systems — rsi-001 best score on a3-bf16-exp: 29.91 377 LUT4 + 24 FF = 401 area units no DSP · no block RAM · 95.95 MHz · latency 1 · 0 ULP the harness wrapper registers the boundary · the design adds one register stage of its own: latency 1 · one result per cycle 1 · REDUCE M×log₂e: 2 tables, 1 add 2 · ALIGN + SIGN shift by r, XOR s → t = k.f 24 FF 3 · TABLE + ONE CHAIN base, round, bias in one add out_y bfloat16, 0 ULP in_x bfloat16, whole line TA,TB + classifier in LUTs · 36 LUT4 · no EBR bases + thresholds 161 LUT4 · no block RAM No multiplier and no hard block anywhere: the range reduction is two small chunk tables summed on one carry chain, and the alignment is four hand-mapped LUT4 stages with the sign fold in the last. Specials force a substitute value into the register, so stage B needs no logic of its own.
Figure 5. The design. It rewrites e^x as 2^t and splits t into an integer and a fraction. Two small lookup tables and one adder do the range reduction. A threshold table and a single 24-bit carry chain then round and assemble the result.

Here is the trick in plain terms. The usual textbook design multiplies the input by log₂e, which needs a multiplier. The loop found that, for 16-bit inputs, the product can be built from two tiny tables added on one carry chain. Rounding, the exponent bias and the final assembly all ride on that same chain. Special inputs such as infinity and NaN load a fixed value into the register, so the second stage needs no extra logic.

A second example: trimming a multiplier

The same behavior shows up on an fp16 exponential tuned for clock speed. Here the loop kept a multiplier but made it narrower. It re-fit the slope coefficients to multiples of 32, which stores 9 bits instead of 14 and shrinks the multiplier from 14×11 to 9×11. The re-fit breaks a few inputs. A small exact-match block corrects those 7 inputs before rounding, so the result stays correctly rounded.

SLOPE · RE-FIT TO MULTIPLES OF 32 d8d7d6d5d4 d3d2d1d0 00000 9 stored 5 fixed zeros 14→9 stored slope bits x fp16 coeff ROM base · slope 14×11 SAVED 9×11 multiplier residual 11b slope 9b base ≪5 wired + +bias round y fp16 exact-input match 9 → 16 +7 bias set before rounding range reduction / registers omitted · schematic, not area-scaled
Figure 6. Five slope bits become fixed zeros, wired as a shift. An exact-input match block corrects the 7 inputs that notice. Schematic, not drawn to area.
fp16 exponentialAreafmax (MHz)Score
Our loop1,215119.3516.37
Codex Astra1,338122.4614.95
Claude Code Fable3,98459.290 (missed 60 MHz)

In a local ablation between two versions of the loop, this one idea cut the unit’s area from 1,842 to 1,411, a 23.4% drop.

How to read these numbers

  • Each line is a single run. We have not yet repeated runs to measure spread.
  • The flow is an open-source FPGA flow on a Lattice ECP5, so anyone can rerun the grader. Area counts LUT4 equivalents and flip-flops, with hard blocks charged at the weights above.
  • All systems shared the same harness files: the makefile, scoring and gate scripts, testbench and reference model.
  • The post-trained open-weight model passes up to 75% of runs. Its circuits are still larger than the loop’s best, and closing that gap needs more data and compute.

What this means for a chip team

Nothing here is specific to exponentials. The loop needs three things a chip team already has: a spec, a flow that grades a design, and the tools that flow runs. We set the loop up on the team’s own flow, inside its network. The team keeps the graded traces, the benchmark and any trained weights, so each project starts from everything the last one learned.

Want to see this loop on your own flow? contact@ara-commons.com

Next: Science in Broad Daylight