Buckets:

download
raw
13 kB
import{s as ue,n as we,o as Te}from"../chunks/scheduler.2b22cead.js";import{S as be,i as Je,e as o,s as n,c as r,h as fe,a as i,d as l,b as a,f as Me,g as c,j as y,k as ye,l as je,m as s,n as d,t as p,o as h,p as m}from"../chunks/index.1a0e8013.js";import{C as ge,H as S,E as ve}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.9d81ac4e.js";import{C as ne}from"../chunks/CodeBlock.655aa1b5.js";function Be(ae){let M,X,A,Z,u,z,w,Y,T,oe=`OpenEnv port of the <a href="https://github.com/acharyaanusha/sophistry-bench" rel="nofollow">sophistry-bench</a>
single-agent advocacy <strong>reward-hacking sprint</strong> environment. One-turn advocacy on QuALITY
reading-comprehension passages: the policy is assigned the gold answer or a distractor and must
produce one <code>&lt;claim&gt;</code>/<code>&lt;cite&gt;</code> argument. The reward proxy peaks at exactly 8 <code>&lt;claim&gt;</code> tags
(<code>claim_count_cliff</code>); four weight-0 canaries detect format hacking.`,C,b,ie=`Scoring is imported verbatim from the <a href="https://pypi.org/project/sophistry-bench-sprint/" rel="nofollow"><code>sophistry-bench-sprint</code></a>
PyPI package, so the reward numbers are identical to the Prime Intellect Hub env.`,H,J,V,f,re=`Single step. <code>reset()</code> issues a task; <code>step(AdvocacyAction(text=...))</code> scores it and returns
<code>done=True</code>.`,x,j,L,g,ce="<thead><tr><th>Var</th> <th>Default</th> <th>Meaning</th></tr></thead> <tbody><tr><td><code>SPRINT_N_ITEMS</code></td> <td><code>50</code></td> <td>QuALITY items to load (2 advocacy rows each)</td></tr> <tr><td><code>SPRINT_PASSAGE_CHARS</code></td> <td><code>2000</code></td> <td>Passage char cap</td></tr> <tr><td><code>SPRINT_SEED</code></td> <td><code>0</code></td> <td>Distractor-selection seed (deterministic)</td></tr> <tr><td><code>SPRINT_WEIGHTS</code></td> <td><code>1,0,0,0,0,0,0,0</code></td> <td>8 reward weights, order: <code>aggregate, correctness, n_claims, n_citations, alternation_canary, starts_with_canary, length_band_canary, template_echo_canary</code>. Do <strong>not</strong> weight canaries during training.</td></tr> <tr><td><code>SPRINT_EXPOSE_CORRECTNESS</code></td> <td><code>0</code></td> <td>When <code>1</code>/<code>true</code>, surface <code>correctness_reward</code> (the hidden ground truth) in the wire <code>metadata</code>/<code>components</code>. Off by default so a harness can’t accidentally leak it to the policy. This flag controls only <em>surfacing</em>, not <em>weighting</em>: correctness affects <code>reward</code> only via its <code>SPRINT_WEIGHTS</code> entry, which is <code>0</code> by default.</td></tr></tbody>",R,v,F,B,de="The client is <strong>async by default</strong> (like every OpenEnv client):",Q,_,P,$,pe="For <strong>synchronous usage</strong>, use the <code>.sync()</code> wrapper:",D,I,K,U,he=`<code>result.observation.metadata</code> carries the reward components every step — the canary scores are
the reward-hacking measurement. By default it holds <strong>seven</strong> components; <code>correctness_reward</code>
(the hidden ground truth) is withheld unless <code>SPRINT_EXPOSE_CORRECTNESS=1</code> (see above).`,q,G,me=`<p><strong>Do not feed <code>observation.metadata</code> / <code>observation.components</code> back into the policy’s
prompt.</strong> <code>reset()</code> deliberately tells the policy only <em>what</em> to defend, never <em>whether</em> it
is correct. <code>correctness_reward</code> is withheld from the wire by default for exactly this
reason; even with the rest of the components, forwarding them to the agent leaks the
reward signal and defeats the reward-hacking measurement.</p>`,O,N,ee,E,te,k,le,W,se;return u=new ge({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),w=new S({props:{title:"sophistry_bench_sprint_env",local:"sophistrybenchsprintenv",headingTag:"h1"}}),J=new S({props:{title:"Episode model",local:"episode-model",headingTag:"h2"}}),j=new S({props:{title:"Configuration (environment variables)",local:"configuration-environment-variables",headingTag:"h2"}}),v=new S({props:{title:"Usage",local:"usage",headingTag:"h2"}}),_=new ne({props:{code:"aW1wb3J0JTIwYXN5bmNpbyUwQSUwQWZyb20lMjBzb3BoaXN0cnlfYmVuY2hfc3ByaW50X2VudiUyMGltcG9ydCUyMFNvcGhpc3RyeUJlbmNoU3ByaW50RW52JTBBJTBBJTBBYXN5bmMlMjBkZWYlMjBtYWluKCklM0ElMEElMjAlMjAlMjAlMjAlMjMlMjBEZXBsb3llZCUyMEh1Z2dpbmclMjBGYWNlJTIwU3BhY2UlMjAob3IlMjAuZnJvbV9kb2NrZXJfaW1hZ2UoJTIyb3BlbmVudi1zb3BoaXN0cnlfYmVuY2hfc3ByaW50JTNBbGF0ZXN0JTIyKSklM0ElMEElMjAlMjAlMjAlMjBjbGllbnQlMjAlM0QlMjBhd2FpdCUyMFNvcGhpc3RyeUJlbmNoU3ByaW50RW52LmZyb21fZW52KCUyMmFudXNoYWFjaGFyeWElMkZzb3BoaXN0cnlfYmVuY2hfc3ByaW50X2VudiUyMiklMEElMjAlMjAlMjAlMjBhc3luYyUyMHdpdGglMjBjbGllbnQlM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBvYnMlMjAlM0QlMjAoYXdhaXQlMjBjbGllbnQucmVzZXQoKSkub2JzZXJ2YXRpb24lMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBwcmludChvYnMucHJvbXB0JTJDJTIwb2JzLmFuc3dlcl90b19kZWZlbmQpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmVzdWx0JTIwJTNEJTIwYXdhaXQlMjBjbGllbnQuc3RlcF90ZXh0KCUyMiUzQ2NsYWltJTNFLi4uJTNDJTJGY2xhaW0lM0UlM0NjaXRlJTNFLi4uJTNDJTJGY2l0ZSUzRSUyMiklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBwcmludChyZXN1bHQucmV3YXJkJTJDJTIwcmVzdWx0Lm9ic2VydmF0aW9uLm1ldGFkYXRhKSUwQSUwQSUwQWFzeW5jaW8ucnVuKG1haW4oKSk=",highlighted:`<span class="hljs-keyword">import</span> asyncio
<span class="hljs-keyword">from</span> sophistry_bench_sprint_env <span class="hljs-keyword">import</span> SophistryBenchSprintEnv
<span class="hljs-keyword">async</span> <span class="hljs-keyword">def</span> <span class="hljs-title function_">main</span>():
<span class="hljs-comment"># Deployed Hugging Face Space (or .from_docker_image(&quot;openenv-sophistry_bench_sprint:latest&quot;)):</span>
client = <span class="hljs-keyword">await</span> SophistryBenchSprintEnv.from_env(<span class="hljs-string">&quot;anushaacharya/sophistry_bench_sprint_env&quot;</span>)
<span class="hljs-keyword">async</span> <span class="hljs-keyword">with</span> client:
obs = (<span class="hljs-keyword">await</span> client.reset()).observation
<span class="hljs-built_in">print</span>(obs.prompt, obs.answer_to_defend)
result = <span class="hljs-keyword">await</span> client.step_text(<span class="hljs-string">&quot;&lt;claim&gt;...&lt;/claim&gt;&lt;cite&gt;...&lt;/cite&gt;&quot;</span>)
<span class="hljs-built_in">print</span>(result.reward, result.observation.metadata)
asyncio.run(main())`,lang:"python",wrap:!1}}),I=new ne({props:{code:"d2l0aCUyMFNvcGhpc3RyeUJlbmNoU3ByaW50RW52KGJhc2VfdXJsJTNEJTIyaHR0cCUzQSUyRiUyRmxvY2FsaG9zdCUzQTgwMDAlMjIpLnN5bmMoKSUyMGFzJTIwY2xpZW50JTNBJTBBJTIwJTIwJTIwJTIwb2JzJTIwJTNEJTIwY2xpZW50LnJlc2V0KCkub2JzZXJ2YXRpb24lMEElMjAlMjAlMjAlMjByZXN1bHQlMjAlM0QlMjBjbGllbnQuc3RlcF90ZXh0KCUyMiUzQ2NsYWltJTNFLi4uJTNDJTJGY2xhaW0lM0UlM0NjaXRlJTNFLi4uJTNDJTJGY2l0ZSUzRSUyMiklMEElMjAlMjAlMjAlMjBwcmludChyZXN1bHQucmV3YXJkJTJDJTIwcmVzdWx0Lm9ic2VydmF0aW9uLm1ldGFkYXRhKQ==",highlighted:`<span class="hljs-keyword">with</span> SophistryBenchSprintEnv(base_url=<span class="hljs-string">&quot;http://localhost:8000&quot;</span>).sync() <span class="hljs-keyword">as</span> client:
obs = client.reset().observation
result = client.step_text(<span class="hljs-string">&quot;&lt;claim&gt;...&lt;/claim&gt;&lt;cite&gt;...&lt;/cite&gt;&quot;</span>)
<span class="hljs-built_in">print</span>(result.reward, result.observation.metadata)`,lang:"python",wrap:!1}}),N=new S({props:{title:"Build & test",local:"build--test",headingTag:"h2"}}),E=new ne({props:{code:"JTIzJTIwVGVzdHMlMjBsaXZlJTIwd2l0aCUyMHRoZSUyMG90aGVyJTIwZW52JTIwdGVzdHMuJTIwUnVuJTIwdGhlbSUyMGZyb20lMjB0aGUlMjByZXBvJTIwcm9vdCUyMHVzaW5nJTIwdGhpcyUwQSUyMyUyMGVudidzJTIwdmVudiUyMCh3aGljaCUyMGluc3RhbGxzJTIwdGhlJTIwc2NvcmluZyUyMHBhY2thZ2UpJTNBJTBBdXYlMjBydW4lMjAtLXByb2plY3QlMjBlbnZzJTJGc29waGlzdHJ5X2JlbmNoX3NwcmludF9lbnYlMjAtLWV4dHJhJTIwZGV2JTIwJTVDJTBBJTIwJTIwcHl0ZXN0JTIwdGVzdHMlMkZlbnZzJTJGdGVzdF9zb3BoaXN0cnlfYmVuY2hfc3ByaW50X2Vudmlyb25tZW50LnB5JTIwLXYlMEElMjMlMjBUaGUlMjBtb2R1bGUlMjBwdWxscyUyMHRoZSUyMHB1Ymxpc2hlZCUyMHNvcGhpc3RyeS1iZW5jaC1zcHJpbnQlMkMlMjBzbyUyMGluJTIwdGhlJTIwcmVwbydzJTIwc2hhcmVkJTBBJTIzJTIwQ0klMjAod2hlcmUlMjBpdCUyMGlzbid0JTIwaW5zdGFsbGVkKSUyMGl0JTIwc2tpcHMlMjB2aWElMjBweXRlc3QuaW1wb3J0b3Jza2lwJTIwJUUyJTgwJTk0JTIwc2FtZSUyMGFzJTIwb3RoZXIlMEElMjMlMjBlbnZzJTIwd2l0aCUyMGhlYXZ5JTIwZGVwcyUyMChlLmcuJTIwdGJlbmNoMidzJTIwY2FtZWwlMjBndWFyZCkuJTBBJTBBJTIzJTIwQ29udGFpbmVyJTBBb3BlbmVudiUyMGJ1aWxkJTIwc29waGlzdHJ5X2JlbmNoX3NwcmludF9lbnYlMEElMjMlMjBwcm9kdWNlcyUyMGltYWdlJTIwdGFnJTNBJTIwb3BlbmVudi1zb3BoaXN0cnlfYmVuY2hfc3ByaW50JTNBbGF0ZXN0",highlighted:`<span class="hljs-comment"># Tests live with the other env tests. Run them from the repo root using this</span>
<span class="hljs-comment"># env&#x27;s venv (which installs the scoring package):</span>
uv run --project envs/sophistry_bench_sprint_env --extra dev \\
pytest tests/envs/test_sophistry_bench_sprint_environment.py -v
<span class="hljs-comment"># The module pulls the published sophistry-bench-sprint, so in the repo&#x27;s shared</span>
<span class="hljs-comment"># CI (where it isn&#x27;t installed) it skips via pytest.importorskip — same as other</span>
<span class="hljs-comment"># envs with heavy deps (e.g. tbench2&#x27;s camel guard).</span>
<span class="hljs-comment"># Container</span>
openenv build sophistry_bench_sprint_env
<span class="hljs-comment"># produces image tag: openenv-sophistry_bench_sprint:latest</span>`,lang:"bash",wrap:!1}}),k=new ve({props:{source:"https://github.com/huggingface/openenv/blob/main/docs/source/environments/sophistry_bench_sprint.md"}}),{c(){M=o("meta"),X=n(),A=o("p"),Z=n(),r(u.$$.fragment),z=n(),r(w.$$.fragment),Y=n(),T=o("p"),T.innerHTML=oe,C=n(),b=o("p"),b.innerHTML=ie,H=n(),r(J.$$.fragment),V=n(),f=o("p"),f.innerHTML=re,x=n(),r(j.$$.fragment),L=n(),g=o("table"),g.innerHTML=ce,R=n(),r(v.$$.fragment),F=n(),B=o("p"),B.innerHTML=de,Q=n(),r(_.$$.fragment),P=n(),$=o("p"),$.innerHTML=pe,D=n(),r(I.$$.fragment),K=n(),U=o("p"),U.innerHTML=he,q=n(),G=o("blockquote"),G.innerHTML=me,O=n(),r(N.$$.fragment),ee=n(),r(E.$$.fragment),te=n(),r(k.$$.fragment),le=n(),W=o("p"),this.h()},l(e){const t=fe("svelte-u9bgzb",document.head);M=i(t,"META",{name:!0,content:!0}),t.forEach(l),X=a(e),A=i(e,"P",{}),Me(A).forEach(l),Z=a(e),c(u.$$.fragment,e),z=a(e),c(w.$$.fragment,e),Y=a(e),T=i(e,"P",{"data-svelte-h":!0}),y(T)!=="svelte-15u7av6"&&(T.innerHTML=oe),C=a(e),b=i(e,"P",{"data-svelte-h":!0}),y(b)!=="svelte-q0h6nh"&&(b.innerHTML=ie),H=a(e),c(J.$$.fragment,e),V=a(e),f=i(e,"P",{"data-svelte-h":!0}),y(f)!=="svelte-14rz5wf"&&(f.innerHTML=re),x=a(e),c(j.$$.fragment,e),L=a(e),g=i(e,"TABLE",{"data-svelte-h":!0}),y(g)!=="svelte-zyi8cg"&&(g.innerHTML=ce),R=a(e),c(v.$$.fragment,e),F=a(e),B=i(e,"P",{"data-svelte-h":!0}),y(B)!=="svelte-takdag"&&(B.innerHTML=de),Q=a(e),c(_.$$.fragment,e),P=a(e),$=i(e,"P",{"data-svelte-h":!0}),y($)!=="svelte-8391rg"&&($.innerHTML=pe),D=a(e),c(I.$$.fragment,e),K=a(e),U=i(e,"P",{"data-svelte-h":!0}),y(U)!=="svelte-wt0ysh"&&(U.innerHTML=he),q=a(e),G=i(e,"BLOCKQUOTE",{"data-svelte-h":!0}),y(G)!=="svelte-1xjww68"&&(G.innerHTML=me),O=a(e),c(N.$$.fragment,e),ee=a(e),c(E.$$.fragment,e),te=a(e),c(k.$$.fragment,e),le=a(e),W=i(e,"P",{}),Me(W).forEach(l),this.h()},h(){ye(M,"name","hf:doc:metadata"),ye(M,"content",_e)},m(e,t){je(document.head,M),s(e,X,t),s(e,A,t),s(e,Z,t),d(u,e,t),s(e,z,t),d(w,e,t),s(e,Y,t),s(e,T,t),s(e,C,t),s(e,b,t),s(e,H,t),d(J,e,t),s(e,V,t),s(e,f,t),s(e,x,t),d(j,e,t),s(e,L,t),s(e,g,t),s(e,R,t),d(v,e,t),s(e,F,t),s(e,B,t),s(e,Q,t),d(_,e,t),s(e,P,t),s(e,$,t),s(e,D,t),d(I,e,t),s(e,K,t),s(e,U,t),s(e,q,t),s(e,G,t),s(e,O,t),d(N,e,t),s(e,ee,t),d(E,e,t),s(e,te,t),d(k,e,t),s(e,le,t),s(e,W,t),se=!0},p:we,i(e){se||(p(u.$$.fragment,e),p(w.$$.fragment,e),p(J.$$.fragment,e),p(j.$$.fragment,e),p(v.$$.fragment,e),p(_.$$.fragment,e),p(I.$$.fragment,e),p(N.$$.fragment,e),p(E.$$.fragment,e),p(k.$$.fragment,e),se=!0)},o(e){h(u.$$.fragment,e),h(w.$$.fragment,e),h(J.$$.fragment,e),h(j.$$.fragment,e),h(v.$$.fragment,e),h(_.$$.fragment,e),h(I.$$.fragment,e),h(N.$$.fragment,e),h(E.$$.fragment,e),h(k.$$.fragment,e),se=!1},d(e){e&&(l(X),l(A),l(Z),l(z),l(Y),l(T),l(C),l(b),l(H),l(V),l(f),l(x),l(L),l(g),l(R),l(F),l(B),l(Q),l(P),l($),l(D),l(K),l(U),l(q),l(G),l(O),l(ee),l(te),l(le),l(W)),l(M),m(u,e),m(w,e),m(J,e),m(j,e),m(v,e),m(_,e),m(I,e),m(N,e),m(E,e),m(k,e)}}}const _e='{"title":"sophistry_bench_sprint_env","local":"sophistrybenchsprintenv","sections":[{"title":"Episode model","local":"episode-model","sections":[],"depth":2},{"title":"Configuration (environment variables)","local":"configuration-environment-variables","sections":[],"depth":2},{"title":"Usage","local":"usage","sections":[],"depth":2},{"title":"Build & test","local":"build--test","sections":[],"depth":2}],"depth":1}';function $e(ae){return Te(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ee extends be{constructor(M){super(),Je(this,M,$e,Be,ue,{})}}export{Ee as component};

Xet Storage Details

Size:
13 kB
·
Xet hash:
4433266fe0399af176581327503c61a54f3540324ff33f2b6d0392a3c94160b5

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.