Skip to content

Latest commit

Β 

History

28 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

title ScholarEnv
emoji πŸ”¬
colorFrom blue
colorTo yellow
sdk docker
app_port 7860
pinned false
license apache-2.0
short_description Research Paper Integrity Auditor β€” OpenEnv Hackathon 2026

πŸ”¬ ScholarEnv v6.7 β€” Research Paper Integrity Auditor

"The first step toward integrity is being honest about the numbers." Nobody said this. But somebody should have. Especially the people writing the abstracts.

Meta Γ— PyTorch OpenEnv Hackathon 2026 Β· Theme 3.1 β€” World Modeling / Professional Tasks

Team: Nensi Pansuriya Β· Krushna Parmar Β· Ishita Bhojani Β· Scaler School of Technology


HF Space Model Colab Blog OpenEnv


The Problem

Every year, 10,000+ papers are retracted. $2.4 billion of downstream research is built on those retracted foundations before anyone notices. Abstract says 94.3%. Table 1 says 91.7%.

We trained a 1.5B model to navigate a research paper like a detective, cross-reference every numerical claim against its source table, and submit a structured JSON finding with the exact table ID and value that contradicts the abstract.

The frozen model scores 0.008. After 22 minutes of GRPO on a free T4, it reaches 0.905. That is not a benchmark. That is a model learning where to look.


Results

Smoke Run Β· T3 Claim-Evidence Audit Β· 25 GRPO Steps

Metric Value
Frozen baseline 0.008
Smoothed end 0.511
Peak reward 0.905
Improvement Γ—67
valid_json 95.4%
has_table_id 94.7%
Duration 25.7 min

Smoke Run Figure 1 β€” Reward curve from the smoke run. Frozen model flatlines at 0.008 for the first 16 completions, then something clicks β€” the model discovers reading results-first is the right strategy. Peak reward 0.905.

Multi-Task Run Β· 200 Steps Β· 383 Graded Completions

Task n Baseline Trained Γ—
T1: Formatting 91 0.1709 0.2787 1.63Γ— ↑
T2: Consistency 67 0.0187 0.0176 0.94Γ— ↓
T3: Claim Audit 91 0.8245 0.4932 0.60Γ— ↓†
T4: Citation 115 0.3604 0.4807 1.33Γ— ↑
T5: Injection (zero-shot) 19 0.1397 0.1771 1.27Γ— ↑

† T3 regression: T2 system-prompt used wrong field names (location_a β†’ location), causing zero-reward T2 rollouts to contaminate GRPO advantage estimates. Fixed in v8. The smoke run confirms T3 learning reaches 0.905 in isolation.

T5 improved +27% with zero T5 training examples β€” Saccade-RL hypothesis confirmed.

Before After Figure 2 β€” Before vs. after across 5 tasks. Green = improved, red = regressed. T5 zero-shot transfer is the standout scientific result.

Components Figure 3 β€” Reward component breakdown. Specificity (green) learns first β€” the model quickly includes table_id/table_value. F-beta stabilises later as claim matching improves.

Format Compliance Figure 4 β€” JSON format compliance stays above 90% throughout training.

Summary Figure 5 β€” Combined summary panel: learning curve, before/after, weighted components, training config.


How It Works

Paper Generation

ProceduralPaperGenerator picks domain (e.g., NLP), generates:
  true_GLUE = 89.4
  Table 1:  {"Ours": {"GLUE": "89.4"}}
  Abstract: "...achieving 93.1 on GLUE..."  ← inflated by difficulty Γ— random(0.2, 8.0)
Ground truth is correct by construction β€” RLVE principle (arXiv:2511.07317)

Agent Navigation (Multi-Turn)

RESET β†’ sees section names + table names (no content)
STEP 1 β†’ query_section("results") β†’ PBRS bonus +0.09
STEP 2 β†’ check_table("Table 1")  β†’ PBRS bonus +0.12
STEP 3 β†’ query_section("abstract") β†’ PBRS bonus +0.06
STEP 4 β†’ submit_findings([{...}]) β†’ F-beta reward 0.87

