NetHack+ & Prime-Agent-Explore: O(1) Checkpointing for Long-Horizon Agents

Released in arXiv:2612.06161, NetHack+ upgrades the NetHack Learning Environment with O(1) state save/restore/branching, 2.1x faster throughput (thousands of environments per process), 17 difficulty knobs, and 12 observation formats. Paired with Prime-Agent-Explore (PAE), BAL_min climbs 8.6x (1.32% to 11.38%) while cutting cost by 94%.
NetHack+ & Prime-Agent-Explore: O(1) Checkpointing for Long-Horizon Agents: Released in arXiv:2612.06161, NetHack+ upgrades the NetHack Learning Environment with O(1) state save/restore/branching, 2.1x faster throughput (thousands of environments per process), 17 difficulty knobs, and 12 observation formats. Paired with Prime-Agent-Explore (PAE), BAL_min climbs 8.6x (1.32% to 11.38%) while cutting cost by 94%. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- 8.6x BAL_min Performance Leap: Prime-Agent-Explore (PAE) with 30 checkpointed attempts reaches 11.38% BAL_min and 34.7% BAL_max (20.43% BAL_min at 100 attempts), beating Best@30 independent runs by 1.6x–2.8x.
- 94% Cost Reduction via Better Harnesses: Switching from raw BALROG setups to NetHack+ + NetCore slashes mean cost per game on GLM-5.2 from $82.61 to $0.90 (and $0.99 to $0.03 on DeepSeek V4.1 Flash).
- O(1) State Save, Restore & Level Transplant: Supports thousands of concurrent games per process (2.1x NLE throughput at 64 games/thread) with Gym and Prime Intellect Verifiers hooks.
- 0% Empty-Tile Misfires With JSON Maps: Streaming full JSON dungeon maps every turn eliminates the 9.7% melee_attack(x,y) misfire rate seen with on-demand ASCII refreshes.
import { createAgent } from '@smoke-monkey/harness';// Long-horizon agent orchestrating NetHack+ O(1) checkpoints and JSON map observationsconst agent = createAgent({agentId: 'pae-checkpoint-explorer',provider: 'openai-compatible',baseUrl: 'https://api.deepseek.com/v1',model: 'deepseek-v4.1-flash',workspacePath: process.cwd(),permissions: {read_file: 'allow',write_file: 'allow',run_command: 'ask',},});async function main() {const result = await agent.run('Execute a 30-budget Prime-Agent-Explore evaluation against the NetHack+ Verifiers bridge, checkpointing before descending each dungeon level and logging BAL_min.');console.log('PAE Benchmark Summary:', result.summary);}main().catch(console.error);
Watch: Related Video Guides
Reinforcement Learning for Long-Horizon Interactive LLM Agents (Feb 2025)
Rethinking Environments for Long-Horizon Work — Rayan Garg, Theta Software
What Is NetHack+ and Why Does BAL_min Fix Long-Horizon Agent Evaluation?
NetHack+ (arXiv:2612.06161) is a refactored, multi-environment roguelike benchmark offering O(1) state checkpointing, 2.1x higher throughput than NLE (at 64 games/thread), 17 runtime difficulty knobs, and 12 observation formats. To stop agents from gaming BAL_max by diving deeper without leveling up, the authors introduce `BAL_min` (the minimum of depth and experience progression).
Pairing Prime-Agent-Explore (PAE)—an orchestrator that branches from saved checkpoints—with NetHack+ lifts BAL_min from 1.32% to 11.38% in 30 attempts (exceeding the 92nd human percentile) while dropping per-game LLM cost by ~94%:
| Agent / Harness Setup | Attempts | Mean BAL_min | Median BAL_min | Human Pctile | Mean Cost / Game |
|---|---|---|---|---|---|
| Human Baseline (46,796 runs) | 1 | 5.41 ± 0.06 | 2.12 | 52.4% | — |
| Prime Agent + NetCore (GLM-5.2) | 1 | 1.32 ± 0.30 | 1.85 | 41.6% | $0.90 (vs $82.61 BALROG) |
| Prime Agent + NetCore (DeepSeek V4.1 Flash) | 1 | — | 1.81 | — | $0.03 (vs $0.99 BALROG) |
| Best@30 Independent (GLM-5.2) | 30 | 4.15 ± 0.46 | 3.69 | 76.4% | — |
| PAE + Explore (GLM-5.2, Full Vision) | 30 | 11.38 ± 1.33 | 11.70 | 92.0% | Checkpointed search |
| PAE + Explore (GLM-5.2, Full Vision) | 100 | 20.43 ± 2.52 | 17.91 | 94.3% | Checkpointed search |
| PAE + Explore (GLM-5.2, Fog-of-War) | 30 | 6.03 ± 0.58 | 5.08 | 85.8% | Beats GPT-6 Astra (4.0% BAL_min) |
Why Observation Formats and Skill Surfaces Dictate Agent Reliability
The NetHack+ ablations quantify how seemingly minor harness bugs distort agent benchmarks. Refreshing the ASCII map only on demand caused 9.7% of melee_attack(x,y) calls to hit empty tiles; streaming an ASCII map every turn cut misfires to 2.4%, and streaming a structured JSON map dropped misfires to 0%. Similarly, pre-opening standard doors reduced np_kick() calls from 4.9% to 3.9% and boosted BAL_min by +33%:
# Example NetHack+ Gym / Verifiers checkpoint-and-branch loop
import nethack_plus as nhp
env = nhp.make("NetHackPlus-v0", obs_format="json", action_surface="netcore")
obs, info = env.reset(seed=42)
# Save O(1) snapshot before risky combat or level descent
checkpoint_id = env.save_state()
obs_next, reward, terminated, truncated, step_info = env.step("np_explore_level")
if step_info["hp_ratio"] < 0.25:
# Branch back instantaneously instead of restarting a fresh episode
obs = env.restore_state(checkpoint_id)Generalization Beyond NetHack
The authors verified Prime-Agent-Explore across MiniHack, Crafter, and TextWorld—improving over single-attempt runs on all three and reaching the highest reported score on TextWorld.
Bringing O(1) Branching & Structured State Into Coding Harnesses
Software engineering agents suffer from the exact same trajectory collapse seen in roguelikes: one broken migration or stale file diff wastes 20 subsequent turns. Smoke Monkey Harness mirrors NetHack+'s lessons by pairing git-backed workspace checkpoints (Recover phase) with structured AST/JSON file views rather than brittle screen-scraping.
Instead of spending $82+ per long-horizon run on raw unguided retries, engineers combine cheap fast models (DeepSeek V4.1 Flash at $0.03/run) with checkpointed verification branches.
Frequently Asked Questions
Q:What is BAL_min in the NetHack+ paper?
BAL_min takes the lower of an agent’s human-normalized dungeon depth (Dlvl) and experience level (XL) scores, preventing agents from inflating scores by rushing down stairs without gaining combat experience.
Q:How much faster is NetHack+ than the original NetHack Learning Environment (NLE)?
NetHack+ runs at 2.1x NLE’s throughput at 64 games per thread, supports thousands of environments per process, and adds O(1) save, restore, and branching.
Q:How did JSON map observations affect combat accuracy?
Streaming only on-demand maps caused 9.7% of melee_attack(x,y) tool calls to target empty tiles. Streaming ASCII every turn lowered misfires to 2.4%, and streaming JSON maps eliminated misfires completely (0%).
Q:How much cheaper are NetHack+ + NetCore runs compared to BALROG?
Mean cost per game dropped by roughly 94% across tested models—from $82.61 to $0.90 on GLM-5.2, $75.49 to $10.87 on Gemini-3.1 Pro, and $0.99 to $0.03 on DeepSeek V4.1 Flash.
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.