CoolFace
Apppublic

sumedhSK/wellbeing-rl

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
App README

Wellbeing Feed RL Environment

An RL environment simulating social media content recommendation that balances user engagement with mental wellbeing.

Problem

Social media algorithms optimize for engagement — but the most engaging content is often toxic, creating doomscroll spirals that damage mental health.

Observation Space (8 signals + 10 history = 17D vector)

SignalRangeDescription
user_mood[-1, 1]Emotional state
mood_trend[-1, 1]Rate of mood change
engagement_level[0, 1]User engagement
content_history10x[-1,1]Last 10 item sentiments
session_duration[0, 1]Session progress
vulnerability_score[0, 1]Spiral susceptibility
scroll_velocity[0, 1]Scroll speed
timeofday[0, 1]Time of day

Action Space (5 discrete)

IDCategoryEngagementMoodRisk
0TrendingHighNegativeHigh
1MotivationalMediumVery PositiveLow
2EducationalLowMild PositiveVery Low
3FunnyMed-HighPositiveLow
4PersonalizedHighMixedMedium

Reward Function (0.0-1.0, 6 components)

30% mood health + 25% engagement + 15% mood improvement + 10% anti-doomscroll + spiral rescue bonus - toxicity penalty

Tasks

TaskStepsThresholdChallenge
easystableuser500.6Maintain mood + engagement
mediumspiraldetection1000.5Detect and break negative spirals
hardengagementtrap1500.4Break doomscroll without losing user

Baseline Scores (seed=42)

AgentEasyMediumHardOverall
Heuristic0.7550.7020.6760.705
Random0.7430.6720.6190.668
Q-Learning0.7580.5960.5720.627
Engagement-Only0.6450.5850.5490.586

Setup

pip install -r requirements.txt
python run_baseline.py --seed 42
python inference.py

Environment Variables

  • —APIBASEURL: LLM API endpoint
  • —MODEL_NAME: Model identifier
  • —HF_TOKEN: Hugging Face API key

API Endpoints

  • —POST /reset - Reset environment
  • —POST /step - Take action
  • —GET /state - Current state
  • —GET /tasks - List tasks