Reward Architecture

Total = 0.60 Γ— F-beta(Ξ²=0.5)        ← precision counts 4Γ— more than recall
      + 0.15 Γ— evidence_specificity  ← table_id + table_value present?
      + 0.25 Γ— reasoning_quality     ← CoT grounded in paper numbers?
      βˆ’ 0.20 Γ— hallucination_penalty ← fabricated finding β†’ negative reward

PBRS Navigation Shaping

Ξ¦(state) = 0.30 Γ— section_coverage + 0.30 Γ— table_coverage + 0.40 Γ— claims_ratio
bonus    = Ξ³ Γ— Ξ¦(state') βˆ’ Ξ¦(state),  Ξ³ = 0.99, max_bonus = 0.15

Dense intermediate rewards prevent zero-gradient collapse on navigation steps.


16 Research Papers Implemented

# Paper arXiv Implemented In
01 RLVE β€” Adaptive Verifiable Environments 2511.07317 server/paper_generator.py
02 PRS β€” Progressive Reward Shaping 2512.07478 graders/formatting_grader.py
03 DAPO β€” Structured JSON Training 2503.14476 GRPOConfig(loss_type="dapo")
04 PBRS β€” Potential-Based Reward Shaping Ng et al. '99 server/reward_shaper.py
05 AdaRFT β€” Adaptive Curriculum 2504.05520 server/curriculum.py
06 Agent-RLVR β€” Partial Credit 2506.11425 graders/audit_grader.py
07 UniDoc-RL β€” Hierarchical Actions 2604.14967 models.py
08 ProRL Agent β€” Rollout-as-Service 2603.18815 server/app.py
09 RAGEN-2 β€” SNR Filtering 2604.06268 train.py snr_filter_batch()
10 Experience Replay 2604.08706 train.py ExperienceReplayBuffer
11 Abstain-R1 β€” Calibrated Abstention 2604.17073 train.py CITATION_ABSTAIN_REWARD
12 Veri-R1 β€” Claim Verification RL 2510.01932 Task 3 design
13 CiteAudit β€” Citation Hallucination 2602.23452 Task 4 design
14 GDPO β€” Decoupled Reward Normalisation 2601.05242 GRPOConfig reward_aggregation
15 Dr. GRPO β€” Remove Std Bias 2503.20783 scale_rewards="batch"
16 AgentReview β€” Peer Review Bias 2406.12708 Domain motivation

Five Tasks

Task What the agent does Reward design
T1: Formatting Reformat IEEE manuscript (wrong order, MLA citations) 3-stage PRS (arXiv:2512.07478)
T2: Consistency Find "4 datasets" vs "3 benchmarks" contradictions Tier-aware bipartite matching
T3: Claim Audit Abstract says 93.1, Table 1 says 89.4 β€” find it F-beta(Ξ²=0.5) + SemanticCite 4-class
T4: Citation Ghost reference (FakeName et al. 2027) + retracted Live CrossRef + Semantic Scholar
T5: Injection Hidden IGNORE PRIOR INSTRUCTIONS in Unicode InjectionScanner (5 techniques, no model)

OpenEnv Compliance

Requirement Status
OpenEnv base classes βœ… ScholarEnvironment(_OpenEnvBase)
Valid openenv.yaml βœ… spec_version=1, 5 tasks
reset() / step() / state() βœ… FastAPI endpoints
inference.py at root βœ… OpenAI client, [START]/[STEP]/[END]
API_BASE_URL, MODEL_NAME, HF_TOKEN βœ… Env vars with graceful fallback
Runs in < 20 min, vcpu=2 / 8GB βœ… Verified
Dockerfile builds βœ… Tested
3+ tasks, reward in [0.0, 1.0] βœ… 5 tasks
Training script (Colab) βœ… Meta_Final.ipynb
Evidence of training βœ… assets/ (plots + CSVs)
HF Space deployed βœ… Badge above
Mini-blog / video βœ… HF Blog (badge above)

File Structure

scholarenv/
β”œβ”€β”€ Meta_Final.ipynb              ← Training notebook (run this)
β”œβ”€β”€ inference.py                  ← Baseline agent
β”œβ”€β”€ openenv.yaml                  ← OpenEnv manifest
β”œβ”€β”€ train.py / corpus.py / models.py / client.py
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ server/
β”‚   β”œβ”€β”€ app.py                    ← FastAPI server
β”‚   β”œβ”€β”€ environment.py            ← ScholarEnvironment (678 lines)
β”‚   β”œβ”€β”€ paper_generator.py        ← ProceduralPaperGenerator (5 domains)
β”‚   β”œβ”€β”€ curriculum.py + bandit.py ← UCB1 + AdaRFT
β”‚   β”œβ”€β”€ reward_shaper.py          ← PBRS
β”‚   β”œβ”€β”€ citation_verifier.py      ← CrossRef + S2
β”‚   β”œβ”€β”€ real_paper_fetcher.py     ← arXiv + RetractWatch
β”‚   └── graders/ (5 graders)
β”œβ”€β”€ hf_space/
β”‚   β”œβ”€β”€ app.py                    ← Space FastAPI + UI server
β”‚   β”œβ”€β”€ index.html                ← Dashboard UI
β”‚   └── static/                   ← CSS, JS, media assets
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ fig1_reward_curve.png
β”‚   β”œβ”€β”€ fig2_components.png
β”‚   β”œβ”€β”€ fig3_format_compliance.png
β”‚   β”œβ”€β”€ fig4_multitask.png
β”‚   β”œβ”€β”€ fig6_summary_panel.png
β”‚   β”œβ”€β”€ reward_log.csv
β”‚   └── reward_log_smoke.csv
└── scripts/
    β”œβ”€β”€ plot_scholarenv_figures.py  ← Reproduce all figures
    └── colab_smoke_v6.py

Quickstart

# Local server
pip install -e .
uvicorn server.app:app --host 0.0.0.0 --port 7860

# Inference
export API_BASE_URL="https://router.huggingface.co/v1"
export MODEL_NAME="Qwen/Qwen2.5-72B-Instruct"
export HF_TOKEN="hf_..."
python inference.py

# Reproduce figures
cp assets/reward_log_smoke.csv reward_log_smoke.csv
cp assets/reward_log.csv reward_log.csv
python scripts/plot_scholarenv_figures.py

Deploy

# GitHub
git init && git add . && git commit -m "ScholarEnv v6.7"
git remote add origin https://github.com/YOUR_USERNAME/scholarenv.git
git push -u origin main

# HF Space
git clone https://huggingface.co/spaces/YOUR_USERNAME/scholar-env
cp -r hf_space/* scholar-env/
cd scholar-env && git add . && git commit -m "deploy" && git push
# Space secrets: HF_LORA_REPO = YOUR_USERNAME/scholarenv-auditor-qwen-1.5b

# Validate
bash validate-submission.sh

Links

πŸ€— HF Space https://huggingface.co/spaces/YOUR_USERNAME/scholar-env
πŸ€— Model https://huggingface.co/YOUR_USERNAME/scholarenv-auditor-qwen-1.5b
πŸ““ Notebook Meta_Final.ipynb (this repo)
πŸ“ Blog https://huggingface.co/blog/YOUR_USERNAME/scholarenv
πŸ“Š CSV logs assets/reward_log*.csv

Nensi Pansuriya Β· Krushna Parmar Β· Ishita Bhojani Β· Scaler School of Technology

All numbers from Meta_Final.ipynb Cell 10 (baseline) + Cell 13 (post-training) + attached CSVs. Nothing invented.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages