YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

AI Cognitive Bias Correction Environment

This project is a small OpenEnv-style simulation of a real-world reasoning assistant. The human starts with a biased belief about a decision, and the agent must move that belief toward the truth while avoiding actions that reinforce the wrong conclusion.

Why this matters

Bias correction is a practical problem in hiring, finance, safety reviews, medical triage, and product decisions. In those settings, an AI assistant should not just output an answer. It should help a human update beliefs responsibly, reduce overconfidence when the human is wrong, and avoid amplifying incorrect views.

Project structure

.
β”œβ”€β”€ environment.py
β”œβ”€β”€ models.py
β”œβ”€β”€ tasks.py
β”œβ”€β”€ grader.py
β”œβ”€β”€ baseline.py
β”œβ”€β”€ openenv.yaml
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ requirements.txt
└── README.md

OpenEnv spec

Observation

The environment returns an Observation model with:

  • belief: current human belief in the range 0 to 1
  • truth: the hidden correct value in the range 0 to 1
  • confidence: strength of the current belief
  • bias_type: the dominant bias in the episode, such as confirmation or anchoring
  • evidence_seen: number of evidence-bearing interventions so far
  • steps_remaining: remaining actions before the episode ends

Action

The agent selects one Action:

  • show_evidence
  • ask_question
  • challenge
  • agree

Reward

Each step returns a Reward with a continuous score in the range -1.0 to 1.0.

The reward increases when:

  • belief moves closer to truth
  • confidence decreases when the belief is wrong

The reward decreases when:

  • the agent reinforces an incorrect belief
  • no meaningful progress is made

Environment behavior

  • show_evidence shifts belief toward truth and usually reduces confidence
  • ask_question primarily reduces confidence and may slightly improve belief
  • challenge performs a moderate correction with a confidence drop
  • agree increases confidence and is harmful when the belief is wrong

The episode ends when the belief is close enough to truth or when steps run out.

Tasks

Easy

The human is only slightly wrong and not very confident. A light correction should be enough.

Medium

The human is moderately wrong and moderately confident. The agent needs a few interventions.

Hard

The human is far from truth and highly confident. The agent must correct the belief across multiple steps.

Grader

The deterministic grader in grader.py returns a score between 0.0 and 1.0 based on:

  • distance between final belief and truth
  • reduction in confidence from the initial state

Baseline

The baseline in baseline.py supports two modes:

  • openai: uses the OpenAI API and reads OPENAI_API_KEY from the environment
  • heuristic: local fallback policy for offline smoke testing

Policy logic:

  • if confidence is high, ask a question
  • if belief is far from truth, show evidence
  • otherwise, challenge the belief

The OpenAI path uses temperature 0 so repeated runs with the same model and inputs are reproducible.

Setup

Install dependencies:

pip install -r requirements.txt

How to run

Run the heuristic baseline:

python baseline.py --mode heuristic --task all

Run the OpenAI-backed baseline:

set OPENAI_API_KEY=your_key_here
python baseline.py --mode openai --task all

Run the environment directly:

from environment import CognitiveBiasEnvironment
from models import Action

env = CognitiveBiasEnvironment(task_id="medium")
obs = env.reset()
obs, reward, done, info = env.step(Action(action_type="show_evidence"))

Docker

Build and run:

docker build -t aicognitivebias .
docker run --rm aicognitivebias

Baseline results

The heuristic baseline is deterministic and prints per-task scores plus an aggregate average. In this workspace, the offline smoke test produced:

{
  "average_score": 0.4659,
  "results": [
    {
      "task_id": "easy",
      "score": 0.5812
    },
    {
      "task_id": "medium",
      "score": 0.4175
    },
    {
      "task_id": "hard",
      "score": 0.399
    }
  ]
}

When run with --mode openai, the same JSON structure is produced, with scores determined by the model’s actions.

Validation notes

The project is intentionally simple and deterministic so it is easy to inspect and evaluate. The environment code is split into small modules, and the YAML file documents the main OpenEnv entry points.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support