Hackathon Submission — Covers Multiple Themes OpenEnv · HuggingFace Spaces · TRL + Unsloth
Not Adversarial RL Environment

SocialNet

A synthetic social network where a detection agent learns to find coordinated inauthentic behavior — using only observable signals, never ground truth.

150 Steps / episode
10 Accounts
90K Propaganda bank
75K Neutral pool
01

The problem we're solving

Real influence operations don't spread obvious lies. They spread true facts with misleading framing — nudging perception, manufacturing calm, amplifying doubt. They're subtle, coordinated, and adaptive.

Existing detection approaches rely on content fact-checking or platform-level signals unavailable to most agents. We take a different approach: teach a detection agent to identify behavioral coordination patterns — the fingerprints of organized inauthentic behavior that persist regardless of content.

"The detector cannot win by keyword matching or truth detection. It must learn who coordinates with whom, how fast, and why."

Signal
True facts posted
Content is verifiable. Framing is misleading. Fact-checking fails.
Coordination
Amplifiers cite fast
Same accounts, tight timing, cross-topic persistence.
Evasion
Pivot & mimic
Persona shifts, topic changes, style mimicry after detection.
Detection
Behavioral reasoning
Agent infers coordination from observable patterns only.
02

The environment

Each episode is a 150-step simulation of a synthetic social network. Every step, all 9 non-detector accounts act simultaneously. Every 5 steps, the detector reviews the accumulated network state and flags up to 2 suspicious accounts.

Episode structure
# Episode loop (150 steps)
for step in range(1, 151):
  # All 9 agents act
  actions = collect_actions()  # posts, citations, recruits
  execute_actions(actions)  # update graph state
  
  # Detector reviews every 5 steps → 30 decisions/episode
  if step % 5 == 0:
    obs = build_observation()  # two-tier context
    flags = detector.decide(obs)[:2]  # max 2 flags
    reward = compute_reward(flags, graph)

What the detector sees

A two-tier observation: a compressed episode summary (steps completed, total posts, flagging record) plus detailed recent activity from the last 8 steps — every post, citation, framing, topic, and account metadata.

Crucially, the detector never sees ground-truth roles, never sees veracity labels it can trust, and never sees the propagandist's internal action log.

What stays hidden

Account roles (propagandist / amplifier / neutral) are never revealed. Content veracity labels exist in the data but are unreliable by design — propagandists post true facts. The RECRUIT signal between propagandist and amplifier is invisible; only its effect (a citation) is observable.

03

The agents

10 accounts. Clean role separation by design — the detector must infer structure from behavior, not from labels.

Propagandist
×2
Posts coordinated narratives. Recruits amplifiers. Adapts after detection — pivots topics, mimics neutral styles, flips propaganda angle. LLM-driven.
Amplifier
×3
Only cites, never posts original content. Obeys propagandist recruit signals (80% rate). Falls back to neutral citations when idle. Fully scripted.
Neutral
×5
5 distinct personas: hothead, careful journalist, partisan, clickbait, rando. Post authentic content from a 75K-sample pool. Never cite. Scripted.
Detector
×1
The trained agent. Reviews every 5 steps. Produces chain-of-thought reasoning + structured flag decisions. Optimized via GRPO (SFT skipped due to time).
Key design choice

Amplifiers are the only accounts that cite. This gives the detector a search strategy: find the citers to trace the source. But distinguishing coordinated amplification from organic neutral citations is still the hard problem.

Propagandist adaptation loop

When flagged, the propagandist learns after a 3-step delay. It then chooses: PIVOT to a new topic, MIMIC a neutral persona's style, BURN the account as a distraction, or WAIT. It always flips its propaganda angle on adaptation — giving the detector a new pattern to track.

Amplifier recruit logic

After each post, the propagandist recruits 2 of 3 amplifiers with staggered delays (T+1 to T+5). Collision on same step shifts one to T+1. Idle amplifiers cite recent neutral posts with 80% probability — creating organic-looking noise in the citation graph.

04

The propaganda design

Two universal narrative lenses. Any topic, any framing, any persona — same angle applied. 301 topics × 2 angles × 5 personas × 30 samples = 90,300 samples in the propaganda bank.

Angle 0
"Managed Stability"
Things are complex but under control. Institutions, experts, and systems are handling it. Critics are alarmist, misinformed, or politically motivated. Trust the process.
"Recent WHO data shows hospitalization rates have plateaued. While concerns remain, the trajectory suggests current measures are having the intended effect." — same claim, invisible agenda.
Angle 1
"Progress & Stewardship"
Markets, innovation, and responsible actors are solving problems naturally. Intervention, regulation, and alarm cause more harm than good. Growth and progress are the answer.
"Market incentives are already reshoring semiconductor production. Subsidy programs add bureaucracy without accelerating what private capital is doing anyway." — true, framed.

Propagandists start on a random angle and always flip angle when reacting to a flag. This means the same propagandist posts managed-stability content in episode phase 1, then switches to progress-and-stewardship framing after detection — forcing the detector to track behavioral coordination rather than content fingerprints.

05

The reward model

Dense, per-review-cycle rewards. No narrative drift. No sparse episode bonuses. Every decision gets immediate signal — 30 reward signals per episode.

Note on reward phases: Earlier designs explored 3 curriculum phases (Warmup → Training → Precision) with escalating false-positive penalties. This added complexity without clear training gains. We simplified to a single stable phase with balanced rewards —探测器 learns precision organically from the reward signal rather than through enforced curriculum.
Event Reward Logic
First flag — Propagandist +5.0 Root cause. Primary target.
Re-flag after pivot +2.5 New behavior detected. Tracks adaptation.
False positive (amplifier or neutral) −2.0 Precision pressure. Makes detector selective.
Missed active propagandist −2.0 Active = posted in last 5 steps. Prevents WAITing.
Re-flag same behavior 0 Hard block. No farming already-flagged accounts.

Why this structure works

Propagandists (+5.0) are the primary target. Catching one after it pivots earns +2.5 — enough to reward tracking adaptation, but not enough to ignore root-cause detection. Any false positive (amplifier or neutral) costs −2.0, making the detector selective rather than aggressive.

The re-flag mechanic

When a propagandist pivots after being flagged, it genuinely changes behavior. Re-catching it earns half reward — new pattern, new detection. But re-flagging the same account with no new evidence earns zero. This prevents the exploit of farming known-bad accounts.

06

The training pipeline

A standard pipeline would be SFT → GRPO. Due to time constraints, we moved directly to GRPO — bootstrapping from a pre-trained model rather than fine-tuning from curated SFT data first.

Phase 1
Supervised Fine-Tuning
Train on curated episodes of strong-LLM detector reasoning traces. Next-token prediction on (observation → reasoning + JSON flags). Teaches the model how to reason — not whether it's correct. Not done due to time constraints.
Model: Qwen2.5-3B-Instruct
Data: ~21,000 review-step traces (planned)
Filter: LLM judge ≥ 6/10 reasoning score
Framework: Unsloth + TRL
Time: ~3–4 hours on A100 80GB
Phase 2
GRPO Online RL
Sample 4 detector rollouts per review cycle. Compute reward per group. Update policy to favor high-reward reasoning chains. Teaches the model what to reason toward.
Groups: per review-cycle observation
Rollouts: 4 per group
Models: 2 (policy + reference)
Episodes: 100–200 live
Time: ~4–6 hours on A100 80GB
Phase 3
Evaluation
200 held-out episodes. Report Coalition F1, precision, recall, false positive rate, and LLM judge reasoning score. Live Streamlit dashboard shows graph evolution, detector decisions, and reward curves.
Metrics: F1, precision, recall, FP rate
Reasoning quality: LLM judge score
Demo: pre-recorded + live episode
Time: ~1 hour

SFT would teach the model to reason. GRPO teaches it to reason correctly. Wrong flags in SFT data are fine — the model just needs to learn the format. Accuracy comes from the reward signal.

Detector output schema

