Skip to main content

CogBench

Verifiable Cognitive Constraint Benchmark for LLM Question Generation

CogBench evaluates whether large language models can generate educationally appropriate questions at specific Bloom's Taxonomy cognitive levels while satisfying 28 deterministic constraints.

Features

  • 6 Bloom's Taxonomy Levels: Remember, Understand, Apply, Analyze, Evaluate, Create
  • 8 Academic Subjects: Biology, Chemistry, Physics, Mathematics, Psychology, Economics, History, Computer Science
  • 28 Deterministic Constraints: No LLM-as-judge — every constraint is verifiable and reproducible
  • Adversarial Mode: Tests robustness by using mismatched cognitive-level vocabulary
  • 120 Passages: From OpenStax open-access textbooks

Installation

pip install cogbench

For NLP features (key concept extraction with spaCy):

pip install cogbench[nlp]
python -m spacy download en_core_web_sm

Quick Start

# Show benchmark configuration
cogbench info

# Run benchmark for a single model (requires Ollama)
cogbench run --model qwen2.5:14b --mode standard

# Run all local models in both modes
cogbench run --local-all --mode both

# Re-evaluate existing results with updated constraints
cogbench evaluate

# Generate leaderboard data
cogbench leaderboard

CLI Commands

Command Description
cogbench info Show benchmark config, models, and passage stats
cogbench run Generate questions and evaluate models
cogbench evaluate Re-evaluate existing generation files
cogbench leaderboard Populate leaderboard data.json from results
cogbench scrape Scrape passages from OpenStax textbooks
cogbench submit Submit results to the CogBench leaderboard via GitHub

Submitting Results

After running the benchmark, submit your results to the public leaderboard:

# Submit all completed models
cogbench submit --name "Your Name"

# Submit a specific model
cogbench submit --model qwen2.5:14b --name "Your Name"

This creates a GitHub issue with your results. The maintainers will review and add them to the leaderboard. Requires the GitHub CLI (gh).

Python API

from cogbenchv2.passages.processor import load_all_passages
from cogbenchv2.evaluation.evaluate import evaluate_generations
from cogbenchv2.evaluation.metrics import compute_metrics

# Load the 120 bundled passages
passages = load_all_passages()

# Evaluate a generation file
evaluations = evaluate_generations("gen_qwen2_5_14b_standard.json", passages)

# Compute metrics
metrics = compute_metrics(evaluations)
print(f"Prompt-level strict: {metrics['prompt_level_strict']['rate']:.1%}")

Environment Variables

Variable Default Description
COGBENCH_RESULTS_DIR ./data/results Where benchmark results are saved
OPENAI_API_KEY — For OpenAI API models
GOOGLE_API_KEY — For Google Gemini models
TOGETHER_API_KEY — For Together.ai models

License

Apache 2.0

Metadata

Release files for cogbench 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cogbench 1.1.0
File Size Uploaded Provenance
cogbench-1.1.0.tar.gz 186.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cogbench 1.1.0
File Interpreter ABI Platform
cogbench-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 379.3 kB

Release files / cogbench-1.1.0.tar.gz

Download URL cogbench-1.1.0.tar.gz
Size 186.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3597ff1545e42518f9d5abb88b744fe7a27540c2f530554e6d94627de1c1cfb3
BLAKE2b-256 checksum
How to use checksums
0db9ddc5832af456660d1846e8d14fd0d041749db660d206adc5e51f7cf0c5b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / cogbench-1.1.0-py3-none-any.whl

Download URL cogbench-1.1.0-py3-none-any.whl
Size 193.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e2f6adc696668c75e908e30e59a9a0a5b884b81e880e2eb84bf286304db56be
BLAKE2b-256 checksum
How to use checksums
52d35e7ba09bbbc8c7f642d109df62d4085074429620e2b532e2129cb9eb310d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Security for cogbench 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page