Runs LLM-driven hypothesis generation and testing on labelled datasets using the HypoGeniC method. Claude generates, scores, and refines keyword-rule hypotheses in-conversation (no API key needed), or optionally drives the hypogenic package at scale with an LLM provider key.
Hypogenic provides automated hypothesis generation and testing using large language models to accelerate scientific discovery. The framework supports three approaches: HypoGeniC (data-driven hypothesis generation), HypoRefine (synergistic literature and data integration), and Union methods (mechanistic combination of literature and data-driven hypotheses).
The large language model that HypoGeniC needs is Claude — so the whole loop runs in this
conversation with no package and no API key. The deterministic scoring is a bundled
stdlib script; Claude does the generate/refine reasoning. This is the default path; the
hypogenic package (below) is an optional scaled-up alternative.
The loop (the HypoGeniC method, data-driven):
scripts/score_hypotheses.py --emit-template prints the shape).python scripts/score_hypotheses.py \
--data your_labelled_data.jsonl --hypotheses bank.json --split test
It reports each hypothesis's held-out accuracy, the best single hypothesis, the
first-match bank accuracy, and the examples the bank misclassifies. Pure stdlib, fully
reproducible — no model call.A worked example ships as a fixture: evals/fixtures/ai_vs_human_texts.jsonl (24 labelled
human-vs-AI texts, train/test split). On its test split the connector hypothesis scores
0.875 and a two-hypothesis bank reaches 1.000 — verified with the scorer, so the loop is
checkable end to end without any credential.
For your own data, give the scorer a .jsonl/.csv with text, label, and split
columns (or pass --text-field/--label-field/--split-field). When features are not
keyword-expressible, Claude can still apply each natural-language hypothesis to each
held-out example to emit a predicted label, then compute accuracy the same deterministic
way.
The upstream hypogenic package automates the same loop against an LLM provider and adds
HypoRefine (literature) and Union methods. It needs its own environment and an LLM provider
API key, and is worth it mainly for large banks, HypoRefine's PDF/literature integration, or
heavy batch inference. Everything below documents that optional package.
Get started with the hypogenic package in minutes:
# Install into its own environment: hypogenic 0.3.5 pins numpy~=1.26, pandas~=2.1,
# torch~=2.4, transformers~=4.45, openai~=1.40 and anthropic~=0.32 (Python 3.10–3.12)
uv venv .venv-hypogenic --python 3.10 && source .venv-hypogenic/bin/activate
uv pip install hypogenic
# Clone example datasets
git clone https://github.com/ChicagoHAI/HypoGeniC-datasets.git ./data
# Run data-driven hypothesis generation (model_type: gpt | claude | vllm | huggingface)
hypogenic_generation --task_config_path ./data/your_task/config.yaml \
--model_type gpt --model_name <provider-model-id> \
--max_num_hypotheses 20 --output_folder ./outputs/your_task
# Run inference with a saved hypothesis bank
hypogenic_inference --task_config_path ./data/your_task/config.yaml \
--hypothesis_file ./outputs/your_task/<hypotheses_*.json> \
--model_type gpt --model_name <provider-model-id>
Flags verified against the
hypogenic0.3.5 console scripts (hypogenic_cmd). The CLI covers data-driven HypoGeniC generation and inference; HypoRefine and Union runs are driven by the example scripts (below). Run--helpfor the full option list.
Or use the example scripts (the library ships runnable scripts under examples/; there is no one-line fluent task.generate_hypotheses(...) API — see "Python API Usage" below for the real classes):
python ./examples/generation.py --help # HypoGeniC data-driven generation
python ./examples/inference.py --help # single-hypothesis inference
Use this skill when working on:
| Scenario | Use Instead |
|---|---|
| Hand-formulating falsifiable hypotheses and predictions from observations (no LLM pipeline) | alterlab-hypothesis-gen |
| Open-ended ideation or research-gap brainstorming with no dataset yet | alterlab-scientific-brainstorm |
| Topic models, dictionaries, or supervised classifiers over text as social-science measurement | alterlab-text-as-data |
| Testing one pre-specified hypothesis with a conventional statistical test | alterlab-statistical-analysis |
Hand-off rule. When the request matches a row above, open your answer by naming that skill by its exact id (for example alterlab-hypothesis-gen) and saying in one line why it fits better, then stop applying this skill's procedure. Name it even when you also need to ask for missing input. If only part of the request is out of scope, name the skill for that part and do only the in-scope part. A brief general pointer is fine; the named skill does the work.
Automated Hypothesis Generation
Literature Integration
Performance Optimization
Flexible Configuration
Reported Results (from arXiv:2410.17309, Literature Meets Data)
Generate hypotheses solely from observational data through iterative refinement.
Process:
Best for: Exploratory research without existing literature, pattern discovery in novel datasets
Synergistically combine existing literature with empirical data through an agentic framework.
Process:
Best for: Research with established theoretical foundations, validating or extending existing theories
Mechanistically combine literature-only hypotheses with framework outputs.
Variants:
Best for: Comprehensive hypothesis coverage, eliminating redundancy while maintaining diverse perspectives
Install via pip:
uv pip install hypogenic
Because of the pinned dependency versions above, keep hypogenic out of your main analysis environment.
Optional dependencies:
Clone example datasets:
# For HypoGeniC examples
git clone https://github.com/ChicagoHAI/HypoGeniC-datasets.git ./data
# For HypoRefine/Union examples
git clone https://github.com/ChicagoHAI/Hypothesis-agent-datasets.git ./data
Datasets must follow HuggingFace datasets format with specific naming conventions:
Required files:
<TASK>_train.json: Training data<TASK>_val.json: Validation data<TASK>_test.json: Test dataRequired keys in JSON:
text_features_1 through text_features_n: Lists of strings containing feature valueslabel: List of strings containing ground truth labelsExample (headline click prediction):
{
"headline_1": [
"What Up, Comet? You Just Got *PROBED*",
"Scientists Made a Breakthrough in Quantum Computing"
],
"headline_2": [
"Scientists Everywhere Were Holding Their Breath Today. Here's Why.",
"New Quantum Computer Achieves Milestone"
],
"label": [
"Headline 2 has more clicks than Headline 1",
"Headline 1 has more clicks than Headline 2"
]
}
Important notes:
extract_label() function output formatreview_text, post_content, etc.)Each task requires a config.yaml file specifying:
Required elements:
Template capabilities:
${text_features_1}, ${num_hypotheses})Configuration structure:
task_name: your_task_name
train_data_path: ./your_task_train.json
val_data_path: ./your_task_val.json
test_data_path: ./your_task_test.json
prompt_templates:
# Extra keys for reusable prompt components
observations: |
Feature 1: ${text_features_1}
Feature 2: ${text_features_2}
Observation: ${label}
# Required templates
batched_generation:
system: "Your system prompt here"
user: "Your user prompt with ${num_hypotheses} placeholder"
inference:
system: "Your inference system prompt"
user: "Your inference user prompt"
# Optional templates for advanced features
few_shot_baseline: {...}
is_relevant: {...}
adaptive_inference: {...}
adaptive_selection: {...}
Refer to references/config_template.yaml for a complete example configuration.
To use literature-based hypothesis generation, you must preprocess PDF papers:
Step 1: Setup GROBID (first time only)
bash ./modules/setup_grobid.sh
Step 2: Add PDF files
Place research papers in literature/YOUR_TASK_NAME/raw/
Step 3: Process PDFs
# Start GROBID service
bash ./modules/run_grobid.sh
# Process PDFs for your task
cd examples
python pdf_preprocess.py --task_name YOUR_TASK_NAME
This converts PDFs to structured format for hypothesis extraction. Automated literature search will be supported in future releases.
hypogenic_generation --help
Key parameters:
hypogenic_inference --help
Key parameters:
The library is not a one-call fluent API — generation runs as an explicit init/update
loop over the algorithm classes (DefaultGeneration, DefaultInference, DefaultUpdate,
DefaultReplace), and inference runs through the inference_register. Copy and adapt the
scripts under examples/; for HypoRefine/Union adapt examples/union_generation.py.
Full import list, the generation/inference loop, inference_type strategy options, and the
critical extract_label() parsing contract: see references/python_api.md.
Three end-to-end scenarios — data-driven (HypoGeniC, AI-content detection), literature-informed
(HypoRefine, deception in hotel reviews), and comprehensive coverage (Union, mental-stress
detection) — with dataset prep, generation, and inference commands for each: see
references/workflow_examples.md.
Caching: Enable Redis caching to reduce API costs and computation time for repeated LLM calls
Parallel Processing: Leverage multiple workers for large-scale hypothesis generation and testing
Adaptive Refinement: Use challenging examples to iteratively improve hypothesis quality
Issue: Generated hypotheses are too generic
Solution: Refine prompt templates in config.yaml to request more specific, testable hypotheses
Issue: Poor inference performance Solution: Ensure dataset has sufficient training examples, adjust hypothesis generation parameters, or increase number of hypotheses
Issue: Label extraction failures
Solution: Implement custom extract_label() function for domain-specific output parsing
Issue: GROBID PDF processing fails
Solution: Ensure GROBID service is running (bash ./modules/run_grobid.sh) and PDFs are valid research papers
Adding a new task follows five steps: (1) prepare train/val/test JSON with
text_features_* + label keys, (2) author config.yaml, (3) implement a custom
extract_label(), (4) optionally process literature PDFs for HypoRefine/Union, and
(5) run generation + inference.
Full step-by-step guide with the custom extract_label implementation and BaseTask wiring:
see references/custom_tasks.md.
Core code lives in hypogenic/, CLI entry points in hypogenic_cmd/, the HypoRefine agent in
hypothesis_agent/, PDF/literature tools in literature/ + modules/, and runnable scripts in
examples/. Full annotated directory tree: see references/repository_structure.md.
The framework rests on three papers from ChicagoHAI: HypoBench (2025, arXiv:2504.11524),
Literature Meets Data (2024, arXiv:2410.17309, introduces HypoRefine), and the original
Hypothesis Generation with Large Language Models (2024, EMNLP NLP4Science). Full citations,
descriptions, and BibTeX entries: see references/publications.md.
Clone these repositories for ready-to-use examples:
# HypoGeniC examples (data-driven only)
git clone https://github.com/ChicagoHAI/HypoGeniC-datasets.git ./data
# HypoRefine/Union examples (literature + data)
git clone https://github.com/ChicagoHAI/Hypothesis-agent-datasets.git ./data
For contributions or questions, visit the GitHub repository and check the issues page.
score_hypotheses.py — the deterministic, LLM-free scorer for the keyless loop. Applies
keyword-rule hypotheses to a labelled split and reports per-hypothesis and first-match
bank accuracy plus the misclassified examples. --emit-template prints a hypotheses-JSON
skeleton. Stdlib only.ai_vs_human_texts.jsonl — 24 labelled human-vs-AI texts (train/test split) for the
worked keyless example; the connector hypothesis scores 0.875 and a two-hypothesis bank
1.000 on its test split.config_template.yaml — a runnable-shape config.yaml matching the real hypogenic
schema (task_name, train/val/test_data_path, prompt_templates with role-based
system/user sub-keys and ${...} placeholders). Read it before authoring a config:
it documents the ${...} substitution, the reusable "extra key" mechanism, and which
settings belong in CLI flags rather than the YAML.python_api.md — the init/update generation loop, inference registry, inference_type
strategy options, and the extract_label() parsing contract.workflow_examples.md — three end-to-end scenarios (HypoGeniC, HypoRefine, Union).custom_tasks.md — five-step guide for adding a new task or dataset.repository_structure.md — annotated layout of the upstream repository.publications.md — full citations and BibTeX for the HypoGeniC/HypoRefine/HypoBench papers.Part of the AlterLab Academic Skills suite.
evals/evals.json (opens in a new tab)evals/fixtures/ai_vs_human_texts.jsonl (opens in a new tab)references/config_template.yaml (opens in a new tab)references/custom_tasks.md (opens in a new tab)references/publications.md (opens in a new tab)references/python_api.md (opens in a new tab)references/repository_structure.md (opens in a new tab)references/workflow_examples.md (opens in a new tab)scripts/score_hypotheses.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Not loaded · from alterlab-writing-tools
Claude Code won't load this skill
It ships in alterlab-writing-tools at skills/, but Claude Code only loads skills/<name>/SKILL.md and folders listed under skills in plugin.json. Installing the plugin doesn't add it.
Generated from the plugin's indexed repository (alterlab-ieu/alterlab-academic-skills) — no native marketplace selected
npx claudepluginhub p/alterlab-ieu-alterlab-writing-tools241 skills in this plugin
/alterlab-abm-mesaBuilds agent-based models of social systems with Mesa 3 — the current AgentSet API (model.agents.shuffle_do('step'), auto-assigned unique_id, mandatory super().__init__(rng=...)), cell spaces (mesa.discrete_space OrthogonalMooreGrid / classic mesa.space grids), the DataCollector, batch_run parameter sweeps, and SolaraViz — for emergence, segregation, diffusion, opinion dynamics, and cooperation models. It uses the Mesa 3.x API (the old mesa.time schedulers like RandomActivation are removed) and treats the model as a generative theory to be validated, not just run. Use when the request mentions an agent-based model, Mesa, simulating interacting agents, or emergent macro behavior from micro rules. For discrete-event (queueing/process) simulation prefer alterlab-simpy; for reinforcement learning prefer alterlab-stable-baselines3. Part of the AlterLab Academic Skills suite./alterlab-academic-careerPrepares academic career documents and professional-development materials for faculty and researchers. Use when drafting academic CVs, research statements, teaching philosophies, diversity statements, faculty-position cover letters, tenure dossiers, promotion narratives, academic portfolios, or mentorship statements, and when planning conference-networking strategy, building academic web presence, setting up ORCID profiles, or understanding impact metrics. Part of the AlterLab Academic Skills suite.2 plugins in one repository ship this exact skill · first indexed Nov 9, 2026
Other plugins' skills for the same job