Datasets:
File size: 20,721 Bytes
99e41a8 654707f 99e41a8 f4fdc38 99e41a8 caa90b0 f4fdc38 caa90b0 c5de05c f4fdc38 caa90b0 c5de05c caa90b0 f4fdc38 caa90b0 f4fdc38 caa90b0 f4fdc38 caa90b0 f4fdc38 caa90b0 f4fdc38 caa90b0 f4fdc38 caa90b0 99e41a8 caa90b0 99e41a8 c5de05c 99e41a8 caa90b0 99e41a8 caa90b0 f4fdc38 99e41a8 caa90b0 99e41a8 caa90b0 99e41a8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | #!/usr/bin/env python3
"""Build the static Hugging Face Space (showcase page) from results/leaderboard.json.
python scripts/make_space.py OUT_DIR -> OUT_DIR/index.html, OUT_DIR/README.md
Media are served from the dataset repo (resolve URLs), so the Space stays small and never drifts from it.
"""
import html
import json
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
DS = "Nabidnur/RoboRACE-Bench"
RES = f"https://huggingface.co/datasets/{DS}/resolve/main"
GH = "https://github.com/Hisernberg/robotics"
def pct(x, d=1):
return "–" if x is None or x != x else f"{100 * x:.{d}f}"
def table(rows, cols, highlight=lambda r: False):
head = "".join(f"<th>{c}</th>" for c, _ in cols) # column titles are trusted literals (may contain entities)
body = ""
for r in rows:
cls = ' class="ours"' if highlight(r) else ""
body += f"<tr{cls}>" + "".join(f"<td>{f(r)}</td>" for _, f in cols) + "</tr>"
return f'<div class="tw"><table><thead><tr>{head}</tr></thead><tbody>{body}</tbody></table></div>'
def lb_rows(lb, key, n=9):
rs = lb.get(key, [])
rs = rs[:n] + [r for r in rs[n:] if r["method"].startswith("REF")]
return table(rs, [("rank", lambda r: f"{r['rank']:.0f} <small>({r['rank_lo']}–{r['rank_hi']})</small>" if "rank" in r else "ref"),
("method", lambda r: html.escape(r["method"])),
("mean", lambda r: f"<b>{pct(r['mean_acc'])}</b>"),
("clean", lambda r: pct(r["clean"])),
("liars < 50%", lambda r: pct(r["minority_liars"])),
("liars ≥ 50%", lambda r: pct(r["majority_liars"])),
("worst cell", lambda r: pct(r["worst_cell"]))],
highlight=lambda r: "new" in r["method"] or r["method"].startswith(("race_c", "race_map", "race_net_m")))
def fig(path, caption, width="100%"):
return (f'<figure><img loading="lazy" src="{RES}/{path}" style="width:{width}" alt="{html.escape(caption)}">'
f"<figcaption>{caption}</figcaption></figure>")
def video(path, caption, autoplay=False):
ap = " autoplay" if autoplay else ""
return (f'<figure><video controls muted loop playsinline preload="metadata"{ap} src="{RES}/{path}"></video>'
f"<figcaption>{caption}</figcaption></figure>")
def build(out):
out = Path(out)
out.mkdir(parents=True, exist_ok=True)
lb = json.loads((ROOT / "results/leaderboard.json").read_text())
rep, sw, pb = lb.get("ERQA_reproduction", {}), lb.get("ERQA_swarm", {}), lb.get("PlanBench", {})
rep768 = lb.get("ERQA_reproduction_768", {})
A = {r["method"]: r for r in lb.get("A", [])}
B = {r["method"]: r for r in lb.get("B", [])}
csys = {r["system"]: r for r in lb.get("C_systems", [])}
zs = [r["acc"] for n, r in csys.items() if n.endswith("zero-shot") and not n.startswith("swarm")]
en = [r["acc"] for n, r in csys.items() if n.endswith("engineered") and not n.startswith(("swarm", "small"))]
a_best = max((r for r in lb.get("A", []) if not r["method"].startswith("REF")), key=lambda r: r["mean_acc"])
AP = {r["method"]: r for r in lb.get("AP", [])}
Dm = {r["method"]: r for r in lb.get("D", [])}
net = "race_net (new, learned)"
extra_cards = []
if AP:
ap_best = max((r for r in lb["AP"] if not r["method"].startswith("REF")), key=lambda r: r["mean_acc"])
extra_cards.append(("Track A-Panda · new robot, frozen methods", f"{pct(ap_best['mean_acc'])}%",
f"{html.escape(ap_best['method'])} · majority vote {pct(AP['majority']['mean_acc'])}%"))
if Dm:
dbest = "race_net_m + reach-repair" if "race_net_m + reach-repair" in Dm else "race_map"
extra_cards.append(("Track D · maze swarm · RACE-Net-M", f"{pct(Dm[dbest]['mean_acc'])}",
f"SPL×100 · rank 1 of 10 fusion rules · hand-written RACE map {pct(Dm['race_map']['mean_acc'])} · best literature baseline "
f"{pct(max(Dm[m]['mean_acc'] for m in ('wmsr_trim', 'reputation', 'eigentrust', 'dawid_skene', 'majority') if m in Dm))}"
+ (f" · oracle {pct(Dm['REF oracle']['mean_acc'])}" if "REF oracle" in Dm else "")))
if net in A:
hs_ = {r["method"]: r for r in lb.get("AH_so101", [])}
hp_ = {r["method"]: r for r in lb.get("AH_panda", [])}
extra_cards.append(("RACE-Net-V · our learned verification model", f"{pct(A[net]['mean_acc'])}%",
f"0.2 M params, trained on synthetic swarms only · zero-shot on SO-101"
+ (f" · Panda {pct(AP[net]['mean_acc'])}%" if net in AP else "")
+ (f" · on the hold-out {pct(hs_[net]['mean_acc'])} / {pct(hp_[net]['mean_acc'])}, behind our EM methods" if net in hs_ and net in hp_ else "")))
if hs_ and hp_:
rs_, pl_ = "race_s_online (new)", "race_pool (new)"
extra_cards.append(("Hold-out · new episodes, nothing tuned on it", f"{pct(hs_[rs_]['mean_acc'])} / {pct(hp_[pl_]['mean_acc'])}%",
f"SO-101: RACE-S online rank 1 · Panda: RACE-Pool rank 1 · majority vote {pct(hs_['majority']['mean_acc'])} / "
f"{pct(hp_['majority']['mean_acc'])}%"))
panda_html = "" if not AP else f"""
<h2>RoboRACE · Track A-Panda — replication on a different robot</h2>
<p>All methods and hyper-parameters were frozen before this data existed. Same tasks, cameras and physics labels, new arm (Franka Panda).</p>
{video("media/videos/panda_rollouts.mp4", "Franka Panda rollouts with the camera swarm's verdicts.")}
{lb_rows(lb, "AP")}
<div class="grid2">{fig("media/figures/cross_embodiment.png", "Every method's mean accuracy on SO-101 vs Panda.")}
{fig("media/figures/panda_gallery.png", "Panda episodes seen by the five cameras.")}</div>"""
AHs, AHp = {r["method"]: r for r in lb.get("AH_so101", [])}, {r["method"]: r for r in lb.get("AH_panda", [])}
hold_html = "" if not (AHs and AHp) else f"""
<h3>Hold-out: a test nothing was tuned on</h3>
<p>New episodes of both arms (new seeds). Their views were scored by the frozen VLM pipeline, and no fusion method was run on them until a commit had
frozen every model, rule and threshold (<code>results/holdout/FREEZE.json</code>).</p>
<div class="grid2"><div><p><b>SO-101 hold-out</b></p>{lb_rows(lb, "AH_so101", 7)}</div><div><p><b>Franka Panda hold-out</b></p>{lb_rows(lb, "AH_panda", 7)}</div></div>"""
net_html = "" if net not in A else f"""
<h2>Our two models: one design</h2>
<p>Both models answer the same question in two domains: a robot receives reports from peers, some of whom lie in a structured way; what is true?
They share one design from RACE and AIP: anchor on the receiver's own evidence, estimate every peer's channel in context, and <b>invert</b> consistent liars
instead of discarding them. Peers and items are sets, and both models are trained on simulated swarms only.
(<a href="https://huggingface.co/datasets/{DS}/blob/main/docs/MODELS.md">design note</a>)</p>
<div class="grid2">{fig("media/architecture/racenet.png", "RACE-Net-V (pick-and-place): axial set transformer over agents × episodes, 0.2 M parameters.")}
{fig("media/architecture/racenet_m.png", "RACE-Net-M (maze): anchored channel encoder, peer transformer, signed read-out, 3 refinement rounds, 45 K parameters.")}</div>
<h2>RACE-Net-V — the learned verification model</h2>
<p>A 0.2 M-parameter axial set transformer that has <i>learned</i> receiver-anchored truth inference from synthetic swarms and is applied
unchanged to the real camera swarms. RACE-Pool is the AIP-style pool of RACE-Net-V, RACE-S and RACE. Weights:
<a href="https://huggingface.co/Nabidnur/RoboRACE-Net">Nabidnur/RoboRACE-Net</a>.</p>
{fig("media/figures/racenet.png", "Training curve and zero-shot transfer to real VLM camera swarms.")}
{fig("media/figures/racenet_scaling.png", "Scaling study on an independent synthetic generator.")}{hold_html}"""
d_html = "" if not Dm else f"""
<h2>RoboRACE · Track D — maze exploration with lying robots · RACE-Net-M</h2>
<p>Six mobile robots explore an unknown maze and share what they sense; up to four corrupt their broadcasts. <b>RACE-Net-M</b> (45 K parameters,
trained on simulated mazes with <i>random</i> liars; the benchmark's attack names never appear in training) verifies each peer against cells the robot
sensed itself and inverts consistent liars. It is compared with six rules from the literature and with our hand-written RACE map. Score = SPL of honest robots.
Weights: <a href="https://huggingface.co/Nabidnur/RoboRACE-Net-M">Nabidnur/RoboRACE-Net-M</a>.</p>
{video("media/videos/maze_swarm.mp4", "Three of six robots invert their reports: majority map (false walls in red) vs RACE map. This is the maze with the largest gap; averages below.")}
{lb_rows(lb, "D", 11)}
{fig("media/figures/trackD_vs_liars.png", "SPL as liars take over the maze swarm.")}""" + (
"" if not (ROOT / "media/figures/racenet_m_scaling.png").exists() else fig("media/figures/racenet_m_scaling.png", "RACE-Net-M, unchanged, on swarm and map sizes it was never trained on.")) + (
"" if not lb.get("maze_llm") else fig("media/figures/maze_llm.png", "LLM agents on text mazes: one-shot vs validator-feedback repair.", "70%"))
pub_html = "" if not lb.get("published") else f"""
<h2>In context: published numbers</h2>
{fig("media/figures/published_context.png", "Grey = numbers from the cited papers' tables; teal = measured here. Context only: models, dates and instance subsets differ.")}"""
cards = [
("ERQA reproduction", f"{pct(rep.get('acc'))}%", f"Cosmos-Reason2-2B on CPU · NVIDIA reports {pct(rep.get('published'), 2)}% · inside our 95% CI ({pct(rep.get('lo'))}–{pct(rep.get('hi'))})"),
("Track A · SO-101 camera swarm", f"{pct(a_best['mean_acc'])}%", f"{html.escape(a_best['method'])} · rank 1 · liar-majority {pct(a_best['majority_liars'])}% vs majority vote {pct(A['majority']['majority_liars'])}%"),
("Track B · Byzantine rendezvous", f"{pct(B['race_c+wmsr']['mean_acc'])}%", f"RACE-C + W-MSR · rank 1 · W-MSR {pct(B['wmsr']['mean_acc'])}%"),
("Track C · LLM planners", f"{pct(sum(en) / len(en))}%", f"engineered (spec + validator + repair) · zero-shot {pct(sum(zs) / len(zs))}%"),
]
cards_html = "".join(f'<div class="card"><div class="k">{t}</div><div class="v">{v}</div><div class="d">{d}</div></div>'
for t, v, d in cards + extra_cards)
erqa_tbl = table(sw.get("table", []), [("system", lambda r: html.escape(r["system"].replace("swarm: ", "⊕ "))),
("accuracy", lambda r: f"<b>{pct(r['acc'])}</b>"),
("95% CI", lambda r: f"{pct(r['lo'])}–{pct(r['hi'])}"),
("reweighted", lambda r: pct(r["reweighted"]))],
highlight=lambda r: "ours" in r["system"])
pb_tbl = table(pb.get("table", []), [("agent / strategy", lambda r: html.escape(r["system"])),
("success", lambda r: f"<b>{pct(r['acc'])}</b>"),
("95% CI", lambda r: f"{pct(r['lo'])}–{pct(r['hi'])}"),
("LLM calls / task", lambda r: f"{r['calls']:.2f}")],
highlight=lambda r: "Modulo" in r["system"] or "verify" in r["system"])
page = f"""<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>RoboRACE</title>
<meta name="description" content="Byzantine-robust multi-agent robotics: ERQA, PlanBench and three RoboRACE tracks, on CPU.">
<style>
:root{{--bg:#fafaf9;--fg:#1f2937;--mut:#6b7280;--card:#ffffff;--line:#e5e7eb;--teal:#0f766e;--tealbg:#e6f4f1;--red:#b91c1c}}
@media (prefers-color-scheme:dark){{:root{{--bg:#0f1115;--fg:#e5e7eb;--mut:#9ca3af;--card:#171a21;--line:#2a2f3a;--teal:#2dd4bf;--tealbg:#11312d;--red:#f87171}}}}
*{{box-sizing:border-box}}body{{margin:0;background:var(--bg);color:var(--fg);font:16px/1.55 system-ui,-apple-system,Segoe UI,Roboto,sans-serif}}
main{{max-width:1080px;margin:0 auto;padding:28px 16px 64px}}
h1{{font-size:2.3rem;margin:.2em 0 .1em;letter-spacing:-.02em}}h2{{margin-top:2.4em;border-bottom:1px solid var(--line);padding-bottom:.3em}}h3{{margin-top:1.6em}}
.lead{{color:var(--mut);font-size:1.08rem;max-width:62em}}a{{color:var(--teal)}}
.btns a{{display:inline-block;margin:10px 8px 0 0;padding:8px 14px;border:1px solid var(--line);border-radius:10px;background:var(--card);text-decoration:none;font-weight:600}}
.cards{{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:12px;margin-top:22px}}
.card{{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:14px 16px}}
.card .k{{color:var(--mut);font-size:.85rem}}.card .v{{font-size:2rem;font-weight:750;color:var(--teal)}}.card .d{{font-size:.85rem;color:var(--mut)}}
figure{{margin:18px 0}}figure img,figure video{{width:100%;border-radius:12px;border:1px solid var(--line);background:#fff}}
figcaption{{color:var(--mut);font-size:.88rem;margin-top:6px}}
.grid2{{display:grid;grid-template-columns:1fr 1fr;gap:16px}}.grid2>*{{min-width:0}}@media (max-width:760px){{.grid2{{grid-template-columns:1fr}}h1{{font-size:1.8rem}}}}
.tw{{overflow-x:auto;border:1px solid var(--line);border-radius:12px;background:var(--card)}}
table{{border-collapse:collapse;width:100%;font-size:.9rem}}th,td{{padding:7px 10px;border-bottom:1px solid var(--line);text-align:right;white-space:nowrap}}
th:first-child,td:first-child,th:nth-child(2),td:nth-child(2){{text-align:left}}tr.ours td{{background:var(--tealbg)}}th{{color:var(--mut);font-weight:600}}
details{{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:10px 14px;margin:12px 0}}summary{{cursor:pointer;font-weight:600}}
ul.check li{{margin:4px 0}}footer{{margin-top:48px;color:var(--mut);font-size:.85rem}}
</style></head><body><main>
<h1>RoboRACE</h1>
<p class="lead">Byzantine-robust multi-agent robotics: when some of your robots, cameras or AI agents are wrong on purpose.
Two public benchmarks (ERQA, PlanBench) and five RoboRACE tracks, run on a CPU with real VLMs, real LLMs, two simulated robot arms and a maze swarm.
Every number below is generated from cached agent outputs in the dataset repository.</p>
<div class="btns"><a href="https://huggingface.co/datasets/{DS}">Dataset · full work</a><a href="{GH}">GitHub</a>
<a href="https://huggingface.co/datasets/{DS}/blob/main/results/LEADERBOARD.md">Leaderboard</a>
<a href="https://huggingface.co/datasets/{DS}/blob/main/docs/BENCHMARK.md">Protocol</a>
<a href="https://huggingface.co/spaces/Nabidnur/RoboRACE-Playground">Interactive playground</a><a href="https://huggingface.co/Nabidnur/RoboRACE-Net">RACE-Net-V model</a>
<a href="https://huggingface.co/Nabidnur/RoboRACE-Net-M">RACE-Net-M model</a></div>
{video("media/videos/robot_rollouts.mp4", "SO-101 arm (MuJoCo Menagerie) rollouts judged by five Cosmos-Reason2-2B camera agents; then 3 of 5 cameras lie. Majority vote flips; RACE-S learns negative weights for the liars without labels and stays correct.", autoplay=True)}
<div class="cards">{cards_html}</div>
<h2>The idea</h2>
<p>Majority vote and classical truth inference (Dawid–Skene, GLAD, MACE) fail once liars are the majority, because the latent-truth model becomes
symmetric. <b>RACE</b> (from the <i>Liars Are Information</i> program) anchors on the receiver's own honesty and gives every peer a <i>signed</i>
channel weight: trust, <b>invert</b> or discard. This work adds RACE-S (score level), online variants against sleepers, RACE-C + W-MSR for robot
consensus, confidence-gated anchoring (reported as a compromise, not a free lunch), and an engineered / LLM-Modulo planning layer.</p>
{fig("media/figures/overview.png", "Best method per family on the three RoboRACE tracks.")}
<h2>Architecture</h2>
<div class="grid2">{fig("media/architecture/cosmos_reason2_verifier.png", "Cosmos-Reason2-2B (Qwen3-VL) as the success verifier — numbers from the real checkpoint (2.44 B params).")}
<div>{fig("media/architecture/race_s.png", "RACE-S: anchored EM over rank-Gaussianized scores with signed weights.")}
{fig("media/architecture/roborace_system.png", "The three agent swarms.")}</div></div>
{fig("media/architecture/plotnn/cosmos_verifier_plotnn.png", "PlotNeuralNet view of the verifier: one 448×448 view → 196 image tokens → P(yes).")}
<h2>Public benchmark · ERQA</h2>
<p>Cosmos-Reason2-2B reproduced on 4 CPU cores: <b>{pct(rep.get('acc'))}%</b> (95% CI {pct(rep.get('lo'))}–{pct(rep.get('hi'))}, n = {rep.get('n')}),
reported {pct(rep.get('published'), 2)}%. At ≤768² px: {pct(rep768.get('acc'))}% ({rep768.get('n_changed_answers', '–')} of 400 answers change).
Swarm of {len(sw.get('agents', []))} VLM agents on {sw.get('n_questions')} shared questions:</p>
{erqa_tbl}
{fig("media/figures/erqa_results.png", "Reproduction by category (left) and the multi-agent swarm without attackers (right).")}
<div class="grid2">{fig("media/figures/erqa_pareto_cga.png", "Robustness vs clean accuracy with the robot's own CPU model as receiver.")}
{fig("media/figures/verifier_calibration.png", "Cosmos-Reason2 as a binary success verifier: calibration matters (56% → 83%).")}</div>
<h2>Public benchmark · PlanBench Blocksworld</h2>
<p>An exact simulator (accepts all 500 official ground-truth plans) turns into a repair signal: LLM-Modulo with ≤3 repairs.</p>
<div class="grid2">{fig("media/figures/planbench.png", f"{pb.get('n_instances')} instances answered by all {len(pb.get('agents', []))} agents.")}
{video("media/videos/planbench_modulo.mp4", "A real cached LLM plan: the validator rejects step 11, the repaired plan reaches the goal.")}</div>
{pb_tbl}
<h2>RoboRACE · Track A — SO-101 camera swarm</h2>
{fig("media/figures/so101_gallery.png", "220 physics rollouts × 5 cameras; ground truth = final physics state.")}
{lb_rows(lb, "A")}
{fig("media/figures/trackA_vs_liars.png", "Accuracy as liars take over the camera swarm.")}
<div class="grid2">{fig("media/figures/race_s_weights.jpg", "RACE-S signed weights learned without labels: liars get negative weight.")}
{fig("media/figures/trackA_cameras.png", "Per-camera quality of the five agents.")}</div>
{panda_html}
{net_html}
<h2>RoboRACE · Track B — Byzantine rendezvous</h2>
{video("media/videos/swarm_rendezvous.mp4", "12 robots, 4 colluding Byzantine robots: DeGroot vs W-MSR vs RACE-C + W-MSR.")}
{lb_rows(lb, "B")}
{fig("media/figures/trackB_vs_liars.png", "Mission success vs number of Byzantine robots.")}
<h2>RoboRACE · Track C — LLM planners</h2>
{fig("media/figures/trackC_systems.png", "Same models, better plumbing: zero-shot vs engineered.", "80%")}
{lb_rows(lb, "C")}
{d_html}
{pub_html}
<h2>Validation</h2>
<ul class="check">
<li>ERQA pipeline: reported 37.75% inside our 95% CI.</li>
<li>Blocksworld validator: accepts 500/500 official ground-truth plans, rejects corrupted ones.</li>
<li>W-MSR: the safety theorem holds in every tested case (honest states stay in the honest hull).</li>
<li>Dawid–Skene: ≥90% decision agreement with the crowd-kit reference implementation.</li>
<li>A fresh clone regenerates every leaderboard, figure and the README byte-for-byte.</li>
</ul>
<details><summary>Limitations</summary><ul>
<li>Track A renders are simulated (real SO-101 mesh, synthetic lighting); all cameras share one VLM.</li>
<li>ERQA swarm covers the questions every hosted agent answered within free-tier quotas; the SOTA reference covers 27 questions.</li>
<li>PlanBench uses a seeded 100-instance subset; Track C saturates after engineering.</li>
<li>Confidence-gated anchoring was proposed post hoc; its robust floor did not replicate on the full data.</li></ul></details>
<footer>RoboRACE · code <a href="{GH}">{GH.replace('https://', '')}</a> · data and full work
<a href="https://huggingface.co/datasets/{DS}">huggingface.co/datasets/{DS}</a> · builds on RACE / <i>Liars Are Information</i> and AIP-AD.</footer>
</main></body></html>
"""
(out / "index.html").write_text(page)
(out / "README.md").write_text("""---
title: RoboRACE
emoji: 🤖
colorFrom: green
colorTo: blue
sdk: static
pinned: false
short_description: Byzantine-robust multi-agent robotics on CPU
---
Showcase for RoboRACE. Full work: https://huggingface.co/datasets/""" + DS + "\n")
return out
if __name__ == "__main__":
print(build(sys.argv[1] if len(sys.argv) > 1 else ROOT / ".hf_stage_space"))
|