Views
No views yet
value ≠ expected_value (errors). These errors are interconnected through a hidden dependency graph — fixing one entry can cascade changes to the expected_value of dependent entries, potentially creating new errors.| Action | Description | Cost |
|---|---|---|
FIX_ENTRY <id> | Sets value = expected_value for the entry. Triggers dependency updates. | 1 |
ADJUST_ENTRY <id> <delta> | Increments/decrements the entry's value by delta. | 1 |
REVERT_ENTRY <id> | Undoes the last change to an entry. | 1 |
NO_OP | Does nothing. No budget cost. | 0 |
1class AuditAction(BaseModel):
2 action_type: str # FIX_ENTRY | ADJUST_ENTRY | REVERT_ENTRY | NO_OP
3 target_id: int # ID of the ledger entry (not needed for NO_OP)
4 adjust_delta: int # +/- value for ADJUST_ENTRY1{
2 "task_id": "medium",
3 "task_description": "Repair a financial ledger with 8 entries...",
4 "ledger": [
5 {"id": 0, "value": 100, "expected_value": 100, "dependencies": []},
6 {"id": 1, "value": 180, "expected_value": 200, "dependencies": [3, 5]}
7 ],
8 "errors": [
9 {"entry_id": 1, "current_value": 180, "expected_value": 200, "delta": -20}
10 ],
11 "remaining_budget": 12,
12 "initial_budget": 12,
13 "step": 0,
14 "max_steps": 15,
15 "done": false
16}Note: Inhardmode, thedependencieslist is hidden (shown as[]), requiring the agent to discover dependency effects through interaction.
easy · max 10 steps · budget 105 independent entries, 3 errors, no dependencies.
medium · max 15 steps · budget 128 entries with visible dependencies and moderate budget.
expected_value of entries 3 and 5. The agent must reason about repair ordering to avoid creating new errors.hard · max 12 steps · budget 810 entries with HIDDEN dependency graph. Cascading errors. Tight budget.
score = 0.5 × consistency_score
+ 0.3 × efficiency_score
+ 0.2 × budget_remaining_ratio
− overcorrection_penaltyconsistency_score = correct_entries / total_entriesefficiency_score = optimal_steps / actual_steps (capped at 1.0)budget_remaining_ratio = remaining_budget / initial_budgetovercorrection_penalty = 0.05 × overcorrection_count1# 1. Install dependencies
2pip install -r requirements.txt
3
4# 2. Start the environment server
5python server.py
6
7# 3. Set env vars for inference
8export API_BASE_URL="https://router.huggingface.co/v1"
9export MODEL_NAME="Qwen/Qwen2.5-72B-Instruct"
10export HF_TOKEN="hf_..."
11
12# 4. Run the inference agent
13python inference.py1docker build -t auditrepairenv .
2
3docker run -p 7860:7860 \
4 -e HF_TOKEN=hf_... \
5 auditrepairenv1# Set required environment variables
2export API_BASE_URL="https://router.huggingface.co/v1"
3export MODEL_NAME="Qwen/Qwen2.5-72B-Instruct"
4export HF_TOKEN="hf_..."
5export ENV_BASE_URL="http://localhost:7860"
6
7# Run the agent (runs all 3 tasks: easy, medium, hard)
8python inference.pyENV_BASE_URL1# Verify the space is running
2curl -X POST http://localhost:7860/reset -d '{"task_id":"easy"}' -H "Content-Type: application/json"
3
4# Check health
5curl http://localhost:7860/healthinference.py with Qwen/Qwen2.5-72B-Instruct| Task | Score |
|---|---|
| easy | 0.90 |
| medium | 0.70 |
| hard | 0.55 |
inference.py — exactly at root (not in subfolder)requirements.txt — all dependencies listedREADME.md — clear setup instructionsdemo.py — working Gradio UIDockerfile — builds successfullyHF_TOKEN env variableAPI_BASE_URL with defaultMODEL_NAME with defaultHF_TOKEN and raises error if missing[START] at beginning[STEP] per step with action and reward[END] at end (even on error)true/false)[START]
Task: easy
[STEP]
Action: FIX_ENTRY 1
Reward: 0.20
[STEP]
Action: NO_OP
Reward: 0.00
[END]
Final Score: 0.85demo.py loads successfully1git add .
2git commit -m "Ready for submission"
3git push origin main1curl -X POST https://your-space.hf.space/reset \
2 -d '{"task_id":"easy"}' \
3 -H "Content-Type: application/json""We built AuditRepairEnv++, an RL environment where AI agents repair financial ledgers with interdependent errors under budget constraints. Fixing one entry cascades changes to others, forcing agents to plan strategically. It benchmarks LLM reasoning on cost-constrained optimization."
inference.py fails with "module not found"requirements.txt is installed: pip install -r requirements.txtHF_TOKEN errorexport HF_TOKEN="hf_..."0.0.0.0:7860audit-repair-env/
├── inference.py ← Main submission file (MUST be at root)
├── server.py ← OpenEnv environment server
├── tasks.py ← Task definitions & environment logic
├── demo.py ← Gradio UI (minimal black aesthetic)
├── requirements.txt ← Python dependencies
├── Dockerfile ← Docker image definition
├── README.md ← This file
├── HF_SPACES_GUIDE.md ← Deployment instructions
├── PITCH.md ← Project pitch & overview
└── auditrepairenv/ ← Python package (optional)
└── __init__.py1@misc{auditrepairenv2024,
2 title={AuditRepairEnv++: Cost-Constrained Iterative Ledger Repair},
3 author={Your Name},
4 year={2024},
5 howpublished={Hugging Face Spaces},
6 url={https://huggingface.co/spaces/username/audit-repair-env}
7}