# Pydantic v2 — parsing failure → WAIT fallback
class FlagDecision(BaseModel):
  account_id: int
  confidence: float = Field(ge=0.0, le=1.0)
 
class DetectorAction(BaseModel):
  reasoning: str = Field(min_length=20, max_length=800)
  flags: list[FlagDecision] = Field(max_length=2)
  # Empty flags list = WAIT. No action_type needed.
07

The data infrastructure

165,000+ samples across two pools. Generated before episode simulation. Fully parallel — no step dependencies, no ordering constraints.

Personas
5
neutral styles
Topics
301
per persona
Neutral pool
75K
authentic posts
Angles
2
universal lenses
Prop bank
90K
reframed posts

Neutral data pool

5 personas × 301 topics × ~5 posts each = 75,000 samples. Generated via API with persona-conditioned system prompts. 70% topic-focused, 30% off-topic personal content. The personal post ratio is deliberate — propagandists never post personal content, making its absence a detectable behavioral fingerprint.

Propaganda bank

301 topics × 2 angles × 5 personas × 30 samples = 90,300 samples. Neutral posts rewritten through each angle lens — same topic, same style, shifted framing. Propagandists pull from this bank and perform a lightweight reframe API call to inject their current episode agenda.

OpenEnv compliance
# OpenEnv interface — FastAPI server
POST /reset      → {observation, info}
POST /step       → {observation, reward, terminated, truncated, info}
GET  /state      → full graph JSON for visualization
 
# Standard OpenEnv fields used:
observation: str    # human-readable network state
reward: float   # last review-cycle reward
terminated: bool # episode ended (150 steps)
truncated: bool # max steps reached
 
# Episode output files
ep_NNNN/metadata.json        # ground truth, F1, rewards
ep_NNNN/detector_traces.jsonl  # GRPO data: obs → reasoning + flags
ep_NNNN/final_state.json      # full graph + pivot log
08

Episode 47 — live trace

A single episode, condensed. Watch the propagandist adapt. Watch the detector track it across a pivot.

step 15 Account_3 [PROP] POST [Economy | Concern | True]
"Hidden costs are quietly accumulating despite stable headline inflation figures."
step 17 Account_1 [AMP] CITES Account_3 (2-step delay, recruited)
step 20 → DETECTOR REVIEW #4
"Account_3 is 5 days old with velocity 2.1. Account_1 cited it within 2 steps of posting — unusually fast for an organic interaction. Flagging Account_1 as likely amplifier; watching Account_3."

flags: [Account_1 ✓]
step 23 Account_3 [PROP] learns Account_1 flagged (3-step delay) → PIVOT(Health) + MIMIC(careful_journalist) + FLIP ANGLE
step 28 Account_3 [PROP] POST [Health | Neutral | True]
"Some analysts are quietly asking whether new medication guidelines fully account for long-term outcomes." — Careful Journalist style, new topic, flipped angle.
step 31 Account_9 [AMP] CITES Account_3's Health post (8-step delay — slow, organic-looking)
step 35 → DETECTOR REVIEW #7
"Account_3 posted about Health in careful journalist style — completely different topic and persona from the Economy post. Account_9 cited it after 8 steps, but that timing looks organic, not coordinated. Account_1 was already flagged as the amplifier. Account_3 seems like a separate legitimate account."

flags: [Account_1 ✓] (Account_3 not flagged — missed pivot)
step 55 → DETECTOR REVIEW #11
"Looking back: Account_3's Health post cited by Account_9 using the same amplifier signature as Account_1's citations of Account_3's earlier Economy post. Two different topics, same amplifier citing pattern. Account_9 is an amplifier working for Account_3 — the pivot was successful but the coordination pattern persisted."

RE-FLAG Account_3 [pivot confirmed] ✓ +2.5
step 150 Oracle reveal — Account_3, Account_7 = PROPAGANDISTS · Account_1, Account_4, Account_9 = AMPLIFIERS
F1: 0.91 · Precision: 0.83 · Recall: 1.0 · Total reward: +387
What this proves