Back to Home
AI

Cognition launches new SWE-2 model, Rivaling Fable 5.1 and GPT-Astra

Article URL: https://cognition.com/blog/swe-2 Comments URL: https://news.ycombinator.com/item?id=49645443 Points: 290 # Comments: 120

t
tech4you AI
September 12, 20265 min read
Share

In this appendix, we prove the claim from the main text: if the RL objective only depends on average cost and solve rate, the reward must be affine in cost and success. For simplicity, we allow S[0,1]S \in [0, 1]. The result also holds for binary success S{0,1}S \in \{0, 1\}, but we omit the more involved proof for this blog.

Let X=(C,S)X=(C,S) denote the cost and success of a rollout and let h(X)h(X) be its reward. Recall the assumptions we made in the section above. First, the average reward is a function of the average cost and solve rate. Equivalently, there is a fixed function ff such that

E[h(X)]=f(E[X]).\mathbb{E}[h(X)]=f(\mathbb{E}[X]).

Second, this identity holds for every distribution of XX supported on at most two points (in the main section above, we stated for simplicity the assumption that it holds for all distributions, but this is in fact stronger than is really needed!).

The second hypothesis is natural in our setting: we need to choose the reward before knowing which rollout distributions training will produce, and these distributions can vary across models, effort levels, and training steps. Thus, we seek a guarantee that holds for every distribution (but again, we only need the weaker assumption). We need the following simple fact.

Jensen’s functional equation. A function h:DRh:D\to\mathbb{R} on a convex set DRnD\subseteq\mathbb{R}^n satisfies

h(tx+(1t)y)=th(x)+(1t)h(y),x,yD, t[0,1]h(tx+(1-t)y)=th(x)+(1-t)h(y), \quad \forall x,y\in D,\ t\in[0,1]

if and only if h(x)=cx+bh(x) = c^\top x + b for some cRnc \in \mathbb{R}^n and bRb \in \mathbb{R}.

For deterministic X=xX=x, the hypothesis says that f(x)=h(x)f(x)=h(x), so f=hf=h. Now taking X=xX=x with probability tt and X=yX=y with probability 1t1-t gives

th(x)+(1t)h(y)=h(tx+(1t)y).th(x)+(1-t)h(y)=h(tx+(1-t)y).

Thus hh satisfies Jensen’s functional equation and is affine: R=h(C,S)=α+βSλCR=h(C,S)=\alpha+\beta S-\lambda C. Dropping the additive constant α\alpha and rescaling to set β=1\beta=1 leaves R=SλCR=S-\lambda C as desired.


Originally published on Hacker News (Best)

Related Articles